Skip to content

Commit

Permalink
Merge pull request OpenLiberty#4 from mezarin/fixStartWithCommandAction
Browse files Browse the repository at this point in the history
Process start with parm request on OK only
  • Loading branch information
ajm01 authored Mar 4, 2022
2 parents 3d97b0d + 6b062b4 commit 7941f37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion liberty/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
id="liberty.toolbars.open.dashboard"
commandId="liberty.commands.open.dashboard"
icon="icons/openLibertyLogo.png"
tooltip="Liberty Dashboard View">
tooltip="Open Liberty Dashboard View">
</command>
</toolbar>
</menuContribution>
Expand Down
13 changes: 9 additions & 4 deletions liberty/src/liberty/tools/ui/DashboardView.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ public void run() {
@Override
public void run() {
String parms = getStartParms();
devMode.startWithParms(parms);

if (parms != null) {
devMode.startWithParms(parms);
}
}
};
startWithParmAction.setImageDescriptor(ActionImg);
Expand Down Expand Up @@ -231,9 +234,9 @@ public void run() {
}

/**
* Gets start command parameters provided by the user through an input dialog window.
* Returns the list of parameters if the user presses OK, null otherwise.
*
* @return The parameters entered by the user.
* @return The list of parameters if the user presses OK, null otherwise.
*/
public String getStartParms() {
String dTitle = "Liberty Development Mode";
Expand All @@ -243,7 +246,9 @@ public String getStartParms() {
Shell shell = Display.getCurrent().getActiveShell();
InputDialog iDialog = new InputDialog(shell, dTitle, dMessage, dInitValue, iValidator) {
};
String userInput = "";

String userInput = null;

if (iDialog.open() == Window.OK) {
userInput = iDialog.getValue();
}
Expand Down

0 comments on commit 7941f37

Please sign in to comment.