Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2014-08-21 11:43:07 +0000
committerCamille Letavernier2014-08-21 13:50:25 +0000
commitdbc038b44bcbb890ae256d15eb09eb285512f020 (patch)
tree757e736583eea3ae352ad9ac91a81df7e59b79ff /plugins/editor
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')
-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
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/Activator.java2
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusActionBarContributor.java15
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMatchingStrategy.java25
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java4
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusPaletteSynchronizer.java26
-rw-r--r--plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/commands/RenameNestedEditorCommand.java71
12 files changed, 279 insertions, 271 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));
}
});
diff --git a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/Activator.java b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/Activator.java
index 8aae9b1f975..ab096ec2ffc 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/Activator.java
+++ b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/Activator.java
@@ -48,7 +48,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/src/org/eclipse/papyrus/editor/PapyrusActionBarContributor.java b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusActionBarContributor.java
index a5c9c48e702..8615fee5bf2 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusActionBarContributor.java
+++ b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusActionBarContributor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2008 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
@@ -26,9 +26,9 @@ import org.eclipse.ui.IEditorActionBarContributor;
* This ActionBarContributor is composed of ActionBarContributor described in extension.
* It also implements interfaces requested by some well knowns Papyrus nested
* editors (EMF, GMF, ...)
- *
+ *
* @author dumoulin
- *
+ *
*/
public class PapyrusActionBarContributor extends CoreComposedActionBarContributor implements IMenuListener {
@@ -40,15 +40,16 @@ public class PapyrusActionBarContributor extends CoreComposedActionBarContributo
/**
* Methods requested by EMF nested diagrams.
* Propagate the call to the currently active contributor.
- *
+ *
* @see org.eclipse.jface.action.IMenuListener#menuAboutToShow(org.eclipse.jface.action.IMenuManager)
* @param manager
- *
+ *
*/
+ @Override
public void menuAboutToShow(IMenuManager manager) {
IEditorActionBarContributor contributor = getActiveContributor();
- if(contributor != this && contributor instanceof IMenuListener) {
- ((IMenuListener)contributor).menuAboutToShow(manager);
+ if (contributor != this && contributor instanceof IMenuListener) {
+ ((IMenuListener) contributor).menuAboutToShow(manager);
return;
}
diff --git a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMatchingStrategy.java b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMatchingStrategy.java
index d56f212bcfa..6b33d372b75 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMatchingStrategy.java
+++ b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMatchingStrategy.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
@@ -12,7 +12,7 @@
*
*****************************************************************************/
- package org.eclipse.papyrus.editor;
+package org.eclipse.papyrus.editor;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
@@ -32,28 +32,29 @@ public class PapyrusMatchingStrategy implements IEditorMatchingStrategy {
* get focus instead of opening a second one. Whereas the passed editor reference always refers to a Papyrus
* editor, the passed editor input may not be related to UML, it might for instance be a Java or text
* file. Therefore, the code verifies that the new editor input is either a notation, uml or di file
- *
+ *
* @see org.eclipse.ui.IEditorMatchingStrategy#matches(org.eclipse.ui.IEditorReference, org.eclipse.ui.IEditorInput)
- *
+ *
* @param editorRef
- * a reference to an opened Papyrus editor
+ * a reference to an opened Papyrus editor
* @param newEInput
- * the new editor input
+ * the new editor input
* @return true, if the new input matches the existing editor reference.
*/
+ @Override
public boolean matches(IEditorReference editorRef, IEditorInput newEInput) {
- if(newEInput instanceof IFileEditorInput) {
- IFile newFile = ((IFileEditorInput)newEInput).getFile();
+ if (newEInput instanceof IFileEditorInput) {
+ IFile newFile = ((IFileEditorInput) newEInput).getFile();
String extension = newFile.getFileExtension();
- if("uml".equals(extension) || "di".equals(extension) || "notation".equals(extension)) {
+ if ("uml".equals(extension) || "di".equals(extension) || "notation".equals(extension)) {
try {
IEditorInput exiEInput = editorRef.getEditorInput();
- if((exiEInput instanceof IFileEditorInput)) {
- IFile exiFile = ((IFileEditorInput)exiEInput).getFile();
+ if ((exiEInput instanceof IFileEditorInput)) {
+ IFile exiFile = ((IFileEditorInput) exiEInput).getFile();
IPath exiFilenameWOE = exiFile.getFullPath().removeFileExtension();
IPath newFilenameWOE = newFile.getFullPath().removeFileExtension();
- if(exiFilenameWOE.equals(newFilenameWOE)) {
+ if (exiFilenameWOE.equals(newFilenameWOE)) {
return true;
}
}
diff --git a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java
index bd10758819c..cf889d72ff8 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java
+++ b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusMultiDiagramEditor.java
@@ -1,7 +1,7 @@
/*****************************************************************************
* Copyright (c) 2008 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
@@ -21,7 +21,7 @@ import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
* Papyrus main MultiEditor. This class add GMF adaptation dedicated to Papyrus.
* <p/>
* TODO : move GMF dependencies into this plugin.
- *
+ *
* @author dumoulin
*/
public class PapyrusMultiDiagramEditor extends CoreMultiDiagramEditor {
diff --git a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusPaletteSynchronizer.java b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusPaletteSynchronizer.java
index f655bfc175a..d6f0f81e9d1 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusPaletteSynchronizer.java
+++ b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/PapyrusPaletteSynchronizer.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014 Montages AG, CEA, and others.
- *
+ *
* 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,15 +33,17 @@ import org.eclipse.ui.IWorkbenchPage;
public PapyrusPaletteSynchronizer(PapyrusMultiDiagramEditor multiEditor) {
myMultiDiagramEditor = multiEditor;
-
+
// Handle the initial page selection
synchronizePaletteView(multiEditor.getISashWindowsContainer().getActiveSashWindowsPage());
}
+ @Override
public void activeEditorChanged(PagePart oldEditor, PagePart newEditor) {
synchronizePaletteView(newEditor);
}
+ @Override
public void pageChanged(IPage newPage) {
synchronizePaletteView(newPage);
}
@@ -49,23 +51,23 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* If {@link PaletteView} is available, synchronizes it with the content provided by active
* inner page
- *
+ *
* @param activePage
- * inner page to synchronize palette view with
+ * inner page to synchronize palette view with
*/
private void synchronizePaletteView(IPage activePage) {
PaletteView paletteView = findPaletteView();
- if(paletteView == null) {
+ if (paletteView == null) {
return;
}
// IEditorPage is not granted, it may be, e.g ErrorComponentPart
- IEditorPart activePart = activePage instanceof IEditorPage ? ((IEditorPage)activePage).getIEditorPart() : null;
- if(activePart == myLastActivePart) {
+ IEditorPart activePart = activePage instanceof IEditorPage ? ((IEditorPage) activePage).getIEditorPart() : null;
+ if (activePart == myLastActivePart) {
return;
}
- if(activePart == null) {
+ if (activePart == null) {
paletteView.partClosed(myLastActivePart);
} else {
// multi-editor may be activated outside of this code
@@ -82,10 +84,10 @@ import org.eclipse.ui.IWorkbenchPage;
*/
public void dispose() {
PaletteView paletteView = findPaletteView();
- if(paletteView == null) {
+ if (paletteView == null) {
return;
}
- if(myLastActivePart != null) {
+ if (myLastActivePart != null) {
paletteView.partClosed(myLastActivePart);
} else {
paletteView.partClosed(myMultiDiagramEditor);
@@ -94,12 +96,12 @@ import org.eclipse.ui.IWorkbenchPage;
/**
* Finds the {@link PaletteView} at the same page as the host multi-editor
- *
+ *
* @return palette view or <code>null</code> if not found
*/
private PaletteView findPaletteView() {
IWorkbenchPage samePage = myMultiDiagramEditor.getSite().getPage();
- return (PaletteView)samePage.findView(PaletteView.ID);
+ return (PaletteView) samePage.findView(PaletteView.ID);
}
}
diff --git a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/commands/RenameNestedEditorCommand.java b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/commands/RenameNestedEditorCommand.java
index 455a7d7ef04..5cf26b013f7 100644
--- a/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/commands/RenameNestedEditorCommand.java
+++ b/plugins/editor/org.eclipse.papyrus.editor/src/org/eclipse/papyrus/editor/commands/RenameNestedEditorCommand.java
@@ -1,5 +1,5 @@
/**
- *
+ *
*/
package org.eclipse.papyrus.editor.commands;
@@ -24,12 +24,12 @@ import org.eclipse.ui.IEditorPart;
* A command to be used with the Eclipse Commands Framework.
* This command is to be used with {@link SashWindowsContainer} implemented with the Di model.
* This command allows to rename a nested editor.
- *
+ *
* This command use a Transaction.
* TODO Move to gmf adapter.
- *
+ *
* @author cedric dumoulin
- *
+ *
*/
public class RenameNestedEditorCommand extends AbstractHandler {
@@ -38,37 +38,38 @@ public class RenameNestedEditorCommand extends AbstractHandler {
*/
@Override
public void setEnabled(Object evaluationContext) {
- // System.out.println("call to CloseDiagramCommand.setEnable(" + evaluationContext + ")");
+ // System.out.println("call to CloseDiagramCommand.setEnable(" + evaluationContext + ")");
}
/**
* Execute the command. This method is called when the action is triggered.
- *
+ *
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- // try {
- // IEditorPart part = HandlerUtil.getActiveEditor(event);
- // IPageMngr pageMngr = (IPageMngr)part.getAdapter(IPageMngr.class);
- // ISashWindowsContainer container = (ISashWindowsContainer)part.getAdapter(ISashWindowsContainer.class);
- // IPage sashPage = container.getActiveSashWindowsPage();
- //
- // if(sashPage instanceof IEditorPage )
- // {
- // IEditorPage editorPage = (IEditorPage)sashPage;
- // execute(editorPage.getRawModel(), editorPage.getIEditorPart());
- // }
- // // Bug from sash Di to be corrected
- // if(pageIdentifier instanceof PageRef)
- // {
- // pageIdentifier = ((PageRef)pageIdentifier).getPageIdentifier();
- // }
- // execute(sashPage.getRawModel(), sashPage.);
+ // try {
+ // IEditorPart part = HandlerUtil.getActiveEditor(event);
+ // IPageMngr pageMngr = (IPageMngr)part.getAdapter(IPageMngr.class);
+ // ISashWindowsContainer container = (ISashWindowsContainer)part.getAdapter(ISashWindowsContainer.class);
+ // IPage sashPage = container.getActiveSashWindowsPage();
+ //
+ // if(sashPage instanceof IEditorPage )
+ // {
+ // IEditorPage editorPage = (IEditorPage)sashPage;
+ // execute(editorPage.getRawModel(), editorPage.getIEditorPart());
+ // }
+ // // Bug from sash Di to be corrected
+ // if(pageIdentifier instanceof PageRef)
+ // {
+ // pageIdentifier = ((PageRef)pageIdentifier).getPageIdentifier();
+ // }
+ // execute(sashPage.getRawModel(), sashPage.);
//
- // } catch (NullPointerException e) {
- // // PageMngr can't be found
- // return null;
- // }
+ // } catch (NullPointerException e) {
+ // // PageMngr can't be found
+ // return null;
+ // }
@@ -77,17 +78,17 @@ public class RenameNestedEditorCommand extends AbstractHandler {
/**
* Close selected page.
- *
+ *
* @param pageMngr
*/
public void execute(final Diagram diagram, final IEditorPart editorPart) {
TransactionalEditingDomain editingDomain = null;
- if(editorPart instanceof IAdaptable) {
- ServicesRegistry registry = (ServicesRegistry)((IAdaptable)editorPart).getAdapter(ServicesRegistry.class);
+ if (editorPart instanceof IAdaptable) {
+ ServicesRegistry registry = (ServicesRegistry) ((IAdaptable) editorPart).getAdapter(ServicesRegistry.class);
- if(registry == null) {
- editingDomain = (TransactionalEditingDomain)((IAdaptable)editorPart).getAdapter(TransactionalEditingDomain.class);
+ if (registry == null) {
+ editingDomain = (TransactionalEditingDomain) ((IAdaptable) editorPart).getAdapter(TransactionalEditingDomain.class);
} else {
try {
editingDomain = ServiceUtils.getInstance().getTransactionalEditingDomain(registry);
@@ -98,11 +99,11 @@ public class RenameNestedEditorCommand extends AbstractHandler {
}
- if(editingDomain != null) {
+ if (editingDomain != null) {
InputDialog dialog = new InputDialog(Display.getCurrent().getActiveShell(), "Rename an existing diagram", "New name:", diagram.getName(), null);
- if(dialog.open() == Window.OK) {
+ if (dialog.open() == Window.OK) {
final String name = dialog.getValue();
- if(name != null && name.length() > 0) {
+ if (name != null && name.length() > 0) {
Command command = new RecordingCommand(editingDomain) {

Back to the top