generated from redhat-developer/new-project-template
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mitja Leino
committed
Apr 24, 2024
1 parent
43f88e9
commit c4b2799
Showing
7 changed files
with
48 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
* Mitja Leino <[email protected]> - Extend ValidatableDialog for validations | ||
******************************************************************************/ | ||
package com.redhat.devtools.lsp4ij.launching.ui; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
* Mitja Leino <[email protected]> - Implement DialogWrapper for validations | ||
* Mitja Leino <[email protected]> - Extend ValidatableDialog for validations | ||
*******************************************************************************/ | ||
package com.redhat.devtools.lsp4ij.settings; | ||
|
||
|
@@ -19,7 +19,6 @@ | |
import com.intellij.openapi.fileTypes.FileNameMatcher; | ||
import com.intellij.openapi.fileTypes.FileType; | ||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.ui.DialogWrapper; | ||
import com.intellij.openapi.ui.ValidationInfo; | ||
import com.intellij.ui.IdeBorderFactory; | ||
import com.intellij.util.ui.FormBuilder; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
* Mitja Leino <[email protected]> - Add DialogWrapper for validations | ||
******************************************************************************/ | ||
package com.redhat.devtools.lsp4ij.settings.ui; | ||
|
||
|
@@ -84,11 +85,14 @@ private void createUI(FormBuilder builder, JComponent description, EditionMode m | |
addDebugTab(tabbedPane, mode); | ||
|
||
// Add validation | ||
var serverName = getServerName(); | ||
if (serverName != null) { | ||
addValidator(serverName); | ||
var serverNameWidget = getServerName(); | ||
if (serverNameWidget != null) { | ||
addValidator(serverNameWidget); | ||
} | ||
var commandLineWidget = getCommandLine(); | ||
if (commandLineWidget != null) { | ||
addValidator(getCommandLine()); | ||
} | ||
addValidator(getCommandLine()); | ||
} | ||
|
||
private void addServerTab(JBTabbedPane tabbedPane, JComponent description, EditionMode mode) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 15 additions & 1 deletion
16
src/main/java/com/redhat/devtools/lsp4ij/settings/ui/ValidatableDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Red Hat Inc. and others. | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Mitja Leino <[email protected]> - Initial API and implementation | ||
*******************************************************************************/ | ||
package com.redhat.devtools.lsp4ij.settings.ui; | ||
|
||
import com.intellij.openapi.project.Project; | ||
import com.intellij.openapi.ui.DialogWrapper; | ||
|
||
/** | ||
* Shareable component for shared validations using DialogWrapper | ||
*/ | ||
public abstract class ValidatableDialog extends DialogWrapper { | ||
public ValidatableDialog(Project project) { | ||
protected ValidatableDialog(Project project) { | ||
super(project); | ||
} | ||
|
||
|