Skip to content
Permalink
Browse files

Merge pull request #8273 from Sargul/devel

Fixes Exasol Priority Group Creation Bug
  • Loading branch information
Sargul committed Mar 25, 2020
2 parents 82669c8 + 873ffcb commit 6f8db702ffe59b93a127afc13d08d8d3abd887fa
@@ -29,7 +29,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.jkiss.dbeaver.ext.exasol.ExasolMessages;
import org.jkiss.dbeaver.ext.exasol.model.ExasolDataSource;
import org.jkiss.dbeaver.ext.exasol.model.ExasolPriorityGroup;
import org.jkiss.dbeaver.ui.UIUtils;
import org.jkiss.dbeaver.ui.dialogs.BaseDialog;
@@ -38,7 +37,7 @@
public class ExasolPriorityGroupDialog extends BaseDialog {

private String name = "";
private int weight;
private int weight = -1;
private String comment = "";

public ExasolPriorityGroupDialog(Shell parentShell, ExasolPriorityGroup group) {
@@ -68,10 +67,14 @@ protected Composite createDialogArea(Composite parent) {
@Override
public void modifyText(ModifyEvent e) {
name = nameText.getText();
weight = Integer.parseInt(weightText.getText());
try {
if (weightText.getText().length()>0)
weight = Integer.parseInt(weightText.getText());
} catch (NumberFormatException ex) {
}
comment = commentText.getText();
//enable/disable OK button
if (name.isEmpty() | weight == -1) {
if (name.isEmpty() | weight == -1 | weight > 1000 | weight < 1) {
getButton(IDialogConstants.OK_ID).setEnabled(false);
} else {
getButton(IDialogConstants.OK_ID).setEnabled(true);
@@ -81,6 +84,7 @@ public void modifyText(ModifyEvent e) {

nameText.addModifyListener(mod);
commentText.addModifyListener(mod);
weightText.addModifyListener(mod);
return composite;
}

0 comments on commit 6f8db70

Please sign in to comment.
You can’t perform that action at this time.