Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-10-29 08:38:17 -0400
committervlorenzo2013-10-29 08:38:17 -0400
commitac16069f0efe9925213c43687886442292867b20 (patch)
tree8f310c707957c9f4961bb10d82251bf3faa26b95 /extraplugins
parent85a637bd67a77c1eedadbabdf16ff2ef49e60ef4 (diff)
downloadorg.eclipse.papyrus-ac16069f0efe9925213c43687886442292867b20.tar.gz
org.eclipse.papyrus-ac16069f0efe9925213c43687886442292867b20.tar.xz
org.eclipse.papyrus-ac16069f0efe9925213c43687886442292867b20.zip
371388: [Table 2] Papyrus shall support copy/paste from/to a table
editor https://bugs.eclipse.org/bugs/show_bug.cgi?id=371388 Correct 2 errors on table
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java2
-rw-r--r--extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java17
2 files changed, 10 insertions, 9 deletions
diff --git a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
index d8a4c9331d6..def97c3c4e7 100644
--- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
+++ b/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java b/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java
index 2f5f4688765..92f4533e536 100644
--- a/extraplugins/table/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/CellHelper.java
+++ b/extraplugins/table/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);
}
}

Back to the top