NEW: fix side effect of toolbar action
authorHyeoongseok Heo <harry.heo@samsung.com>
Sun, 24 Jul 2016 05:35:58 +0000 (14:35 +0900)
committerHyeoongseok Heo <harry.heo@samsung.com>
Sun, 24 Jul 2016 05:35:58 +0000 (14:35 +0900)
- With c502d70c286b5f0c1d1e77fff008a68788c05841 commit, Other menu also
open Tizen New wizard.
- So, fix the Other menu don't show Tizen new project.

Change-Id: Id11723589f1d475bc1d087ad713ed527b0819126
Signed-off-by: Hyeoongseok Heo <harry.heo@samsung.com>
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/IDEActionFactory.java
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionFactory.java

index 4f59485..1bb57a4 100644 (file)
@@ -260,7 +260,10 @@ public final class IDEActionFactory {
                 throw new IllegalArgumentException();
             }
             // @issue we are creating a NEW action just to pass to NewWizardDropDownAction
-            IWorkbenchAction innerAction = ActionFactory.NEW.create(window);
+                       /* Tizen */
+                       // IWorkbenchAction innerAction = ActionFactory.NEW.create(window);
+                       IWorkbenchAction innerAction = ActionFactory.TIZEN_NEW.create(window);
+                       /* ===== */
             NewWizardMenu newWizardMenu = new NewWizardMenu(window);
             IWorkbenchAction action = new NewWizardDropDownAction(window,
                     innerAction, newWizardMenu);
index d23b69f..6739c45 100644 (file)
@@ -686,11 +686,31 @@ public abstract class ActionFactory {
         * dialog. This action maintains its enablement state.
         */
     public static final ActionFactory NEW = new ActionFactory("new", //$NON-NLS-1$
-                       /* Tizen */
-                       // IWorkbenchCommandConstants.FILE_NEW) {
-                       IWorkbenchCommandConstants.FILE_NEW_TIZEN) {
-                       /* ===== */
+                       IWorkbenchCommandConstants.FILE_NEW) {
+               @Override
+               public IWorkbenchAction create(IWorkbenchWindow window) {
+                       if (window == null) {
+                               throw new IllegalArgumentException();
+                       }
+                       WorkbenchCommandAction action = new WorkbenchCommandAction(getCommandId(), window);
+                       action.setId(getId());
+                       ISharedImages images = window.getWorkbench().getSharedImages();
+                       action.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD));
+                       action.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_NEW_WIZARD_DISABLED));
+                       action.setText(WorkbenchMessages.NewWizardAction_text);
+                       action.setToolTipText(WorkbenchMessages.NewWizardAction_toolTip);
+                       window.getWorkbench().getHelpSystem().setHelp(action, IWorkbenchHelpContextIds.NEW_ACTION);
+                       return action;
+               }
+       };
 
+       /* Tizen */
+       /**
+        * Workbench action (id: "tizenNew", commandId: "org.tizen.common.ui.command.projectwizard"):
+        * Opens the Tizen new wizard dialog. This action maintains its enablement state.
+        */
+       public static final ActionFactory TIZEN_NEW = new ActionFactory("tizenNew", //$NON-NLS-1$
+                       IWorkbenchCommandConstants.FILE_NEW_TIZEN) {
         @Override
                public IWorkbenchAction create(IWorkbenchWindow window) {
             if (window == null) {
@@ -711,6 +731,7 @@ public abstract class ActionFactory {
             return action;
         }
     };
+       /* ===== */
 
        /**
         * Workbench action (id: "newWizardDropDown"): Drop-down action which shows shows the new wizard