Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java17
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/ConnectorEditHelperAdvice.java17
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF6
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/Activator.java (renamed from plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/Activator.java)2
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java (renamed from plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java)7
-rw-r--r--plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/util/XTextEditorResultWrapper.java (renamed from plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/util/XTextEditorResultWrapper.java)4
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java6
-rw-r--r--plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java3
-rw-r--r--plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java67
11 files changed, 109 insertions, 26 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
index d8a4c9331d6..def97c3c4e7 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
@@ -793,7 +793,7 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen
}
public Object getRowElement(int index) {
- if(index < 0 || index > this.horizontalElements.size()) {
+ if(index < 0 || index >= this.horizontalElements.size()) {
return null;
}
return this.horizontalElements.get(index);
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java
index 2f5f4688765..92f4533e536 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java
@@ -211,17 +211,18 @@ public class CellHelper {
SetRequest setProblemRequest = new SetRequest(domain, cell, NattablecellPackage.eINSTANCE.getCell_Problems(), problem);
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(cell);
command.add(provider.getEditCommand(setProblemRequest));
- } else {//we update the string problem
- IElementEditService provider = ElementEditServiceUtils.getCommandProvider(problem);
- SetRequest request = new SetRequest(domain, problem, NattableproblemPackage.eINSTANCE.getStringResolutionProblem_ValueAsString(), pastedText);
- command.add(provider.getEditCommand(request));
- request = new SetRequest(domain, problem, NattableproblemPackage.eINSTANCE.getStringResolutionProblem_UnresolvedString(), ((StringValueConverterStatus)status).getUnresolvedString());
- command.add(provider.getEditCommand(request));
- request = new SetRequest(domain, problem, NattableconfigurationPackage.eINSTANCE.getTableNamedElement_Description(), status.getMessage());
- command.add(provider.getEditCommand(request));
}
+ } else {//we update the string problem
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(problem);
+ SetRequest request = new SetRequest(domain, problem, NattableproblemPackage.eINSTANCE.getStringResolutionProblem_ValueAsString(), pastedText);
+ command.add(provider.getEditCommand(request));
+ request = new SetRequest(domain, problem, NattableproblemPackage.eINSTANCE.getStringResolutionProblem_UnresolvedString(), ((StringValueConverterStatus)status).getUnresolvedString());
+ command.add(provider.getEditCommand(request));
+ request = new SetRequest(domain, problem, NattableconfigurationPackage.eINSTANCE.getTableNamedElement_Description(), status.getMessage());
+ command.add(provider.getEditCommand(request));
}
+
return new GMFtoEMFCommandWrapper(command);
}
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/ConnectorEditHelperAdvice.java b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/ConnectorEditHelperAdvice.java
index e77dd0d7568..14fd4fe1c5c 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/ConnectorEditHelperAdvice.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.service.types/src/org/eclipse/papyrus/sysml/service/types/helper/advice/ConnectorEditHelperAdvice.java
@@ -78,7 +78,10 @@ public class ConnectorEditHelperAdvice extends AbstractEditHelperAdvice {
int reorientDirection = request.getDirection();
Edge reorientedEdgeView = RequestParameterUtils.getReconnectedEdge(request);
View newEndView = RequestParameterUtils.getReconnectedEndView(request);
- View oppositeEndView = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? reorientedEdgeView.getTarget() : reorientedEdgeView.getSource();
+ View oppositeEndView = null;
+ if(reorientedEdgeView != null) {
+ oppositeEndView = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? reorientedEdgeView.getTarget() : reorientedEdgeView.getSource();
+ }
List<Property> newNestedPath = null;
if(reorientedEdgeView != null && newEndView != null) {
//we are working with a 'graphical' reconnect request
@@ -99,11 +102,13 @@ public class ConnectorEditHelperAdvice extends AbstractEditHelperAdvice {
} else if(reorientDirection == ReorientReferenceRelationshipRequest.REORIENT_TARGET) {
oldEndView = current.getTarget();
}
- final List<Property> oldNestedPath = utils.getNestedPropertyPath(oldEndView, oppositeEndView);
- if(!newNestedPath.equals(oldNestedPath)) {
- final DestroyElementRequest destroyRequest = new DestroyElementRequest(request.getEditingDomain(), current, false);
- final IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(current);
- compositeCommand.add(commandProvider.getEditCommand(destroyRequest));
+ if(oppositeEndView != null) {
+ final List<Property> oldNestedPath = utils.getNestedPropertyPath(oldEndView, oppositeEndView);
+ if(!newNestedPath.equals(oldNestedPath)) {
+ final DestroyElementRequest destroyRequest = new DestroyElementRequest(request.getEditingDomain(), current, false);
+ final IElementEditService commandProvider = ElementEditServiceUtils.getCommandProvider(current);
+ compositeCommand.add(commandProvider.getEditCommand(destroyRequest));
+ }
}
}
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF
index a7de579937f..e07344f581f 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.papyrus.uml.nattable.xtext.integration
Bundle-Version: 0.10.1.qualifier
-Bundle-Activator: org.eclipse.papyrus.infra.nattable.xtext.integration.Activator
+Bundle-Activator: org.eclipse.papyrus.uml.nattable.xtext.integration.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@@ -21,4 +21,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.gmf.runtime.common.ui.services
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.papyrus.infra.nattable.xtext.integration.celleditor
+Export-Package: org.eclipse.papyrus.uml.nattable.xtext.integration,
+ org.eclipse.papyrus.uml.nattable.xtext.integration.celleditor,
+ org.eclipse.papyrus.uml.nattable.xtext.integration.util
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/Activator.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/Activator.java
index 33574d1f36b..65877a33d92 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/Activator.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/Activator.java
@@ -1,4 +1,4 @@
-package org.eclipse.papyrus.infra.nattable.xtext.integration;
+package org.eclipse.papyrus.uml.nattable.xtext.integration;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
index d068294aa8b..963d85c3fa7 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/celleditor/AbstractNatTableXTextCellEditor.java
@@ -11,7 +11,7 @@
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
*
*****************************************************************************/
-package org.eclipse.papyrus.infra.nattable.xtext.integration.celleditor;
+package org.eclipse.papyrus.uml.nattable.xtext.integration.celleditor;
import java.util.List;
@@ -25,7 +25,7 @@ import org.eclipse.papyrus.infra.nattable.celleditor.AbstractPapyrusStyledTextCe
import org.eclipse.papyrus.infra.nattable.manager.table.ITableAxisElementProvider;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableproblem.StringResolutionProblem;
-import org.eclipse.papyrus.infra.nattable.xtext.integration.util.XTextEditorResultWrapper;
+import org.eclipse.papyrus.uml.nattable.xtext.integration.util.XTextEditorResultWrapper;
import org.eclipse.papyrus.uml.xtext.integration.DefaultXtextDirectEditorConfiguration;
import org.eclipse.papyrus.uml.xtext.integration.XtextFakeResourceContext;
import org.eclipse.papyrus.uml.xtext.integration.core.ContextElementAdapter;
@@ -179,8 +179,7 @@ public abstract class AbstractNatTableXTextCellEditor extends AbstractPapyrusSty
if(styledText != null) {
typedString = styledText.getText();
final IParserEditStatus result = parser.isValidEditString(null, typedString);
- System.out.println(result);
- if(result.isOK()) {
+ if(result!=null && result.isOK()) {
parseCommand = parser.getParseCommand(null, typedString, 0);
}
}
diff --git a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/util/XTextEditorResultWrapper.java b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/util/XTextEditorResultWrapper.java
index 6c866a80702..4854a6115ef 100644
--- a/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/infra/nattable/xtext/integration/util/XTextEditorResultWrapper.java
+++ b/plugins/uml/nattable/org.eclipse.papyrus.uml.nattable.xtext.integration/src/org/eclipse/papyrus/uml/nattable/xtext/integration/util/XTextEditorResultWrapper.java
@@ -1,4 +1,4 @@
-package org.eclipse.papyrus.infra.nattable.xtext.integration.util;
+package org.eclipse.papyrus.uml.nattable.xtext.integration.util;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
@@ -30,7 +30,7 @@ public class XTextEditorResultWrapper implements IAdaptable {
* the command to do the set value according to the typed text. Could be <code>null</code> if the text can't be parsed
*/
public XTextEditorResultWrapper(String text, ICommand parseCommand) {
- this.text = text;
+ this.text = text.trim();//to remove invalid /r/n at the end of the string, see bug 420495
this.parseCommand = parseCommand;
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java
index 47fcabd0b7a..96a464caf0d 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientCommand.java
@@ -77,7 +77,11 @@ public class ConnectorReorientCommand extends ConnectorReorientSemanticCommand {
super.initFields();
reorientedEdgeView = RequestParameterUtils.getReconnectedEdge(getRequest());
newEndView = RequestParameterUtils.getReconnectedEndView(getRequest());
- oppositeEndView = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? reorientedEdgeView.getTarget() : reorientedEdgeView.getSource();
+ if(this.reorientedEdgeView != null) {
+ oppositeEndView = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? reorientedEdgeView.getTarget() : reorientedEdgeView.getSource();
+ } else {
+ oppositeEndView = null;
+ }
setNewPartWithPort(getNewPartWithPort());
setOppositePartWithPort(getOppositePartWithPort());
}
diff --git a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java
index f7887f3568e..1fa6881f9ee 100644
--- a/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java
+++ b/plugins/uml/org.eclipse.papyrus.uml.service.types/src/org/eclipse/papyrus/uml/service/types/command/ConnectorReorientSemanticCommand.java
@@ -136,6 +136,9 @@ public class ConnectorReorientSemanticCommand extends EditElementCommand {
* <code>true</code> if the newRole can be used as role for connector
*/
private boolean canReorient(final EObject newRole, final EObject oppositeRole) {
+ if(newRole==null){
+ return true;//we allow to reinitialize the role
+ }
//the new role must be a connectable element
if(!(newRole instanceof ConnectableElement)) {
return false;
diff --git a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF
index e1347f5e498..c2c35eb38e4 100644
--- a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF
+++ b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/META-INF/MANIFEST.MF
@@ -14,10 +14,12 @@ Require-Bundle: org.eclipse.gef;bundle-version="3.9.0",
org.eclipse.papyrus.uml.xtext.integration.core;bundle-version="0.10.1";visibility:=reexport,
org.eclipse.papyrus.extensionpoints.editors;bundle-version="0.10.1";visibility:=reexport,
org.eclipse.uml2.uml;bundle-version="4.1.0",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1"
+ org.eclipse.papyrus.uml.tools.utils;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1"
Export-Package: org.eclipse.papyrus.uml.xtext.integration
Bundle-Vendor: Eclipse Modeling Project
Import-Package: org.eclipse.papyrus.infra.services.validation,
org.eclipse.papyrus.infra.services.validation.commands,
org.eclipse.papyrus.uml.extensionpoints.profile,
org.eclipse.papyrus.uml.extensionpoints.standard
+Bundle-Activator: org.eclipse.papyrus.uml.xtext.integration.ui.Activator
diff --git a/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java
new file mode 100644
index 00000000000..25f3f7a7fec
--- /dev/null
+++ b/plugins/uml/xtext/org.eclipse.papyrus.uml.xtext.integration.ui/src/org/eclipse/papyrus/uml/xtext/integration/ui/Activator.java
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.xtext.integration.ui;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.xtext.integration.ui"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}

Back to the top