diff options
| author | Florian Barbin | 2015-09-02 09:45:18 +0000 |
|---|---|---|
| committer | Florian Barbin | 2015-09-04 14:49:55 +0000 |
| commit | 3bf021443737ff45515c317539d752a62dd966fc (patch) | |
| tree | bbfe7a539266f7b4fbb0e2ee42beb70afdf912e0 | |
| parent | 96e7c6ac5d3378cc9701750d07adba28684c0cf4 (diff) | |
| download | org.eclipse.sirius-3bf021443737ff45515c317539d752a62dd966fc.tar.gz org.eclipse.sirius-3bf021443737ff45515c317539d752a62dd966fc.tar.xz org.eclipse.sirius-3bf021443737ff45515c317539d752a62dd966fc.zip | |
[472057] Externalize translatable strings from org.eclipse.sirius.diagram
Bug: 472057
Change-Id: Ib2bdd6739a5dfd8f83eb417727edfe6d7142d8dd
Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
61 files changed, 646 insertions, 185 deletions
diff --git a/plugins/org.eclipse.sirius.diagram/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.sirius.diagram/.settings/org.eclipse.jdt.core.prefs index fc8c7f3ddc..39e1d0d4d4 100644 --- a/plugins/org.eclipse.sirius.diagram/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.sirius.diagram/.settings/org.eclipse.jdt.core.prefs @@ -32,7 +32,7 @@ org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error org.eclipse.jdt.core.compiler.problem.nullReference=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore diff --git a/plugins/org.eclipse.sirius.diagram/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.diagram/META-INF/MANIFEST.MF index 854174090b..9cfb6f8fb8 100644 --- a/plugins/org.eclipse.sirius.diagram/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.sirius.diagram/META-INF/MANIFEST.MF @@ -93,7 +93,7 @@ Export-Package: org.eclipse.sirius.diagram;version="3.0.0", org.eclipse.sirius.diagram.util;version="3.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy -Import-Package: org.eclipse.sirius.ext.base;version="2.0.0", +Import-Package: org.eclipse.sirius.ext.base;version="2.1.0", org.eclipse.sirius.ext.base.cache;version="2.0.0", org.eclipse.sirius.ext.base.collect;version="2.0.0", org.eclipse.sirius.ext.emf;version="2.0.0" diff --git a/plugins/org.eclipse.sirius.diagram/plugin.properties b/plugins/org.eclipse.sirius.diagram/plugin.properties index cd7df93e73..8efdeae169 100644 --- a/plugins/org.eclipse.sirius.diagram/plugin.properties +++ b/plugins/org.eclipse.sirius.diagram/plugin.properties @@ -1,5 +1,5 @@ # ==================================================================== -# Copyright (c) 2007, 2008 THALES GLOBAL SERVICES +# Copyright (c) 2007, 2015 THALES GLOBAL SERVICES # 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 @@ -155,3 +155,86 @@ constraint.validVariable.message = The expression {0} of {1} does not accept the constraint.validVariable.name = Valid Variables extension-point.canonicalSynchronizerFactoryOverride.name = org.eclipse.sirius.diagram.canonicalSynchronizerFactoryOverride extension-point.diagramTypeProvider.name = org.eclipse.sirius.diagram.diagramTypeProvider + + +AbstractDDiagramConstraint_validationErrorMessage = Validation issues +AbstractDiagramCommandBuilder_diagramVariableTaskLabel = Add diagram variable +AbstractDiagramCommandBuilder_refreshTaskLabel = Set RefreshEditorsPrecommitListener options +AbstractNodeMappingQuery_evaluationErrorMsg = the following abstract node mapping precondition could not be correctly evaluated : {0} +ChangeLayerActivationCommand_executeMsg = Apply layer modifications... +ChangeLayerActivationCommand_hideLabel = Hide +ChangeLayerActivationCommand_showLabel = Show \"{0}\" layer +ContainerDropDescriptionSpec_unknownTgtMsg = Unknown drag&drop target : {0} +ContainerMappingHelper_nodeCreationErrorMsg = Error creating nodes : domain class is not defined on a mapping +CreateContainerTask_label = create a container +CreateDEdgeTask_label = create edge +CreateDNodeTask_label = create a node +CreateViewTask_label = create a view +DDiagramElementContainerSpecOperations_tooMuchDropDescErrorMsg = There are more than one drop description that match the dropped element : {0} ({1} and {2}). +DDiagramSynchronizer_borderNodeRefreshMsg = BorderedNodes refresh +DDiagramSynchronizer_deleteNodesMsg = Nodes deletion +DDiagramSynchronizer_initDiagramMsg = Init diagram +DDiagramSynchronizer_nodeCreationMsg = Nodes creation +DDiagramSynchronizer_nodeRefreshMsg = Node refresh +DDiagramSynchronizer_refreshContainerChildsMsg = Refresh container childs +DDiagramSynchronizer_refreshContainerMsg = Refresh containers +DDiagramSynchronizer_refreshEdgeMsg = Refresh edges +DDiagramSynchronizer_refreshMappingsMsg = Refreshing mappings +DDiagramSynchronizer_refreshNodeMsg = Nodes refresh +DDiagramSynchronizer_refreshNodesMsg = Refresh Nodes +DEdgeSpec_deprecatedMsg = Deprecated method. +DeletionCommandBuilder_deleteDiagramLabel = Delete diagram +DeletionCommandBuilder_deleteFromDiagramLabel = Delete from diagram +DeletionCommandBuilder_deleteFromModelLabel = Delete from model +DeletionCommandBuilder_deleteLabel = Delete +DiagramDialectServices_createDiagramMsg = Create diagram : {0} +DiagramDialectServices_initializeDiagramMsg = Initialize diagram of type {0} +DiagramDialectServices_refreshDiagramMsg = Refresh diagram +DiagramDialectServices_refreshImactedElementsMsg = Refresh impacted elements +DiagramElementMappingHelper_edgeTargetMsg = The edge target {0}{1} +DiagramElementMappingQuery_diagramRootExpressionEvaluationErrorMsg = the following diagram description root expression could not be correctly evaluated : {0} +DiagramElementMappingQuery_mappingCandidateExpressionEvaluationErrorMsg = the following mapping semantic candidates expression could not be correctly evaluated : {0} +DiagramIdentifier_parametersErrorMsg = semantic & descriptionName are mandatories +DiagramMappingsManagerRegistryImpl_diagramParamErrorMsg = Parameter \"diagram\" cannot be null +DiagramTypeDescriptorRegistry_loadingErrorMsg = Error while loading the extension : {0} +DirectEditCommandBuilder_editLabel = Edit label +DnDTasksOperations_modelErrorMsg = Error while modifying model +DropinForContainerTaskCommand_taskLabel = DropIn task for container +DropinForNodeTaskCommand_taskLabel = DropIn task for node +EdgeFilter_errorMsg = source, target, edgeSource or edgeTarget is null +EdgeFilter_semanticIsNullErrorMsg = One of the semTargets is null +EdgeIdentifier_parametersErrorMsg = semantic, mappingName, source and target are mandatories +EdgeMappingQuery_preconditionEvaluationErrorMsg = the following edge mapping precondition could not be correctly evaluated : {0} +EdgeMappingQuery_sourceFinderEvaluationErrorMsg = the following edge mapping source finder expression could not be correctly evaluated : {0} +EdgeMappingQuery_targetFinderEvaluationErrorMsg = the following edge mapping target finder expression could not be correctly evaluated : {0} +GetConditionalStyle_errorMsg = Impossible to get the conditional style descriptions for object : {0} +GetStyleDescription_errorMsg = Impossible to get the style description for object : {0} +GlobalMappingsTable_mappingErrorMsg = Mapping ({0}) is not a ContainerMapping, NodeMapping, EdgeMapping +HideDDiagramElement_hideElementLabel = Hide element +HideDDiagramElement_hideElementsLabel = Hide elements +HideDDiagramElementLabel_hideLabel = Hide label +HideDDiagramElementLabel_hideLabels = Hide labels +NodeFilter_notNullErrorMsg = The node must not be null +NodeIdentifier_parametersErrorMsg = semantic & mappingName are mandatories +NodeMappingHelper_methodInvocationErrorMsg = [NodeMapping.getNodesCandidates(EObject semanticOrigin, EObject container)] This method must not be invoked. Use [NodeMapping.getNodesCandidates(EObject semanticOrigin, EObject container, EObject containerView)] instead. +NodeMappingHelper_nodeCreationErrorMsg = Error creating nodes : domain class is not defined on a mapping +PasteCommandBuilder_pasteLabel = Paste +PinElementsCommand_commandLabel = Pin elements +ReconnectionCommandBuilder_initVariablesMsg = Initializing Variables +ReconnectionCommandBuilder_mappingImportErrorMsg = This should not happen as IEdgeMapping is only extended by EdgeMappingImport and EdgeMapping +ReconnectSourceNodeCommand_commandLabel = Reconnect source node +RefreshExtensionProviderDescriptor_instantiatingErrorMsg = Error while instantiating a provider +RefreshSiriusElement_refreshRepresentationMsg = Refresh representation +RepresentationExtensionDescriptionRegexConstraint_errorMsg = The representation extension description \"{0}\" uses a regular expression for viewpoint URI or for representation name, but it does not contain only style customizations. +RevealAllElementsCommand_revealAllElementsLabel = Reveal all elements +RevealDDiagramElements_revealElementLabel = Reveal element +RevealDDiagramElements_revealElementsLabel = Reveal elements +RevealDDiagramElementsLabel_revealLabel = Reveal label +RevealDDiagramElementsLabel_revealLabels = Reveal labels +SetEdgeActualMappingCommand_commandLabel = Set edge actual mapping +UndoRedoCapableEMFCommandFactory_addDiagramVariableLabel = Add diagram variable +UndoRedoCapableEMFCommandFactory_createNewDiagramLabel = Create new diagram +UndoRedoCapableEMFCommandFactory_createRepresentationLabel = Create new representation +UndoRedoCapableEMFCommandFactory_quickFixLabel = Quick fix +UnpinElementsCommand_commandLabel = Unpin elements +ValidStyleConstraint_validationErrorMsg = Conditional style {0} of {1} diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/diagramtype/DiagramTypeDescriptorRegistry.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/diagramtype/DiagramTypeDescriptorRegistry.java index a9a0668d32..9afadd7059 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/diagramtype/DiagramTypeDescriptorRegistry.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/diagramtype/DiagramTypeDescriptorRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.api.diagramtype; +import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -20,6 +21,7 @@ import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.Platform; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -129,10 +131,10 @@ public final class DiagramTypeDescriptorRegistry { final IDiagramTypeDescriptor descriptor = new PluginDiagramTypeDescriptor(label, (IDiagramDescriptionProvider) provider); allProviders.add(descriptor); } else { - SiriusPlugin.getDefault().error("Error while loading the extension : " + extension.getLabel(), new ClassCastException()); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.DiagramTypeDescriptorRegistry_loadingErrorMsg, extension.getLabel()), new ClassCastException()); } } catch (final CoreException e) { - SiriusPlugin.getDefault().error("Error while loading the extension " + extension.getLabel(), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.DiagramTypeDescriptorRegistry_loadingErrorMsg, extension.getLabel()), e); SiriusPlugin.getDefault().getLog().log(e.getStatus()); } } @@ -174,6 +176,7 @@ public final class DiagramTypeDescriptorRegistry { * * @see org.eclipse.sirius.diagram.business.api.diagramtype.IDiagramTypeDescriptor#getDiagramDescriptionProvider() */ + @Override public IDiagramDescriptionProvider getDiagramDescriptionProvider() { return this.diagramDescriptionProvider; } @@ -183,6 +186,7 @@ public final class DiagramTypeDescriptorRegistry { * * @see org.eclipse.sirius.diagram.business.api.diagramtype.IDiagramTypeDescriptor#getLabel() */ + @Override public String getLabel() { return label; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/AbstractNodeMappingQuery.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/AbstractNodeMappingQuery.java index f5471f84f2..e6b9dfc384 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/AbstractNodeMappingQuery.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/AbstractNodeMappingQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 THALES GLOBAL SERVICES. + * Copyright (c) 2013, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.api.query; +import java.text.MessageFormat; + import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.common.tools.DslCommonPlugin; import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException; @@ -18,6 +20,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreterSiriusVariabl import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.AbstractNodeMapping; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; import org.eclipse.sirius.viewpoint.DSemanticDecorator; @@ -75,7 +78,7 @@ public class AbstractNodeMappingQuery extends DiagramElementMappingQuery { try { result = interpreter.evaluateBoolean(semantic, abstractNodeMapping.getPreconditionExpression()); } catch (final EvaluationException e) { - SiriusPlugin.getDefault().warning("the following abstract node mapping precondition could not be correctly evaluated : " + abstractNodeMapping.getPreconditionExpression(), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.AbstractNodeMappingQuery_evaluationErrorMsg, abstractNodeMapping.getPreconditionExpression()), e); } interpreter.unSetVariable(IInterpreterSiriusVariables.CONTAINER_VIEW); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/DiagramElementMappingQuery.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/DiagramElementMappingQuery.java index 5c3a303553..3822e82db6 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/DiagramElementMappingQuery.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/DiagramElementMappingQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.api.query; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -27,6 +28,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.AbstractNodeMapping; import org.eclipse.sirius.diagram.description.ContainerMappingImport; import org.eclipse.sirius.diagram.description.DiagramElementMapping; @@ -263,6 +265,7 @@ public class DiagramElementMappingQuery { this.mapping = mapping; } + @Override public Iterator<DiagramElementMapping> iterator() { return new SuperTypesIterator(mapping); } @@ -282,10 +285,12 @@ public class DiagramElementMappingQuery { this.cur = map; } + @Override public boolean hasNext() { return doGetNext() != null; } + @Override public DiagramElementMapping next() { cur = doGetNext(); if (cur == null) { @@ -307,6 +312,7 @@ public class DiagramElementMappingQuery { return next; } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -442,7 +448,7 @@ public class DiagramElementMappingQuery { try { candidates = interpreter.evaluateCollection(rootContent, mapping.getSemanticCandidatesExpression()); } catch (final EvaluationException e) { - SiriusPlugin.getDefault().warning("the following mapping semantic candidates expression could not be correctly evaluated : " + mapping.getSemanticCandidatesExpression(), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.DiagramElementMappingQuery_mappingCandidateExpressionEvaluationErrorMsg, mapping.getSemanticCandidatesExpression()), e); } if (candidates != null && !candidates.isEmpty()) { semanticCandidatesEvaluation.addAll(candidates); @@ -483,7 +489,8 @@ public class DiagramElementMappingQuery { try { computedRoot = interpreter.evaluateEObject(rootContent, diagram.getDescription().getRootExpression()); } catch (final EvaluationException e) { - SiriusPlugin.getDefault().warning("the following diagram description root expression could not be correctly evaluated : " + diagram.getDescription().getRootExpression(), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.DiagramElementMappingQuery_diagramRootExpressionEvaluationErrorMsg, diagram.getDescription().getRootExpression()), + e); } interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM); interpreter.unSetVariable(IInterpreterSiriusVariables.VIEWPOINT); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/EdgeMappingQuery.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/EdgeMappingQuery.java index 7b758159a5..781ec8a7ed 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/EdgeMappingQuery.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/query/EdgeMappingQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.api.query; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; @@ -21,6 +22,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreterSiriusVariabl import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.EdgeMapping; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; import org.eclipse.sirius.viewpoint.DMappingBased; @@ -106,7 +108,7 @@ public class EdgeMappingQuery extends DiagramElementMappingQuery { try { result = interpreter.evaluateBoolean(semantic, mapping.getPreconditionExpression()); } catch (final EvaluationException e) { - SiriusPlugin.getDefault().warning("the following edge mapping precondition could not be correctly evaluated : " + mapping.getPreconditionExpression(), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.EdgeMappingQuery_preconditionEvaluationErrorMsg, mapping.getPreconditionExpression()), e); } interpreter.unSetVariable(IInterpreterSiriusVariables.TARGET); interpreter.unSetVariable(IInterpreterSiriusVariables.SOURCE); @@ -146,7 +148,7 @@ public class EdgeMappingQuery extends DiagramElementMappingQuery { result.addAll(sourceSemantics); } } catch (final EvaluationException e) { - SiriusPlugin.getDefault().warning("the following edge mapping source finder expression could not be correctly evaluated : " + mapping.getSourceFinderExpression(), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.EdgeMappingQuery_sourceFinderEvaluationErrorMsg, mapping.getSourceFinderExpression()), e); } finally { interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM); interpreter.unSetVariable(IInterpreterSiriusVariables.VIEWPOINT); @@ -188,7 +190,7 @@ public class EdgeMappingQuery extends DiagramElementMappingQuery { result.addAll(targetSemantics); } } catch (final EvaluationException e) { - SiriusPlugin.getDefault().warning("the following edge mapping target finder expression could not be correctly evaluated : " + mapping.getTargetFinderExpression(), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.EdgeMappingQuery_targetFinderEvaluationErrorMsg, mapping.getTargetFinderExpression()), e); } finally { interpreter.unSetVariable(IInterpreterSiriusVariables.DIAGRAM); interpreter.unSetVariable(IInterpreterSiriusVariables.VIEWPOINT); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/AbstractUniqueRefreshExtension.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/AbstractUniqueRefreshExtension.java index 1de21054a7..fa52ceeb17 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/AbstractUniqueRefreshExtension.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/AbstractUniqueRefreshExtension.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -27,6 +27,7 @@ import org.eclipse.sirius.diagram.DNode; import org.eclipse.sirius.diagram.DNodeContainer; import org.eclipse.sirius.diagram.DNodeList; import org.eclipse.sirius.diagram.DNodeListElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.internal.helper.refresh.EdgeFilter; import org.eclipse.sirius.diagram.description.ContainerMapping; import org.eclipse.sirius.diagram.description.DiagramDescription; @@ -51,6 +52,7 @@ public abstract class AbstractUniqueRefreshExtension implements IRefreshExtensio * * @see org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension#beforeRefresh(DDiagram) */ + @Override public void beforeRefresh(final DDiagram viewPoint) { // Do nothing. } @@ -60,6 +62,7 @@ public abstract class AbstractUniqueRefreshExtension implements IRefreshExtensio * * @see org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension#postRefresh(DDiagram) */ + @Override public void postRefresh(final DDiagram diagram) { final DiagramDescription desc = diagram.getDescription(); if (desc != null) { @@ -179,8 +182,6 @@ public abstract class AbstractUniqueRefreshExtension implements IRefreshExtensio */ private static class NodeFilter { - private static final String THE_NODE_MUST_NOT_BE_NULL = "The node must not be null"; - /** The targeted element. */ private EObject targetedElement; @@ -195,7 +196,7 @@ public abstract class AbstractUniqueRefreshExtension implements IRefreshExtensio */ public NodeFilter(final DNode viewNode) { if (viewNode == null) { - throw new IllegalArgumentException(THE_NODE_MUST_NOT_BE_NULL); + throw new IllegalArgumentException(Messages.NodeFilter_notNullErrorMsg); } this.targetedElement = viewNode.getTarget(); this.semanticElements = viewNode.getSemanticElements(); @@ -209,7 +210,7 @@ public abstract class AbstractUniqueRefreshExtension implements IRefreshExtensio */ public NodeFilter(final DNodeListElement viewNodeListElement) { if (viewNodeListElement == null) { - throw new IllegalArgumentException(THE_NODE_MUST_NOT_BE_NULL); + throw new IllegalArgumentException(Messages.NodeFilter_notNullErrorMsg); } this.targetedElement = viewNodeListElement.getTarget(); this.semanticElements = viewNodeListElement.getSemanticElements(); @@ -223,7 +224,7 @@ public abstract class AbstractUniqueRefreshExtension implements IRefreshExtensio */ public NodeFilter(final DNodeList viewNodeList) { if (viewNodeList == null) { - throw new IllegalArgumentException(THE_NODE_MUST_NOT_BE_NULL); + throw new IllegalArgumentException(Messages.NodeFilter_notNullErrorMsg); } this.targetedElement = viewNodeList.getTarget(); this.semanticElements = viewNodeList.getSemanticElements(); @@ -237,7 +238,7 @@ public abstract class AbstractUniqueRefreshExtension implements IRefreshExtensio */ public NodeFilter(final DNodeContainer viewNodeContainer) { if (viewNodeContainer == null) { - throw new IllegalArgumentException(THE_NODE_MUST_NOT_BE_NULL); + throw new IllegalArgumentException(Messages.NodeFilter_notNullErrorMsg); } this.targetedElement = viewNodeContainer.getTarget(); this.semanticElements = viewNodeContainer.getSemanticElements(); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/componentization/mappings/DiagramMappingsManagerRegistryImpl.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/componentization/mappings/DiagramMappingsManagerRegistryImpl.java index a1ec1ff223..bb18522b28 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/componentization/mappings/DiagramMappingsManagerRegistryImpl.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/componentization/mappings/DiagramMappingsManagerRegistryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -26,6 +26,7 @@ import org.eclipse.sirius.business.api.session.SessionManagerListener; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DiagramPackage; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramDescriptionMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramDescriptionMappingsRegistry; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; @@ -82,9 +83,10 @@ public final class DiagramMappingsManagerRegistryImpl extends AdapterImpl implem * @see org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry#getDiagramMappingsManager(Session, * DDiagram) */ + @Override public DiagramMappingsManager getDiagramMappingsManager(final Session session, final DDiagram diagram) { if (diagram == null) { - throw new IllegalArgumentException("Parameter \"diagram\" cannot be null"); + throw new IllegalArgumentException(Messages.DiagramMappingsManagerRegistryImpl_diagramParamErrorMsg); } if (diagramMappingsManagers.containsKey(diagram)) { return diagramMappingsManagers.get(diagram); @@ -170,6 +172,7 @@ public final class DiagramMappingsManagerRegistryImpl extends AdapterImpl implem * * @see org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry#removeDiagramMappingsManagers(org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager) */ + @Override public void removeDiagramMappingsManagers(DiagramMappingsManager manager) { final Set<DDiagram> toRemove = new LinkedHashSet<DDiagram>(); for (final Map.Entry<DDiagram, DiagramMappingsManager> entry : diagramMappingsManagers.entrySet()) { diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectServices.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectServices.java index b21ccc9538..ff3d6636af 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectServices.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/DiagramDialectServices.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.dialect; +import java.text.MessageFormat; import java.util.Collection; import java.util.Map; import java.util.Set; @@ -44,6 +45,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.DSemanticDiagram; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.NodeStyle; import org.eclipse.sirius.diagram.business.api.componentization.DiagramDescriptionMappingsRegistry; import org.eclipse.sirius.diagram.business.api.helper.display.DisplayMode; @@ -115,6 +117,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService /** * {@inheritDoc} */ + @Override public boolean canCreate(final EObject semantic, final RepresentationDescription desc) { boolean result = false; if (semantic != null && isSupported(desc)) { @@ -146,6 +149,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService /** * {@inheritDoc} */ + @Override public DRepresentation createRepresentation(final String name, final EObject semantic, final RepresentationDescription description, final IProgressMonitor monitor) { // TODO ensure that the given description is contained in the same // resource set as the given semantic element @@ -165,8 +169,8 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService public DRepresentation createRepresentation(final String name, final EObject semantic, final RepresentationDescription description, final Session session, final IProgressMonitor monitor) { DRepresentation diagram = null; try { - monitor.beginTask("Create diagram : " + name, 6); - monitor.subTask("Create diagram : " + name); + monitor.beginTask(MessageFormat.format(Messages.DiagramDialectServices_createDiagramMsg, name), 6); + monitor.subTask(MessageFormat.format(Messages.DiagramDialectServices_createDiagramMsg, name)); diagram = createRepresentation(name, semantic, description, new SubProgressMonitor(monitor, 2)); if (diagram != null) { refresh(diagram, new SubProgressMonitor(monitor, 26)); @@ -236,9 +240,10 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService * * {@inheritDoc} */ + @Override public void refresh(final DRepresentation representation, final boolean fullRefresh, final IProgressMonitor monitor) { try { - monitor.beginTask("Refresh diagram", 10); + monitor.beginTask(Messages.DiagramDialectServices_refreshDiagramMsg, 10); final DSemanticDiagram diagram = (DSemanticDiagram) representation; if (diagram.getDescription() != null) { final IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(representation); @@ -274,6 +279,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService /** * {@inheritDoc} */ + @Override public RepresentationDescription getDescription(final DRepresentation representation) { if (representation instanceof DDiagram) { return ((DDiagram) representation).getDescription(); @@ -291,6 +297,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService /** * {@inheritDoc} */ + @Override public void initRepresentations(final Viewpoint vp, final EObject semantic, IProgressMonitor monitor) { super.initRepresentations(semantic, vp, DiagramDescription.class, monitor); } @@ -298,6 +305,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService /** * {@inheritDoc} */ + @Override protected <T extends RepresentationDescription> void initRepresentationForElement(T representationDescription, EObject semanticElement, IProgressMonitor monitor) { if (representationDescription instanceof DiagramDescription) { DiagramDescription diagramDescription = (DiagramDescription) representationDescription; @@ -308,7 +316,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService if (transactionalEditingDomain != null) { try { - monitor.beginTask("Initialize diagram of type " + new IdentifiedElementQuery(representationDescription).getLabel(), 1); + monitor.beginTask(MessageFormat.format(Messages.DiagramDialectServices_initializeDiagramMsg, new IdentifiedElementQuery(representationDescription).getLabel()), 1); DCommand command = DiagramCommandFactoryService.getInstance().getNewProvider().getCommandFactory(transactionalEditingDomain) .buildCreateDiagramFromDescription(diagramDescription, semanticElement, new SubProgressMonitor(monitor, 1)); TransactionUtil.getEditingDomain(semanticElement).getCommandStack().execute(command); @@ -441,6 +449,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService * @see org.eclipse.sirius.business.api.dialect.DialectServices#createInterpretedExpressionQuery(org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature) */ + @Override public IInterpretedExpressionQuery createInterpretedExpressionQuery(EObject target, EStructuralFeature feature) { return new DiagramInterpretedExpressionQuery(target, feature); } @@ -508,7 +517,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService @Override public void refreshImpactedElements(DRepresentation representation, Collection<Notification> notifications, IProgressMonitor monitor) { try { - monitor.beginTask("Refresh diagram", 10); + monitor.beginTask(Messages.DiagramDialectServices_refreshDiagramMsg, 10); DSemanticDiagram diagram = (DSemanticDiagram) representation; IInterpreter interpreter = SiriusPlugin.getDefault().getInterpreterRegistry().getInterpreter(diagram.getTarget()); ModelAccessor accessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(representation); @@ -518,7 +527,7 @@ public class DiagramDialectServices extends AbstractRepresentationDialectService DDiagramElementSynchronizer sync = new DDiagramElementSynchronizer(diagram, interpreter, accessor); IProgressMonitor subMonitor = new SubProgressMonitor(monitor, 8); try { - subMonitor.beginTask("Refresh impacted elements", diagramElements.size()); + subMonitor.beginTask(Messages.DiagramDialectServices_refreshImactedElementsMsg, diagramElements.size()); for (DDiagramElement diagramElement : diagramElements) { sync.refresh(diagramElement); subMonitor.worked(1); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/DiagramIdentifier.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/DiagramIdentifier.java index 17cb20a328..fb9cd39e2f 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/DiagramIdentifier.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/DiagramIdentifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -15,6 +15,7 @@ import org.eclipse.sirius.business.api.dialect.identifier.AbstractRepresentation import org.eclipse.sirius.common.tools.api.util.EqualityHelper; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DSemanticDiagram; +import org.eclipse.sirius.diagram.Messages; /** * Identifies a diagram. @@ -44,7 +45,7 @@ public class DiagramIdentifier extends AbstractRepresentationElementIdentifier i */ public DiagramIdentifier(final EObject semantic, final String descriptionName, final int index) { if (semantic == null || descriptionName == null) { - throw new IllegalArgumentException("semantic & descriptionName are mandatories"); + throw new IllegalArgumentException(Messages.DiagramIdentifier_parametersErrorMsg); } this.semantic = semantic; this.descriptionName = descriptionName; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/EdgeIdentifier.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/EdgeIdentifier.java index 3293af8c1c..f2b80e4258 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/EdgeIdentifier.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/EdgeIdentifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.business.api.dialect.identifier.AbstractRepresentationElementIdentifier; import org.eclipse.sirius.common.tools.api.util.EqualityHelper; import org.eclipse.sirius.diagram.DEdge; +import org.eclipse.sirius.diagram.Messages; /** * An edge identifier. @@ -58,7 +59,7 @@ public class EdgeIdentifier extends AbstractRepresentationElementIdentifier { */ public EdgeIdentifier(final EObject semantic, final String mappingName, final NodeIdentifier source, final NodeIdentifier target) { if (semantic == null || mappingName == null || source == null || target == null) { - throw new IllegalArgumentException("semantic, mappingName, source and target are mandatories"); + throw new IllegalArgumentException(Messages.EdgeIdentifier_parametersErrorMsg); } this.semantic = semantic; this.mappingName = mappingName; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/NodeIdentifier.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/NodeIdentifier.java index 39cd21e5e3..4744515c3f 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/NodeIdentifier.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/dialect/identifier/NodeIdentifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.business.api.dialect.identifier.AbstractRepresentationElementIdentifier; import org.eclipse.sirius.common.tools.api.util.EqualityHelper; import org.eclipse.sirius.diagram.AbstractDNode; +import org.eclipse.sirius.diagram.Messages; /** * Type that identifies one node. @@ -55,7 +56,7 @@ public class NodeIdentifier extends AbstractRepresentationElementIdentifier impl */ public NodeIdentifier(final EObject semantic, final String mappingName, final NodeContainerIdentifier parent) { if (semantic == null || mappingName == null) { - throw new IllegalArgumentException("semantic & mappingName are mandatories"); + throw new IllegalArgumentException(Messages.NodeIdentifier_parametersErrorMsg); } this.semantic = semantic; this.mappingName = mappingName; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/experimental/sync/DDiagramSynchronizer.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/experimental/sync/DDiagramSynchronizer.java index 4acd83b2ea..a745f4441c 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/experimental/sync/DDiagramSynchronizer.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/experimental/sync/DDiagramSynchronizer.java @@ -55,6 +55,7 @@ import org.eclipse.sirius.diagram.DiagramFactory; import org.eclipse.sirius.diagram.DiagramPackage; import org.eclipse.sirius.diagram.DragAndDropTarget; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; import org.eclipse.sirius.diagram.business.api.helper.SiriusDiagramHelper; @@ -225,7 +226,7 @@ public class DDiagramSynchronizer { */ public void initDiagram(final String name, final EObject target, final IProgressMonitor monitor) { try { - monitor.beginTask("Init diagram", 4); + monitor.beginTask(Messages.DDiagramSynchronizer_initDiagramMsg, 4); this.session = SessionManager.INSTANCE.getSession(target); this.diagram = createEmptyDiagram(name, target); monitor.worked(1); @@ -384,7 +385,7 @@ public class DDiagramSynchronizer { RefreshExtensionService.getInstance().beforeRefresh(this.diagram); final int mappingNumbers = nodeMappings.size() + edgeMappings.size() + containerMappings.size(); - monitor.beginTask("Refreshing mappings", mappingNumbers); + monitor.beginTask(Messages.DDiagramSynchronizer_refreshMappingsMsg, mappingNumbers); /* * compute a first time the cache with old mappings => updater @@ -797,7 +798,7 @@ public class DDiagramSynchronizer { final SetIntersection<AbstractDNodeCandidate> status = computeCurrentStatus(viewContainer, mapping, semanticFilter); Collection<AbstractDNodeCandidate> newElements = status.getNewElements(); try { - monitor.beginTask("Refresh containers", 3); + monitor.beginTask(Messages.DDiagramSynchronizer_refreshContainerMsg, 3); deleteCandidatesToRemove(status, new SubProgressMonitor(monitor, 1)); // kept and created nodes @@ -838,7 +839,7 @@ public class DDiagramSynchronizer { private void refreshMappingsInContainerMapping(final Map<DiagramElementMapping, Collection<EdgeTarget>> mappingsToEdgeTargets, final DDiagramElementContainer newNode, IProgressMonitor monitor) { if (this.accessor.getPermissionAuthority().canEditInstance(newNode)) { try { - monitor.beginTask("Refresh container childs", 1); + monitor.beginTask(Messages.DDiagramSynchronizer_refreshContainerChildsMsg, 1); /* Refresh border node mappings */ refreshBorderNodeMapping(mappingsToEdgeTargets, newNode, null, new SubProgressMonitor(monitor, 1)); @@ -898,7 +899,7 @@ public class DDiagramSynchronizer { /* compute added/removed candidates. */ final SetIntersection<AbstractDNodeCandidate> status = computeCurrentStatus(viewContainer, mapping, semanticFilter); try { - monitor.beginTask("Nodes refresh", 3); + monitor.beginTask(Messages.DDiagramSynchronizer_refreshNodeMsg, 3); deleteCandidatesToRemove(status, new SubProgressMonitor(monitor, 1)); @@ -941,7 +942,7 @@ public class DDiagramSynchronizer { final DragAndDropTarget newNodeDDT = (DragAndDropTarget) newNode; List<NodeMapping> borderedNodeMappings = diagramMappingsManager.getBorderedNodeMappings(newNode); try { - monitor.beginTask("BorderedNodes refresh", 4 * borderedNodeMappings.size()); + monitor.beginTask(Messages.DDiagramSynchronizer_borderNodeRefreshMsg, 4 * borderedNodeMappings.size()); for (final NodeMapping bordermapping : borderedNodeMappings) { final SetIntersection<AbstractDNodeCandidate> borderStatus = computeCurrentStatus(newNodeDDT, bordermapping, semanticFilter); @@ -982,7 +983,7 @@ public class DDiagramSynchronizer { private void deleteCandidatesToRemove(final SetIntersection<AbstractDNodeCandidate> status, IProgressMonitor monitor) { try { final Iterable<AbstractDNodeCandidate> candidatesToRemove = status.getRemovedElements(); - monitor.beginTask("Nodes deletion", Iterables.size(candidatesToRemove)); + monitor.beginTask(Messages.DDiagramSynchronizer_deleteNodesMsg, Iterables.size(candidatesToRemove)); for (final AbstractDNodeCandidate nodeToDelete : candidatesToRemove) { if (nodeToDelete.comesFromDiagramElement()) { this.accessor.eDelete(nodeToDelete.getOriginalElement(), session != null ? session.getSemanticCrossReferencer() : null); @@ -1039,7 +1040,7 @@ public class DDiagramSynchronizer { IProgressMonitor monitor) { final Iterable<AbstractDNodeCandidate> keptNodeCandidates = status.getKeptElements(); try { - monitor.beginTask("Refresh Nodes", Iterables.size(keptNodeCandidates)); + monitor.beginTask(Messages.DDiagramSynchronizer_refreshNodesMsg, Iterables.size(keptNodeCandidates)); for (final AbstractDNodeCandidate keptCandidate : keptNodeCandidates) { handleKeptNode(viewContainer, keptCandidate, keptNodes, border, new SubProgressMonitor(monitor, 1)); } @@ -1053,7 +1054,7 @@ public class DDiagramSynchronizer { /* The element is already here. */ AbstractDNode keptNode = keptCandidate.getOriginalElement(); try { - monitor.beginTask("Node refresh", 3); + monitor.beginTask(Messages.DDiagramSynchronizer_nodeRefreshMsg, 3); final AbstractNodeMapping nodeMapping = (AbstractNodeMapping) keptNode.getDiagramElementMapping(); @@ -1258,7 +1259,7 @@ public class DDiagramSynchronizer { private List<AbstractDNode> createNewContent(final Collection<AbstractDNodeCandidate> candidatesToCreate, boolean force, final DragAndDropTarget container, final AbstractNodeMapping mapping, final boolean border, IProgressMonitor monitor) { try { - monitor.beginTask("Nodes creation", candidatesToCreate.size()); + monitor.beginTask(Messages.DDiagramSynchronizer_nodeCreationMsg, candidatesToCreate.size()); /* check first that there is candidates */ if (!candidatesToCreate.isEmpty() && this.accessor.getPermissionAuthority().canCreateIn(container) && (force || new DiagramElementMappingQuery(mapping).isSynchronizedAndCreateElement(diagram))) { @@ -1326,7 +1327,7 @@ public class DDiagramSynchronizer { if (new DiagramElementMappingQuery(mapping).isSynchronizedAndCreateElement(diagram)) { try { Collection<DEdgeCandidate> newElements = status.getNewElements(); - monitor.beginTask("Refresh edges", newElements.size()); + monitor.beginTask(Messages.DDiagramSynchronizer_refreshEdgeMsg, newElements.size()); for (final DEdgeCandidate candidate : newElements) { edgesDones.add(this.sync.createNewEdge(mappingManager, candidate, mappingsToEdgeTargets, edgeToMappingBasedDecoration, edgeToSemanticBasedDecoration)); monitor.worked(1); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/EdgeFilter.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/EdgeFilter.java index c023a12e01..5b5a82dc81 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/EdgeFilter.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/EdgeFilter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -14,6 +14,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.IEdgeMappingQuery; import org.eclipse.sirius.diagram.description.EdgeMapping; import org.eclipse.sirius.viewpoint.DSemanticDecorator; @@ -69,7 +70,7 @@ public class EdgeFilter { */ public EdgeFilter(final EObject source, final EObject target, final EObject semTarget, final EdgeTarget edgeSource, final EdgeTarget edgeTarget, final EdgeMapping edgeMapping) { if (source == null || target == null || edgeSource == null || edgeTarget == null) { - throw new IllegalArgumentException("source, target, edgeSource or edgeTarget is null"); + throw new IllegalArgumentException(Messages.EdgeFilter_errorMsg); } this.source = source; this.target = target; @@ -133,7 +134,7 @@ public class EdgeFilter { if (!result && obj instanceof EdgeFilter) { final EdgeFilter edgeFilter = (EdgeFilter) obj; if ((semTarget == null && edgeFilter.semTarget != null) || (semTarget != null && edgeFilter.semTarget == null)) { - SiriusPlugin.getDefault().error("One of the semTargets is null", null); + SiriusPlugin.getDefault().error(Messages.EdgeFilter_semanticIsNullErrorMsg, null); } result = getHashString(this).equals(getHashString(edgeFilter)); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/RefreshExtensionProviderDescriptor.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/RefreshExtensionProviderDescriptor.java index 2a0da5f4fc..61b4594975 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/RefreshExtensionProviderDescriptor.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/refresh/RefreshExtensionProviderDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.business.internal.helper.refresh; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.sirius.business.internal.helper.refresh.AbstractProviderDescriptor; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtensionProvider; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -46,7 +47,7 @@ public class RefreshExtensionProviderDescriptor extends AbstractProviderDescript try { this.extensionProvider = (IRefreshExtensionProvider) this.element.createExecutableExtension("providerClass"); //$NON-NLS-1$ } catch (final CoreException e) { - SiriusPlugin.getDefault().error("Error while instantiating a provider", e); + SiriusPlugin.getDefault().error(Messages.RefreshExtensionProviderDescriptor_instantiatingErrorMsg, e); } } return this.extensionProvider; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateContainerTask.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateContainerTask.java index 33c75f6ab0..b107d95019 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateContainerTask.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateContainerTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES and others. * 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 @@ -27,6 +27,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; @@ -85,6 +86,7 @@ public class CreateContainerTask extends AbstractCommandTask implements ICreatio * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { EObjectQuery eObjectQuery = new EObjectQuery(containerView); Session session = eObjectQuery.getSession(); @@ -130,8 +132,9 @@ public class CreateContainerTask extends AbstractCommandTask implements ICreatio * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "create a container"; + return Messages.CreateContainerTask_label; } /** @@ -139,6 +142,7 @@ public class CreateContainerTask extends AbstractCommandTask implements ICreatio * * @see org.eclipse.sirius.business.api.helper.task.ICreationTask#getCreatedElements() */ + @Override public Collection<EObject> getCreatedElements() { // not applicable return Collections.emptySet(); @@ -147,6 +151,7 @@ public class CreateContainerTask extends AbstractCommandTask implements ICreatio /** * {@inheritDoc} */ + @Override public Collection<DRepresentationElement> getCreatedRepresentationElements() { return new ArrayList<DRepresentationElement>(createdAbstractDNodes); } @@ -154,6 +159,7 @@ public class CreateContainerTask extends AbstractCommandTask implements ICreatio /** * {@inheritDoc} */ + @Override public Collection<EObject> getAffectedElements() { // not applicable return Collections.emptySet(); @@ -162,6 +168,7 @@ public class CreateContainerTask extends AbstractCommandTask implements ICreatio /** * {@inheritDoc} */ + @Override public Collection<EObject> getCreatedReferences() { // not applicable return Collections.emptySet(); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDEdgeTask.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDEdgeTask.java index 4524fd2019..259f1f0d4a 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDEdgeTask.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDEdgeTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -25,6 +25,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; @@ -93,6 +94,7 @@ public class CreateDEdgeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { EObjectQuery eObjectQuery = new EObjectQuery(sourceView); @@ -131,8 +133,9 @@ public class CreateDEdgeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "create edge"; + return Messages.CreateDEdgeTask_label; } private Collection<EObject> getAllSemantics() { @@ -146,6 +149,7 @@ public class CreateDEdgeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.api.helper.task.ICreationTask#getCreatedRepresentationElements() */ + @Override public Collection<DRepresentationElement> getCreatedRepresentationElements() { return new ArrayList<DRepresentationElement>(createdDEdges); } @@ -155,6 +159,7 @@ public class CreateDEdgeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.api.helper.task.ICreationTask#getCreatedElements() */ + @Override public Collection<EObject> getCreatedElements() { // not applicable return Collections.emptySet(); @@ -165,6 +170,7 @@ public class CreateDEdgeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.internal.helper.task.IModificationTask#getAffectedElements() */ + @Override public Collection<EObject> getAffectedElements() { // not applicable return Collections.emptySet(); @@ -175,6 +181,7 @@ public class CreateDEdgeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.internal.helper.task.IModificationTask#getCreatedReferences() */ + @Override public Collection<EObject> getCreatedReferences() { // not applicable return Collections.emptySet(); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDNodeTask.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDNodeTask.java index e9a74fd432..5a6dc87810 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDNodeTask.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/CreateDNodeTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES and others. * 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 @@ -26,6 +26,7 @@ import org.eclipse.sirius.diagram.ArrangeConstraint; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; @@ -90,6 +91,7 @@ public class CreateDNodeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { if (containerView instanceof DSemanticDecorator) { DSemanticDecorator containerViewDSemanticDecorator = (DSemanticDecorator) containerView; @@ -126,8 +128,9 @@ public class CreateDNodeTask extends AbstractCommandTask implements ICreationTas } } + @Override public String getLabel() { - return "create a node"; + return Messages.CreateDNodeTask_label; } private boolean isAutoPinOnCreateEnabled() { @@ -140,6 +143,7 @@ public class CreateDNodeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.api.helper.task.ICreationTask#getCreatedElements() */ + @Override public Collection<EObject> getCreatedElements() { // not applicable return Collections.emptySet(); @@ -151,6 +155,7 @@ public class CreateDNodeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.internal.helper.task.IModificationTask#getAffectedElements() */ + @Override public Collection<EObject> getAffectedElements() { // not applicable return Collections.emptySet(); @@ -162,6 +167,7 @@ public class CreateDNodeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.internal.helper.task.IModificationTask#getCreatedReferences() */ + @Override public Collection<EObject> getCreatedReferences() { // not applicable return Collections.emptySet(); @@ -172,6 +178,7 @@ public class CreateDNodeTask extends AbstractCommandTask implements ICreationTas * * @see org.eclipse.sirius.business.api.helper.task.ICreationTask#getCreatedRepresentationElements() */ + @Override public Collection<DRepresentationElement> getCreatedRepresentationElements() { return new ArrayList<DRepresentationElement>(createdAbstractDNodes); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java index 0e6cd315a2..c3f6abc36b 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DnDTasksOperations.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -35,6 +35,7 @@ import org.eclipse.sirius.diagram.DNodeList; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DragAndDropTarget; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramComponentizationManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; @@ -318,9 +319,9 @@ public final class DnDTasksOperations { } } catch (MetaClassNotFoundException e) { - SiriusPlugin.getDefault().error("Error while modifying model", e); + SiriusPlugin.getDefault().error(Messages.DnDTasksOperations_modelErrorMsg, e); } catch (FeatureNotFoundException e) { - SiriusPlugin.getDefault().error("Error while modifying model", e); + SiriusPlugin.getDefault().error(Messages.DnDTasksOperations_modelErrorMsg, e); } } } @@ -373,6 +374,7 @@ public final class DnDTasksOperations { return new AbstractCommandTask() { + @Override public void execute() { if (viewContainer instanceof DDiagram) { ((DDiagram) viewContainer).getOwnedDiagramElements().remove(element); @@ -397,6 +399,7 @@ public final class DnDTasksOperations { } } + @Override public String getLabel() { return null; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForContainerTaskCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForContainerTaskCommand.java index 2d09e694ce..a82e636d01 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForContainerTaskCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForContainerTaskCommand.java @@ -19,6 +19,7 @@ import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DDiagramElementContainer; import org.eclipse.sirius.diagram.DNodeContainer; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.internal.metamodel.description.extensions.IContainerMappingExt; import org.eclipse.sirius.diagram.business.internal.metamodel.helper.ContainerMappingHelper; import org.eclipse.sirius.diagram.description.ContainerMapping; @@ -76,7 +77,7 @@ public class DropinForContainerTaskCommand extends AbstractCommandTask { @Override public String getLabel() { - return "DropIn task for container"; + return Messages.DropinForContainerTaskCommand_taskLabel; } @Override diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForNodeTaskCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForNodeTaskCommand.java index 62e11ac88b..b46fcd837a 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForNodeTaskCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/DropinForNodeTaskCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -21,6 +21,7 @@ import org.eclipse.sirius.diagram.DNodeContainer; import org.eclipse.sirius.diagram.DNodeList; import org.eclipse.sirius.diagram.DNodeListElement; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.internal.metamodel.helper.NodeMappingHelper; import org.eclipse.sirius.diagram.description.AbstractNodeMapping; import org.eclipse.sirius.diagram.description.NodeMapping; @@ -75,6 +76,7 @@ public class DropinForNodeTaskCommand extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { final DDiagram parentDiagram = DnDTasksOperations.getParentDiagram(target); if (target instanceof DNodeList) { @@ -203,7 +205,8 @@ public class DropinForNodeTaskCommand extends AbstractCommandTask { } } + @Override public String getLabel() { - return "DropIn task for node"; + return Messages.DropinForNodeTaskCommand_taskLabel; } } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/operations/CreateViewTask.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/operations/CreateViewTask.java index 8d6e13ecee..616d53eec6 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/operations/CreateViewTask.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/helper/task/operations/CreateViewTask.java @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.DragAndDropTarget; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; import org.eclipse.sirius.diagram.business.api.helper.display.DisplayMode; @@ -101,7 +102,7 @@ public class CreateViewTask extends AbstractOperationTask { @Override public String getLabel() { - return "create a view"; + return Messages.CreateViewTask_label; } @Override diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/layers/GlobalMappingsTable.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/layers/GlobalMappingsTable.java index 4cb6a2ff55..fb072bea2e 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/layers/GlobalMappingsTable.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/layers/GlobalMappingsTable.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,11 +10,13 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.layers; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramDescriptionMappingsManager; import org.eclipse.sirius.diagram.business.internal.componentization.mappings.table.CandidateMappingManager; import org.eclipse.sirius.diagram.description.ContainerMapping; @@ -172,7 +174,7 @@ public class GlobalMappingsTable { } else if (mapping instanceof EdgeMapping) { entry = edgeMappingsTable.searchMappingEntry((EdgeMapping) mapping); } else { - throw new IllegalArgumentException("Mapping (" + mapping.getClass() + ") is not a ContainerMapping, NodeMapping, EdgeMapping"); + throw new IllegalArgumentException(MessageFormat.format(Messages.GlobalMappingsTable_mappingErrorMsg, mapping.getClass())); } return entry; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/description/tool/spec/ContainerDropDescriptionSpec.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/description/tool/spec/ContainerDropDescriptionSpec.java index 0fd219fb22..8a15f4bb62 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/description/tool/spec/ContainerDropDescriptionSpec.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/description/tool/spec/ContainerDropDescriptionSpec.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.metamodel.description.tool.spec; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -32,6 +33,7 @@ import org.eclipse.sirius.diagram.DDiagramElementContainer; import org.eclipse.sirius.diagram.DNode; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramComponentizationManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; @@ -74,8 +76,8 @@ public class ContainerDropDescriptionSpec extends ContainerDropDescriptionImpl { session = SessionManager.INSTANCE.getSession(((DSemanticDiagram) diagram).getTarget()); } - final Collection<DiagramElementMapping> allMappings = new LinkedList<DiagramElementMapping>(new DiagramComponentizationManager().getAllContainerMappings( - session.getSelectedViewpoints(false), desc)); + final Collection<DiagramElementMapping> allMappings = new LinkedList<DiagramElementMapping>( + new DiagramComponentizationManager().getAllContainerMappings(session.getSelectedViewpoints(false), desc)); allMappings.addAll(getAllMappingsWithSuperMappings(session, desc)); allMappings.addAll(new DiagramComponentizationManager().getAllEdgeMappings(session.getSelectedViewpoints(false), desc)); iterCandidates = allMappings.iterator(); @@ -99,7 +101,7 @@ public class ContainerDropDescriptionSpec extends ContainerDropDescriptionImpl { iterCandidates = allMappings.iterator(); } if (iterCandidates == null) { - SiriusPlugin.getDefault().error("Unknown drag&drop target : " + targetContainer, new RuntimeException()); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ContainerDropDescriptionSpec_unknownTgtMsg, targetContainer), new RuntimeException()); return null; } Session session = SessionManager.INSTANCE.getSession(droppedElement); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java index 4047cb35ed..add0924c08 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/ContainerMappingHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -31,6 +31,7 @@ import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DDiagramElementContainer; import org.eclipse.sirius.diagram.DNodeContainer; import org.eclipse.sirius.diagram.DiagramFactory; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.ContainerMappingQuery; import org.eclipse.sirius.diagram.business.internal.metamodel.description.extensions.IContainerMappingExt; import org.eclipse.sirius.diagram.business.internal.metamodel.description.operations.SiriusElementMappingSpecOperations; @@ -187,7 +188,7 @@ public final class ContainerMappingHelper { } } } else { - SiriusPlugin.getDefault().error("Error creating nodes : domain class is not defined on a mapping", new RuntimeException()); + SiriusPlugin.getDefault().error(Messages.ContainerMappingHelper_nodeCreationErrorMsg, new RuntimeException()); } self.getCandidatesCache().put(couple, result); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/DiagramElementMappingHelper.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/DiagramElementMappingHelper.java index 6d17b75a2e..8f6d3cd854 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/DiagramElementMappingHelper.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/DiagramElementMappingHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.metamodel.helper; +import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.Iterator; @@ -27,6 +28,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.AbstractNodeMapping; import org.eclipse.sirius.diagram.description.DescriptionPackage; import org.eclipse.sirius.diagram.description.DiagramElementMapping; @@ -273,7 +275,8 @@ public final class DiagramElementMappingHelper { if (edgeTarget instanceof DSemanticDecorator) { return ((DSemanticDecorator) edgeTarget).getTarget(); } else if (edgeTarget != null) { - SiriusPlugin.getDefault().warning("The edge target " + String.valueOf(edgeTarget) + ISiriusMessages.IS_NOT_A_DECORATE_SEMANTIC_ELEMENT, null); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.DiagramElementMappingHelper_edgeTargetMsg, String.valueOf(edgeTarget), ISiriusMessages.IS_NOT_A_DECORATE_SEMANTIC_ELEMENT), + null); } return null; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/EdgeMappingHelper.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/EdgeMappingHelper.java index b9ffb0cfc0..4ad88ffeb9 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/EdgeMappingHelper.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/EdgeMappingHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.metamodel.helper; +import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.Iterator; @@ -36,6 +37,7 @@ import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DiagramFactory; import org.eclipse.sirius.diagram.EdgeStyle; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.EdgeMappingQuery; import org.eclipse.sirius.diagram.business.api.query.IEdgeMappingQuery; import org.eclipse.sirius.diagram.business.internal.metamodel.description.operations.EdgeMappingImportWrapper; @@ -91,7 +93,8 @@ public final class EdgeMappingHelper { if (edgeTarget instanceof DSemanticDecorator) { return ((DSemanticDecorator) edgeTarget).getTarget(); } - SiriusPlugin.getDefault().warning("The edge target " + String.valueOf(edgeTarget) + ISiriusMessages.IS_NOT_A_DECORATE_SEMANTIC_ELEMENT, null); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.DiagramElementMappingHelper_edgeTargetMsg, String.valueOf(edgeTarget), ISiriusMessages.IS_NOT_A_DECORATE_SEMANTIC_ELEMENT), + null); return null; } @@ -407,9 +410,8 @@ public final class EdgeMappingHelper { if (edgeMappingOption.some() && dEdge.getSourceNode() instanceof DSemanticDecorator && dEdge.getTargetNode() instanceof DSemanticDecorator) { EdgeMapping edgeMapping = edgeMappingOption.get(); EdgeMappingQuery edgeMappingQuery = new EdgeMappingQuery(edgeMapping); - result = result - && edgeMappingQuery.evaluatePrecondition(diagram, diagram, rootInterpreter, dEdge.getTarget(), (DSemanticDecorator) dEdge.getSourceNode(), - (DSemanticDecorator) dEdge.getTargetNode()); + result = result && edgeMappingQuery.evaluatePrecondition(diagram, diagram, rootInterpreter, dEdge.getTarget(), (DSemanticDecorator) dEdge.getSourceNode(), + (DSemanticDecorator) dEdge.getTargetNode()); } } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetConditionalStyle.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetConditionalStyle.java index 3c00d99698..c59d3a8a3b 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetConditionalStyle.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetConditionalStyle.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2013 THALES GLOBAL SERVICES. + * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.metamodel.helper; +import java.text.MessageFormat; import java.util.Collection; import java.util.List; @@ -17,6 +18,7 @@ import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.IEdgeMappingQuery; import org.eclipse.sirius.diagram.business.internal.metamodel.description.operations.EdgeMappingImportWrapper; import org.eclipse.sirius.diagram.description.ConditionalContainerStyleDescription; @@ -181,7 +183,7 @@ public class GetConditionalStyle extends DescriptionSwitch<List<? extends Condit */ @Override public EList<? extends ConditionalStyleDescription> defaultCase(final EObject object) { - SiriusPlugin.getDefault().error("Impossible to get the conditional style descriptions for object : " + object, new RuntimeException()); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.GetConditionalStyle_errorMsg, object), new RuntimeException()); return EMPTY; } } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetStyleDescription.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetStyleDescription.java index 281562504a..e468e94770 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetStyleDescription.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/GetStyleDescription.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,7 +10,10 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.metamodel.helper; +import java.text.MessageFormat; + import org.eclipse.emf.ecore.EObject; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.ConditionalContainerStyleDescription; import org.eclipse.sirius.diagram.description.ConditionalEdgeStyleDescription; import org.eclipse.sirius.diagram.description.ConditionalNodeStyleDescription; @@ -57,7 +60,7 @@ public class GetStyleDescription extends DescriptionSwitch<StyleDescription> { @Override public StyleDescription defaultCase(final EObject object) { - SiriusPlugin.getDefault().error("Impossible to get the style description for object : " + object, new RuntimeException()); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.GetStyleDescription_errorMsg, object), new RuntimeException()); return null; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/NodeMappingHelper.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/NodeMappingHelper.java index 117f2cddcb..9174d2e0b0 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/NodeMappingHelper.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/helper/NodeMappingHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -30,6 +30,7 @@ import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DNode; import org.eclipse.sirius.diagram.DNodeListElement; import org.eclipse.sirius.diagram.DiagramFactory; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.NodeStyle; import org.eclipse.sirius.diagram.ResizeKind; import org.eclipse.sirius.diagram.business.internal.metamodel.description.extensions.INodeMappingExt; @@ -79,9 +80,7 @@ public final class NodeMappingHelper { * @return all semantic elements that are candidates for the mapping. */ public static EList<EObject> getNodesCandidates(NodeMapping self, EObject semanticOrigin, EObject container) { - SiriusPlugin.getDefault().warning( - "[NodeMapping.getNodesCandidates(EObject semanticOrigin, EObject container)] This method must not be invoked. Use" - + " [NodeMapping.getNodesCandidates(EObject semanticOrigin, EObject container, EObject containerView)] instead.", null); + SiriusPlugin.getDefault().warning(Messages.NodeMappingHelper_methodInvocationErrorMsg, null); return self.getNodesCandidates(semanticOrigin, container, null); } @@ -128,7 +127,7 @@ public final class NodeMappingHelper { } } } else { - SiriusPlugin.getDefault().error("Error creating nodes : domain class is not defined on a mapping", new RuntimeException()); + SiriusPlugin.getDefault().error(Messages.NodeMappingHelper_nodeCreationErrorMsg, new RuntimeException()); } self.getCandidatesCache().put(couple, result); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/operations/DDiagramElementContainerSpecOperations.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/operations/DDiagramElementContainerSpecOperations.java index 550bed18cd..af972f7b63 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/operations/DDiagramElementContainerSpecOperations.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/operations/DDiagramElementContainerSpecOperations.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.business.internal.metamodel.operations; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; @@ -31,6 +32,7 @@ import org.eclipse.sirius.diagram.DNodeList; import org.eclipse.sirius.diagram.DNodeListElement; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.DragAndDropTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.DiagramElementMappingQuery; import org.eclipse.sirius.diagram.business.internal.metamodel.description.extensions.IContainerMappingExt; import org.eclipse.sirius.diagram.business.internal.metamodel.helper.ContainerMappingHelper; @@ -57,12 +59,6 @@ import com.google.common.collect.Sets; */ public final class DDiagramElementContainerSpecOperations { - /** - * Start of the error message when more than one drop description - * corresponds to a drop element. - */ - public static final String MORE_THAN_ONE_DROP_DESCRIPTION_ERROR_MSG = "There are more than one drop description that match the dropped element"; - /** Avoid instanciations */ private DDiagramElementContainerSpecOperations() { // empty. @@ -237,7 +233,9 @@ public final class DDiagramElementContainerSpecOperations { if (representedParent instanceof DSemanticDiagram) { representedParentSemantic = DSemanticDiagramHelper.getRootContent((DSemanticDiagram) representedParent); } - if (!ContainerMappingHelper.getNodesCandidates((IContainerMappingExt) container.getActualMapping(), representedParentSemantic, ((DSemanticDecorator) representedParent).getTarget(), container).contains(mySemanticElement)) { + if (!ContainerMappingHelper + .getNodesCandidates((IContainerMappingExt) container.getActualMapping(), representedParentSemantic, ((DSemanticDecorator) representedParent).getTarget(), container) + .contains(mySemanticElement)) { return false; } } @@ -328,16 +326,17 @@ public final class DDiagramElementContainerSpecOperations { } } - /* if a candidate define a target mapping which matches he has priority */ + /* + * if a candidate define a target mapping which matches he has priority + */ for (final ContainerDropDescription dropTool : candidates) { if (dropTool.getBestMapping((DragAndDropTarget) newViewContainer, droppedElement) != null) { if (bestDropDescription == null) { bestDropDescription = dropTool; } else { - SiriusPlugin.getDefault() - .warning( - DDiagramElementContainerSpecOperations.MORE_THAN_ONE_DROP_DESCRIPTION_ERROR_MSG + " : " + droppedElement + " (" + bestDropDescription.getName() + " and " - + dropTool + ").", new RuntimeException()); + SiriusPlugin.getDefault().warning( + MessageFormat.format(Messages.DDiagramElementContainerSpecOperations_tooMuchDropDescErrorMsg, droppedElement, bestDropDescription.getName(), dropTool), + new RuntimeException()); } } } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DEdgeSpec.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DEdgeSpec.java index 07e20f5530..eb23ad5bda 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DEdgeSpec.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DEdgeSpec.java @@ -17,6 +17,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.DiagramPackage; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.IEdgeMappingQuery; import org.eclipse.sirius.diagram.business.internal.metamodel.description.operations.EdgeMappingImportWrapper; import org.eclipse.sirius.diagram.business.internal.metamodel.operations.DDiagramElementSpecOperations; @@ -85,7 +86,7 @@ public class DEdgeSpec extends DEdgeImpl { @Override @Deprecated public boolean isRootFolding() { - throw new UnsupportedOperationException("Deprecated method."); + throw new UnsupportedOperationException(Messages.DEdgeSpec_deprecatedMsg); } /** diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DNodeListElementSpec.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DNodeListElementSpec.java index 5032aa9b2b..9ffb4ecb1f 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DNodeListElementSpec.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/metamodel/spec/DNodeListElementSpec.java @@ -84,6 +84,6 @@ public class DNodeListElementSpec extends DNodeListElementImpl { */ @Override public String toString() { - return "List element " + getName(); + return "List element " + getName(); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostDiagramData.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostDiagramData.java index adc54a88e7..a7469fe7b3 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostDiagramData.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostDiagramData.java @@ -24,6 +24,7 @@ public class LostDiagramData extends AbstractLostElementDataWithTarget implement /** * {@inheritDoc} */ + @Override public LostElementDataState addDiagramElementInCorrespondingParentContainer(final DDiagram diagram, final DDiagramElement diagramElement) { return diagram.getOwnedDiagramElements().add(diagramElement) ? LostElementDataState.CREATED : LostElementDataState.NOT_CREATED; } @@ -33,12 +34,13 @@ public class LostDiagramData extends AbstractLostElementDataWithTarget implement */ @Override public String toString() { - return super.toString() + " Diagram data"; + return super.toString() + " Diagram data"; //$NON-NLS-1$ } /** * {@inheritDoc} */ + @Override public boolean isSimilarTo(final DSemanticDecorator semanticDecorator) { // Works for null values too return getTarget() == semanticDecorator.getTarget(); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostEdgeData.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostEdgeData.java index 6a457e1ce2..ccec03f8e6 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostEdgeData.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostEdgeData.java @@ -115,15 +115,15 @@ public class LostEdgeData extends LostElementDataWithMapping { public String toString() { String result = super.toString() + SEPARATOR; if (sourceData == null) { - result += "No source data"; + result += "No source data"; //$NON-NLS-1$ } else { - result += "Source data: " + sourceData.toString(); + result += "Source data: " + sourceData.toString(); //$NON-NLS-1$ } if (targetData == null) { - result += "No target data"; + result += "No target data"; //$NON-NLS-1$ } else { - result += "Target data: " + targetData.toString(); + result += "Target data: " + targetData.toString(); //$NON-NLS-1$ } return result; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostElementDataWithMapping.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostElementDataWithMapping.java index 8d0b5f2b44..b807c920bf 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostElementDataWithMapping.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostElementDataWithMapping.java @@ -29,6 +29,7 @@ public class LostElementDataWithMapping extends AbstractLostElementDataWithTarge /** * {@inheritDoc} */ + @Override public void setMapping(final RepresentationElementMapping mapping) { this.mapping = mapping; } @@ -36,6 +37,7 @@ public class LostElementDataWithMapping extends AbstractLostElementDataWithTarge /** * {@inheritDoc} */ + @Override public RepresentationElementMapping getMapping() { return mapping; } @@ -82,12 +84,13 @@ public class LostElementDataWithMapping extends AbstractLostElementDataWithTarge */ @Override public String toString() { - return super.toString() + SEPARATOR + "Mapping name: " + mapping.getName(); + return super.toString() + SEPARATOR + "Mapping name: " + mapping.getName(); //$NON-NLS-1$ } /** * {@inheritDoc} */ + @Override public final boolean isSimilarTo(final DSemanticDecorator semanticDecorator) { boolean result; if (semanticDecorator instanceof DDiagramElement) { diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostNodeData.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostNodeData.java index ad82c69971..0154d51d50 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostNodeData.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/session/diagram/data/LostNodeData.java @@ -77,9 +77,9 @@ public class LostNodeData extends LostElementDataWithMapping implements ILostEle public String toString() { String result = super.toString() + SEPARATOR; if (parentData == null) { - result += "no parent data"; + result += "no parent data"; //$NON-NLS-1$ } else { - result += "Parent data: " + parentData.toString(); + result += "Parent data: " + parentData.toString(); //$NON-NLS-1$ } return result; } @@ -105,6 +105,7 @@ public class LostNodeData extends LostElementDataWithMapping implements ILostEle /** * {@inheritDoc} */ + @Override public LostElementDataState addDiagramElementInCorrespondingParentContainer(final DDiagram designerDiagram, final DDiagramElement createdElement) { LostElementDataState result = LostElementDataState.NOT_CREATED; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/ChangeLayerActivationCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/ChangeLayerActivationCommand.java index fbf0a3a685..0e4c3d52eb 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/ChangeLayerActivationCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/ChangeLayerActivationCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.tools.api.command; +import java.text.MessageFormat; + import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.emf.transaction.RecordingCommand; @@ -20,6 +22,7 @@ import org.eclipse.sirius.business.api.query.IdentifiedElementQuery; import org.eclipse.sirius.common.tools.api.listener.Notification; import org.eclipse.sirius.common.tools.api.listener.NotificationUtil; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.internal.metamodel.helper.LayerHelper; import org.eclipse.sirius.diagram.description.Layer; @@ -50,7 +53,8 @@ public final class ChangeLayerActivationCommand extends RecordingCommand { * activation changes */ public ChangeLayerActivationCommand(TransactionalEditingDomain domain, DDiagram dDiagram, Layer layer, IProgressMonitor monitor) { - super(domain, dDiagram.getActivatedLayers().contains(layer) ? "Hide" : "Show" + " \"" + new IdentifiedElementQuery(layer).getLabel() + "\" layer"); + super(domain, dDiagram.getActivatedLayers().contains(layer) ? Messages.ChangeLayerActivationCommand_hideLabel + : MessageFormat.format(Messages.ChangeLayerActivationCommand_showLabel, new IdentifiedElementQuery(layer).getLabel())); this.dDiagram = dDiagram; this.layer = layer; this.monitor = monitor; @@ -62,7 +66,7 @@ public final class ChangeLayerActivationCommand extends RecordingCommand { @Override protected void doExecute() { try { - monitor.beginTask("Apply layer modifications...", 3); + monitor.beginTask(Messages.ChangeLayerActivationCommand_executeMsg, 3); boolean launchRefresh = !LayerHelper.containsOnlyTools(layer) || layer.getCustomization() != null; if (!launchRefresh) { NotificationUtil.sendNotification(dDiagram, Notification.Kind.START, Notification.VISIBILITY); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElement.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElement.java index b4b1f2866a..86da145865 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElement.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -16,6 +16,7 @@ import java.util.Set; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.helper.graphicalfilters.HideFilterHelper; import org.eclipse.sirius.diagram.business.api.query.DDiagramElementQuery; @@ -31,14 +32,14 @@ public class HideDDiagramElement extends RecordingCommand { * * @since 0.9.0 */ - public static final String HIDE_ELEMENT_LABEL = "Hide element"; + public static final String HIDE_ELEMENT_LABEL = Messages.HideDDiagramElement_hideElementLabel; /** * Label for hide many elements. * * @since 0.9.0 */ - public static final String HIDE_ELEMENTS_LABEL = "Hide elements"; + public static final String HIDE_ELEMENTS_LABEL = Messages.HideDDiagramElement_hideElementsLabel; /** The objects to hide. */ private final Set<?> objectsToHide; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElementLabel.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElementLabel.java index 9d2dab3d3c..9015e8da38 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElementLabel.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/HideDDiagramElementLabel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -16,6 +16,7 @@ import java.util.Set; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.helper.graphicalfilters.HideFilterHelper; import org.eclipse.sirius.diagram.business.api.query.DDiagramElementQuery; @@ -31,14 +32,14 @@ public class HideDDiagramElementLabel extends RecordingCommand { * * @since 0.9.0 */ - public static final String HIDE_LABEL = "Hide label"; + public static final String HIDE_LABEL = Messages.HideDDiagramElementLabel_hideLabel; /** * Label for hide many labels. * * @since 0.9.0 */ - public static final String HIDE_LABELS = "Hide labels"; + public static final String HIDE_LABELS = Messages.HideDDiagramElementLabel_hideLabels; /** The objects to hide. */ private final Set<?> objectsToHide; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RefreshSiriusElement.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RefreshSiriusElement.java index d7d61454ca..b670bec87a 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RefreshSiriusElement.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RefreshSiriusElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -21,6 +21,7 @@ import org.eclipse.sirius.common.tools.api.listener.Notification; import org.eclipse.sirius.common.tools.api.listener.NotificationUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; import org.eclipse.sirius.diagram.business.api.helper.display.DisplayServiceManager; @@ -53,7 +54,7 @@ public class RefreshSiriusElement extends RecordingCommand { * the object to refresh. */ public RefreshSiriusElement(final TransactionalEditingDomain domain, final DRefreshable objectToRefresh) { - super(domain, "Refresh representation"); + super(domain, Messages.RefreshSiriusElement_refreshRepresentationMsg); this.uniqueRefreshable = objectToRefresh; } @@ -68,7 +69,7 @@ public class RefreshSiriusElement extends RecordingCommand { * the filters. */ public RefreshSiriusElement(final TransactionalEditingDomain domain, final Collection<?> objectsToRefresh, final Collection<RefreshFilter> filters) { - super(domain, "Refresh representation"); + super(domain, Messages.RefreshSiriusElement_refreshRepresentationMsg); this.refreshablesList = objectsToRefresh; this.filters = filters; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealAllElementsCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealAllElementsCommand.java index 7bf96bb30b..de31f450d9 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealAllElementsCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealAllElementsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES. * 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 @@ -18,6 +18,7 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.helper.graphicalfilters.HideFilterHelper; import com.google.common.collect.Lists; @@ -34,7 +35,7 @@ public class RevealAllElementsCommand extends RecordingCommand { * * @since 0.9.0 */ - public static final String REVEAL_ALL_ELEMENTS_LABEL = "Reveal all elements"; + public static final String REVEAL_ALL_ELEMENTS_LABEL = Messages.RevealAllElementsCommand_revealAllElementsLabel; /** The viewpoint. */ private final DDiagram viewpoint; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElements.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElements.java index 81c9a9943b..c31cb4b9fd 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElements.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElements.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES. * 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 @@ -15,6 +15,7 @@ import java.util.Set; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.helper.graphicalfilters.HideFilterHelper; /** @@ -28,12 +29,12 @@ public class RevealDDiagramElements extends RecordingCommand { /** * Label for hide element. */ - public static final String REVEAL_ELEMENTS_LABEL = "Reveal elements"; + public static final String REVEAL_ELEMENTS_LABEL = Messages.RevealDDiagramElements_revealElementsLabel; /** * Label for hide element. */ - public static final String REVEAL_ELEMENT_LABEL = "Reveal element"; + public static final String REVEAL_ELEMENT_LABEL = Messages.RevealDDiagramElements_revealElementLabel; /** The viewpoint elements to reveal. */ private final Set<DDiagramElement> diagramElements; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElementsLabel.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElementsLabel.java index dba4d6ac13..3d206cfc86 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElementsLabel.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/command/view/RevealDDiagramElementsLabel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -15,6 +15,7 @@ import java.util.Set; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.helper.graphicalfilters.HideFilterHelper; /** @@ -28,12 +29,12 @@ public class RevealDDiagramElementsLabel extends RecordingCommand { /** * Label for hide many labels. */ - public static final String REVEAL_LABELS = "Reveal labels"; + public static final String REVEAL_LABELS = Messages.RevealDDiagramElementsLabel_revealLabels; /** * Label for hide one label. */ - public static final String REVEAL_LABEL = "Reveal label"; + public static final String REVEAL_LABEL = Messages.RevealDDiagramElementsLabel_revealLabel; /** The viewpoint elements for which we want to reveal th label. */ private final Set<DDiagramElement> diagramElements; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/validation/constraint/AbstractDDiagramConstraint.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/validation/constraint/AbstractDDiagramConstraint.java index cd984aa751..3f60761d6a 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/validation/constraint/AbstractDDiagramConstraint.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/api/validation/constraint/AbstractDDiagramConstraint.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. * 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 @@ -28,6 +28,7 @@ import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.DiagramDescription; import org.eclipse.sirius.diagram.description.DiagramElementMapping; import org.eclipse.sirius.tools.api.validation.constraint.RuleWrappingStatus; @@ -56,7 +57,7 @@ public abstract class AbstractDDiagramConstraint extends AbstractModelConstraint if (typeEvenement == EMFEventType.NULL) { final Collection<ValidationRule> failures = getFailingRules(objectToValidate); if (failures.size() > 0) { - final MultiStatus parentStatus = new MultiStatus(SiriusPlugin.ID, getHighestStatusCode(failures), "Validation issues", null); + final MultiStatus parentStatus = new MultiStatus(SiriusPlugin.ID, getHighestStatusCode(failures), Messages.AbstractDDiagramConstraint_validationErrorMessage, null); for (ValidationRule failedRule : failures) { EObject target = objectToValidate; @@ -205,7 +206,8 @@ public abstract class AbstractDDiagramConstraint extends AbstractModelConstraint // be check twice (one for the edge.getTarget() that // return the source.getTarget() and one for the source // Node sourceNode.getTarget()) - if (((DEdge) objectToValidate).getSourceNode() instanceof DSemanticDecorator && !semanticElement.equals(((DSemanticDecorator) ((DEdge) objectToValidate).getSourceNode()).getTarget())) { + if (((DEdge) objectToValidate).getSourceNode() instanceof DSemanticDecorator + && !semanticElement.equals(((DSemanticDecorator) ((DEdge) objectToValidate).getSourceNode()).getTarget())) { result = true; } } else { diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/UndoRedoCapableEMFCommandFactory.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/UndoRedoCapableEMFCommandFactory.java index de12941e4d..c536951c72 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/UndoRedoCapableEMFCommandFactory.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/UndoRedoCapableEMFCommandFactory.java @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.DNode; import org.eclipse.sirius.diagram.DragAndDropTarget; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.DDiagramElementQuery; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.description.DiagramDescription; @@ -330,7 +331,7 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp command.getTasks().add(new AbstractCommandTask() { @Override public String getLabel() { - return "Add diagram variable"; + return Messages.UndoRedoCapableEMFCommandFactory_addDiagramVariableLabel; } @Override @@ -418,7 +419,7 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp */ @Override public Command buildDoExecuteDetailsOperation(final DSemanticDecorator target, final RepresentationCreationDescription desc, final String newRepresentationName) { - final DCommand cmd = new SiriusCommand(domain, "Create new representation"); + final DCommand cmd = new SiriusCommand(domain, Messages.UndoRedoCapableEMFCommandFactory_createRepresentationLabel); final Map<AbstractVariable, Object> variables = new HashMap<AbstractVariable, Object>(); variables.put(desc.getContainerViewVariable(), target); final Map<AbstractVariable, String> stringVariables = new HashMap<AbstractVariable, String>(); @@ -607,7 +608,7 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp */ @Override public DCommand buildCreateDiagramFromDescription(final DiagramDescription description, final EObject semanticElement, IProgressMonitor monitor) { - final DCommand command = new SiriusCommand(domain, "Create new diagram") { + final DCommand command = new SiriusCommand(domain, Messages.UndoRedoCapableEMFCommandFactory_createNewDiagramLabel) { /** * creation of a diagram must not be undoable ! {@inheritDoc} */ @@ -637,7 +638,7 @@ public class UndoRedoCapableEMFCommandFactory extends AbstractCommandFactory imp @Override public Command buildQuickFixOperation(final ValidationFix fix, final EObject fixTarget, final DDiagram diagram) { if (fix.getInitialOperation() != null && fix.getInitialOperation().getFirstModelOperations() != null) { - final DCommand result = new SiriusCommand(domain, "Quick fix"); + final DCommand result = new SiriusCommand(domain, Messages.UndoRedoCapableEMFCommandFactory_quickFixLabel); result.getTasks().add(commandTaskHelper.buildTaskFromModelOperation(diagram, fixTarget, fix.getInitialOperation().getFirstModelOperations())); return result; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java index 4eb42f4300..8ced083c64 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/AbstractDiagramCommandBuilder.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -20,6 +20,7 @@ import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DSemanticDiagram; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaClassNotFoundException; import org.eclipse.sirius.ext.base.Option; @@ -80,10 +81,12 @@ public abstract class AbstractDiagramCommandBuilder extends org.eclipse.sirius.t final Session session = SessionManager.INSTANCE.getSession(semanticElement); if (semanticElement != null && session != null) { result.getTasks().add(new AbstractCommandTask() { + @Override public String getLabel() { - return "Set RefreshEditorsPrecommitListener options"; + return Messages.AbstractDiagramCommandBuilder_refreshTaskLabel; } + @Override public void execute() throws MetaClassNotFoundException, FeatureNotFoundException { if (abstractToolDescription.isForceRefresh()) { // Set the RefreshEditorsListener in forceRefresh @@ -133,10 +136,12 @@ public abstract class AbstractDiagramCommandBuilder extends org.eclipse.sirius.t if (diag.some()) { command.getTasks().add(new AbstractCommandTask() { + @Override public String getLabel() { - return "Add diagram variable"; + return Messages.AbstractDiagramCommandBuilder_diagramVariableTaskLabel; } + @Override public void execute() { interpreter.setVariable(IInterpreterSiriusVariables.DIAGRAM, diag.get()); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DeletionCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DeletionCommandBuilder.java index ab87d178ea..b57490ea8e 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DeletionCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DeletionCommandBuilder.java @@ -36,6 +36,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.business.api.query.IEdgeMappingQuery; import org.eclipse.sirius.diagram.description.DiagramElementMapping; @@ -62,18 +63,6 @@ import com.google.common.collect.Sets; */ public class DeletionCommandBuilder extends AbstractDiagramCommandBuilder { - /** The default label for the enclosing command. */ - protected static final String DELETE = "Delete"; - - /** The label for delete from diagram. */ - protected static final String DELETE_FROM_DIAGRAM_LABEL = "Delete from diagram"; - - /** The label for delete from model without tool. */ - protected static final String DELETE_FROM_MODEL = "Delete from model "; - - /** The label for delete diagram. */ - protected static final String DELETE_DIAGRAM_LABEL = "Delete diagram"; - /** * The diagram to delete. */ @@ -356,14 +345,14 @@ public class DeletionCommandBuilder extends AbstractDiagramCommandBuilder { @Override protected String getEnclosingCommandLabel() { - String commandLabel = DELETE; + String commandLabel = Messages.DeletionCommandBuilder_deleteLabel; if (diagram != null) { - commandLabel = DELETE_DIAGRAM_LABEL; + commandLabel = Messages.DeletionCommandBuilder_deleteDiagramLabel; } else if (diagramElement != null) { if (deleteFromDiagram) { - commandLabel = DELETE_FROM_DIAGRAM_LABEL; + commandLabel = Messages.DeletionCommandBuilder_deleteFromDiagramLabel; } else if (tool == null) { - commandLabel = DELETE_FROM_MODEL; + commandLabel = Messages.DeletionCommandBuilder_deleteFromModelLabel; } else { commandLabel = new IdentifiedElementQuery(tool).getLabel(); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java index b15cf0c916..2a854e93db 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/DirectEditCommandBuilder.java @@ -17,6 +17,7 @@ import org.eclipse.sirius.business.api.helper.task.label.InitInterpreterFromPars import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.description.tool.DirectEditLabel; import org.eclipse.sirius.ext.base.Option; @@ -27,8 +28,6 @@ import org.eclipse.sirius.viewpoint.DRepresentationElement; public class DirectEditCommandBuilder extends AbstractDiagramCommandBuilder { - private static final String EDIT_LABEL = "Edit label"; - private DRepresentationElement repElement; private DirectEditLabel directEditTool; @@ -107,7 +106,7 @@ public class DirectEditCommandBuilder extends AbstractDiagramCommandBuilder { @Override protected String getEnclosingCommandLabel() { - return EDIT_LABEL; + return Messages.DirectEditCommandBuilder_editLabel; } @Override diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/PasteCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/PasteCommandBuilder.java index a94d5de6f8..676156c4d9 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/PasteCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/PasteCommandBuilder.java @@ -25,6 +25,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreterSiriusVariabl import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; @@ -190,7 +191,7 @@ public class PasteCommandBuilder extends AbstractDiagramCommandBuilder { */ @Override protected String getEnclosingCommandLabel() { - return tool != null ? new IdentifiedElementQuery(tool).getLabel() : "Paste"; + return tool != null ? new IdentifiedElementQuery(tool).getLabel() : Messages.PasteCommandBuilder_pasteLabel; } /** diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java index bd6b15d72f..b08dc06b24 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/builders/ReconnectionCommandBuilder.java @@ -29,6 +29,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.description.DiagramElementMapping; import org.eclipse.sirius.diagram.description.EdgeMapping; @@ -168,7 +169,7 @@ public class ReconnectionCommandBuilder extends AbstractDiagramCommandBuilder { if (edgeMapping.getImportedMapping() instanceof EdgeMappingImport) { return getImportedMapping((EdgeMappingImport) edgeMapping.getImportedMapping()); } - Assert.isTrue(edgeMapping.getImportedMapping() instanceof EdgeMapping, "This should not happen as IEdgeMapping is only extended by EdgeMappingImport and EdgeMapping"); + Assert.isTrue(edgeMapping.getImportedMapping() instanceof EdgeMapping, Messages.ReconnectionCommandBuilder_mappingImportErrorMsg); return (EdgeMapping) edgeMapping.getImportedMapping(); } @@ -242,7 +243,7 @@ public class ReconnectionCommandBuilder extends AbstractDiagramCommandBuilder { return new AbstractCommandTask() { @Override public String getLabel() { - return "Initializing Variables"; + return Messages.ReconnectionCommandBuilder_initVariablesMsg; } @Override diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/ReconnectSourceNodeCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/ReconnectSourceNodeCommand.java index 8430cac456..793e4750d6 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/ReconnectSourceNodeCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/ReconnectSourceNodeCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -15,6 +15,7 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.EdgeTarget; +import org.eclipse.sirius.diagram.Messages; /** * Specific command to change the source node and the semantic target of a @@ -43,7 +44,7 @@ public final class ReconnectSourceNodeCommand extends RecordingCommand { * the DEdge to update. */ public ReconnectSourceNodeCommand(TransactionalEditingDomain domain, DEdge edge, EdgeTarget reconnectionTarget, EObject semanticTarget) { - super(domain, "Reconnect source node"); + super(domain, Messages.ReconnectSourceNodeCommand_commandLabel); this.edge = edge; this.reconnectionTarget = reconnectionTarget; this.semanticTarget = semanticTarget; diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/SetEdgeActualMappingCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/SetEdgeActualMappingCommand.java index 15e06fe0a2..1ea9714986 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/SetEdgeActualMappingCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/command/reconnect/SetEdgeActualMappingCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. * 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.tools.internal.command.reconnect; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DEdge; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.EdgeMapping; /** @@ -37,7 +38,7 @@ public final class SetEdgeActualMappingCommand extends RecordingCommand { * the DEdge to update. */ public SetEdgeActualMappingCommand(TransactionalEditingDomain domain, DEdge edge, EdgeMapping newEdgeMapping) { - super(domain, "Set edge actual mapping"); + super(domain, Messages.SetEdgeActualMappingCommand_commandLabel); this.edge = edge; this.newEdgeMapping = newEdgeMapping; } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/PinElementsCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/PinElementsCommand.java index 81b6d89849..3ec4901ef1 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/PinElementsCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/PinElementsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -15,6 +15,7 @@ import java.util.Collection; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.tools.api.layout.PinHelper; import com.google.common.collect.Lists; @@ -38,7 +39,7 @@ public class PinElementsCommand extends RecordingCommand { * the elements which must be marked as pinned. */ public PinElementsCommand(final Collection<? extends DDiagramElement> targetElements) { - super(TransactionUtil.getEditingDomain(targetElements.iterator().next()), "Pin elements"); + super(TransactionUtil.getEditingDomain(targetElements.iterator().next()), Messages.PinElementsCommand_commandLabel); this.targetElements = Lists.newArrayList(targetElements); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/UnpinElementsCommand.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/UnpinElementsCommand.java index bd0365de07..b70fbd983b 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/UnpinElementsCommand.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/commands/UnpinElementsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. * 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 @@ -15,6 +15,7 @@ import java.util.Collection; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.util.TransactionUtil; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.tools.api.layout.PinHelper; import com.google.common.collect.Lists; @@ -38,7 +39,7 @@ public class UnpinElementsCommand extends RecordingCommand { * the elements which must be marked as un-pinned. */ public UnpinElementsCommand(final Collection<? extends DDiagramElement> targetElements) { - super(TransactionUtil.getEditingDomain(targetElements.iterator().next()), "Unpin elements"); + super(TransactionUtil.getEditingDomain(targetElements.iterator().next()), Messages.UnpinElementsCommand_commandLabel); this.targetElements = Lists.newArrayList(targetElements); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/RepresentationExtensionDescriptionRegexConstraint.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/RepresentationExtensionDescriptionRegexConstraint.java index d8fe822d96..0f4327dbd2 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/RepresentationExtensionDescriptionRegexConstraint.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/RepresentationExtensionDescriptionRegexConstraint.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES. * 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 @@ -18,6 +18,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.AbstractModelConstraint; import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.AdditionalLayer; import org.eclipse.sirius.diagram.description.DiagramExtensionDescription; import org.eclipse.sirius.viewpoint.description.Customization; @@ -39,7 +40,7 @@ public class RepresentationExtensionDescriptionRegexConstraint extends AbstractM * Error message for this constraint. The first argument is the name of the * representation extension description. */ - private static final String ERROR_MESSAGE = "The representation extension description \"{0}\" uses a regular expression for viewpoint URI or for representation name, but it does not contain only style customizations."; + private static final String ERROR_MESSAGE = Messages.RepresentationExtensionDescriptionRegexConstraint_errorMsg; /** * Pattern used to detect if a String is a Regex. For that, we watching the diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/ValidStyleConstraint.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/ValidStyleConstraint.java index 0121c7af92..964545ae3c 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/ValidStyleConstraint.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/tools/internal/validation/description/constraints/ValidStyleConstraint.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES. * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.tools.internal.validation.description.constraints; +import java.text.MessageFormat; import java.util.List; import org.eclipse.core.runtime.IStatus; @@ -18,6 +19,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.AbstractModelConstraint; import org.eclipse.emf.validation.IValidationContext; import org.eclipse.emf.validation.model.ConstraintStatus; +import org.eclipse.sirius.diagram.Messages; import org.eclipse.sirius.diagram.description.ConditionalContainerStyleDescription; import org.eclipse.sirius.diagram.description.ConditionalEdgeStyleDescription; import org.eclipse.sirius.diagram.description.ConditionalNodeStyleDescription; @@ -78,10 +80,6 @@ public class ValidStyleConstraint extends AbstractModelConstraint { public static final ElementMappingSwitch INSTANCE = new ElementMappingSwitch(); - private static final String MESSAGE_CONDITION = "Conditional style "; - - private static final String OF = " of "; - /** * Switch object is valid. * @@ -158,21 +156,24 @@ public class ValidStyleConstraint extends AbstractModelConstraint { public IStatus caseConditionalEdgeStyleDescription(ConditionalEdgeStyleDescription object, IValidationContext ctx) { if (object.getStyle() == null) { - return ctx.createFailureStatus(new Object[] { MESSAGE_CONDITION + object.getPredicateExpression() + OF + ((EdgeMapping) object.eContainer()).getName() }); + return ctx.createFailureStatus( + new Object[] { MessageFormat.format(Messages.ValidStyleConstraint_validationErrorMsg, object.getPredicateExpression(), ((EdgeMapping) object.eContainer()).getName()) }); } return null; } private IStatus caseConditionalNodeStyleDescription(ConditionalNodeStyleDescription object, IValidationContext ctx) { if (object.getStyle() == null) { - return ctx.createFailureStatus(new Object[] { MESSAGE_CONDITION + object.getPredicateExpression() + OF + ((NodeMapping) object.eContainer()).getName() }); + return ctx.createFailureStatus( + new Object[] { MessageFormat.format(Messages.ValidStyleConstraint_validationErrorMsg, object.getPredicateExpression(), ((NodeMapping) object.eContainer()).getName()) }); } return null; } private IStatus caseConditionalContainerStyleDescription(ConditionalContainerStyleDescription object, IValidationContext ctx) { if (object.getStyle() == null) { - return ctx.createFailureStatus(new Object[] { MESSAGE_CONDITION + object.getPredicateExpression() + OF + ((ContainerMapping) object.eContainer()).getName() }); + return ctx.createFailureStatus( + new Object[] { MessageFormat.format(Messages.ValidStyleConstraint_validationErrorMsg, object.getPredicateExpression(), ((ContainerMapping) object.eContainer()).getName()) }); } return null; } diff --git a/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/Messages.java b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/Messages.java new file mode 100644 index 0000000000..15d0d24dad --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram/src/org/eclipse/sirius/diagram/Messages.java @@ -0,0 +1,276 @@ +/******************************************************************************* + * Copyright (c) 2015 Obeo. + * 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: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.diagram; + +import org.eclipse.sirius.ext.base.I18N; +import org.eclipse.sirius.ext.base.I18N.TranslatableMessage; + +/** + * Helper class to obtains translated strings. + * + * @author Florian Barbin + * + */ +public final class Messages { + static { + I18N.initializeMessages(Messages.class, DiagramPlugin.INSTANCE); + } + + // CHECKSTYLE:OFF + + @TranslatableMessage + public static String AbstractDDiagramConstraint_validationErrorMessage; + + @TranslatableMessage + public static String AbstractDiagramCommandBuilder_diagramVariableTaskLabel; + + @TranslatableMessage + public static String AbstractDiagramCommandBuilder_refreshTaskLabel; + + @TranslatableMessage + public static String AbstractNodeMappingQuery_evaluationErrorMsg; + + @TranslatableMessage + public static String ChangeLayerActivationCommand_executeMsg; + + @TranslatableMessage + public static String ChangeLayerActivationCommand_hideLabel; + + @TranslatableMessage + public static String ChangeLayerActivationCommand_showLabel; + + @TranslatableMessage + public static String ContainerDropDescriptionSpec_unknownTgtMsg; + + @TranslatableMessage + public static String ContainerMappingHelper_nodeCreationErrorMsg; + + @TranslatableMessage + public static String CreateContainerTask_label; + + @TranslatableMessage + public static String CreateDEdgeTask_label; + + @TranslatableMessage + public static String CreateDNodeTask_label; + + @TranslatableMessage + public static String CreateViewTask_label; + + @TranslatableMessage + public static String DDiagramElementContainerSpecOperations_tooMuchDropDescErrorMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_borderNodeRefreshMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_deleteNodesMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_initDiagramMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_nodeCreationMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_nodeRefreshMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_refreshContainerChildsMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_refreshContainerMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_refreshEdgeMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_refreshMappingsMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_refreshNodeMsg; + + @TranslatableMessage + public static String DDiagramSynchronizer_refreshNodesMsg; + + @TranslatableMessage + public static String DEdgeSpec_deprecatedMsg; + + @TranslatableMessage + public static String DeletionCommandBuilder_deleteDiagramLabel; + + @TranslatableMessage + public static String DeletionCommandBuilder_deleteFromDiagramLabel; + + @TranslatableMessage + public static String DeletionCommandBuilder_deleteFromModelLabel; + + @TranslatableMessage + public static String DeletionCommandBuilder_deleteLabel; + + @TranslatableMessage + public static String DiagramDialectServices_createDiagramMsg; + + @TranslatableMessage + public static String DiagramDialectServices_initializeDiagramMsg; + + @TranslatableMessage + public static String DiagramDialectServices_refreshDiagramMsg; + + @TranslatableMessage + public static String DiagramDialectServices_refreshImactedElementsMsg; + + @TranslatableMessage + public static String DiagramElementMappingHelper_edgeTargetMsg; + + @TranslatableMessage + public static String DiagramElementMappingQuery_diagramRootExpressionEvaluationErrorMsg; + + @TranslatableMessage + public static String DiagramElementMappingQuery_mappingCandidateExpressionEvaluationErrorMsg; + + @TranslatableMessage + public static String DiagramIdentifier_parametersErrorMsg; + + @TranslatableMessage + public static String DiagramMappingsManagerRegistryImpl_diagramParamErrorMsg; + + @TranslatableMessage + public static String DiagramTypeDescriptorRegistry_loadingErrorMsg; + + @TranslatableMessage + public static String DirectEditCommandBuilder_editLabel; + + @TranslatableMessage + public static String DnDTasksOperations_modelErrorMsg; + + @TranslatableMessage + public static String DropinForContainerTaskCommand_taskLabel; + + @TranslatableMessage + public static String DropinForNodeTaskCommand_taskLabel; + + @TranslatableMessage + public static String EdgeFilter_errorMsg; + + @TranslatableMessage + public static String EdgeFilter_semanticIsNullErrorMsg; + + @TranslatableMessage + public static String EdgeIdentifier_parametersErrorMsg; + + @TranslatableMessage + public static String EdgeMappingQuery_preconditionEvaluationErrorMsg; + + @TranslatableMessage + public static String EdgeMappingQuery_sourceFinderEvaluationErrorMsg; + + @TranslatableMessage + public static String EdgeMappingQuery_targetFinderEvaluationErrorMsg; + + @TranslatableMessage + public static String GetConditionalStyle_errorMsg; + + @TranslatableMessage + public static String GetStyleDescription_errorMsg; + + @TranslatableMessage + public static String GlobalMappingsTable_mappingErrorMsg; + + @TranslatableMessage + public static String HideDDiagramElement_hideElementLabel; + + @TranslatableMessage + public static String HideDDiagramElement_hideElementsLabel; + + @TranslatableMessage + public static String HideDDiagramElementLabel_hideLabel; + + @TranslatableMessage + public static String HideDDiagramElementLabel_hideLabels; + + @TranslatableMessage + public static String NodeFilter_notNullErrorMsg; + + @TranslatableMessage + public static String NodeIdentifier_parametersErrorMsg; + + @TranslatableMessage + public static String NodeMappingHelper_methodInvocationErrorMsg; + + @TranslatableMessage + public static String NodeMappingHelper_nodeCreationErrorMsg; + + @TranslatableMessage + public static String PasteCommandBuilder_pasteLabel; + + @TranslatableMessage + public static String PinElementsCommand_commandLabel; + + @TranslatableMessage + public static String ReconnectionCommandBuilder_initVariablesMsg; + + @TranslatableMessage + public static String ReconnectionCommandBuilder_mappingImportErrorMsg; + + @TranslatableMessage + public static String ReconnectSourceNodeCommand_commandLabel; + + @TranslatableMessage + public static String RefreshExtensionProviderDescriptor_instantiatingErrorMsg; + + @TranslatableMessage + public static String RefreshSiriusElement_refreshRepresentationMsg; + + @TranslatableMessage + public static String RepresentationExtensionDescriptionRegexConstraint_errorMsg; + + @TranslatableMessage + public static String RevealAllElementsCommand_revealAllElementsLabel; + + @TranslatableMessage + public static String RevealDDiagramElements_revealElementLabel; + + @TranslatableMessage + public static String RevealDDiagramElements_revealElementsLabel; + + @TranslatableMessage + public static String RevealDDiagramElementsLabel_revealLabel; + + @TranslatableMessage + public static String RevealDDiagramElementsLabel_revealLabels; + + @TranslatableMessage + public static String SetEdgeActualMappingCommand_commandLabel; + + @TranslatableMessage + public static String UndoRedoCapableEMFCommandFactory_addDiagramVariableLabel; + + @TranslatableMessage + public static String UndoRedoCapableEMFCommandFactory_createNewDiagramLabel; + + @TranslatableMessage + public static String UndoRedoCapableEMFCommandFactory_createRepresentationLabel; + + @TranslatableMessage + public static String UndoRedoCapableEMFCommandFactory_quickFixLabel; + + @TranslatableMessage + public static String UnpinElementsCommand_commandLabel; + + @TranslatableMessage + public static String ValidStyleConstraint_validationErrorMsg; + + // CHECKSTYLE:ON + private Messages() { + // Prevents instanciation. + } +} diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html index 3697c8a944..cfc8053509 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html @@ -299,6 +299,9 @@ <code>org.eclipse.sirius.diagram.sequence.ui</code> </li> <li> + <code>org.eclipse.sirius.diagram</code> + </li> + <li> <code>org.eclipse.sirius.eef.adapters</code> </li> <li> @@ -327,7 +330,7 @@ <code>org.eclipse.sirius.common.tools.api.interpreter.IInterpreterWithDiagnostic</code> has been added. It allows an interpreter to evaluate an expression and return not only the result of the evaluation but also a diagnostic. </li> <li><span class="label label-success">Added</span> The new class - <code>org.eclipse.sirius.common.tools.api.contentassist.ContentProposalWithReplacement</code> has been added. It allows interpreters to provide proposals for the code completion which can replace an existing part of the expression used. This behavior can be used if the user has started to type a value that would be returned by the code completion. For example, if the user types «aql:self.na» and if he selects the content proposal «name», it can replace the existing part of the expression «na» to write «aql:self.name» instead of just appending «name» to create «aql:self.naname». + <code>org.eclipse.sirius.common.tools.api.contentassist.ContentProposalWithReplacement</code> has been added. It allows interpreters to provide proposals for the code completion which can replace an existing part of the expression used. This behavior can be used if the user has started to type a value that would be returned by the code completion. For example, if the user types “aql:self.na” and if he selects the content proposal “name”, it can replace the existing part of the expression “na” to write “aql:self.name” instead of just appending “name” to create “aql:self.naname”. </li> <li><span class="label label-success">Added</span> The new class <code>org.eclipse.sirius.common.tools.api.contentassist.ContentProposalBuilder</code> used to build the content proposals with their various parameters more easily. @@ -1895,4 +1898,4 @@ </li> </ul> </body> -</html> +</html>
\ No newline at end of file diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile index 0e8e2306cb..7d2663a062 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile @@ -71,6 +71,7 @@ Additional non-breaking changes: ** @org.eclipse.sirius.common.ui@ ** @org.eclipse.sirius.diagram.sequence@ ** @org.eclipse.sirius.diagram.sequence.ui@ +** @org.eclipse.sirius.diagram@ ** @org.eclipse.sirius.eef.adapters@ ** @org.eclipse.sirius.interpreter@ ** @org.eclipse.sirius.table@ |
