From bb1039528af7321717541e392279d9f345495306 Mon Sep 17 00:00:00 2001 From: "ggh1933.go" Date: Tue, 5 Jul 2016 14:33:27 +0900 Subject: [PATCH] [SRADA-880]FIX : abnormal menubar disabled. - +forced disabled. Change-Id: Ibe542eaf4231373a7d85ee479e35fa17b604fac4 --- .../dynamicanalyzer.product | 2 +- .../dynamicanalyzer/workbench/Application.java | 1 + .../workbench/ApplicationActionBarAdvisor.java | 56 +++++++++++----------- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/org.tizen.dynamicanalyzer.workbench.product/dynamicanalyzer.product b/org.tizen.dynamicanalyzer.workbench.product/dynamicanalyzer.product index 69ddcdc..e6b3227 100644 --- a/org.tizen.dynamicanalyzer.workbench.product/dynamicanalyzer.product +++ b/org.tizen.dynamicanalyzer.workbench.product/dynamicanalyzer.product @@ -14,7 +14,7 @@ - -data -clearPersistedState @noDefault + -data @noDefault -XX:MaxPermSize=64m -Xms256m diff --git a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java index c7d4b2e..796ac91 100644 --- a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java +++ b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/Application.java @@ -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 { diff --git a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationActionBarAdvisor.java b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationActionBarAdvisor.java index b1c1d58..2098864 100644 --- a/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationActionBarAdvisor.java +++ b/org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationActionBarAdvisor.java @@ -1,49 +1,47 @@ -/* - * Dynamic Analyzer - * - * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Jaewon Lim - * Jooyoul Lee - * Juyoung Kim - * - * 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 -- 2.7.4