summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhyunsik.noh <hyunsik.noh@samsung.com>2013-07-26 17:46:13 +0900
committerhyunsik.noh <hyunsik.noh@samsung.com>2013-07-26 17:46:13 +0900
commitda54e69c64808f451004f674ad0d5a07c6aef76a (patch)
tree828ac895da69a068704b34ddd4a6562eef12e2b9
parentf66b4744943fc51915c3b9c9bacce1da55671cd2 (diff)
downloadcommon-eplugin-da54e69c64808f451004f674ad0d5a07c6aef76a.tar.gz
common-eplugin-da54e69c64808f451004f674ad0d5a07c6aef76a.tar.bz2
common-eplugin-da54e69c64808f451004f674ad0d5a07c6aef76a.zip
[Title]Fix UX bug for smart launch when selected project is a tizen web project.
Fix to not open smart launch dialog when it already opened. Fix to show messages when try to open smart launch dialog even though there is no tizen project. [Type] [Module]common [Priority] [CQ#] [Redmine#]9925 [Problem] [Cause] [Solution] Change-Id: Ia7c8476b6b76fdb1dfe352e86061f1489a924bca
-rw-r--r--org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/GomSmartLauncher.java23
-rw-r--r--org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/action/GomSmartLaunchToolbarAction.java2
-rw-r--r--org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/handler/GomSmartLaunchCycleHandler.java2
-rw-r--r--org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.java1
-rw-r--r--org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.properties1
-rw-r--r--org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/ui/GomDialog.java22
6 files changed, 36 insertions, 15 deletions
diff --git a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/GomSmartLauncher.java b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/GomSmartLauncher.java
index a20affca5..1fc27286f 100644
--- a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/GomSmartLauncher.java
+++ b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/GomSmartLauncher.java
@@ -50,6 +50,8 @@ public class GomSmartLauncher {
public static final String ATTR_CONFIG_DEVICE_IS_EMULATOR = "org.tizen.common.launch.device.emulator";
public static final String ATTR_CONFIG_NO_DEVICE = "";
+
+ private static GomDialog gomDialog = null;
private final static Logger logger = LoggerFactory.getLogger(GomSmartLauncher.class);
@@ -75,13 +77,18 @@ public class GomSmartLauncher {
}
public static void openDialog(IWorkbenchWindow window) {
- if(checkBeforeDialogOpen(window)) {
- GomDialog gomDialog = new GomDialog(window.getShell());
- if(gomDialog.open() == Window.OK) {
- IProject project = gomDialog.getProject();
- if(checkBeforeLaunch(project, window)) {
- smartLaunch(getLaunchData(gomDialog));
+ if(gomDialog == null) {
+ if(existTizenProjectBeforeDialogOpen(window)) {
+ gomDialog = new GomDialog(window.getShell());
+ if(gomDialog.open() == Window.OK) {
+ IProject project = gomDialog.getProject();
+ if(existProjectAndDeviceBeforeLaunch(project, window)) {
+ smartLaunch(getLaunchData(gomDialog));
+ }
}
+ gomDialog = null;
+ } else {
+ MessageDialog.openError(window.getShell(), GomMessages.SMARTLAUNCH_FAIL, GomMessages.SMARTLAUNCH_NO_PROJECT);
}
}
}
@@ -92,7 +99,7 @@ public class GomSmartLauncher {
return data;
}
- private static boolean checkBeforeDialogOpen(IWorkbenchWindow window) {
+ private static boolean existTizenProjectBeforeDialogOpen(IWorkbenchWindow window) {
boolean result = false;
if(window != null) {
@@ -110,7 +117,7 @@ public class GomSmartLauncher {
return result;
}
- public static boolean checkBeforeLaunch(IProject project, IWorkbenchWindow window) {
+ public static boolean existProjectAndDeviceBeforeLaunch(IProject project, IWorkbenchWindow window) {
boolean result = false;
if(!project.exists()) {
diff --git a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/action/GomSmartLaunchToolbarAction.java b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/action/GomSmartLaunchToolbarAction.java
index 3c89c65c3..54c4d6bf5 100644
--- a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/action/GomSmartLaunchToolbarAction.java
+++ b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/action/GomSmartLaunchToolbarAction.java
@@ -74,7 +74,7 @@ public class GomSmartLaunchToolbarAction implements IWorkbenchWindowPulldownDele
if(recentIndex > -1)
{
GomLaunchData data = list.get(recentIndex);
- if(GomSmartLauncher.checkBeforeLaunch(data.getProject(), window)) {
+ if(GomSmartLauncher.existProjectAndDeviceBeforeLaunch(data.getProject(), window)) {
new GomSmartLaunchAction(data).run();
}
}else
diff --git a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/handler/GomSmartLaunchCycleHandler.java b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/handler/GomSmartLaunchCycleHandler.java
index afa616848..f6e6f7d86 100644
--- a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/handler/GomSmartLaunchCycleHandler.java
+++ b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/handler/GomSmartLaunchCycleHandler.java
@@ -254,7 +254,7 @@ public class GomSmartLaunchCycleHandler extends CycleBaseHandler {
if (selectedItem instanceof GomLaunchData) {
GomLaunchData data = (GomLaunchData)selectedItem;
- if(GomSmartLauncher.checkBeforeLaunch(data.getProject(), window)) {
+ if(GomSmartLauncher.existProjectAndDeviceBeforeLaunch(data.getProject(), window)) {
GomSmartLauncher.smartLaunch(data);
}
}
diff --git a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.java b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.java
index 271d460ae..bebf892ca 100644
--- a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.java
+++ b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.java
@@ -43,6 +43,7 @@ public class GomMessages extends NLS{
public static String SMARTLAUNCH_NEW_DIALOG_CONFIGURATION_TYPE;
public static String SMARTLAUNCH_FAIL;
+ public static String SMARTLAUNCH_NO_PROJECT;
public static String SMARTLAUNCH_UNEXIST_PROJECT;
public static String SMARTLAUNCH_DISCONNECTED_DEVICE;
diff --git a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.properties b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.properties
index e862facdf..ea6826399 100644
--- a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.properties
+++ b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/messages/GomMessages.properties
@@ -1,6 +1,7 @@
SMARTLAUNCH_DIALOG_TITLE=New Launch Configuration
SMARTLAUNCH_DIALOG_DESCRIPTION=Create launch configuration
SMARTLAUNCH_FAIL=Fail to launch
+SMARTLAUNCH_NO_PROJECT=There is no Tizen project to launch
SMARTLAUNCH_UNEXIST_PROJECT=There is no {0} Tizen project to launch
SMARTLAUNCH_DISCONNECTED_DEVICE=There is no Tizen device to launch
diff --git a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/ui/GomDialog.java b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/ui/GomDialog.java
index 16e44180c..cbdbf47cf 100644
--- a/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/ui/GomDialog.java
+++ b/org.tizen.common.gom/src/org/tizen/common/gom/smartlaunch/ui/GomDialog.java
@@ -73,6 +73,8 @@ public class GomDialog extends TitleAreaDialog{
private final int WIDTH = 500;
private final int HEIGHT = 500;
+ private Label lbBuild;
+ private Button[] btnMode;
private Text textConfigName;
private Combo comboBuildConfiguration;
private Combo comboShortcut;
@@ -202,6 +204,7 @@ public class GomDialog extends TitleAreaDialog{
{
project = (IProject) tree.getSelection()[0].getData();
setBuildConfigurationCombo();
+ setModeCombo();
setShortcutCombo();
modifyDefaultConfigName();
}
@@ -260,7 +263,7 @@ public class GomDialog extends TitleAreaDialog{
}
private void createBuildConfigPart(Composite composite) {
- Label lbBuild = new Label(composite, SWT.NONE);
+ lbBuild = new Label(composite, SWT.NONE);
lbBuild.setText(GomMessages.SMARTLAUNCH_NEW_DIALOG_BUILD_CONFIGURATION);
comboBuildConfiguration = new Combo(composite, SWT.READ_ONLY);
@@ -289,11 +292,12 @@ public class GomDialog extends TitleAreaDialog{
comboBuildConfiguration.removeAll();
if(!ProjectUtil.isTizenNativeProject((project))) {
- comboBuildConfiguration.setEnabled(false);
+ lbBuild.setVisible(false);
+ comboBuildConfiguration.setVisible(false);
return ;
}
-
- comboBuildConfiguration.setEnabled(true);
+ lbBuild.setVisible(true);
+ comboBuildConfiguration.setVisible(true);
configList.clear();
ITizenNativeProject adapter = (ITizenNativeProject) project.getAdapter(ITizenNativeProject.class);
@@ -334,7 +338,7 @@ public class GomDialog extends TitleAreaDialog{
GridData radio_gd = new GridData(GridData.FILL_HORIZONTAL);
grpMode.setLayoutData(radio_gd);
- Button[] btnMode = new Button[modes.length];
+ btnMode = new Button[modes.length];
for(int i = 0; i < modes.length; i++) {
btnMode[i] = new Button(grpMode, SWT.RADIO);
btnMode[i].setText(StringUtil.convertFirstLetterUpperCase(modes[i]));
@@ -383,6 +387,14 @@ public class GomDialog extends TitleAreaDialog{
setShortcutCombo();
}
+ private void setModeCombo() {
+ if(!ProjectUtil.isTizenNativeProject((project))) {
+ btnMode[2].setVisible(false);
+ return ;
+ }
+ btnMode[2].setVisible(true);
+ }
+
private void setShortcutCombo() {
comboShortcut.removeAll();