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/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu
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/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu')
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/Activator.java4
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/AbstractUmlNattableCreateCommandHandler.java25
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/UmlNattableCreateMenu.java4
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/messages/Messages.java2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/util/TableMenuUtils.java24
5 files changed, 31 insertions, 28 deletions
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/Activator.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/Activator.java
index a8e6ce1d7e8..d022cff7909 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/Activator.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/Activator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -62,7 +62,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/AbstractUmlNattableCreateCommandHandler.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/AbstractUmlNattableCreateCommandHandler.java
index 2afa9925989..1ec081d7795 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/AbstractUmlNattableCreateCommandHandler.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/AbstractUmlNattableCreateCommandHandler.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 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,22 +21,23 @@ import org.eclipse.papyrus.uml.service.types.utils.ICommandContext;
/**
* Abstract handler for the creation commands of UML elements in the Nattable editor
- *
+ *
*/
public abstract class AbstractUmlNattableCreateCommandHandler extends AbstractUmlCreateCommandHandler {
/**
* <pre>
- *
+ *
* Build the create command for an element creation in the selected container.
- * The create command is given by the {@link IElementEditService} of selected
+ * The create command is given by the {@link IElementEditService} of selected
* element.
*
* @return the composite creation command for current selection
- *
+ *
* </pre>
*/
+ @Override
protected Command buildCommand() {
Command createCmd = super.buildCommand();
return TableMenuUtils.buildNattableCreationCommand(createCmd, this.createRequest);
@@ -45,11 +46,12 @@ public abstract class AbstractUmlNattableCreateCommandHandler extends AbstractUm
/**
* Obtain the context of the active table editor.
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.handlers.AbstractUmlCreateCommandHandler#getCommandContext()
- *
+ *
* @return
*/
+ @Override
protected ICommandContext getCommandContext() {
return TableMenuUtils.getTableCommandContext(INattableModelManagerUtils.getTableManagerFromWorkbenchPart(getActiveWorkbenchPart()));
@@ -57,16 +59,17 @@ public abstract class AbstractUmlNattableCreateCommandHandler extends AbstractUm
/**
* Verify if this handler is currently active and the command can execute. Additionally, verify if this table can add this type of element.
- *
+ *
* @see org.eclipse.papyrus.uml.service.types.handlers.AbstractCreateCommandHandler#setEnabled(java.lang.Object)
- *
+ *
* @param evaluationContext
*/
+ @Override
public void setEnabled(Object evaluationContext) {
INattableModelManager tableManager = INattableModelManagerUtils.getTableManagerFromWorkbenchPart(getActiveWorkbenchPart());
boolean isEnabled = tableManager.canCreateRowElement(getElementTypeToCreate().getId());
- if(isEnabled) {
- //we test the enable of the super implementation
+ if (isEnabled) {
+ // we test the enable of the super implementation
super.setEnabled(evaluationContext);
isEnabled = super.isEnabled();
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/UmlNattableCreateMenu.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/UmlNattableCreateMenu.java
index 58b3762b7c0..d80365a8dc8 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/UmlNattableCreateMenu.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/handlers/UmlNattableCreateMenu.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -28,7 +28,7 @@ public class UmlNattableCreateMenu extends AbstractCreateUmlChildMenu {
@Override
public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart();
- if(tester.test(part, NattableWidgetPropertyTester.IS_NATTABLE_WIDGET, null, Boolean.TRUE)) {
+ if (tester.test(part, NattableWidgetPropertyTester.IS_NATTABLE_WIDGET, null, Boolean.TRUE)) {
super.createContributionItems(serviceLocator, additions);
}
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/messages/Messages.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/messages/Messages.java
index 790a7f7be9a..9471f7f20e2 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/messages/Messages.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/messages/Messages.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 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
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/util/TableMenuUtils.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/util/TableMenuUtils.java
index 20107d73847..c90596f54fe 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/util/TableMenuUtils.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.menu/src/org/eclipse/papyrus/uml/nattable/menu/util/TableMenuUtils.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2013 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
@@ -38,19 +38,19 @@ import org.eclipse.ui.PlatformUI;
public class TableMenuUtils {
/**
- *
- *
+ *
+ *
* @param tableManager
- * the table manager
+ * the table manager
* @return
* the command context to use to create new elements in the table
*/
public static ICommandContext getTableCommandContext(final INattableModelManager tableManager) {
INattableModelManager manager = tableManager;
- if(manager != null) {
+ if (manager != null) {
final EObject container = manager.getTable().getContext();
ICommandContext context = null;
- if(container != null) {
+ if (container != null) {
context = new CommandContext(container);
}
return context;
@@ -59,21 +59,21 @@ public class TableMenuUtils {
}
/**
- *
+ *
* @param createCmd
- * the create command
+ * the create command
* @param createElementRequest
- * the create element request
+ * the create element request
* @return
* the command to use to create elements in the table editor
*/
public static Command buildNattableCreationCommand(Command createCmd, final CreateElementRequest createElementRequest) {
final INattableModelManager nattableModelManager = INattableModelManagerUtils.getTableManagerFromWorkbenchPart(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart());
- if(nattableModelManager != null) {
+ if (nattableModelManager != null) {
CompositeCommand cmd = new CompositeCommand(""); //$NON-NLS-1$
cmd.add(new EMFtoGMFCommandWrapper(createCmd));
- // depends on the synchronization of the axis manager
+ // depends on the synchronization of the axis manager
cmd.add(new AbstractTransactionalCommand(createElementRequest.getEditingDomain(), Messages.AbstractNattableCreateCommandHandler_AddElementCommand, null) {
@Override
@@ -82,7 +82,7 @@ public class TableMenuUtils {
Collection<Object> toAdd = new ArrayList<Object>();
toAdd.add(newElement);
Command tmp = nattableModelManager.getAddRowElementCommand(toAdd);
- if(tmp != null) {
+ if (tmp != null) {
tmp.execute();
}
return CommandResult.newOKCommandResult();

Back to the top