Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2016-12-05 15:17:28 +0000
committerGerrit Code Review @ Eclipse.org2016-12-05 15:42:12 +0000
commit15357a858aeef74d10a9714b0c5b374c390fa568 (patch)
tree7120bbd3bc63e35d797c2547ca27c8d603c3493d /plugins/infra/emf
parent74502beb31fc59559e17d6a1ac5f3655eb7121e7 (diff)
downloadorg.eclipse.papyrus-15357a858aeef74d10a9714b0c5b374c390fa568.tar.gz
org.eclipse.papyrus-15357a858aeef74d10a9714b0c5b374c390fa568.tar.xz
org.eclipse.papyrus-15357a858aeef74d10a9714b0c5b374c390fa568.zip
Bug 508675: [Internationalization] SysML Creation model is broken
https://bugs.eclipse.org/bugs/show_bug.cgi?id=508675 - Add to resource only if readable file. Change-Id: Iab7db2a440480723cef66940a5fb6520a548eb20 Signed-off-by: Nicolas FAUVERGUE <nicolasfauvergue@gmail.com>
Diffstat (limited to 'plugins/infra/emf')
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java
index 9daa7d391c3..77af3a715fc 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java
@@ -61,7 +61,9 @@ public class AddToResourceCommand extends AbstractTransactionalCommand {
*/
@Override
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- this.resource.getContents().add(this.toAdd);
+ if(!getEditingDomain().isReadOnly(resource)){
+ this.resource.getContents().add(this.toAdd);
+ }
return CommandResult.newOKCommandResult();
}
}

Back to the top