[SRADA-880]FIX : abnormal menubar disabled.
authorggh1933.go <ggh1933.go@samsung.com>
Tue, 5 Jul 2016 05:33:27 +0000 (14:33 +0900)
committerggh1933.go <ggh1933.go@samsung.com>
Tue, 5 Jul 2016 05:49:27 +0000 (14:49 +0900)
 - +forced disabled.
Change-Id: Ibe542eaf4231373a7d85ee479e35fa17b604fac4

org.tizen.dynamicanalyzer.workbench.product/dynamicanalyzer.product
org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java
org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationActionBarAdvisor.java

index 69ddcdc..e6b3227 100644 (file)
@@ -14,7 +14,7 @@
    </configIni>
 
    <launcherArgs>
-      <programArgs>-data -clearPersistedState @noDefault
+      <programArgs>-data @noDefault
       </programArgs>
       <vmArgs>-XX:MaxPermSize=64m
 -Xms256m
index c7d4b2e..796ac91 100644 (file)
@@ -71,6 +71,7 @@ private Display m_display;
                m_display = PlatformUI.createDisplay();
                // set workspace directory for dynamic analyzer
                // this work must be done first before any other work.
+               System.setProperty("clearPersistedState", "true");
                Location instanceLoc = Platform.getInstanceLocation();
                String path = Platform.getInstallLocation().getURL().getPath() + File.separator;
                try {
index b1c1d58..2098864 100644 (file)
@@ -1,49 +1,47 @@
-/*
- *  Dynamic Analyzer
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Jaewon Lim <jaewon81.lim@samsung.com>
- * Jooyoul Lee <jy.exe.lee@samsung.com>
- * Juyoung Kim <j0.kim@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * Contributors:
- * - S-Core Co., Ltd
- * 
- */
-
 package org.tizen.dynamicanalyzer.workbench;
 
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.application.ActionBarAdvisor;
 import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.registry.ActionSetRegistry;
+import org.eclipse.ui.internal.registry.IActionSetDescriptor;
 
 public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
-
+       
+       private static final String[] actionSetId = new String[] { "org.eclipse.search.searchActionSet", "org.eclipse.ui.externaltools.ExternalToolsSet"}; //$NON-NLS-1$
+       
        public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
                super(configurer);
+               removeUnWantedActions();
        }
 
        @Override
        protected void fillMenuBar(IMenuManager menuBar) {
+
        }
 
        @Override
        protected void makeActions(IWorkbenchWindow window) {
        }
+       
+    private void removeUnWantedActions() {
+        ActionSetRegistry asr = WorkbenchPlugin.getDefault().getActionSetRegistry();
+        IActionSetDescriptor[] actionSets = asr.getActionSets();
+
+        IExtension ext = null;
+        for (IActionSetDescriptor actionSet : actionSets) {
+           for (String element : actionSetId) {
+               System.out.println(element);
 
-}
+              if (element.equals(actionSet.getId())) {
+                 ext = actionSet.getConfigurationElement().getDeclaringExtension();
+                 asr.removeExtension(ext, new Object[] { actionSet });
+              }
+           }
+        }
+     }
+}
\ No newline at end of file