From 84fb7f50acc143086441e8365e40b16de5b4c494 Mon Sep 17 00:00:00 2001 From: "daeryong.park" Date: Tue, 4 Apr 2017 19:59:54 +0900 Subject: [PATCH] RTSDK : Clean up codes - Clean up unnecessary code - Fixed to flash wizard open as application modal Change-Id: I99d2485c4d9512fdc1168bc5d0eac083292e9269 Signed-off-by: daeryong.park --- .../src/org/tizen/rt/ide/build/BuildBuilder.java | 8 +----- .../tizen/rt/ide/build/RtosBuildWizardDialog.java | 3 --- .../src/org/tizen/rt/ide/flash/FlashBuilder.java | 8 +----- .../tizen/rt/ide/flash/RtosFlashWizardDialog.java | 31 +++++++++------------- 4 files changed, 14 insertions(+), 36 deletions(-) diff --git a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/BuildBuilder.java b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/BuildBuilder.java index 80697f3..a5c4b63 100644 --- a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/BuildBuilder.java +++ b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/BuildBuilder.java @@ -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); } } diff --git a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/RtosBuildWizardDialog.java b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/RtosBuildWizardDialog.java index 7375720..7a1b52f 100644 --- a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/RtosBuildWizardDialog.java +++ b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/build/RtosBuildWizardDialog.java @@ -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 diff --git a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/FlashBuilder.java b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/FlashBuilder.java index 490616f..6434429 100644 --- a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/FlashBuilder.java +++ b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/FlashBuilder.java @@ -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); } } diff --git a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/RtosFlashWizardDialog.java b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/RtosFlashWizardDialog.java index c49ebf3..5c239ca 100644 --- a/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/RtosFlashWizardDialog.java +++ b/rt-ide/tizen.rt.product.plugin/src/org/tizen/rt/ide/flash/RtosFlashWizardDialog.java @@ -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 } (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); } } -- 2.7.4