From 54507b2d2a1ebb6f799d3163ea2620077abc59c9 Mon Sep 17 00:00:00 2001 From: "joon.c.baek" Date: Thu, 12 May 2016 19:46:41 +0900 Subject: [PATCH] [SRADA-543] Deactivate 'OK' button on feature dialog Deactivate 'OK' Button on feature dialog. In case of, None of selected feature, 'OK' button have to deactivated as UX guide. Change-Id: I7ad923d6b326baeab585bc7905dea97e188484f1 Signed-off-by: joon.c.baek --- .../ui/toolbar/setting/FlatFeatureDialog.java | 16 ++++++++++++---- .../setting/FlatFeatureDialogSelectedFeaturePage.java | 8 ++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialog.java index 91236b3..4383d2b 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialog.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialog.java @@ -167,10 +167,6 @@ public class FlatFeatureDialog extends DAMessageBox { compData.bottom = new FormAttachment(100, -60); selectedFeatureComp.setLayoutData(compData); - targetPage = new FlatFeatureDialogTargetPage(targetComp, this, SWT.NONE); - featureListPage = new FlatFeatureDialogFeatureListPage(featureListComp, this, SWT.NONE); - selectedFeaturePage = new FlatFeatureDialogSelectedFeaturePage(selectedFeatureComp, this, SWT.NONE); - // button composite buttonContentsComp = new Composite(shell, SWT.NONE); compLayout = new FormLayout(); @@ -205,6 +201,10 @@ public class FlatFeatureDialog extends DAMessageBox { buttonData.height = 30; cancelButton.setLayoutData(buttonData); + targetPage = new FlatFeatureDialogTargetPage(targetComp, this, SWT.NONE); + selectedFeaturePage = new FlatFeatureDialogSelectedFeaturePage(selectedFeatureComp, this, SWT.NONE); + featureListPage = new FlatFeatureDialogFeatureListPage(featureListComp, this, SWT.NONE); + shell.addDisposeListener(new DisposeListener() { @Override @@ -277,4 +277,12 @@ public class FlatFeatureDialog extends DAMessageBox { public FlatFeatureDialogSelectedFeaturePage getSelectedFeaturePage() { return selectedFeaturePage; } + + public DACustomButton getOKButton() { + return okButton; + } + + public DACustomButton getCancelButton() { + return cancelButton; + } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialogSelectedFeaturePage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialogSelectedFeaturePage.java index 0027eab..692fc1c 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialogSelectedFeaturePage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialogSelectedFeaturePage.java @@ -186,9 +186,13 @@ public class FlatFeatureDialogSelectedFeaturePage extends DAPageComposite { List featureList = target.getSelectedFlatFeatureList(); System.out.println("SelectedFeaturePage: " + featureList); - int topPosition = 30; + if (featureList.size() > 0) + featureDialog.getOKButton().setButtonEnabled(true); + else + featureDialog.getOKButton().setButtonEnabled(false); - for (int i = featureList.size() - 1 ; i >= 0; i--) { + int topPosition = 30; + for (int i = 0 ; i < featureList.size(); i++) { FlatFeature feature = featureList.get(i); // image -- 2.7.4