Setting : modify apply, close button in setting dialog 87/27987/2
authorheeyoung <heeyoung1008.hwang@samsung.com>
Wed, 24 Sep 2014 05:45:10 +0000 (14:45 +0900)
committerheeyoung <heeyoung1008.hwang@samsung.com>
Thu, 25 Sep 2014 11:02:25 +0000 (20:02 +0900)
comment : HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)

Change-Id: Ia9288e7c51fed1c28d96f6ac002ef0eb93864ace
Signed-off-by: heeyoung <heeyoung1008.hwang@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/PostWindowOpenCallback.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FeatureDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogOptionPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/SettingDialogTemplatePage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/WelcomeDialog.java

index 35868b5..a873f71 100644 (file)
@@ -35,12 +35,13 @@ import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
 public class PostWindowOpenCallback implements IExecutionCallback {
        @Override
        public void execute() {
-               if (!SettingDataManager.getInstance().isShowInitial()) {
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//             if (!SettingDataManager.getInstance().isShowInitial()) {
                        final Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
                        WelcomeDialog dialog = new WelcomeDialog(shell); // FIXME
                        Logger.performance("TEST", "DA Start", "Welcome Dialog");
                        dialog.open();
-               }
+//             }
        }
        
        public void execute(String[] msg) {
index e04437c..02c046f 100644 (file)
@@ -96,8 +96,9 @@ public class FeatureDialog extends DAMessageBox {
                                templatePage.createTemplateTitleComposite();
                                templatePage.createTemplateDescriptionComposite();
                                
-                               // update setting dialog button
-                               SettingDialogManager.getInstance().updateSaveButtonStatus(null);
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//                             // update setting dialog button
+//                             SettingDialogManager.getInstance().updateSaveButtonStatus(null);
                        }
                        shell.dispose();        // close dialog
                }
index 96b38ed..34d8a28 100644 (file)
@@ -52,9 +52,13 @@ import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite;
 
 public class SettingDialog extends DAMessageBox {
        private static boolean opened = false;
-       private DACustomButton applyButton = null;
+       private DACustomButton okButton = null;
+       private DACustomButton cancelButton = null;
+       
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)    
+//     private DACustomButton applyButton = null;
 //     private DACustomButton revertButton = null;
-       private DACustomButton closeButton = null;
+//     private DACustomButton closeButton = null;
        
        private SettingDialogTemplatePage templatesPage = null;
        
@@ -66,43 +70,66 @@ public class SettingDialog extends DAMessageBox {
                SettingDataManager.getInstance();       // read setting information file
        }
 
-       private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() {
+       private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
                        doApply();
-                       applicableButteon();
-               }
-       };
-       private DACustomButtonClickEventListener revertButtonListener = new DACustomButtonClickEventListener() {
-
-               @Override
-               public void handleClickEvent(DACustomButton button) {
-                       doRevert();
-                       applicableButteon();
+                       doRun();
+                       shell.close();  // close dialog
                }
        };
        
-       private DACustomButtonClickEventListener closeButtonListener = new DACustomButtonClickEventListener() {
+       private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       doRevert();
                        doRun();
-                       shell.dispose();        // close dialog
+                       shell.close();  // close dialog
                }
        };
-       
+
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)            
+//     private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() {
+//
+//             @Override
+//             public void handleClickEvent(DACustomButton button) {
+//                     doApply();
+//                     applicableButteon();
+//             }
+//     };
+//     private DACustomButtonClickEventListener revertButtonListener = new DACustomButtonClickEventListener() {
+//
+//             @Override
+//             public void handleClickEvent(DACustomButton button) {
+//                     doRevert();
+//                     applicableButteon();
+//             }
+//     };
+//     
+//     private DACustomButtonClickEventListener closeButtonListener = new DACustomButtonClickEventListener() {
+//
+//             @Override
+//             public void handleClickEvent(DACustomButton button) {
+//                     doRun();
+//                     shell.dispose();        // close dialog
+//             }
+//     };
+
        private void doApply() {
                Composite selectedComposite = tabView.getTopComposite();
-               if (!(selectedComposite instanceof SettingDialogBinarySettingsPage)) {          
-                       // add & remove tab view page
-                       SettingDialogManager.getInstance().updateTabViewPage();
-                       
-                       // add & remove (timeline) chart
-                       SettingDialogManager.getInstance().updateChartList();
-                       
-                       // write setting data
-                       SettingDataManager.getInstance().applySettingData();
+               if (!(selectedComposite instanceof SettingDialogBinarySettingsPage)) {
+                       if (DACommunicator.isRunning() == false) {
+                               // add & remove tab view page
+                               SettingDialogManager.getInstance().updateTabViewPage();
+                               
+                               // add & remove (timeline) chart
+                               SettingDialogManager.getInstance().updateChartList();
+                               
+                               // write setting data
+                               SettingDataManager.getInstance().applySettingData();
+                       }
                } else {
                        // binary setting page
                        SettingDialogBinarySettingsPage page = (SettingDialogBinarySettingsPage) selectedComposite;
@@ -116,11 +143,12 @@ public class SettingDialog extends DAMessageBox {
                if (!(selectedComposite instanceof SettingDialogBinarySettingsPage)) {
                        // rollback setting data
                        SettingDataManager.getInstance().revertSettingData();
-                       
-                       // update template view
-                       templatesPage.createTemplateTitleComposite();
-                       templatesPage.createTemplateDescriptionComposite();
-                       templatesPage.createTargetComposite();
+               
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)            
+//                     // update template view
+//                     templatesPage.createTemplateTitleComposite();
+//                     templatesPage.createTemplateDescriptionComposite();
+//                     templatesPage.createTargetComposite();
                }
        }
 
@@ -262,17 +290,41 @@ public class SettingDialog extends DAMessageBox {
 //             });
 
                
-               closeButton = new DAButton(buttonContentsComp, SWT.NONE);
-               closeButton.addClickListener(closeButtonListener);
-               closeButton.setText(WidgetLabels.CLOSE);
-               closeButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+               cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
+               cancelButton.addClickListener(cancelButtonListener);
+               cancelButton.setText(WidgetLabels.CANCEL);
+               cancelButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                FormData buttonData = new FormData();
                buttonData.right = new FormAttachment(100, -9);
                buttonData.top = new FormAttachment(0, 11);
                buttonData.width = 100;
                buttonData.height = 28;
-               closeButton.setLayoutData(buttonData);
+               cancelButton.setLayoutData(buttonData);
+               
+               okButton = new DAButton(buttonContentsComp, SWT.NONE);
+               okButton.addClickListener(okButtonListener);
+               okButton.setText(WidgetLabels.OK);
+               okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+               buttonData = new FormData();
+               buttonData.right = new FormAttachment(cancelButton, -8);
+               buttonData.top = new FormAttachment(0, 11);
+               buttonData.width = 100;
+               buttonData.height = 28;
+               okButton.setLayoutData(buttonData);
+
                
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)    
+//             closeButton = new DAButton(buttonContentsComp, SWT.NONE);
+//             closeButton.addClickListener(closeButtonListener);
+//             closeButton.setText(WidgetLabels.CLOSE);
+//             closeButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+//             FormData buttonData = new FormData();
+//             buttonData.right = new FormAttachment(100, -9);
+//             buttonData.top = new FormAttachment(0, 11);
+//             buttonData.width = 100;
+//             buttonData.height = 28;
+//             closeButton.setLayoutData(buttonData);
+//             
 //             revertButton = new DAButton(buttonContentsComp, SWT.NONE);
 //             revertButton.addClickListener(revertButtonListener);
 //             revertButton.setText(WidgetLabels.REVERT);
@@ -283,20 +335,21 @@ public class SettingDialog extends DAMessageBox {
 //             buttonData.width = 100;
 //             buttonData.height = 28;
 //             revertButton.setLayoutData(buttonData);
-               
-               applyButton = new DAButton(buttonContentsComp, SWT.NONE);
-               applyButton.addClickListener(applyButtonListener);
-               applyButton.setText(WidgetLabels.APPLY);
-               applyButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
-               buttonData = new FormData();
+//             
+//             applyButton = new DAButton(buttonContentsComp, SWT.NONE);
+//             applyButton.addClickListener(applyButtonListener);
+//             applyButton.setText(WidgetLabels.APPLY);
+//             applyButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+//             buttonData = new FormData();
 //             buttonData.right = new FormAttachment(revertButton, -8);
-               buttonData.right = new FormAttachment(closeButton, -8);
-               buttonData.top = new FormAttachment(0, 11);
-               buttonData.width = 100;
-               buttonData.height = 28;
-               applyButton.setLayoutData(buttonData);
-               
-               applicableButteon();
+//             buttonData.top = new FormAttachment(0, 11);
+//             buttonData.width = 100;
+//             buttonData.height = 28;
+//             applyButton.setLayoutData(buttonData);
+//             
+//             
+//             applicableButteon();
+
                shell.addDisposeListener(new DisposeListener() {
 
                        @Override
@@ -311,19 +364,20 @@ public class SettingDialog extends DAMessageBox {
                shell.open();
                return true;
        }
-       
-       public void applicableButteon() {
-               applyButton.setButtonEnabled(false);
+
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)            
+//     public void applicableButteon() {
+//             applyButton.setButtonEnabled(false);
 //             revertButton.setButtonEnabled(false);
-               closeButton.setButtonEnabled(true);
-       }
-       
-       public void editableButteon() {
-               if (DACommunicator.isRunning() == false) {
-                       applyButton.setButtonEnabled(true);
+//             closeButton.setButtonEnabled(true);
+//     }
+//     
+//     public void editableButteon() {
+//             if (DACommunicator.isRunning() == false) {
+//                     applyButton.setButtonEnabled(true);
 //                     revertButton.setButtonEnabled(true);
-                       closeButton.setButtonEnabled(false);
-               }
-       }
+//                     closeButton.setButtonEnabled(false);
+//             }
+//     }
 
 }
index 0766b88..ea6d5af 100644 (file)
@@ -96,26 +96,27 @@ public class SettingDialogManager {
                }
        }
 
-       public void updateSaveButtonStatus(Boolean enable) {
-               // change button status
-               if (SettingDataManager.getInstance().changedFeatures() == true) {
-                       if (getConfigDlg() instanceof SettingDialog) {
-                               SettingDialog dlg = (SettingDialog) getConfigDlg();
-                               dlg.editableButteon();
-                       } else {
-                               WelcomeDialog dlg = (WelcomeDialog) getConfigDlg();
-                               dlg.editableButteon();
-                       }
-               } else {
-                       if (getConfigDlg() instanceof SettingDialog) {
-                               SettingDialog dlg = (SettingDialog) getConfigDlg();
-                               dlg.applicableButteon();
-                       } else {
-                               WelcomeDialog dlg = (WelcomeDialog) getConfigDlg();
-                               dlg.applicableButteon();
-                       }
-               }
-       }
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//     public void updateSaveButtonStatus(Boolean enable) {
+//             // change button status
+//             if (SettingDataManager.getInstance().changedFeatures() == true) {
+//                     if (getConfigDlg() instanceof SettingDialog) {
+//                             SettingDialog dlg = (SettingDialog) getConfigDlg();
+//                             dlg.editableButteon();
+//                     } else {
+//                             WelcomeDialog dlg = (WelcomeDialog) getConfigDlg();
+//                             dlg.editableButteon();
+//                     }
+//             } else {
+//                     if (getConfigDlg() instanceof SettingDialog) {
+//                             SettingDialog dlg = (SettingDialog) getConfigDlg();
+//                             dlg.applicableButteon();
+//                     } else {
+//                             WelcomeDialog dlg = (WelcomeDialog) getConfigDlg();
+//                             dlg.applicableButteon();
+//                     }
+//             }
+//     }
 
        public void setFeaturesValueFromTableItemsList(Grid table) {
                TargetData target = SettingDataManager.getInstance().getTarget(null);
index 1f080a0..de1987c 100644 (file)
@@ -45,7 +45,8 @@ public class SettingDialogOptionPage extends DAPageComposite {
        public static final String ID = SettingDialogOptionPage.class
                        .getName();
 
-       private DACheckBox showInitialCheckBox = null;
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//     private DACheckBox showInitialCheckBox = null;
        private DACheckBox autoStopCheckBox = null;
 
        public SettingDialogOptionPage(Composite parent, int style) {
@@ -67,36 +68,38 @@ public class SettingDialogOptionPage extends DAPageComposite {
                data.left = new FormAttachment(0, 8);
                settingLabel.setLayoutData(data);
 
-               // SHOW_INITIAL_FEATURE_SETTING
-               showInitialCheckBox = new DACheckBox(this, SWT.NONE);
-               data = new FormData();
-               data.top = new FormAttachment(settingLabel, 15);
-               data.left = new FormAttachment(0, 22);
-               data.height = 20;
-               data.width = 20;
-               showInitialCheckBox.setLayoutData(data);
-               showInitialCheckBox.setForeground(ColorResources.BLACK);
-               showInitialCheckBox.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-               showInitialCheckBox.setText(ConfigureLabels.SETTING_OPTION_SHOW_INITIAL);
-               showInitialCheckBox.addSelectionListener(showInitiaRadioButtonListener);
-               showInitialCheckBox.setChecked(SettingDataManager.getInstance().isShowInitial());
-
-               Label showInitalLabel = new Label(this, SWT.TRANSPARENT);
-               showInitalLabel.setText(ConfigureLabels.SETTING_OPTION_SHOW_INITIAL);
-               showInitalLabel.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
-               showInitalLabel.setForeground(ColorResources.BLACK);
-               showInitalLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
-               data = new FormData();
-               data.top = new FormAttachment(settingLabel, 17);
-               data.left = new FormAttachment(0, 42);
-               showInitalLabel.setLayoutData(data);
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//             showInitialCheckBox = new DACheckBox(this, SWT.NONE);
+//             data = new FormData();
+//             data.top = new FormAttachment(settingLabel, 15);
+//             data.left = new FormAttachment(0, 22);
+//             data.height = 20;
+//             data.width = 20;
+//             showInitialCheckBox.setLayoutData(data);
+//             showInitialCheckBox.setForeground(ColorResources.BLACK);
+//             showInitialCheckBox.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+//             showInitialCheckBox.setText(ConfigureLabels.SETTING_OPTION_SHOW_INITIAL);
+//             showInitialCheckBox.addSelectionListener(showInitiaRadioButtonListener);
+//             showInitialCheckBox.setChecked(SettingDataManager.getInstance().isShowInitial());
+//
+//             Label showInitalLabel = new Label(this, SWT.TRANSPARENT);
+//             showInitalLabel.setText(ConfigureLabels.SETTING_OPTION_SHOW_INITIAL);
+//             showInitalLabel.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
+//             showInitalLabel.setForeground(ColorResources.BLACK);
+//             showInitalLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
+//             data = new FormData();
+//             data.top = new FormAttachment(settingLabel, 17);
+//             data.left = new FormAttachment(0, 42);
+//             showInitalLabel.setLayoutData(data);
 
                // SHOW_INITIAL_FEATURE_SETTING
                autoStopCheckBox = new DACheckBox(this, SWT.NONE);
                data = new FormData();
-               data.top = new FormAttachment(settingLabel, 42);
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//             data.top = new FormAttachment(settingLabel, 42);
+               data.top = new FormAttachment(settingLabel, 15);
                data.left = new FormAttachment(0, 22);
-               data.height = 20; // 20
+               data.height = 20;
                data.width = 20;
                autoStopCheckBox.setLayoutData(data);
                autoStopCheckBox.setForeground(ColorResources.BLACK);
@@ -111,26 +114,29 @@ public class SettingDialogOptionPage extends DAPageComposite {
                autoStopLabel.setForeground(ColorResources.BLACK);
                autoStopLabel.setFont(FontResources.CONFIGURATION_TABLE_TITLE_FONT);
                data = new FormData();
-               data.top = new FormAttachment(settingLabel, 44);
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//             data.top = new FormAttachment(settingLabel, 44);
+               data.top = new FormAttachment(settingLabel, 15);
                data.left = new FormAttachment(0, 42);
                autoStopLabel.setLayoutData(data);
        }
 
-       private DACheckboxSelectionListener showInitiaRadioButtonListener = new DACheckboxSelectionListener() {
-               @Override
-               public void handleSelectionEvent(DACheckBox checkbox) {
-                       if (SettingDataManager.getInstance().isShowInitial()) {
-                               SettingDataManager.getInstance().setShowInitial(false);
-                               showInitialCheckBox.setChecked(false);                  
-                       } else {
-                               SettingDataManager.getInstance().setShowInitial(true);
-                               showInitialCheckBox.setChecked(true);                                   
-                       }
-
-                       // change button status
-                       SettingDialogManager.getInstance().updateSaveButtonStatus(null);
-               }
-       };
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//     private DACheckboxSelectionListener showInitiaRadioButtonListener = new DACheckboxSelectionListener() {
+//             @Override
+//             public void handleSelectionEvent(DACheckBox checkbox) {
+//                     if (SettingDataManager.getInstance().isShowInitial()) {
+//                             SettingDataManager.getInstance().setShowInitial(false);
+//                             showInitialCheckBox.setChecked(false);                  
+//                     } else {
+//                             SettingDataManager.getInstance().setShowInitial(true);
+//                             showInitialCheckBox.setChecked(true);                                   
+//                     }
+//
+//                     // change button status
+//                     SettingDialogManager.getInstance().updateSaveButtonStatus(null);
+//             }
+//     };
 
        private DACheckboxSelectionListener autoStopRadioButtonListener = new DACheckboxSelectionListener() {
                @Override
@@ -142,9 +148,9 @@ public class SettingDialogOptionPage extends DAPageComposite {
                                SettingDataManager.getInstance().setAutoStop(true);
                                autoStopCheckBox.setChecked(true);                                      
                        }
-
-                       // change button status
-                       SettingDialogManager.getInstance().updateSaveButtonStatus(null);
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//                     // change button status
+//                     SettingDialogManager.getInstance().updateSaveButtonStatus(null);
                }
        };
 }
\ No newline at end of file
index c37dab9..6103ee5 100644 (file)
@@ -260,17 +260,19 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                                        Rectangle r = new Rectangle(0, 0, rect.width - 1, rect.height - 1);
                                        e.gc.setForeground(ColorResources.SETTING_STROKE);
                                        e.gc.drawRectangle(r);
-                                       e.gc.drawLine(0, 22, rect.width-1, 22);
+                                       e.gc.drawLine(0, 22, rect.width-1, 22);                                 
+                                       e.gc.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
+                                       e.gc.fillRectangle(1, 1, 84, 21);
                                }
                        });
                }
                // label
                targetLabel = new Label(targetComp, SWT.TRANSPARENT);
                FormData data = new FormData();
-               data.top = new FormAttachment(0, 1);
+               data.top = new FormAttachment(0, 4);
                data.left = new FormAttachment(0, 1);
-               data.height = 21;
-               data.width = 84;                
+               data.height = 18;
+               data.width = 84;
                targetLabel.setLayoutData(data);
                targetLabel.setText(ConfigureLabels.SETTING_DIALOG_TARGET_TITLE);
                targetLabel.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
@@ -309,7 +311,8 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                
                // ToogleButtonGroup
                Map<String, TargetData> targetList = SettingDataManager.getInstance().getTargetListMap();
-               String selectedTarget = SettingDataManager.getInstance().getSelectedTarget();
+               String selectedTarget = SettingDataManager.getInstance().getConnectedTarget().getTargetName();  
+               SettingDataManager.getInstance().setSelectedTarget(selectedTarget);
                DACustomToggleButtonGroup targetGroup = new DACustomToggleButtonGroup();
                Point imagePoint = new Point(18, 8);
                Point fontPoint = new Point(-1, 60);
@@ -339,8 +342,9 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                                                createTemplateTitleComposite();
                                                createTemplateDescriptionComposite();
                                                
-                                               // change button status
-                                               SettingDialogManager.getInstance().updateSaveButtonStatus(null);
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)                                            
+//                                             // change button status
+//                                             SettingDialogManager.getInstance().updateSaveButtonStatus(null);
                                        }
                                }
                        });                     
@@ -352,7 +356,7 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                        if (selectedTarget.equals(entry.getKey()) == true) {
                                targetGroup.setSelection(toggle);
                        }
-               }
+               }               
                targetComp.layout(true);
        }
        
@@ -367,7 +371,7 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                        compData.top = new FormAttachment(0, 230);
                        compData.left = new FormAttachment(0, 98);
                        compData.width = 504;
-                       compData.height = 159;  
+                       compData.height = 164;  
                        descriptionComp.setLayoutData(compData);
                        descriptionComp.setBackground(ColorResources.WHITE);
                        
@@ -480,6 +484,10 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                                        e.gc.setForeground(ColorResources.SETTING_STROKE);
                                        e.gc.drawRectangle(r);
                                        e.gc.drawLine(0, 22, rect.width-1, 22);
+                                       
+                                       e.gc.setBackground(ColorResources.SETTING_TITLE_BACKGROUND);
+                                       e.gc.fillRectangle(1, 1, 502, 21);
+
                                }
                        });
                }
@@ -487,9 +495,9 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                // label : template
                templateLabel = new Label(templateComp, SWT.TRANSPARENT);
                FormData data = new FormData();
-               data.top = new FormAttachment(0, 1);
+               data.top = new FormAttachment(0, 4);
                data.left = new FormAttachment(0, 1);
-               data.height = 21;
+               data.height = 18;
                data.width = 502;               
                templateLabel.setLayoutData(data);
                templateLabel.setText(ConfigureLabels.SETTING_DIALOG_TEMPLATE_TITLE);
@@ -555,14 +563,20 @@ public class SettingDialogTemplatePage extends DAPageComposite {
                                        if(toggleButton.isToggled()) {
                                                // set select template
                                                TargetData target = SettingDataManager.getInstance().getTarget(null);
-                                               target.setSelectedTemplate(toggleButton.getText());
-                                               target.changeAvailableFeatureListMap(toggleButton.getText());
-                                               
-                                               // change description
-                                               createTemplateDescriptionComposite();
+                                               String preSelectedTemplate = target.getSelectedTemplate();
                                                
-                                               // change button status
-                                               SettingDialogManager.getInstance().updateSaveButtonStatus(null);
+                                               // TODO : redefine custom template usage
+                                               if (preSelectedTemplate.equals(toggleButton.getText()) == false) {
+                                                       target.setSelectedTemplate(toggleButton.getText());
+                                                       target.changeAvailableFeatureListMap(toggleButton.getText());
+                                                       
+                                                       // change description
+                                                       createTemplateDescriptionComposite();
+                                               }
+
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)
+//                                             // change button status
+//                                             SettingDialogManager.getInstance().updateSaveButtonStatus(null);
                                        }
                                }
                        });             
index f8dda11..92fae82 100644 (file)
@@ -55,63 +55,91 @@ import org.tizen.dynamicanalyzer.workbench.ApplicationWorkbenchWindowAdvisor;
 
 public class WelcomeDialog extends DAMessageBox {
        
-       private DACustomButton applyButton = null;
-//     private DACustomButton revertButton = null;
-       private DACustomButton runButton = null;
+       private DACustomButton okButton = null;
+       private DACustomButton cancelButton = null;
        
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)    
+//     private DACustomButton applyButton = null;
+//     private DACustomButton revertButton = null;
+//     private DACustomButton runButton = null;
+//     private DACheckBox useAgainCheckButton = null;
+
        private SettingDialogTemplatePage templatesPage = null;
-       private DACheckBox useAgainCheckButton = null;
        
        public WelcomeDialog(Shell parentShell) {
                super(parentShell);
                SettingDataManager.getInstance();       // read setting information file
        }
 
-       private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() {
+       private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
                        doApply();
-                       applicableButteon();
-               }
-       };
-       private DACustomButtonClickEventListener revertButtonListener = new DACustomButtonClickEventListener() {
-
-               @Override
-               public void handleClickEvent(DACustomButton button) {
-                       doRevert();
-                       applicableButteon();
+                       doRun();
+                       shell.close();  // close dialog
                }
        };
        
-       private DACustomButtonClickEventListener runButtonListener = new DACustomButtonClickEventListener() {
+       private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
+                       doRevert();
                        doRun();
                        shell.close();  // close dialog
                }
        };
+
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)    
+//     private DACustomButtonClickEventListener applyButtonListener = new DACustomButtonClickEventListener() {
+//
+//             @Override
+//             public void handleClickEvent(DACustomButton button) {
+//                     doApply();
+//                     applicableButteon();
+//             }
+//     };
+//     private DACustomButtonClickEventListener revertButtonListener = new DACustomButtonClickEventListener() {
+//
+//             @Override
+//             public void handleClickEvent(DACustomButton button) {
+//                     doRevert();
+//                     applicableButteon();
+//             }
+//     };
+//     
+//     private DACustomButtonClickEventListener runButtonListener = new DACustomButtonClickEventListener() {
+//
+//             @Override
+//             public void handleClickEvent(DACustomButton button) {
+//                     doRun();
+//                     shell.close();  // close dialog
+//             }
+//     };
        
        private void doApply() {        
-               // add & remove tab view page
-               SettingDialogManager.getInstance().updateTabViewPage();
-               
-               // add & remove (timeline) chart
-               SettingDialogManager.getInstance().updateChartList();
-
-               // write setting data
-               SettingDataManager.getInstance().applySettingData();
+               if (DACommunicator.isRunning() == false) {
+                       // add & remove tab view page
+                       SettingDialogManager.getInstance().updateTabViewPage();
+                       
+                       // add & remove (timeline) chart
+                       SettingDialogManager.getInstance().updateChartList();
+       
+                       // write setting data
+                       SettingDataManager.getInstance().applySettingData();
+               }
        }
 
        private void doRevert() {
                // rollback setting data
                SettingDataManager.getInstance().revertSettingData();
                
-               // update template view
-               templatesPage.createTemplateTitleComposite();
-               templatesPage.createTemplateDescriptionComposite();
-               templatesPage.createTargetComposite();
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)    
+//             // update template view
+//             templatesPage.createTemplateTitleComposite();
+//             templatesPage.createTemplateDescriptionComposite();
+//             templatesPage.createTargetComposite();
        }
 
        private void doRun() {
@@ -120,25 +148,26 @@ public class WelcomeDialog extends DAMessageBox {
                }
        }
 
-       private DACheckboxSelectionListener useAgainCheckbuttonListener = new DACheckboxSelectionListener() {
-               @Override
-               public void handleSelectionEvent(DACheckBox checkbox) {
-                       if (SettingDataManager.getInstance().isShowInitial()) {
-                               SettingDataManager.getInstance().setShowInitial(false);
-                               useAgainCheckButton.setChecked(false);                  
-                       } else {
-                               SettingDataManager.getInstance().setShowInitial(true);
-                               useAgainCheckButton.setChecked(true);                                   
-                       }
-
-                       // change button status
-                       SettingDialogManager.getInstance().updateSaveButtonStatus(null);
-               }
-       };
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)    
+//     private DACheckboxSelectionListener useAgainCheckbuttonListener = new DACheckboxSelectionListener() {
+//             @Override
+//             public void handleSelectionEvent(DACheckBox checkbox) {
+//                     if (SettingDataManager.getInstance().isShowInitial()) {
+//                             SettingDataManager.getInstance().setShowInitial(false);
+//                             useAgainCheckButton.setChecked(false);  
+//                     } else {
+//                             SettingDataManager.getInstance().setShowInitial(true);
+//                             useAgainCheckButton.setChecked(true);                                   
+//                     }
+//
+//                     // change button status
+//                     SettingDialogManager.getInstance().updateSaveButtonStatus(null);
+//             }
+//     };
        
        protected boolean run() {
                IDECommunicator.setOpenWelcomeDlg(true);
-               shell.setSize(611, 582);
+               shell.setSize(611, 558);
                shell.setLayout(new FormLayout());
                shell.setText(AnalyzerLabels.SETTING_TITLE);
                shell.setBackground(ColorResources.CONFIGURATION_TABLE_COVER_BACKGROUND_COLOR);
@@ -165,7 +194,7 @@ public class WelcomeDialog extends DAMessageBox {
                compData.top = new FormAttachment(banner, 0);
                compData.left = new FormAttachment(0, 0);
                compData.right = new FormAttachment(100, 0);
-               compData.bottom = new FormAttachment(100, -71);
+               compData.bottom = new FormAttachment(100, -49);
                contentsComp.setLayoutData(compData);
 
                // check exist setting file 
@@ -214,38 +243,62 @@ public class WelcomeDialog extends DAMessageBox {
                                e.gc.drawLine(0, 1, rect.width-1, 1);
                        }
                });
-       
-               // ask use again image
-               useAgainCheckButton = new DACheckBox(buttonContentsComp, SWT.NONE);
-               FormData data = new FormData();
-               data.top = new FormAttachment(0, 13);
-               data.left = new FormAttachment(0, 12);
-               data.height = 16;
-               data.width = 312;
-               useAgainCheckButton.setLayoutData(data);
-               useAgainCheckButton.setForeground(ColorResources.BLACK);
-               useAgainCheckButton
-                               .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
-               useAgainCheckButton.setText(ConfigureLabels.SETTING_OPTION_SHOW_INITIAL);
-               useAgainCheckButton.addSelectionListener(useAgainCheckbuttonListener);
-               useAgainCheckButton.setChecked(SettingDataManager.getInstance().isShowInitial());
                
-               runButton = new DAButton(buttonContentsComp, SWT.NONE);
-               runButton.addClickListener(runButtonListener);          
-               if (ApplicationWorkbenchWindowAdvisor.isAutoStart()) {
-                       runButton.setText(WidgetLabels.RUN);                    
-               } else {
-                       runButton.setText(WidgetLabels.CLOSE);
-               }
+               cancelButton = new DAButton(buttonContentsComp, SWT.NONE);
+               cancelButton.addClickListener(cancelButtonListener);            
+               cancelButton.setText(WidgetLabels.CANCEL);                      
                
-               runButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+               cancelButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
                FormData buttonData = new FormData();
                buttonData.right = new FormAttachment(100, -9);
-               buttonData.top = new FormAttachment(useAgainCheckButton, 6);
+               buttonData.top = new FormAttachment(0, 11);
+               buttonData.width = 100;
+               buttonData.height = 28;
+               cancelButton.setLayoutData(buttonData);
+
+               okButton = new DAButton(buttonContentsComp, SWT.NONE);
+               okButton.addClickListener(okButtonListener);
+               okButton.setText(WidgetLabels.OK);
+               okButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+               buttonData = new FormData();
+               buttonData.right = new FormAttachment(cancelButton, -8);
+               buttonData.top = new FormAttachment(0, 11);
                buttonData.width = 100;
                buttonData.height = 28;
-               runButton.setLayoutData(buttonData);
+               okButton.setLayoutData(buttonData);
                
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)                    
+//             // ask use again image
+//             useAgainCheckButton = new DACheckBox(buttonContentsComp, SWT.NONE);
+//             FormData data = new FormData();
+//             data.top = new FormAttachment(0, 13);
+//             data.left = new FormAttachment(0, 12);
+//             data.height = 16;
+//             data.width = 312;
+//             useAgainCheckButton.setLayoutData(data);
+//             useAgainCheckButton.setForeground(ColorResources.BLACK);
+//             useAgainCheckButton
+//                             .setBackground(ColorResources.CONFIGURATION_BUTTON_COVER_BACKGROUND_COLOR);
+//             useAgainCheckButton.setText(ConfigureLabels.SETTING_OPTION_SHOW_INITIAL);
+//             useAgainCheckButton.addSelectionListener(useAgainCheckbuttonListener);
+//             useAgainCheckButton.setChecked(SettingDataManager.getInstance().isShowInitial());
+//             
+//             runButton = new DAButton(buttonContentsComp, SWT.NONE);
+//             runButton.addClickListener(runButtonListener);          
+//             if (ApplicationWorkbenchWindowAdvisor.isAutoStart()) {
+//                     runButton.setText(WidgetLabels.RUN);                    
+//             } else {
+//                     runButton.setText(WidgetLabels.CLOSE);
+//             }
+//             
+//             runButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+//             FormData buttonData = new FormData();
+//             buttonData.right = new FormAttachment(100, -9);
+//             buttonData.top = new FormAttachment(useAgainCheckButton, 6);
+//             buttonData.width = 100;
+//             buttonData.height = 28;
+//             runButton.setLayoutData(buttonData);
+//             
 //             revertButton = new DAButton(buttonContentsComp, SWT.NONE);
 //             revertButton.addClickListener(revertButtonListener);
 //             revertButton.setText(WidgetLabels.REVERT);
@@ -256,38 +309,40 @@ public class WelcomeDialog extends DAMessageBox {
 //             buttonData.width = 100;
 //             buttonData.height = 28;
 //             revertButton.setLayoutData(buttonData);
-               
-               applyButton = new DAButton(buttonContentsComp, SWT.NONE);
-               applyButton.addClickListener(applyButtonListener);
-               applyButton.setText(WidgetLabels.APPLY);
-               applyButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
-               buttonData = new FormData();
+//             
+//             applyButton = new DAButton(buttonContentsComp, SWT.NONE);
+//             applyButton.addClickListener(applyButtonListener);
+//             applyButton.setText(WidgetLabels.APPLY);
+//             applyButton.setButtonFont(FontResources.DIALOG_BUTTON_FONT);
+//             buttonData = new FormData();
 //             buttonData.right = new FormAttachment(revertButton, -8);
-               buttonData.right = new FormAttachment(runButton, -8);
-               buttonData.top = new FormAttachment(useAgainCheckButton, 6);
-               buttonData.width = 100;
-               buttonData.height = 28;
-               applyButton.setLayoutData(buttonData);
+//             buttonData.top = new FormAttachment(useAgainCheckButton, 6);
+//             buttonData.width = 100;
+//             buttonData.height = 28;
+//             applyButton.setLayoutData(buttonData);
+//             
+//             applicableButteon();
+
                
-               applicableButteon();
                shell.addShellListener(shellListener);
                shell.open();
                return true;
        }
        
-       public void applicableButteon() {
-               applyButton.setButtonEnabled(false);
-//             revertButton.setButtonEnabled(false);
-               runButton.setButtonEnabled(true);
-       }
-       
-       public void editableButteon() {
-               if (DACommunicator.isRunning() == false) {
-                       applyButton.setButtonEnabled(true);
-//                     revertButton.setButtonEnabled(true);
-                       runButton.setButtonEnabled(false);
-               }
-       }
+// HIDDEN SETTING WIDGET (CHECKBOX, BUTTON)            
+//     public void applicableButteon() {
+//             okButton.setButtonEnabled(false);
+////           revertButton.setButtonEnabled(false);
+//             cancelButton.setButtonEnabled(true);
+//     }
+//     
+//     public void editableButteon() {
+//             if (DACommunicator.isRunning() == false) {
+//                     okButton.setButtonEnabled(true);
+////                   revertButton.setButtonEnabled(true);
+//                     cancelButton.setButtonEnabled(false);
+//             }
+//     }
        
        private void notifyAutoRun() {
                synchronized (IDECommunicator.getWaitingWelcomeDlg()) {