Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-03-11 20:54:48 +0000
committerChristian W. Damus2014-03-11 20:54:48 +0000
commite20612278b0b49dadd45e5421c103a42c365abd0 (patch)
tree21247ff4f8e9efef301f53f83b22262b307ca202 /plugins/infra
parent6c21353faf0dbb249e8c42d0ef3a6c23ff1120ef (diff)
parent12834c9a2f7df6408821bad466425b0ce12f520a (diff)
downloadorg.eclipse.papyrus-e20612278b0b49dadd45e5421c103a42c365abd0.tar.gz
org.eclipse.papyrus-e20612278b0b49dadd45e5421c103a42c365abd0.tar.xz
org.eclipse.papyrus-e20612278b0b49dadd45e5421c103a42c365abd0.zip
Merge branch 'refs/heads/master' into bugs/429826-ro-axes
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/ui/DirectEditorsContributionItem.java14
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/DeferredSnapToGridCommand.java247
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java73
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/NodeSnapHelper.java6
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/AbstractPasteImportInNattableManager.java14
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/Messages.java2
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/messages.properties1
7 files changed, 322 insertions, 35 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/ui/DirectEditorsContributionItem.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/ui/DirectEditorsContributionItem.java
index bc57fa0ca1a..93d889f796d 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/ui/DirectEditorsContributionItem.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.extensionpoints.editors/src/org/eclipse/papyrus/extensionpoints/editors/ui/DirectEditorsContributionItem.java
@@ -41,7 +41,7 @@ public class DirectEditorsContributionItem extends ContributionItem implements I
*
*/
public DirectEditorsContributionItem() {
- setId("org.eclipse.papyrus.editors.menuitem");
+ setId("org.eclipse.papyrus.editors.menuitem"); //$NON-NLS-1$
}
/**
@@ -86,7 +86,7 @@ public class DirectEditorsContributionItem extends ContributionItem implements I
return;
}
- // get the uml object type of this element, using the business resolver
+ // get the UML object type of this element, using the business resolver
final Object businessObject = EMFHelper.getEObject(selectedElement);
// no object found: exit
@@ -111,9 +111,10 @@ public class DirectEditorsContributionItem extends ContributionItem implements I
protected void createSubMenu(Menu menu, int index, Object businessObject, Collection<DirectEditorExtensionPoint> configurations) {
// create direct item, and then create sub-items
subMenuItem = new MenuItem(menu, SWT.CASCADE);
- String type = ((businessObject instanceof EObject) ? ((EObject)businessObject).eClass().getName() : "");
+ String type = ((businessObject instanceof EObject) ?
+ ((EObject)businessObject).eClass().getName() : ""); //$NON-NLS-1$
- subMenuItem.setText("Edit " + type);
+ subMenuItem.setText("Edit " + type); //$NON-NLS-1$
// submenu
Menu subMenu = new Menu(menu);
@@ -127,11 +128,10 @@ public class DirectEditorsContributionItem extends ContributionItem implements I
for(final DirectEditorExtensionPoint configuration : configurations) {
MenuItem item = new MenuItem(subMenu, SWT.NONE);
StringBuffer buffer = new StringBuffer();
- buffer.append("Using ");
+ buffer.append("Using "); //$NON-NLS-1$
buffer.append(configuration.getLanguage());
- buffer.append(" Editor");
if(configuration.equals(defaultConfig)) {
- buffer.append(" (Default via F2)");
+ buffer.append(" (Default via F2)"); //$NON-NLS-1$
}
item.setText(buffer.toString());
item.addSelectionListener(new SelectionListener() {
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/DeferredSnapToGridCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/DeferredSnapToGridCommand.java
new file mode 100644
index 00000000000..ad47a39aad6
--- /dev/null
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/DeferredSnapToGridCommand.java
@@ -0,0 +1,247 @@
+/*****************************************************************************
+ * Copyright (c) 2011 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:
+ *
+ * CEALIST - Initial API and implementation (Adapted code from DeferredLayoutCommand)
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.common.commands;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.PrecisionRectangle;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.emf.workspace.util.WorkspaceSynchronizer;
+import org.eclipse.gef.SnapToHelper;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.BorderedBorderItemEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.util.EditPartUtil;
+import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.snap.BorderNodeSnapHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.snap.NodeSnapHelper;
+
+/**
+ * This command is used to snap editparts on the grid, when only the view
+ * adapters are available at the time of creating the command. It is necessary
+ * to have the editparts when creating a snap command so this command defers
+ * the creation of the layout command until execution time at which point it can
+ * get the editparts from the editpart registry using the view adapters.
+ *
+ * @author vlorenzo
+ */
+//TODO : creation from the palette should use me
+//TODO : move action could use me???
+public class DeferredSnapToGridCommand extends AbstractTransactionalCommand {
+
+ /** the IAdaptables from which an View can be retrieved */
+ protected List<?> viewAdapters;
+
+ /** the diagram editpart used to get the editpart registry */
+ protected IGraphicalEditPart containerEP;
+
+ /**
+ * Constructor for <code>DefferedSnapToGridCommand</code>.
+ *
+ * @param editingDomain
+ * the editing domain through which model changes are made
+ * @param viewAdapters
+ * the IAdaptables from which an IView can be retrieved
+ * @param containerEP
+ * the container editpart used to get the editpart registry
+ */
+ public DeferredSnapToGridCommand(TransactionalEditingDomain editingDomain, List<?> viewAdapters, IGraphicalEditPart containerEP) {
+ super(editingDomain, "Deferred Snap to grid command", null); //$NON-NLS-1$
+ this.viewAdapters = viewAdapters;
+ this.containerEP = containerEP;
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#getAffectedFiles()
+ *
+ * @return
+ */
+ @SuppressWarnings("rawtypes")
+ public List getAffectedFiles() {
+ if(containerEP != null) {
+ View view = (View)containerEP.getModel();
+ if(view != null) {
+ IFile f = WorkspaceSynchronizer.getFile(view.eResource());
+ return f != null ? Collections.singletonList(f) : Collections.EMPTY_LIST;
+ }
+ }
+ return super.getAffectedFiles();
+ }
+
+ /**
+ * Executes a layout command with all the editparts for the view adapters.
+ *
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+
+ final RunnableWithResult<List<IGraphicalEditPart>> refreshRunnable = new RunnableWithResult<List<IGraphicalEditPart>>() {
+
+ private IStatus status;
+
+ private List<IGraphicalEditPart> result;
+
+ public List<IGraphicalEditPart> getResult() {
+ return result;
+ }
+
+ public void setStatus(IStatus status) {
+ this.status = status;
+ }
+
+ public IStatus getStatus() {
+ return status;
+ }
+
+ public void run() {
+ containerEP.refresh();
+
+ // The layout command requires that the figure world is updated.
+ getContainerFigure().invalidate();
+ getContainerFigure().validate();
+
+ List<IGraphicalEditPart> editParts = new ArrayList<IGraphicalEditPart>(viewAdapters.size());
+ Map<?, ?> epRegistry = containerEP.getRoot().getViewer().getEditPartRegistry();
+ for(Iterator<?> iter = viewAdapters.iterator(); iter.hasNext();) {
+ IAdaptable ad = (IAdaptable)iter.next();
+ View view = (View)ad.getAdapter(View.class);
+ Object ep = epRegistry.get(view);
+ if(ep instanceof IGraphicalEditPart) {
+ editParts.add((IGraphicalEditPart)ep);
+ }
+ }
+
+ if(editParts.isEmpty()) {
+ result = editParts;
+ return;
+ }
+
+ //probably useless
+ // Set<IGraphicalEditPart> layoutSet = new HashSet<IGraphicalEditPart>(editParts.size());
+ // layoutSet.addAll(editParts);
+ //
+ // // refresh source and target connections of any shapes in the container not being considered for layout
+ // Iterator<?> iter = containerEP.getChildren().iterator();
+ // while(iter.hasNext()) {
+ // Object obj = iter.next();
+ // if(!layoutSet.contains(obj) && obj instanceof IGraphicalEditPart) {
+ // IGraphicalEditPart ep = (IGraphicalEditPart)obj;
+ // ep.refresh();
+ // }
+ // }
+
+ result = editParts;
+ }
+ };
+
+ EditPartUtil.synchronizeRunnableToMainThread(containerEP, refreshRunnable);
+ List<IGraphicalEditPart> editParts = refreshRunnable.getResult();
+ if(editParts == null || editParts.isEmpty()) {
+ return CommandResult.newOKCommandResult();
+ }
+
+ // add an arrange command, to layout the related shapes
+ CompoundCommand cc = new CompoundCommand("Snap Command"); //$NON-NLS-1$
+ for(final IGraphicalEditPart current : editParts) {
+ final SnapToHelper snapHelper = (SnapToHelper)((IAdaptable)current).getAdapter(SnapToHelper.class);
+ final NodeSnapHelper nodeSnapHelper;
+ final PrecisionRectangle boundsFigure = new PrecisionRectangle(((GraphicalEditPart)current).getFigure().getBounds());
+ current.getFigure().translateToAbsolute(boundsFigure);
+ final PrecisionRectangle result = new PrecisionRectangle(boundsFigure);
+ if(current instanceof BorderedBorderItemEditPart) {
+ nodeSnapHelper = new BorderNodeSnapHelper(snapHelper, boundsFigure);
+ } else {
+ nodeSnapHelper = new NodeSnapHelper(snapHelper, boundsFigure);
+ }
+ ChangeBoundsRequest request = new ChangeBoundsRequest("move"); //$NON-NLS-1$
+ request.setEditParts(Collections.singletonList(current));
+ request.setSnapToEnabled(true);
+ request.setLocation(boundsFigure.getLocation());
+ nodeSnapHelper.snapPoint(request);
+ request.setLocation(result.getLocation());
+ cc.add(((GraphicalEditPart)current).getCommand(request));
+ }
+
+
+ if(!cc.isEmpty() && cc.canExecute()) {
+ cc.execute();
+ }
+ return CommandResult.newOKCommandResult();
+ }
+
+ /**
+ *
+ * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#cleanup()
+ *
+ */
+ protected void cleanup() {
+ containerEP = null;//for garbage collection
+ viewAdapters = null;
+ super.cleanup();
+ }
+
+ /**
+ * gets the container edit part's figure
+ *
+ * @return the container figure
+ */
+ protected IFigure getContainerFigure() {
+ return containerEP.getFigure();
+ }
+
+ /**
+ * gets the container edit part
+ *
+ * @return the container edit part
+ */
+ protected IGraphicalEditPart getContainerEP() {
+ return containerEP;
+ }
+
+ /**
+ * gets a list of <code>IAdaptable</code> that can adapt to <code>
+ * View</code>
+ *
+ * @return view adapters
+ */
+ protected List<?> getViewAdapters() {
+ return viewAdapters;
+ }
+
+ /**
+ *
+ * @see org.eclipse.core.commands.operations.AbstractOperation#canExecute()
+ *
+ * @return
+ */
+ @Override
+ public boolean canExecute() {
+ return super.canExecute() && containerEP != null;
+ }
+}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
index 4b51871b97b..885f38a1683 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/editpart/ConnectionEditPart.java
@@ -35,6 +35,11 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
protected static final String LINE_STYLE = "lineStyle";
/**
+ * Supported values of the CSS property lineStyle
+ */
+ protected static final String[] LINE_STYLE_VALUES = { "none", "hidden", "dotted", "dashed", "solid", "double" };
+
+ /**
* CSS property for the line dashes' length
*/
protected static final String LINE_DASH_LENGTH = "lineDashLength";
@@ -45,15 +50,32 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
protected static final String LINE_DASH_GAP = "lineDashGap";
/**
+ * CSS property for the source decoration
+ */
+ protected static final String SOURCE_DECORATION = "sourceDecoration";
+
+ /**
+ * CSS property for the target decoration
+ */
+ protected static final String TARGET_DECORATION = "targetDecoration";
+
+ /**
+ * Supported values of the CSS property targetDecoration
+ */
+ protected static final String[] DECORATION_VALUES = { "default", "none" };
+
+ /**
* Minimum length of dashes for dashed connectors
*/
protected static final int LINE_DASH_MIN_LENGTH = 2;
/**
- * Minimum length of the gapas between dashes
+ * Minimum length of the gaps between dashes
*/
protected static final int LINE_GAP_MIN_LENGTH = 2;
+
+
public ConnectionEditPart(View view) {
super(view);
}
@@ -69,13 +91,22 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
if(figure instanceof PapyrusEdgeFigure && model instanceof Connector) {
Connector connector = (Connector)model;
PapyrusEdgeFigure edge = (PapyrusEdgeFigure)figure;
+ // Reset the style
+ edge.resetStyle();
+ // Re-apply the CSS-defined style if any
String lineStyle = extract((StringValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), LINE_STYLE));
int lineDashLength = extract((IntValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getIntValueStyle(), LINE_DASH_LENGTH));
int lineDashGap = extract((IntValueStyle)connector.getNamedStyle(NotationPackage.eINSTANCE.getIntValueStyle(), LINE_DASH_GAP));
if(lineStyle != null) {
setupLineStyle(edge, lineStyle, connector.getLineWidth(), lineDashLength < LINE_DASH_MIN_LENGTH ? LINE_DASH_MIN_LENGTH : lineDashLength, lineDashGap < LINE_GAP_MIN_LENGTH ? LINE_GAP_MIN_LENGTH : lineDashGap);
- } else {
- edge.resetStyle();
+ }
+ String decoration = extract((StringValueStyle) connector.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), TARGET_DECORATION));
+ if ("none".equals(decoration)) {
+ edge.setTargetDecoration(null);
+ }
+ decoration = extract((StringValueStyle) connector.getNamedStyle(NotationPackage.eINSTANCE.getStringValueStyle(), SOURCE_DECORATION));
+ if ("none".equals(decoration)) {
+ edge.setSourceDecoration(null);
}
}
}
@@ -123,26 +154,22 @@ public abstract class ConnectionEditPart extends ConnectionNodeEditPart implemen
* Length of the gap between dashes
*/
private void setupLineStyle(PapyrusEdgeFigure edge, String style, int originalWidth, int lineDashLength, int lineDashGap) {
- if("none".equals(style)) {
- edge.resetStyle();
- } else {
- if("hidden".equals(style)) {
- edge.setLineStyle(Graphics.LINE_SOLID);
- edge.setLineWidth(0);
- edge.setVisible(false);
- } else if("dotted".equals(style)) {
- edge.setLineStyle(Graphics.LINE_DOT);
- edge.setLineWidth(originalWidth);
- } else if("dashed".equals(style)) {
- edge.setLineStyle(Graphics.LINE_CUSTOM);
- edge.setLineWidth(originalWidth);
- edge.setLineDash(new int[]{ lineDashLength, lineDashGap });
- } else if("solid".equals(style)) {
- edge.setLineStyle(Graphics.LINE_SOLID);
- edge.setLineWidth(originalWidth);
- } else if("double".equals(style)) {
- edge.setLineWidth(originalWidth * 2);
- }
+ if ("hidden".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_SOLID);
+ edge.setLineWidth(0);
+ edge.setVisible(false);
+ } else if ("dotted".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_DOT);
+ edge.setLineWidth(originalWidth);
+ } else if ("dashed".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_CUSTOM);
+ edge.setLineWidth(originalWidth);
+ edge.setLineDash(new int[] { lineDashLength, lineDashGap });
+ } else if ("solid".equals(style)) {
+ edge.setLineStyle(Graphics.LINE_SOLID);
+ edge.setLineWidth(originalWidth);
+ } else if ("double".equals(style)) {
+ edge.setLineWidth(originalWidth * 2);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/NodeSnapHelper.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/NodeSnapHelper.java
index 329b6229324..25bfe373d68 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/NodeSnapHelper.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/snap/NodeSnapHelper.java
@@ -330,9 +330,9 @@ public class NodeSnapHelper {
final Point ref = baseRectTopLeft.getTopLeft();
distVSPoints.put(distance(ref, topLeftCornerDelta), topLeftCornerDelta);
- distVSPoints.put(distance(ref, topRightCornerDelta), topRightCornerDelta);
- distVSPoints.put(distance(ref, bottomLeftCornerDelta), bottomLeftCornerDelta);
- distVSPoints.put(distance(ref, bottomRightCornerDelta), bottomRightCornerDelta);
+ // distVSPoints.put(distance(ref, topRightCornerDelta), topRightCornerDelta);
+ // distVSPoints.put(distance(ref, bottomLeftCornerDelta), bottomLeftCornerDelta);
+ // distVSPoints.put(distance(ref, bottomRightCornerDelta), bottomRightCornerDelta);
}
return distVSPoints;
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/AbstractPasteImportInNattableManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/AbstractPasteImportInNattableManager.java
index 13bfe2307be..c1f689580fd 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/AbstractPasteImportInNattableManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/AbstractPasteImportInNattableManager.java
@@ -239,6 +239,7 @@ public abstract class AbstractPasteImportInNattableManager {
* a status indicating if the first line of the file allows to do the paste
*/
private IStatus verifyColumnCountOnFirstLine(final INattableModelManager tableManager, final Reader reader) {
+ final int axisCount = tableManager.getColumnCount();
CSVParser parser = this.pasteHelper.createParser(reader);
//we verify the nb of columns
final RowIterator rowIter = parser.parse();
@@ -250,12 +251,21 @@ public abstract class AbstractPasteImportInNattableManager {
nbCell++;
}
}
- final int axisCount = tableManager.getColumnCount();
+ //430115: [Table2] Paste/Import must be possible when the number of columns is not the same in the table and in the clipboard/file
+ //https://bugs.eclipse.org/bugs/show_bug.cgi?id=430115
+ if(axisCount == 0) {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.AbstractPasteImportInNattableManager_TheTableDoesntHaveColumns);
+ }
+ //commented because the next line could have data
+ // if(nbCell == 0) {
+ // return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Your data doesn't have cell on the first row");
+ // }
if(axisCount == nbCell) {
return new Status(IStatus.OK, Activator.PLUGIN_ID, Messages.AbstractPasteImportInNattableManager_NumberOfColumnsAreEquals);
} else {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind(Messages.AbstractPasteImportInNattableManager_NumberOfColumnsAreNotEquals, nbCell, axisCount));
+ return new Status(IStatus.OK, Activator.PLUGIN_ID, NLS.bind(Messages.AbstractPasteImportInNattableManager_NumberOfColumnsAreNotEquals, nbCell, axisCount));
}
+
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/Messages.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/Messages.java
index 2ee63196322..eec308428a3 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/Messages.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/Messages.java
@@ -59,6 +59,8 @@ public class Messages extends NLS {
public static String AbstractPasteImportInNattableManager_TheTableCantCreateElement;
+ public static String AbstractPasteImportInNattableManager_TheTableDoesntHaveColumns;
+
public static String AbstractPasteImportInNattableManager_TheTableHasAConfigurationToPaste;
public static String AbstractPasteImportInNattableManager_TheUserChosesToPasteColumns;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/messages.properties b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/messages.properties
index 4c646b3cda0..31a35e4fdb6 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/messages.properties
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/messages/messages.properties
@@ -16,6 +16,7 @@ AbstractPasteImportInNattableManager_TheContextOfTheTableHasNotTheContainmentFea
AbstractPasteImportInNattableManager_TheContextOfTheTableHasTheContainmentFeatureDefinedForThePaste=The context of the table has the containment feature defined for the paste
AbstractPasteImportInNattableManager_TheTableCanCreateElement=The table can create {0} as {1}
AbstractPasteImportInNattableManager_TheTableCantCreateElement=The table can't create {0} as {1}
+AbstractPasteImportInNattableManager_TheTableDoesntHaveColumns=The table doesn't have columns
AbstractPasteImportInNattableManager_TheTableHasAConfigurationToPaste=The table has a configuration to paste {0}.
AbstractPasteImportInNattableManager_TheUserChosesToPasteColumns=The user has chosen to paste columns.
AbstractPasteImportInNattableManager_TheUserChosesToPasteRows=The user has chosen to paste rows.

Back to the top