diff options
author | Nicolas FAUVERGUE | 2016-11-24 11:20:54 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-11-29 10:57:50 +0000 |
commit | b3141df23ca644573f8b2813ad8859722d418bd9 (patch) | |
tree | 6db261c6f918988a7117bfe93731af4ca17f0723 /plugins/infra/services | |
parent | 6d4f41d7e479bfa607ffde18b16fe8ebdae561c2 (diff) | |
download | org.eclipse.papyrus-b3141df23ca644573f8b2813ad8859722d418bd9.tar.gz org.eclipse.papyrus-b3141df23ca644573f8b2813ad8859722d418bd9.tar.xz org.eclipse.papyrus-b3141df23ca644573f8b2813ad8859722d418bd9.zip |
Bug 496905: [Diagram][ModelExplorer][Table][Dialog] Papyrus must integrate
the internationalization feature provided by UML.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=496905
Commit of infra for internationalization.
Change-Id: I1b1859bf111e1ef7a7522212fbe639cf2bd13890
Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@all4tec.net>
Diffstat (limited to 'plugins/infra/services')
4 files changed, 37 insertions, 12 deletions
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/META-INF/MANIFEST.MF b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/META-INF/MANIFEST.MF index f228409e741..a4b34478f18 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/META-INF/MANIFEST.MF +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/META-INF/MANIFEST.MF @@ -2,6 +2,7 @@ Manifest-Version: 1.0 Export-Package: org.eclipse.papyrus.infra.services.controlmode, org.eclipse.papyrus.infra.services.controlmode.commands, org.eclipse.papyrus.infra.services.controlmode.handler, + org.eclipse.papyrus.infra.services.controlmode.messages, org.eclipse.papyrus.infra.services.controlmode.internal.handler;x-internal:=true, org.eclipse.papyrus.infra.services.controlmode.internal.ui;x-internal:=true, org.eclipse.papyrus.infra.services.controlmode.participants, @@ -21,7 +22,7 @@ Require-Bundle: org.eclipse.emf.edit.ui;bundle-version="[2.12.0,3.0.0)";visibili org.eclipse.papyrus.infra.onefile;bundle-version="[2.0.0,3.0.0)" Bundle-Vendor: %providerName Bundle-ActivationPolicy: lazy -Bundle-Version: 1.4.0.qualifier +Bundle-Version: 1.5.0.qualifier Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-Activator: org.eclipse.papyrus.infra.services.controlmode.ControlModePlugin diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/pom.xml b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/pom.xml index b0cf7c2c462..a430a472b84 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/pom.xml +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/pom.xml @@ -7,6 +7,6 @@ <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>org.eclipse.papyrus.infra.services.controlmode</artifactId> - <version>1.4.0-SNAPSHOT</version> + <version>1.5.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java index 213b3f8c88d..16174e6f391 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/CreateControlResource.java @@ -11,6 +11,7 @@ * Christian W. Damus - bug 399859 * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 436952 * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 436998 + * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905 * *****************************************************************************/ package org.eclipse.papyrus.infra.services.controlmode.commands; @@ -19,6 +20,7 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; @@ -149,7 +151,7 @@ public class CreateControlResource extends AbstractControlResourceCommand { resource.setModified(true); // Handle old resource - if (!isControlledResourceLocked(getRequest().getNewURI())) { + if (!isControlledResourceLocked(getNewURI())) { getResourceSet().getResources().remove(oldResource); modelSet.getResourcesToDeleteOnSave().add(oldResource.getURI()); } @@ -157,6 +159,16 @@ public class CreateControlResource extends AbstractControlResourceCommand { return superStatus; } + + /** + * Get the new URI. + * + * @return The new URI. + * @since 1.5 + */ + protected URI getNewURI(){ + return getRequest().getNewURI(); + } /** * Gets the target resrource. @@ -165,7 +177,7 @@ public class CreateControlResource extends AbstractControlResourceCommand { * the object to uncontrol * @return the target resrource */ - private Resource getTargetResrource(EObject objectToUncontrol) { + protected Resource getTargetResrource(EObject objectToUncontrol) { return getRequest().getModelSet().getAssociatedResource(objectToUncontrol, getFileExtension(), true); } diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/RemoveControlResourceCommand.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/RemoveControlResourceCommand.java index 1a35810c63a..94a2690ea1b 100644 --- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/RemoveControlResourceCommand.java +++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/commands/RemoveControlResourceCommand.java @@ -10,6 +10,8 @@ * Contributors: * Arthur Daussy (Atos) arthur.daussy@atos.net - Initial API and implementation * Gabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - Bug 436998 + * Nicolas FAUVERGUE (ALL4TEC) nicolas.fauvergue@all4tec.net - Bug 496905 + * *****************************************************************************/ package org.eclipse.papyrus.infra.services.controlmode.commands; @@ -39,22 +41,22 @@ import org.eclipse.papyrus.infra.services.controlmode.messages.Messages; public class RemoveControlResourceCommand extends AbstractControlResourceCommand { /** The Constant PREVIOUS_RESOURCE_ERROR. */ - private static final String PREVIOUS_RESOURCE_ERROR = Messages.getString("RemoveControlResourceCommand.previous.resource.error"); //$NON-NLS-1$ + protected static final String PREVIOUS_RESOURCE_ERROR = Messages.getString("RemoveControlResourceCommand.previous.resource.error"); //$NON-NLS-1$ /** The Constant TARGET_RESOURCE_ERROR. */ - private static final String TARGET_RESOURCE_ERROR = Messages.getString("RemoveControlResourceCommand.target.resource.error"); //$NON-NLS-1$ + protected static final String TARGET_RESOURCE_ERROR = Messages.getString("RemoveControlResourceCommand.target.resource.error"); //$NON-NLS-1$ /** The Constant RESOURCE_ERROR. */ - private static final String RESOURCE_ERROR = Messages.getString("RemoveControlResourceCommand.resource.error"); //$NON-NLS-1$ + protected static final String RESOURCE_ERROR = Messages.getString("RemoveControlResourceCommand.resource.error"); //$NON-NLS-1$ /** The Constant RESOURCESET_ERROR. */ - private static final String RESOURCESET_ERROR = Messages.getString("RemoveControlResourceCommand.resourceset.error"); //$NON-NLS-1$ + protected static final String RESOURCESET_ERROR = Messages.getString("RemoveControlResourceCommand.resourceset.error"); //$NON-NLS-1$ /** The Constant CONTROL_OBJECT_ERROR. */ - private static final String CONTROL_OBJECT_ERROR = Messages.getString("RemoveControlResourceCommand.object.error"); //$NON-NLS-1$ + protected static final String CONTROL_OBJECT_ERROR = Messages.getString("RemoveControlResourceCommand.object.error"); //$NON-NLS-1$ /** The Constant UNCONTROL_COMMAND_TITLE. */ - private static final String UNCONTROL_COMMAND_TITLE = Messages.getString("RemoveControlResourceCommand.command.title"); //$NON-NLS-1$ + protected static final String UNCONTROL_COMMAND_TITLE = Messages.getString("RemoveControlResourceCommand.command.title"); //$NON-NLS-1$ /** * @param request @@ -128,7 +130,7 @@ public class RemoveControlResourceCommand extends AbstractControlResourceCommand if (modelSet == null) { return CommandResult.newErrorCommandResult(RESOURCESET_ERROR).getStatus(); } - Resource resource = getRequest().getSourceResource(getFileExtension()); + Resource resource = getSourceResource(); if (resource == null) { return CommandResult.newErrorCommandResult(RESOURCE_ERROR).getStatus(); } @@ -141,11 +143,21 @@ public class RemoveControlResourceCommand extends AbstractControlResourceCommand return superStatus; } + + /** + * Get the source resource. + * + * @return The source resource. + * @since 1.5 + */ + protected Resource getSourceResource(){ + return getRequest().getSourceResource(getFileExtension()); + } @Override protected IStatus doRedo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { IStatus superStatus = super.doRedo(monitor, info); - Resource resource = getRequest().getSourceResource(getFileExtension()); + Resource resource = getSourceResource(); if (resource == null) { return CommandResult.newErrorCommandResult(PREVIOUS_RESOURCE_ERROR).getStatus(); } |