-/*
- * 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