RTSDK : Clean up codes
authordaeryong.park <bdragon.park@samsung.com>
Tue, 4 Apr 2017 10:59:54 +0000 (19:59 +0900)
committerdaeryong.park <bdragon.park@samsung.com>
Tue, 4 Apr 2017 10:59:54 +0000 (19:59 +0900)
- Clean up unnecessary code
- Fixed to flash wizard open as application modal

Change-Id: I99d2485c4d9512fdc1168bc5d0eac083292e9269
Signed-off-by: daeryong.park <bdragon.park@samsung.com>
rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/BuildBuilder.java
rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/RtosBuildWizardDialog.java
rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/FlashBuilder.java
rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/RtosFlashWizardDialog.java

index 80697f3..a5c4b63 100644 (file)
@@ -45,15 +45,9 @@ public class BuildBuilder {
         RtosBuildWizardDialog rtosWizardDialog = new RtosBuildWizardDialog(Util
                 .getWorkbenchWindow().getShell(), rtosWizard);
 
-        rtosWizardDialog.setHelpAvailable(true);
         rtosWizardDialog.create();
         int result = rtosWizardDialog.open();
 
-        if (result == Window.OK) {
-            return true;
-        } else {
-            // logger.error("failed to open BuildWizard ");
-        }
-        return false;
+        return (result == Window.OK);
     }
 }
index 7375720..7a1b52f 100644 (file)
@@ -73,8 +73,6 @@ public class RtosBuildWizardDialog extends WizardDialog {
     public static String toolchainPath = null;
     private Shell shell;
     private Button make;
-    // private Button cancel;
-
     private Button kernelConfigButton;
 
     public RtosBuildWizardDialog(Shell parentShell, IWizard newWizard) {
@@ -123,7 +121,6 @@ public class RtosBuildWizardDialog extends WizardDialog {
         super.finishPressed();
     }
 
-    // @Override
     @Override
     protected void createButtonsForButtonBar(Composite p) {
         // Parent's LayoutData alignments changed SWT.RIGHT to SWT.FILL
index 490616f..6434429 100644 (file)
@@ -44,15 +44,9 @@ public class FlashBuilder {
         RtosFlashWizardDialog rtosWizardDialog = new RtosFlashWizardDialog(Util
                 .getWorkbenchWindow().getShell(), rtosWizard);
 
-        rtosWizardDialog.setHelpAvailable(true);
         rtosWizardDialog.create();
         int result = rtosWizardDialog.open();
 
-        if (result == Window.OK) {
-            return true;
-        } else {
-            // logger.error("failed to open BuildWizard ");
-        }
-        return false;
+        return (result == Window.OK);
     }
 }
index c49ebf3..5c239ca 100644 (file)
@@ -28,7 +28,6 @@ package org.tizen.rt.ide.flash;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.wizard.IWizard;
 import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Rectangle;
@@ -42,22 +41,22 @@ import org.tizen.rt.ide.util.OSChecker;
  * @author jm.jaemin.kim{@literal <jm.jaemin.kim>} (S-Core)
  */
 public class RtosFlashWizardDialog extends WizardDialog {
-    private Composite parent;
+
+    public static final String LAUNCHER_LABEL = "Flash"; //$NON-NLS-1$
+
     private int x = 0;
     private int y = 0;
-    private final int width = OSChecker.isWindows() ? 485 : 555;
+    private final int width = OSChecker.isWindows() ? 550 : 620;
     private final int height = 450;
     public static FlashOption selectionOption = null;
     private Shell shell;
-    private Button make;
-    private Button cancel;
+    private Button flash;
 
     public RtosFlashWizardDialog(Shell parentShell, IWizard newWizard) {
         super(parentShell, newWizard);
         Rectangle bounds = null;
         bounds = parentShell.getBounds();
         setbounds(bounds);
-        setShellStyle(SWT.MODELESS | SWT.TITLE | SWT.CLOSE);
 
     }
 
@@ -78,34 +77,28 @@ public class RtosFlashWizardDialog extends WizardDialog {
     protected void configureShell(Shell newShell) {
         super.configureShell(newShell);
         this.shell = newShell;
-        newShell.setLocation(x, y);
-        newShell.setSize(width, height);
+        this.shell.setLocation(x, y);
+        this.shell.setSize(width, height);
     }
 
     protected void PressedFinished() {
         super.finishPressed();
     }
 
-    // @Override
     @Override
     protected void createButtonsForButtonBar(Composite p) {
-        this.parent = p;
-        super.createButtonsForButtonBar(parent);
-
-        String LAUNCHER_LABEL = "Flash"; //$NON-NLS-1$
+        super.createButtonsForButtonBar(p);
 
         // LAUNCHER_LABEL
-        make = getButton(IDialogConstants.FINISH_ID);
-        make.setText(LAUNCHER_LABEL);
-        make.addSelectionListener(new SelectionAdapter() {
+        flash = getButton(IDialogConstants.FINISH_ID);
+        flash.setText(LAUNCHER_LABEL);
+        flash.addSelectionListener(new SelectionAdapter() {
             @Override
             public void widgetSelected(SelectionEvent e) {
                 // TODO: something to launch
             }
         });
 
-        setButtonLayoutData(make);
-        // cancel = getButton(IDialogConstants.CANCEL_ID);
-        // cancel.moveAbove(make);
+        setButtonLayoutData(flash);
     }
 }