Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 07:43:07 -0400
committerCamille Letavernier2014-08-21 09:50:25 -0400
commitdbc038b44bcbb890ae256d15eb09eb285512f020 (patch)
tree757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration
parentea48a20561464c3cbb7895d430583669a9f82fcc (diff)
downloadorg.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.gz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.tar.xz
org.eclipse.papyrus-dbc038b44bcbb890ae256d15eb09eb285512f020.zip
[Code style] Apply clean-up and formatter on Main plug-ins
Diffstat (limited to 'plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration')
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Activator.java4
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Configuration.java6
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/ConfigurationService.java24
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/CustomizeActionBars.java12
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PapyrusPerspectiveListener.java355
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PerspectiveConfigurator.java6
6 files changed, 205 insertions, 202 deletions
diff --git a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Activator.java b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Activator.java
index 4511fa27aab..73c2db087b7 100644
--- a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Activator.java
+++ b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Activator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -65,7 +65,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Configuration.java b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Configuration.java
index ebb17bcc304..ac6e83e106d 100644
--- a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Configuration.java
+++ b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/Configuration.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import java.util.ArrayList;
/**
* this class is a structure that contains a configuration
- *
+ *
*/
public class Configuration {
@@ -94,7 +94,7 @@ public class Configuration {
/**
* constructor of a perspective
- *
+ *
* @param perspectiveName
*/
public Configuration(String perspectiveName) {
diff --git a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/ConfigurationService.java b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/ConfigurationService.java
index 753a00cfe1f..a2b0ef1a121 100644
--- a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/ConfigurationService.java
+++ b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/ConfigurationService.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -58,42 +58,42 @@ public class ConfigurationService {
public ConfigurationService() {
IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(PERSPECTIVE_CONFIGURATION_EXTENSION_POINT_ID);
- for(int i = 0; i < configElements.length; i++) {
+ for (int i = 0; i < configElements.length; i++) {
constructAConfiguation(configElements[i]);
}
}
protected void constructAConfiguation(IConfigurationElement iConfigurationElement) {
try {
- String configName = (String)iConfigurationElement.getAttribute(PERPSECTIVE_ID);
- if(!configurationMap.containsKey(configName) || configurationMap.get(configName) == null) {
+ String configName = iConfigurationElement.getAttribute(PERPSECTIVE_ID);
+ if (!configurationMap.containsKey(configName) || configurationMap.get(configName) == null) {
configurationMap.put(configName, new Configuration(configName));
}
Configuration configuration = configurationMap.get(configName);
IConfigurationElement[] element = iConfigurationElement.getChildren(ACTION_SET);
- for(int i = 0; i < element.length; i++) {
+ for (int i = 0; i < element.length; i++) {
configuration.addActionSet(element[i].getAttribute(ACTION_SET_ID));
}
element = iConfigurationElement.getChildren(MENU);
- for(int i = 0; i < element.length; i++) {
+ for (int i = 0; i < element.length; i++) {
configuration.addMenu(element[i].getAttribute(MENU_ID));
}
element = iConfigurationElement.getChildren(TOOLBAR);
- for(int i = 0; i < element.length; i++) {
+ for (int i = 0; i < element.length; i++) {
configuration.addtoolBar(element[i].getAttribute(TOOLBAR_ID));
}
element = iConfigurationElement.getChildren(PREFERENCEPAGE);
- for(int i = 0; i < element.length; i++) {
+ for (int i = 0; i < element.length; i++) {
configuration.addPreference(element[i].getAttribute(PREFERENCEPAGEID));
}
element = iConfigurationElement.getChildren(CATEGORY);
- for(int i = 0; i < element.length; i++) {
+ for (int i = 0; i < element.length; i++) {
configuration.addCategory(element[i].getAttribute(CATEGORYID));
}
element = iConfigurationElement.getChildren(COMMAND);
- for(int i = 0; i < element.length; i++) {
+ for (int i = 0; i < element.length; i++) {
configuration.addCommandID(element[i].getAttribute(COMMANDID));
}
} catch (Exception e) {
@@ -102,7 +102,7 @@ public class ConfigurationService {
}
/**
- *
+ *
* @return a set of perspective id that has a configuration
*/
protected Set<String> getPerspectiveList() {
@@ -111,7 +111,7 @@ public class ConfigurationService {
/**
* get a configuration from a perspective ID
- *
+ *
* @param perspectiveID
* @return a configuration or null if a configuration is not defined for the given perspective ID
*/
diff --git a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/CustomizeActionBars.java b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/CustomizeActionBars.java
index a4ec4050da0..ea2e1ebf00f 100644
--- a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/CustomizeActionBars.java
+++ b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/CustomizeActionBars.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@ import org.eclipse.ui.services.IServiceLocator;
/**
* this class is used to collection all information about menu, cool bar, statusline...
- *
+ *
*/
public class CustomizeActionBars implements IActionBarConfigurer2, IActionBars2 {
@@ -44,7 +44,7 @@ public class CustomizeActionBars implements IActionBarConfigurer2, IActionBars2
/**
* get the list of action set
- *
+ *
* @return
*/
public List<IActionSetDescriptor> getActionSet() {
@@ -53,7 +53,7 @@ public class CustomizeActionBars implements IActionBarConfigurer2, IActionBars2
/**
* set the list of action Set
- *
+ *
* @param actionSet
*/
public void setActionSet(List<IActionSetDescriptor> actionSet) {
@@ -70,9 +70,9 @@ public class CustomizeActionBars implements IActionBarConfigurer2, IActionBars2
/**
* Create a new instance of this class.
- *
+ *
* @param configurer
- * the configurer
+ * the configurer
*/
public CustomizeActionBars(IWorkbenchWindowConfigurer configurer) {
}
diff --git a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PapyrusPerspectiveListener.java b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PapyrusPerspectiveListener.java
index 0125ce9fc13..63e53463758 100644
--- a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PapyrusPerspectiveListener.java
+++ b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PapyrusPerspectiveListener.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,11 +33,12 @@ import org.eclipse.ui.internal.WorkbenchPage;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.WorkbenchWindow;
import org.eclipse.ui.internal.registry.PerspectiveRegistry;
+
//import org.eclipse.ui.internal.Perspective;
/**
* this is a listener hat has in charge to configure a perspective when it is openend etc..
- *
+ *
*/
public class PapyrusPerspectiveListener extends PerspectiveAdapter {
@@ -50,20 +51,20 @@ public class PapyrusPerspectiveListener extends PerspectiveAdapter {
/**
* creation of the listener
- *
+ *
* @param window
*/
public PapyrusPerspectiveListener(IWorkbenchWindow window) {
this.window = window;
this.configurationservice = new ConfigurationService();
- //this is the lauch of eclipse, so we look for which perspective is opened
- if(window.getActivePage() != null) {
+ // this is the lauch of eclipse, so we look for which perspective is opened
+ if (window.getActivePage() != null) {
IPerspectiveDescriptor openedPerspectiveDescriptor = window.getActivePage().getPerspective();
- if(configurationservice.getConfiguration(openedPerspectiveDescriptor.getId()) != null) {
- //it is the frist time?
- if(!isAlreadySave(openedPerspectiveDescriptor.getId())) {
- //Activator.log.debug("First time to open it");
+ if (configurationservice.getConfiguration(openedPerspectiveDescriptor.getId()) != null) {
+ // it is the frist time?
+ if (!isAlreadySave(openedPerspectiveDescriptor.getId())) {
+ // Activator.log.debug("First time to open it");
updateTooling(openedPerspectiveDescriptor);
window.getActivePage().savePerspective();
}
@@ -75,16 +76,16 @@ public class PapyrusPerspectiveListener extends PerspectiveAdapter {
/**
* return yes id it exist a file that custom a given perspective
- *
+ *
* @param perspectiveID
- * the id of the perspective
+ * the id of the perspective
* @return yes it find a file,if not no
*/
public boolean isAlreadySave(String perspectiveID) {
- PerspectiveRegistry perspRegistry = (PerspectiveRegistry)WorkbenchPlugin.getDefault().getPerspectiveRegistry();
+ PerspectiveRegistry perspRegistry = (PerspectiveRegistry) WorkbenchPlugin.getDefault().getPerspectiveRegistry();
try {
- //IMemento memento = perspRegistry.getCustomPersp(perspectiveID);
- //Activator.log.debug(""+memento);
+ // IMemento memento = perspRegistry.getCustomPersp(perspectiveID);
+ // Activator.log.debug(""+memento);
return true;
} catch (Exception e) {
return false;
@@ -93,53 +94,53 @@ public class PapyrusPerspectiveListener extends PerspectiveAdapter {
@Override
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspectivedescriptor) {
- //Activator.log.debug("perspectiveActivated "+perspectivedescriptor.getId());
+ // Activator.log.debug("perspectiveActivated "+perspectivedescriptor.getId());
super.perspectiveActivated(page, perspectivedescriptor);
- //test is we are interesting by the current perspective
- if(configurationservice.getConfiguration(perspectivedescriptor.getId()) != null) {
- //if(!isAlreadySave(perspectivedescriptor.getId())) {
+ // test is we are interesting by the current perspective
+ if (configurationservice.getConfiguration(perspectivedescriptor.getId()) != null) {
+ // if(!isAlreadySave(perspectivedescriptor.getId())) {
updateTooling(perspectivedescriptor);
- // page.savePerspective();
- //}
+ // page.savePerspective();
+ // }
}
updatePreferencePage(perspectivedescriptor);
- // Perspective perspective = ((WorkbenchPage)page).findPerspective(perspectivedescriptor);
- //
- // //due to a bug on the refresh, we need to call explicitly this method.
- // //to remove, when the origin is found.
- // if( perspective!=null){
- // perspective.updateActionBars();
- // }
+ // Perspective perspective = ((WorkbenchPage)page).findPerspective(perspectivedescriptor);
+ //
+ // //due to a bug on the refresh, we need to call explicitly this method.
+ // //to remove, when the origin is found.
+ // if( perspective!=null){
+ // perspective.updateActionBars();
+ // }
}
protected void updatePreferencePage(IPerspectiveDescriptor perspectivedescriptor) {
- //test is we are interesting by the current perspective
- if(configurationservice.getConfiguration(perspectivedescriptor.getId()) != null) {
+ // test is we are interesting by the current perspective
+ if (configurationservice.getConfiguration(perspectivedescriptor.getId()) != null) {
Configuration configuration = configurationservice.getConfiguration(perspectivedescriptor.getId());
IPreferenceNode[] preferencepagelist = window.getWorkbench().getPreferenceManager().getRootSubNodes();
// take in account the preferences
- for(int i = 0; i < preferencepagelist.length; i++) {
- if(preferencepagelist[i] instanceof PreferenceNode) {
- PreferenceNode node = (PreferenceNode)preferencepagelist[i];
- if(!configuration.getPreferenceID().contains(node.getId())) {
+ for (int i = 0; i < preferencepagelist.length; i++) {
+ if (preferencepagelist[i] instanceof PreferenceNode) {
+ PreferenceNode node = (PreferenceNode) preferencepagelist[i];
+ if (!configuration.getPreferenceID().contains(node.getId())) {
hiddenRootPref.add(node);
}
}
}
Iterator<PreferenceNode> iteratorpreftoremove = hiddenRootPref.iterator();
- while(iteratorpreftoremove.hasNext()) {
+ while (iteratorpreftoremove.hasNext()) {
window.getWorkbench().getPreferenceManager().remove(iteratorpreftoremove.next());
}
} else {
- //this is not an interesting perspective
+ // this is not an interesting perspective
Iterator<PreferenceNode> iteratorpreftoremove = hiddenRootPref.iterator();
- while(iteratorpreftoremove.hasNext()) {
+ while (iteratorpreftoremove.hasNext()) {
window.getWorkbench().getPreferenceManager().addToRoot(iteratorpreftoremove.next());
}
hiddenRootPref.clear();
@@ -155,34 +156,34 @@ public class PapyrusPerspectiveListener extends PerspectiveAdapter {
public void run() {
try {
IWorkbenchWindow window = Workbench.getInstance().getActiveWorkbenchWindow();
- if(window instanceof WorkbenchWindow) {
- WorkbenchPage worbenchPage = (WorkbenchPage)window.getActivePage();
- ICommandService cmdService = (ICommandService)worbenchPage.getActivePart().getSite().getService(ICommandService.class);
+ if (window instanceof WorkbenchWindow) {
+ WorkbenchPage worbenchPage = (WorkbenchPage) window.getActivePage();
+ ICommandService cmdService = (ICommandService) worbenchPage.getActivePart().getSite().getService(ICommandService.class);
Configuration configuration = configurationservice.getConfiguration(perspectivedescriptor.getId());
ArrayList<String> commandIdToRemove = new ArrayList<String>();
try {
- //put all commands that not reference to the given category
- for(int i = 0; i < cmdService.getDefinedCommands().length; i++) {
- if(!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
+ // put all commands that not reference to the given category
+ for (int i = 0; i < cmdService.getDefinedCommands().length; i++) {
+ if (!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
commandIdToRemove.add(cmdService.getDefinedCommands()[i].getId());
}
- // else{System.err.println("keep "+cmdService.getDefinedCommands()[i].getId());}
+ // else{System.err.println("keep "+cmdService.getDefinedCommands()[i].getId());}
}
- //then verify for each command by taking account its id.
- for(int i = 0; i < cmdService.getDefinedCommands().length; i++) {
- //put the commands in the list to hide, theis command are not referenced in the given list of command id and are not in the given list of category
- if(!configuration.getCommandIDList().contains(cmdService.getDefinedCommands()[i].getId())) {
- if(!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
- if(!commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
+ // then verify for each command by taking account its id.
+ for (int i = 0; i < cmdService.getDefinedCommands().length; i++) {
+ // put the commands in the list to hide, theis command are not referenced in the given list of command id and are not in the given list of category
+ if (!configuration.getCommandIDList().contains(cmdService.getDefinedCommands()[i].getId())) {
+ if (!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
+ if (!commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
commandIdToRemove.add(cmdService.getDefinedCommands()[i].getId());
}
}
- } else {//may be the id that we want to keep was in already in the list because of the filter on category
- if(commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
+ } else {// may be the id that we want to keep was in already in the list because of the filter on category
+ if (commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
commandIdToRemove.remove(cmdService.getDefinedCommands()[i].getId());
}
}
@@ -194,178 +195,180 @@ public class PapyrusPerspectiveListener extends PerspectiveAdapter {
- MenuManager menuManager = ((WorkbenchWindow)window).getMenuManager();
+ MenuManager menuManager = ((WorkbenchWindow) window).getMenuManager();
IContributionItem[] items = menuManager.getItems();
- for(IContributionItem item:items){
- if(!(configuration.getMenuIDList().contains(item.getId()))){
+ for (IContributionItem item : items) {
+ if (!(configuration.getMenuIDList().contains(item.getId()))) {
menuManager.remove(item.getId());
}
-
+
}
-
+
}
}
- catch(Exception e){
+ catch (Exception e) {
System.err.println(e);
}
}
});
}
- // /**
- // * this method hide menu, tool bar and action hat are not interesting
- // *
- // * @param perspectivedescriptor
- // */
- // protected void updateTooling(IPerspectiveDescriptor perspectivedescriptor) {
+
+ // /**
+ // * this method hide menu, tool bar and action hat are not interesting
+ // *
+ // * @param perspectivedescriptor
+ // */
+ // protected void updateTooling(IPerspectiveDescriptor perspectivedescriptor) {
//
- // CustomizeActionBars customizeActionBars = loadData();
+ // CustomizeActionBars customizeActionBars = loadData();
//
- // if(configurationservice.getConfiguration(perspectivedescriptor.getId()) != null) {
- // Configuration configuration = configurationservice.getConfiguration(perspectivedescriptor.getId());
- // //Activator.log.debug("Update tooling");
- // //Load all information about menus....
- // WorkbenchPage worbenchPage = (WorkbenchPage)window.getActivePage();
- // // Get the perspective
- // Perspective perspective = worbenchPage.findPerspective(perspectivedescriptor);
+ // if(configurationservice.getConfiguration(perspectivedescriptor.getId()) != null) {
+ // Configuration configuration = configurationservice.getConfiguration(perspectivedescriptor.getId());
+ // //Activator.log.debug("Update tooling");
+ // //Load all information about menus....
+ // WorkbenchPage worbenchPage = (WorkbenchPage)window.getActivePage();
+ // // Get the perspective
+ // Perspective perspective = worbenchPage.findPerspective(perspectivedescriptor);
//
- // ICommandService cmdService = (ICommandService)worbenchPage.getActivePart().getSite().getService(ICommandService.class);
+ // ICommandService cmdService = (ICommandService)worbenchPage.getActivePart().getSite().getService(ICommandService.class);
//
//
- // ArrayList<String> commandIdToRemove = new ArrayList<String>();
+ // ArrayList<String> commandIdToRemove = new ArrayList<String>();
//
- // try {
+ // try {
//
- // //put all commands that not reference to the given category
- // for(int i = 0; i < cmdService.getDefinedCommands().length; i++) {
- // if(!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
- // commandIdToRemove.add(cmdService.getDefinedCommands()[i].getId());
- // }
- // // else{System.err.println("keep "+cmdService.getDefinedCommands()[i].getId());}
- // }
+ // //put all commands that not reference to the given category
+ // for(int i = 0; i < cmdService.getDefinedCommands().length; i++) {
+ // if(!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
+ // commandIdToRemove.add(cmdService.getDefinedCommands()[i].getId());
+ // }
+ // // else{System.err.println("keep "+cmdService.getDefinedCommands()[i].getId());}
+ // }
//
- // //then verify for each command by taking account its id.
- // for(int i = 0; i < cmdService.getDefinedCommands().length; i++) {
- // //put the commands in the list to hide, theis command are not referenced in the given list of command id and are not in the given list of category
- // if(!configuration.getCommandIDList().contains(cmdService.getDefinedCommands()[i].getId())) {
- // if(!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
- // if(!commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
- // commandIdToRemove.add(cmdService.getDefinedCommands()[i].getId());
- // }
- // }
- // } else {//may be the id that we want to keep was in already in the list because of the filter on category
- // if(commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
- // commandIdToRemove.remove(cmdService.getDefinedCommands()[i].getId());
- // }
- // }
- // }
- // } catch (Exception e) {
- // System.err.println(e);
- // }
+ // //then verify for each command by taking account its id.
+ // for(int i = 0; i < cmdService.getDefinedCommands().length; i++) {
+ // //put the commands in the list to hide, theis command are not referenced in the given list of command id and are not in the given list of category
+ // if(!configuration.getCommandIDList().contains(cmdService.getDefinedCommands()[i].getId())) {
+ // if(!configuration.getCategoryIDList().contains(cmdService.getDefinedCommands()[i].getCategory().getId())) {
+ // if(!commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
+ // commandIdToRemove.add(cmdService.getDefinedCommands()[i].getId());
+ // }
+ // }
+ // } else {//may be the id that we want to keep was in already in the list because of the filter on category
+ // if(commandIdToRemove.contains(cmdService.getDefinedCommands()[i].getId())) {
+ // commandIdToRemove.remove(cmdService.getDefinedCommands()[i].getId());
+ // }
+ // }
+ // }
+ // } catch (Exception e) {
+ // System.err.println(e);
+ // }
//
//
- // perspective.getHiddenMenuItems().clear();
- // perspective.getHiddenToolbarItems().clear();
+ // perspective.getHiddenMenuItems().clear();
+ // perspective.getHiddenToolbarItems().clear();
//
- // //look for all actionSet
- // ArrayList<IActionSetDescriptor> actionSetToRemove = new ArrayList<IActionSetDescriptor>();
- // Iterator<IActionSetDescriptor> iteratorActionSet = customizeActionBars.getActionSet().iterator();
- // while(iteratorActionSet.hasNext()) {
- // IActionSetDescriptor currentActionSetDescriptor = iteratorActionSet.next();
- // //test if the configuationSet contains the id
- // if(!configuration.getActionSetIDList().contains(currentActionSetDescriptor.getId())) {
- // actionSetToRemove.add(currentActionSetDescriptor);
- // }
- // }
+ // //look for all actionSet
+ // ArrayList<IActionSetDescriptor> actionSetToRemove = new ArrayList<IActionSetDescriptor>();
+ // Iterator<IActionSetDescriptor> iteratorActionSet = customizeActionBars.getActionSet().iterator();
+ // while(iteratorActionSet.hasNext()) {
+ // IActionSetDescriptor currentActionSetDescriptor = iteratorActionSet.next();
+ // //test if the configuationSet contains the id
+ // if(!configuration.getActionSetIDList().contains(currentActionSetDescriptor.getId())) {
+ // actionSetToRemove.add(currentActionSetDescriptor);
+ // }
+ // }
//
//
//
- // // look for all menu
- // ArrayList<String> menuToRemove = new ArrayList<String>();
+ // // look for all menu
+ // ArrayList<String> menuToRemove = new ArrayList<String>();
//
- // for(int i = 0; i < customizeActionBars.getMenuManager().getItems().length; i++) {
- // if(!configuration.getMenuIDList().contains(customizeActionBars.getMenuManager().getItems()[i].getId())) {
- // menuToRemove.add(customizeActionBars.getMenuManager().getItems()[i].getId());
- // }
- // }
+ // for(int i = 0; i < customizeActionBars.getMenuManager().getItems().length; i++) {
+ // if(!configuration.getMenuIDList().contains(customizeActionBars.getMenuManager().getItems()[i].getId())) {
+ // menuToRemove.add(customizeActionBars.getMenuManager().getItems()[i].getId());
+ // }
+ // }
//
- // //look for all toolbar
- // ArrayList<String> toolbarToRemove = new ArrayList<String>();
- // for(int i = 0; i < customizeActionBars.getToolBarManager().getItems().length; i++) {
+ // //look for all toolbar
+ // ArrayList<String> toolbarToRemove = new ArrayList<String>();
+ // for(int i = 0; i < customizeActionBars.getToolBarManager().getItems().length; i++) {
//
- // if(!configuration.getToolBarID().contains(customizeActionBars.getToolBarManager().getItems()[i].getId())) {
- // toolbarToRemove.add(customizeActionBars.getToolBarManager().getItems()[i].getId());
- // }
- // }
+ // if(!configuration.getToolBarID().contains(customizeActionBars.getToolBarManager().getItems()[i].getId())) {
+ // toolbarToRemove.add(customizeActionBars.getToolBarManager().getItems()[i].getId());
+ // }
+ // }
//
- // perspective.getHiddenMenuItems().addAll(commandIdToRemove);
- // perspective.getHiddenToolbarItems().addAll(commandIdToRemove);
- // //hide elements
- // perspective.turnOffActionSets((IActionSetDescriptor[])actionSetToRemove.toArray(new IActionSetDescriptor[actionSetToRemove.size()]));
- // perspective.getHiddenMenuItems().addAll(menuToRemove);
- // perspective.getHiddenToolbarItems().addAll(toolbarToRemove);
- // perspective.updateActionBars();
+ // perspective.getHiddenMenuItems().addAll(commandIdToRemove);
+ // perspective.getHiddenToolbarItems().addAll(commandIdToRemove);
+ // //hide elements
+ // perspective.turnOffActionSets((IActionSetDescriptor[])actionSetToRemove.toArray(new IActionSetDescriptor[actionSetToRemove.size()]));
+ // perspective.getHiddenMenuItems().addAll(menuToRemove);
+ // perspective.getHiddenToolbarItems().addAll(toolbarToRemove);
+ // perspective.updateActionBars();
//
- // }
+ // }
//
- // }
+ // }
//
- // /**
- // * this method search all identifier of menu toolbar and actionSet that are loaded in eclipse
- // *
- // * @return a structure that contains all references of the toolbar, menu, and actionSet..
- // */
- // protected CustomizeActionBars loadData() {
+ // /**
+ // * this method search all identifier of menu toolbar and actionSet that are loaded in eclipse
+ // *
+ // * @return a structure that contains all references of the toolbar, menu, and actionSet..
+ // */
+ // protected CustomizeActionBars loadData() {
//
//
- // CustomizeActionBars ownedActionBar = new CustomizeActionBars(null);
- // //actionSet
- // // Just get the action sets at this point. Do not load the action set
- // // until it is actually selected in the dialog.
- // ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
- // IActionSetDescriptor[] sets = reg.getActionSets();
- // IActionSetDescriptor[] actionSetDescriptors = ((WorkbenchPage)window.getActivePage()).getActionSets();
- // List initiallyAvailableActionSets = Arrays.asList(actionSetDescriptors);
- // ownedActionBar.setActionSet(initiallyAvailableActionSets);
+ // CustomizeActionBars ownedActionBar = new CustomizeActionBars(null);
+ // //actionSet
+ // // Just get the action sets at this point. Do not load the action set
+ // // until it is actually selected in the dialog.
+ // ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
+ // IActionSetDescriptor[] sets = reg.getActionSets();
+ // IActionSetDescriptor[] actionSetDescriptors = ((WorkbenchPage)window.getActivePage()).getActionSets();
+ // List initiallyAvailableActionSets = Arrays.asList(actionSetDescriptors);
+ // ownedActionBar.setActionSet(initiallyAvailableActionSets);
//
//
//
- // // Fill fake action bars with static menu information.
- // ((WorkbenchWindow)window).fillActionBars(ownedActionBar, ActionBarAdvisor.FILL_PROXY | ActionBarAdvisor.FILL_MENU_BAR | ActionBarAdvisor.FILL_COOL_BAR);
- // // Activator.log.debug("\n+-> ActionSetDescriptor");
- // for(int i = 0; i < sets.length; i++) {
- // ActionSetDescriptor actionSetDesc = (ActionSetDescriptor)sets[i];
- // // Activator.log.debug("+--->" + actionSetDesc.getId());
+ // // Fill fake action bars with static menu information.
+ // ((WorkbenchWindow)window).fillActionBars(ownedActionBar, ActionBarAdvisor.FILL_PROXY | ActionBarAdvisor.FILL_MENU_BAR | ActionBarAdvisor.FILL_COOL_BAR);
+ // // Activator.log.debug("\n+-> ActionSetDescriptor");
+ // for(int i = 0; i < sets.length; i++) {
+ // ActionSetDescriptor actionSetDesc = (ActionSetDescriptor)sets[i];
+ // // Activator.log.debug("+--->" + actionSetDesc.getId());
//
- // }
+ // }
//
- // final IMenuService menuService = (IMenuService)window.getService(IMenuService.class);
- // menuService.populateContributionManager((ContributionManager)ownedActionBar.getMenuManager(), MenuUtil.MAIN_MENU);
- // //Activator.log.debug("\n+-> Menu " + ownedActionBar.getMenuManager().getItems().length);
- // for(int i = 0; i < ownedActionBar.getMenuManager().getItems().length; i++) {
- // IContributionItem item = ownedActionBar.getMenuManager().getItems()[i];
- // // Activator.log.debug("+--->" + item.getId());
- // }
+ // final IMenuService menuService = (IMenuService)window.getService(IMenuService.class);
+ // menuService.populateContributionManager((ContributionManager)ownedActionBar.getMenuManager(), MenuUtil.MAIN_MENU);
+ // //Activator.log.debug("\n+-> Menu " + ownedActionBar.getMenuManager().getItems().length);
+ // for(int i = 0; i < ownedActionBar.getMenuManager().getItems().length; i++) {
+ // IContributionItem item = ownedActionBar.getMenuManager().getItems()[i];
+ // // Activator.log.debug("+--->" + item.getId());
+ // }
//
//
- // IToolBarManager toolBarManager = ownedActionBar.getToolBarManager();
- // menuService.populateContributionManager((ContributionManager)toolBarManager, MenuUtil.MAIN_TOOLBAR);
- // //Activator.log.debug("\n+-> toolbar " + ownedActionBar.getToolBarManager() + " " + ownedActionBar.getToolBarManager().getItems().length);
- // for(int i = 0; i < ownedActionBar.getToolBarManager().getItems().length; i++) {
- // IContributionItem item = toolBarManager.getItems()[i];
- // //Activator.log.debug("+--->" + item.getId());
- // }
+ // IToolBarManager toolBarManager = ownedActionBar.getToolBarManager();
+ // menuService.populateContributionManager((ContributionManager)toolBarManager, MenuUtil.MAIN_TOOLBAR);
+ // //Activator.log.debug("\n+-> toolbar " + ownedActionBar.getToolBarManager() + " " + ownedActionBar.getToolBarManager().getItems().length);
+ // for(int i = 0; i < ownedActionBar.getToolBarManager().getItems().length; i++) {
+ // IContributionItem item = toolBarManager.getItems()[i];
+ // //Activator.log.debug("+--->" + item.getId());
+ // }
//
- // return ownedActionBar;
- // }
+ // return ownedActionBar;
+ // }
/**
* {@inheritDoc}
*/
+ @Override
public void perspectiveDeactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
- //in the case of reset this method is called.
- //Activator.log.debug("perspectiveDeactivated "+perspective.getId());
- //updateTooling(perspective);
- //page.savePerspective();
+ // in the case of reset this method is called.
+ // Activator.log.debug("perspectiveDeactivated "+perspective.getId());
+ // updateTooling(perspective);
+ // page.savePerspective();
}
}
diff --git a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PerspectiveConfigurator.java b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PerspectiveConfigurator.java
index f47aa37e685..190d28daa3a 100644
--- a/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PerspectiveConfigurator.java
+++ b/plugins/editor/org.eclipse.papyrus.editor.perspectiveconfiguration/src/org/eclipse/papyrus/editor/perspectiveconfiguration/PerspectiveConfigurator.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2010 CEA LIST.
*
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,7 +20,7 @@ import org.eclipse.ui.PlatformUI;
/**
* this class is used to hide unuseful menu and action Set
- *
+ *
*/
public class PerspectiveConfigurator implements IStartup {
@@ -29,7 +29,7 @@ public class PerspectiveConfigurator implements IStartup {
public void run() {
final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- //a perspective listener is added
+ // a perspective listener is added
workbenchWindow.addPerspectiveListener(new PapyrusPerspectiveListener(workbenchWindow));
}
});

Back to the top