diff options
| author | Florian Barbin | 2015-09-09 14:03:41 +0000 |
|---|---|---|
| committer | Florian Barbin | 2015-09-21 09:36:00 +0000 |
| commit | dc0fdee5030fee9aedcd02c6d529171a259d349e (patch) | |
| tree | bb2490339fa4ce39957df5f45a6b8135a7a8b8a5 | |
| parent | e6d9d4588c3cad674897f06837f1a177976559f7 (diff) | |
| download | org.eclipse.sirius-dc0fdee5030fee9aedcd02c6d529171a259d349e.tar.gz org.eclipse.sirius-dc0fdee5030fee9aedcd02c6d529171a259d349e.tar.xz org.eclipse.sirius-dc0fdee5030fee9aedcd02c6d529171a259d349e.zip | |
[472057] Externalize translatable strings from org.eclipse.sirius
Bug: 472057
Change-Id: I678c36f5430487175c0419d319191c7872fb4219
Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
117 files changed, 2012 insertions, 558 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html index 1886f45ed7..df05351327 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html @@ -85,7 +85,7 @@ <a href="./user/sequences/Sequence%20Diagrams.html#introduction">documentation</a> for details. Previously, the user has to explicitely disable the snap features. </li> <li><span class="label label-info">Modified</span> The Link with Editor behavior has changed. The link with editor was previously unidirectional from the Common Navigator (Model Explorer view or Project view) toward the active representation. By now, when selecting one or several elements in the representation, the corresponding semantic elements are selected in the Common Navigator.</li> - <li><span class="label label-info">Modified</span> The «Arrange Linked Bordered Nodes» tabbar action has been renamed to «Arrange Linked Border Nodes» as it is border nodes which are layouted and not bordered nodes.</li> + <li><span class="label label-info">Modified</span> The “Arrange Linked Bordered Nodes” tabbar action has been renamed to “Arrange Linked Border Nodes” as it is border nodes which are layouted and not bordered nodes.</li> </ul> <h3 id="SpecifierVisibleChanges">Specifier-Visible Changes</h3> <ul> @@ -125,7 +125,7 @@ </p> <h3 id="DeveloperVisibleChanges">Developer-Visible Changes</h3> <h4 id="Partialsupportforinternationalization">Partial support for internationalization</h4> - <p>Sirius 3.1 introduces partial support for internationalization: all literal strings from the runtime part of Sirius are now externalized and can be localized by third parties by providing the appropriate «language packs» as OSGi fragments. Note that this does not concern the VSM editor’s UI, the VSMs themselves, or the parts of the UI inherited from Eclipse/EMF/GEF/GMF and other libraries and frameworks used by Sirius.</p> + <p>Sirius 3.1 introduces partial support for internationalization: all literal strings from the runtime part of Sirius are now externalized and can be localized by third parties by providing the appropriate “language packs” as OSGi fragments. Note that this does not concern the VSM editor’s UI, the VSMs themselves, or the parts of the UI inherited from Eclipse/EMF/GEF/GMF and other libraries and frameworks used by Sirius.</p> <p>Some API changes were required to enable this. While technically breaking changes if interpreting strictly the OSGi versioning rules, the major version number of the impacted bundles was not incremented as the changes only concern classes that should not impact the vast majority of users. Most breaking changes concern the plug-in/activator classes from each bundle. They are:</p> <ul> <li><span class="label label-success">Added</span> @@ -266,6 +266,9 @@ <code>Messages</code> classes, added to all concerned bundles (always in the same package as their plug-in/activator class). The concerned bundles are: <ul> <li> + <code>org.eclipse.sirius</code> + </li> + <li> <code>org.eclipse.sirius.ext.base</code> </li> <li> @@ -339,7 +342,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. @@ -574,7 +577,7 @@ </li> <li><span class="label label-success">Added</span> On diagrams, it is now possible to set a custom background image on list containers.</li> <li><span class="label label-info">Modified</span> In the - <em>Viewpoint Selection</em> dialog and wizard page, the «plug-in» decorator for viewpoints loaded from plug-ins is removed, and a «Folder» decorator for viewpoints loaded from the current workspace has been added. This makes the icons more visible in the most common where viewpoints come from installed plug-ins. + <em>Viewpoint Selection</em> dialog and wizard page, the “plug-in” decorator for viewpoints loaded from plug-ins is removed, and a “Folder” decorator for viewpoints loaded from the current workspace has been added. This makes the icons more visible in the most common where viewpoints come from installed plug-ins. </li> </ul> <h3 id="SpecifierVisibleChanges2">Specifier-Visible Changes</h3> @@ -597,12 +600,12 @@ <li><span class="label label-success">Added</span> Compressed SVG images ( <code>*.svgz</code>) are now supported everywhere normal SVG images were supported. </li> - <li><span class="label label-success">Added</span> When developing a modeler in «live mode», with the VSM in the same workspace as the sample session(s) which use it, VSM expressions which use + <li><span class="label label-success">Added</span> When developing a modeler in “live mode”, with the VSM in the same workspace as the sample session(s) which use it, VSM expressions which use <code>service:</code> or <code>aql:</code> can now invoke Java services which are defined in the workspace (with no need to launch a separate runtime). </li> <li><span class="label label-success">Added</span> A quick outline is now accessible in the VSM editor by using the shortcut <kbd>Ctrl+o</kbd>. It supports filtering on both an element’s name and properties for quick, keyboard-only navigation in complex VSMs.</li> - <li><span class="label label-success">Added</span> The «hide label by default capability» has been added to the container styles.</li> + <li><span class="label label-success">Added</span> The “hide label by default capability” has been added to the container styles.</li> <li><span class="label label-success">Added</span> In addition to <em>Bold</em> and <em>Italic</em>, @@ -635,7 +638,7 @@ </li> <li><span class="label label-success">Improved</span> The precision of the VSM validation, especially regarding the typing of computed expressions, has been greatly improved. Other validation rules like static image paths have also been added or improved.</li> <li><span class="label label-info">Modified</span> In the VSM editor, the context menu entries (categories and items) have been reorganized to put most common actions/items first.</li> - <li><span class="label label-info">Modified</span> In diagrams, the style previously named «Lozenge» is now called «Diamond».</li> + <li><span class="label label-info">Modified</span> In diagrams, the style previously named “Lozenge” is now called “Diamond”.</li> <li><span class="label label-info">Modified</span> In the <em>Open</em> menu on a representation, the menu is computed from the navigation tool’s label instead of its name/id. </li> @@ -1518,13 +1521,13 @@ <img border="0" src="images/containerResize-changedBehavior.gif"/> </p> <ul> - <li>The «snap to shapes» is now enabled by default (see + <li>The “snap to shapes” is now enabled by default (see <em>Sirius > Sirius Diagram > Rulers and Grid</em> preference page). This is true only for new diagrams. The existing diagrams are not impacted. </li> - <li>The «Navigate» top-level contextual menu entry with mixed actions for creating new representations and opening existing ones has been changed by two top-level menus: + <li>The “Navigate” top-level contextual menu entry with mixed actions for creating new representations and opening existing ones has been changed by two top-level menus: <ul> - <li>One named «New», which lists only the available actions to create new representations on the selected element.</li> - <li>One named «Open», which lists only the existing representations on the selected element. </li> + <li>One named “New”, which lists only the available actions to create new representations on the selected element.</li> + <li>One named “Open”, which lists only the existing representations on the selected element. </li> </ul> </li> <li>When a shape is resized (no matter the direction), the edge(s) connection location (toward or from this one) is kept. Before that, edges connections moved according to the ratio of the resizing.</li> @@ -1549,19 +1552,19 @@ <li>Distribute centers vertically</li> </ul> </li> - <li>The end user can now remove all bend-points between the two edge ends. This action is available on edge context menu «Remove Bend-points» or by using the shortcut «Ctrl» + «Shift» + «-».</li> + <li>The end user can now remove all bend-points between the two edge ends. This action is available on edge context menu “Remove Bend-points” or by using the shortcut “Ctrl” + “Shift” + “-”.</li> <li>Reconnection of an edge will only now move the minimum necessary bendpoints instead of reseting it to default.</li> <li>A new action has been added to reset the diagram (or container) origin: the diagram (or container) bounds (the rectangle formed by the highest, the leftmost, the lowest and the rightmost children elements) can have a negative origin or can be shifted toward the bottom-right with a blank zone at the top-left. This action aims to move all diagram (or container) elements so that the it retrieves its origin while keeping elements layout.</li> </ul> <h3 id="SpecifierVisibleChanges3">Specifier-Visible Changes</h3> <ul> - <li>The specifier can now choose to hold the edge ends toward the center of the source, target or both. New fields within the «advance» tab of EdgeStyle description have been added to choose for which source or target mappings an edge should be centered. See + <li>The specifier can now choose to hold the edge ends toward the center of the source, target or both. New fields within the “advance” tab of EdgeStyle description have been added to choose for which source or target mappings an edge should be centered. See <a href="specifier/diagrams/Diagrams.html#edges_styles">Edges Styles > Edge Centering</a> in the specifier manual for more details. </li> <li>When creating a new Viewpoint Specification Project using the supplied wizard: - <em>New > Viewpoint Specification Project</em>, the VSM name is now given according to the project name. If the project name is suffixed with «design», the VSM name is provided by the last word before this suffix. Otherwise, the VSM name is given by the last word of the project name. + <em>New > Viewpoint Specification Project</em>, the VSM name is now given according to the project name. If the project name is suffixed with “design”, the VSM name is provided by the last word before this suffix. Otherwise, the VSM name is given by the last word of the project name. </li> - <li>«Lozenge» is replaced by «Diamond» in diagram style.</li> + <li>“Lozenge” is replaced by “Diamond” in diagram style.</li> </ul> <h3 id="APIChanges">API Changes</h3> <h4 id="Changesinorg.eclipse.sirius3">Changes in diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile index 2c1c2c6d3c..c58f8c5c84 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile @@ -60,6 +60,7 @@ Some API changes were required to enable this. While technically breaking change Additional non-breaking changes: * <span class="label label-success">Added</span> @org.eclipse.sirius.ext.base.I18N@ has been added. It provides common utility code to support internationalization. * <span class="label label-success">Added</span> The translation keys (and default values) have been added to all the concerned bundles, in their @plugin.properties@ file. These (translated) messages are available at runtime as static fields of new @Messages@ classes, added to all concerned bundles (always in the same package as their plug-in/activator class). The concerned bundles are: +** @org.eclipse.sirius@ ** @org.eclipse.sirius.ext.base@ ** @org.eclipse.sirius.ecore.extender@ ** @org.eclipse.sirius.synchronizer@ diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java index 03bcfb5b9c..80a5acf1b8 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/modelingproject/manager/ModelingProjectManagerImpl.java @@ -75,7 +75,7 @@ public class ModelingProjectManagerImpl implements ModelingProjectManager { public void notify(Session updated, int notification) { if (notification == SessionListener.OPENING) { // No need to at it again to the sessionFileLoading list because - // we add it during the starting of the load + // we add it during the starting of the load // ModelingProjectManager.loadAndOpenSession(). } else if (notification == SessionListener.OPENED) { sessionFileLoading.remove(updated.getSessionResource().getURI()); @@ -244,7 +244,7 @@ public class ModelingProjectManagerImpl implements ModelingProjectManager { }; ResourcesPlugin.getWorkspace().run(create, monitor); } - + @Override public void createLocalRepresentationsFile(IProject project, IProgressMonitor monitor) throws CoreException { URI representationsURI = URI.createPlatformResourceURI(project.getFullPath().append(ModelingProject.DEFAULT_REPRESENTATIONS_FILE_NAME).toString(), true); @@ -299,14 +299,14 @@ public class ModelingProjectManagerImpl implements ModelingProjectManager { OpenRepresentationsFileJob.scheduleNewWhenPossible(mainRepresentationsFileURI.get(), true); } } catch (IllegalArgumentException e) { - if (e.getMessage().contains(ModelingProjectQuery.ZERO_REPRESENTATIONS_FILE_FOUND_IN)) { + if (e.getCause() != null && ModelingProjectQuery.ZERO_REPRESENTATIONS_FILE_FOUND_IN.equals(e.getCause().getMessage())) { // 0 files has been found : create a representation ModelingProjectManager.INSTANCE.createLocalRepresentationsFile(project, new SubProgressMonitor(monitor, 1)); // Project has been marked as invalid but now it has a // main representation file, force the computation of // its mainRepresentationFileURI. optionalModelingProject.get().getMainRepresentationsFileURI(new SubProgressMonitor(monitor, 1), true, true); - } else if (e.getMessage().contains(ModelingProjectQuery.A_MODELING_PROJECT_MUST_CONTAIN_ONLY_ONE)) { + } else if (e.getCause() != null && ModelingProjectQuery.A_MODELING_PROJECT_MUST_CONTAIN_ONLY_ONE.equals(e.getCause().getMessage())) { // several files have been found : rollback removeModelingNature(project, new SubProgressMonitor(monitor, 1)); throw new CoreException(new Status(IStatus.ERROR, SiriusEditPlugin.ID, e.getMessage())); diff --git a/plugins/org.eclipse.sirius/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.sirius/.settings/org.eclipse.jdt.core.prefs index fc8c7f3ddc..39e1d0d4d4 100644 --- a/plugins/org.eclipse.sirius/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.sirius/.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/plugin.properties b/plugins/org.eclipse.sirius/plugin.properties index c7a74b05de..6fe05b983d 100644 --- a/plugins/org.eclipse.sirius/plugin.properties +++ b/plugins/org.eclipse.sirius/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 @@ -66,3 +66,276 @@ extension-point.viewpointSpecificationModel.name = org.eclipse.sirius.viewpointS extension.modelingMarker.name = Modeling Marker extension.sessionEditingDomainFactory.name = Local Session EditingDomain Factory extension.siriusMarker.name = Sirius Marker + +AbstractCommandFactory_refreshTasklabel = Set RefreshEditorsPrecommitListener options +AbstractCommonToolToAppliedOnConstraint_label = Element whithout name +AbstractExternalJavaAction_nullParameter = null +AbstractExternalJavaAction_parameterErrorMsg = Missing required parameter ''{0}'' for Java action {1} +AbstractExternalJavaAction_parameterType = a {0} +AbstractExternalJavaAction_parameterTypeErrorMsg = Type error: parameter ''{0}'' should be a {1} but is {2} +AbstractProviderDescriptor_attributeMissingMsg = The {0} attribute is missing +AbstractRepresentationDialectServices_createRepresentationMsg = Create representation : {0} +AbstractRepresentationDialectServices_initRepresentationMsg = Representations initialization : +AbstractSavingPolicy_saveMsg = Save Session +AbstractSavingPolicy_savingErrorMsg = error while saving session +AbstractSiriusMigrationService_contributionInstantiationErrorMsg = Cannot instanciate migration contribution +AbstractVersionSAXParser_getVersionMsg = Get version number of representations file +AbstractVersionSAXParser_stopParsingMsg = All needed informations have been reached. Stop the parsing. +AddSemanticResourceCommand_label = Add Model +AnalysisResourceReloadedCommand_label = Reload {0} file +AttachSemanticResourcesJob_name = Attach semantic resources +ChangeContextTask_label = change the context +CompositeResourceMonitor_addMonitorErrorMsg = New monitors can not be added while running. +CompositeResourceMonitor_alreadyRegisteredErrorMsg = The monitor is already registered in the composite. +CompositeResourceMonitor_alreadyUsedNameErrorMsg = A monitor is already registered under the name {0} +CompositeResourceMonitor_uriCompareErrorMsg = Can only compare URIs from detected resources. +ControlCommand_moveErrorMsg = Invalid target URI for control: could not load or create {0} +ControlledResourcesDetector_refreshCommandLabel = Controlled resource detection +CopyRepresentationCommand_label = Copy representations +CreateInstanceTask_addToRefErrorMsg = Impossible to add a value to the reference {0} of the object {1} +CreateInstanceTask_creationErrorMsg = Impossible to create a {0} +CreateInstanceTask_label = Create a new instance +CreateRepresentationCommand_label = Create representation +CreateRepresentationCommand_nullExpresionWarningMsg = Browse expression {0} evaluated to null. +DAnalysisSelectorService_multipleDefaultErrorMsg = Multiple default analysis selector providers found at extension point \"%s\": took only the first found. +DAnalysisSelectorService_noDefaultWaringMsg = No default analysis selector provider found at extension point \"%s\", using the DefaultAnalysisSelectorProvider instead. +DAnalysisSessionImpl_addNoParentAnalysisErrorMsg = Cant add a referenced analysis if no parent analysis exists +DAnalysisSessionImpl_addSemanticErrorMsg = A representation file cannot be added as semantic resource. +DAnalysisSessionImpl_addSemanticResourceMsg = Semantic resource addition : {0} +DAnalysisSessionImpl_noEditingDomainErrorMsg = A session must be associated to an EditingDomain +DAnalysisSessionImpl_noRessourceErrorMsg = A session must be inside a resource. +DAnalysisSessionImpl_openMsg = Open session +DAnalysisSessionImpl_removeNoParentAnalysisErrorMsg = Cant remove a referenced analysis if no parent analysis exists +DAnalysisSessionImpl_saveInterruptedMsg = save interrupted +DAnalysisSessionImpl_saveMsg = Session saving +DAnalysisSessionImpl_toStringMsg = Local Session: {0} +DAnalysisSessionImpl_unloadingErrorMsg = Error while unloading an unaccessible resource:\n{0} +DanglingRefRemovalTrigger_removeDanglingCmdLabel = Remove dangling references +DefaultLocalSessionCreationOperation_createResoureMsg = Representations resource creation +DefaultLocalSessionCreationOperation_createSessionMsg = Session creation +DefaultLocalSessionCreationOperation_sessionOpenMsg = Session opening +DeleteDRepresentationElementsTask_label = Delete representation elements task +DeleteDRepresentationTask_label = Delete {0} +DeleteEObjectTask_label = Delete EObject task +DeleteRepresentationCommand_label = Delete representation +DeleteWithoutToolTask_label = Delete without tool +DialectManagerImpl_refreshImpactedMsg = Refresh impacted representation elements +DialectManagerImpl_refreshMsg = Refresh representation +DViewOperations_addSelectedViewMsg = View selection +DViewOperations_createViewMsg = View creation for Sirius : {0} +DViewOperations_initRepresentationMsg = Initialize representations +DViewOperations_notContainedErrorMsg = The view is not contained in the analysis +DViewOperations_removeSelectedViewMsg = View unselection +DViewOperations_updateSelectedVPDataMsg = Update selected Viewpoints data +EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_EAttributeDiffernentTypesErrorMsg = {0} and {1}have each a EAttribute named {2} but with differents types +EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_notEAttributeErrorMsg = {0} EAttribute name on {1} concerns {2} which is not a EAttribute +EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationNotExistErrorMsg = {0} EAttribute name on {1} doesn''t exists +EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationStyleDescriptionErrorMsg = {0} doesn''t concerns a style description or a style description element +EclipseDeleteHookDescriptor_extensionLoadingErrorMsg = Error while loading the extension {0} +EObjectQuery_valuesErrorMsg = Expected a collection from many-valued reference {0} but got a {1} +EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_EReferenceNameOn = EReference name on +EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_validationNotExistErrorMsg = {0} EReference name on {1} doesn''t exists +EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_notAReferenceErrorMsg = {0} EReference name on {1} concerns {2} which is not a EReference +EditingDomainUndoContext_label = Affected Editing Domain +ElementsToSelectTask_errorMsg = the following \"Elements To Select\" expression could not be correctly evaluated : {0} +ElementsToSelectTask_label = Get result of Elements To Select interpreted expression +EmptyAppliedOnListConstraint_errorMsg = This customization has no style to customize. +TaskExecutor_errorModifyingModelMsg = Error while modifying model +ExecuteToolOperationTask_label = the main tool operation task +ExternalJavaActionDescriptor_actionCreationErrorMsg = Impossible to create the action {0} +ExternalJavaActionTask_label = Execute external java action \"{0}\" +FeatureContributor_targetObject = Target object +FeatureContributor_sourceObject = Source object +FeatureContributor_featureMissingMsg = {0} ({1}) does not have feature {2} +FeatureContributor_unexpectedTypeErrorMsg = Expected a collection from many-valued feature {0} but got a {1} +FeatureContributor_noTargetSpecifiedErrorMsg = No target object specified. +FeatureContributor_noSourceSpefifiedErrorMsg = No source object specified. +FeatureContributor_imcompatibleFeaturesErrorMsg = Incompatible source and target features. +FeatureContributor_unmodifiableFeatureErrorMsg = Target feature not modifiable. +FeatureContributor_noTargetFeatureErrorMsg = No target feature specified. +ForTask_label = a for task +IInterpreterMessages_invalidFeatureErrorMsg = Invalid feature as name +IPropertiesProvider_unfoundPropertyErrorMsg = The property was not found +ISiriusMessages_invalidAirdFileErrorMsg = The following diagram file is not valid : +ISiriusMessages_invalidDescFileErrorMsg = The following description file is not valid : +ISiriusMessages_notADecoratorErrorMsg = The element is not a DSemanticDecorator +IfTask_label = Evaluate : {0} +InitInterpreterFromParsedVariableTask_label = Init Acceleo interpreter with parsed variables +InitInterpreterVariablesTask_label = Init Acceleo variables +InitInterpreterVariablesTask_invalidModelErrorMsg = Invalid Model +InitializeModelingProjectJob_invalidModelingProjectsErrorMsg = Several modeling projects are invalid. +InitializeModelingProjectJob_invalidModelingProjectErrorMsg = One modeling project is invalid. +InitializeModelingProjectJob_label = Initializing Modeling Projects +InitializeModelingProjectJob_labelEmptyProject = Initializing Empty Modeling Projects +InterpretedExpressionVariableTask_label = set or unset an acceleo variable task +InterpreterRegistry_sessionNotFoundErrorMsg = Could not find a session for model element : {0} +InterpreterRegistry_nullModelElementErrorMsg = Model element is null +InterpreterRegistry_ImpossibleToFindInterpreterErrorMsg = Impossible to find an interpreter +InvalidPermissionCommand_label = Invalid Permission : cannot modify {0} +SavingPolicyImpl_savingErrorMsg = Error saving resource +JavaActionFromToolCommand_label = Java action from tool: {0} +LaunchRunnableTask_label = launch a runnable task +LoadEMFResource_loadingErrorMsg = Unable to load resource {0} +MarkerRuntimeLoggerImpl_feature = Feature: {0} +MarkerRuntimeLoggerImpl_featureWithMessage = Feature: {0}{1} +MigrationCommandExecutor_migrationErrorMsg = Migration error {0} +MigrationUtil_toBigErrorMsg = The size of the file is too big to get its contents. +MigrationUtil_loadingMsg = Loading File +MigrationUtil_IOErrorMsg = I/O Error +MigrationUtil_invalidMappingErrorMsg = the mapping is not valid +ModelingProject_getMainRepFileURIMsg = Get main representations resource URI +ModelingProjectQuery_severalRepresentationsFiles = Found {0} main representations files (that means not referenced by another) in \"{1}\": {2}. A modeling project must contain only one. +ModelingProjectQuery_mustContainOneRepFileMsg = Zero representations file found in \"{0}\". A modeling project must contain one. +ModelingProjectQuery_and = and +MoveElementInListAction_notAMemberErrorMsg = 'element' parameter is not a member of the designated list. +MoveElementInListAction_predecessorParameterErrorMsg = 'predecessor' parameter is not a member of the designated list. +MoveElementInListAction_elementAndPredecessorShouldBeDiffErrorMsg = 'element' and 'predecessor' must be different. +MoveElementInListAction_referenceNotChangeableErrorMsg = Reference {0} is not changeable +MoveElementInListAction_notMultiValuedRefErrorMsg = Reference {0} is not multi-valued +MoveElementInListAction_notARefErrorMsg = Feature {0} is not an EReference +MoveElementInListAction_featureNotFoundErrorMsg = Owner element type {0} does not have a feature named {1} +MoveElementTask_label = Move an element +MoveElementTask_ImpossibleToAddValueErrorMsg = Impossible to add a value to the reference {0} of the object {1} +MoveRepresentationCommand_label = Move representation to {0} +NoNullResourceCommand_instanceErrorMsg = only instances of SiriusCommand are allowed for recording command +NotificationTask_label = notification task +PaneBasedSelectionWizardDescriptionImpl_choiceOfValuesMsg = Choice of values +PaneBasedSelectionWizardDescriptionImpl_selectedValuesMsg = Selected values +PrepareNewAnalysisCommand_label = Prepare new Analysis +RefreshImpactedElementsCommand_label = Refresh impacted representation elements +RefreshRepresentationsCommand_label = Refresh representation +RemoveElementTask_label = Remove an element +RemoveElementTask_notAViewErrorMsg = The element is not a view ! Do not delete ! +RemoveSemanticResourceCommand_label = Remove model +RenameRepresentationCommand_label = Rename representation +XMIModelFileHandler_parsingStopedMsg = All needed informations have been reached. Stop the parsing. +RestoreModelElementStateCommand_label = restor model elements +RuntimeLoggerInterpreterImpl_evaluationConditionErrorMsg = Evaluation condition error +SaveSessionJob_sessionSavingMsg = Session saving +Saver_savingErrorMsg = Core exception while saving session +SelectionWizardDescriptionImpl_title = Selection Wizard +SessionFactoryImpl_EmptyContentErrorMsg = session creation failed: the resource content is empty. +SessionFactoryImpl_creationFailedErrorMsg = session creation failed +SessionFactoryImpl_sessionCreation = Session creation +SessionFactoryImpl_loadingError = Error while loading representations file +SessionFactoryImpl_sessionLoadingMsg = Session loading +SessionManagerImpl_remoteServerConnectionErrorMsg = Error while connecting to remote CDO server +SessionManagerImpl_cantAddNullSessionErrorMsg = SessionManager can't add a null Session +SessionManagerImpl_representationsFileLoadingErrorMsg = Error while loading representations file {0} +SessionManagerImpl_representationsFileLoadingSeeErrorLogMsg = Error while loading representations file: {0}. See error log for more details +SessionResourcesSynchronizer_cantHandleResourceChangeMsg = Can''t handle resource change : {0} +SessionResourcesSynchronizer_reloadOperationFailErrorMsg = a reload operation failed for unknown reason +SessionResourcesTracker_addReferencedSemanticResourcesMsg = Add referenced semantic resources +SessionResourcesTracker_semanticResourcesAccessErrorMsg = Error while accessing semantic resources +SessionVSMUpdater_VSMLoadErrorMsg = Unable to load the VSM at {0} +SetValueTask_label = Set a value +SiriusControlCommand_controlResourceMsg = Control resource +SiriusRepairProcess_errorMsg = An error occurs during repair process. +SiriusRepairProcess_contributionInstantationErrorMsg = Cannot instanciate migration contribution +SiriusRepairProcess_inProgressMsg = Repair in progress... +SiriusRepairProcess_closingSessionMsg = Closing session +SiriusRepairProcess_savingSessionMsg = Saving session +SiriusRepairProcess_repairModelMsg = Repair model {0}{1}{2} +SiriusRepairProcess_backupMsg = --> Backup file +SiriusRepairProcess_resolvingReferencesMsg = Resolving references +SiriusRepairProcess_openingsessionMsg = Opening session +SiriusRepairProcess_loadingModelMsg = Loading model +SiriusRepairProcess_restoringBckErrorMsg = Error while restoring backup file +SiriusRepairProcess_bckupCreationErrorMsg = Error while creating backup file +SiriusRepairProcess_removeElementsMsg = Remove elements +SiriusRepairProcess_saveModelElementStateMsg = save Model Element State +SiriusRepairProcess_restoringElementStatsMsg = --> Restoring element stats +SiriusRepairProcess_postRefreshMsg = --> Post refresh +SiriusRepairProcess_refreshingRepresentationsMsg = --> Refreshing representations +SiriusRepairProcess_removingElementsMsg = --> Removing elements +SiriusRepairProcess_savingElementsStateMsg = --> Saving elements state +SiriusRepairProcess_handlingViewMsg = --> Handling view +SiriusTasksKey_mmExtension = Metamodel Extension +SiriusTasksKey_genericModeler = Generic Modeler +SiriusTasksKey_repairMigrate = Repair/migrate +SiriusTasksKey_cleaningADiagram = Cleaning a diagram +SiriusTasksKey_updatingADiagram = Updating a diagram +SiriusTasksKey_evaluatingAcceleoExpression = Evaluating Acceleo expressions +SiriusTasksKey_evaluatingOCLExpressions = Evaluating OCL expressions +SiriusTasksKey_checkPreconditionExpressions = Check precondition expressions +SiriusTasksKey_InitAcceleoInterpreter = Initialize Acceleo interpreter +SiriusTasksKey_isGMFViewValid = Is the GMF view valid ? +SiriusTasksKey_getNodesCandidates = Get node's candidates +SiriusTasksKey_canonicalRefresh = Canonical refresh +SiriusTasksKey_validateAllDDiagramElements = Validate all the DDiagram elements +SiriusTasksKey_cacheAccess = Cache access +SiriusTasksKey_getEdgesCandidates = Get edge's candidates +SiriusTasksKey_validatingTheNode = Validating the node +SiriusTasksKey_validatingEdge = Validating the edge +SiriusTasksKey_cleaningAllEdges = Cleaning all edges +SiriusTasksKey_getContainerCandidates = Get container candidates +SiriusTasksKey_createMissingContainersFromViewpoint = Create missing containers from viewpoint +SiriusTasksKey_refreshADiagram = Refresh a diagram +SiriusTasksKey_CleaningRemoveDanglingRef = Cleaning : remove dangling references +SiriusTasksKey_createMissingEdgesFromViewpoint = Create missing edges from viewpoint +SiriusTasksKey_createMissingNodeFromContainer = Create missing node from container +SiriusTasksKey_isTheElementCollapsed = FilterService : is the element collapsed ? +SiriusTasksKey_checkThatElementHasToBeDisplayed = Display Service : check that the element has to be displayed +SiriusTasksKey_isElementDisplayed = Display Service : is the element displayed ? +SiriusTasksKey_createMissingNodeFromViewpoint = Create missing node from viewpoint +SiriusTasksKey_updatingAllNodes = Updating all nodes +SiriusTasksKey_updateAllContainers = Updating all containers +SiriusTasksKey_updatingAllEdges = Updating all edges +SiriusTasksKey_getRemovedNodesCandidates = Get removed nodes candidates +SiriusTasksKey_synchronizeDiagram = Synchronize Diagram +SiriusTasksKey_openSession = Open Session +SiriusTasksKey_openDiagram = Open diagram +SiriusTasksKey_computeEdgeSrcTgtViews = Compute edge source/target views +SiriusTasksKey_cleanOrphanedNodes = Clean orphaned nodes +SiriusTasksKey_removeDanglingRef = Remove dangling reference +SiriusTasksKey_getKeptNodesCandidates = Get kept nodes candidates +SiriusTasksKey_launchRefreshFromOperationHistoryListener = Launch Refresh From Operation History Listener +SiriusTasksKey_bigRefresh = Big refresh +SiriusTasksKey_isFold = Is fold +SiriusTasksKey_instanceOf = EInstance of +SiriusTasksKey_addAColumnInSWTTable = Add a column in the SWT table +SiriusTasksKey_setColumnNameInSWTTable = Set the column name in the SWT table +SiriusTasksKey_openSessionAction = Open Session Action +SiriusTasksKey_refreshATree = Refresh a tree +SiriusTasksKey_refreshSWTTable = Refresh the SWT table +SiriusTasksKey_changeSWTTableCollapseState = Change the collapse state of a line of the SWT table +SiriusTasksKey_refreshSWTTableLine = Refresh a line of the SWT table +SiriusTasksKey_createSWTTable = Create the SWT table +SiriusTasksKey_refreshTable = Refresh a table +SiriusTasksKey_getAddedNodesCandidates = Get Added nodes candidates +SiriusTasksKey_findAirFromModelElement = Find .air from model element. +SiriusTasksKey_resolveAll = Resolve All +SiriusTasksKey_launchRefreshFromLayerChange = Launch Refresh From Layer Change +SiriusTasksKey_openTable = Open table +SiriusTasksKey_refreshPropertiesViewSection = Refresh a section of the properties view +SiriusTasksKey_refreshPropertiesView = Refresh the properties view +SiriusTasksKey_updateSWTTableLine = Update a line of the SWT table +SiriusTasksKey_semanticRefresh = Semantic Refresh +SiriusTasksKey_loadAirdFile = Load aird file +SiriusTasksKey_refreshRepairMigrateLostElements = Refresh elements lost by repair/migrate first pass +SiriusTasksKey_changeSWTTableColumnVisibleState = Change the visible state of a column of the SWT table +SiriusTasksKey_changeSWTTableLineVisibleSate = Change the visible state of a line of the SWT table +SiriusTasksKey_openTree = Open tree +SiriusUncontrolCommand_label = Uncontrol resource +SiriusUncontrolCommand_resourceDeletionFailedMsg = Resource deletion failed +UnexecutableTask_label = unexecutable task +UnsetTask_nullOperationErrorMsg = unsetOp is null +UnsetTask_label = unset the value +Updater_updateElementDifferentReferenceTypeErrorMsg = Can not update an element using a reference element of a different type. Expected {0} but got a {1} +Updater_updateElementLogicallyDifferentErrorMsg = Can not update an element using a logically different element as reference. +VSMElementCustomizationReuseValidConstraint_noEReferenceErrorMsg = {0} doesn''t have EReference named {1} +VSMElementCustomizationReuseValidConstraint_noEAttributeErrorMsg = {0} doesn''t have EAttribute named {1} +VSMElementCustomizationReuseValidConstraint_doesntConcernsStyleDescErrorMsg = {0} doesn''t concerns a style description or a style description element +VSMElementNameValidConstraint_invalidNameErrorMsg = is not a valid name, it must be different of empty or null. +ValidImageConstraint_imageDoesntExistErrorMsg = The image ''{0}'' does not exist. +ValidImageConstraint_invalidPathErrorMsg = The path ''{0}'' does not correspond to an image. +ValidationRuleImpl_elementHas = The element has... +ValidationRuleSpecOperations_evaluationErrorMsg = Error while evaluating audit message. +ViewpointProtocolParser_noViewpointErrorMsg = No viewpoint is corresponding to {0} +ViewpointProtocolParser_invalidURIErrorMsg = URI {0} is not valid. +ViewpointProtocolParser_unamed = unnamed +ViewpointRegistryImpl_FileLoadingErrorMsg = The viewpoint registry was not able to load this file {0} +ViewpointRegistryImpl_cantDeployVSMErrorMsg = Can't deploy VSM. +ViewpointRegistryImpl_cantLoadVSMErrorMsg = The viewpoint specification model : {0} can''t be loaded, it may need to be migrated. +ViewpointRegistryImpl_unableToUnloadFileErrorMsg = The viewpoint registry was not able to unload this file {0} +XMIModelFileHandler_stopTheParsingMsg = We try to access external elements. Stop the parsing. diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/PaneBasedSelectionWizardDescriptionImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/PaneBasedSelectionWizardDescriptionImpl.java index ab6c9213a0..0d015bb103 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/PaneBasedSelectionWizardDescriptionImpl.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/PaneBasedSelectionWizardDescriptionImpl.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 @@ -16,6 +16,7 @@ import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.ContainerViewVariable; import org.eclipse.sirius.viewpoint.description.tool.ElementSelectVariable; import org.eclipse.sirius.viewpoint.description.tool.InitialOperation; @@ -211,10 +212,10 @@ public class PaneBasedSelectionWizardDescriptionImpl extends AbstractToolDescrip * <!-- end-user-doc --> * * @see #getChoiceOfValuesMessage() - * @generated + * @not-generated * @ordered */ - protected static final String CHOICE_OF_VALUES_MESSAGE_EDEFAULT = "Choice of values"; + protected static final String CHOICE_OF_VALUES_MESSAGE_EDEFAULT = Messages.PaneBasedSelectionWizardDescriptionImpl_choiceOfValuesMsg; /** * The cached value of the '{@link #getChoiceOfValuesMessage() @@ -319,10 +320,10 @@ public class PaneBasedSelectionWizardDescriptionImpl extends AbstractToolDescrip * <!-- end-user-doc --> * * @see #getSelectedValuesMessage() - * @generated + * @not-generated * @ordered */ - protected static final String SELECTED_VALUES_MESSAGE_EDEFAULT = "Selected values"; + protected static final String SELECTED_VALUES_MESSAGE_EDEFAULT = Messages.PaneBasedSelectionWizardDescriptionImpl_selectedValuesMsg; /** * The cached value of the '{@link #getSelectedValuesMessage() @@ -467,8 +468,8 @@ public class PaneBasedSelectionWizardDescriptionImpl extends AbstractToolDescrip containerView = (ContainerViewVariable) eResolveProxy(oldContainerView); if (containerView != oldContainerView) { InternalEObject newContainerView = (InternalEObject) containerView; - NotificationChain msgs = oldContainerView - .eInverseRemove(this, InternalEObject.EOPPOSITE_FEATURE_BASE - ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__CONTAINER_VIEW, null, null); + NotificationChain msgs = oldContainerView.eInverseRemove(this, InternalEObject.EOPPOSITE_FEATURE_BASE - ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__CONTAINER_VIEW, null, + null); if (newContainerView.eInternalContainer() == null) { msgs = newContainerView.eInverseAdd(this, InternalEObject.EOPPOSITE_FEATURE_BASE - ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__CONTAINER_VIEW, null, msgs); } @@ -626,8 +627,8 @@ public class PaneBasedSelectionWizardDescriptionImpl extends AbstractToolDescrip initialOperation = (InitialOperation) eResolveProxy(oldInitialOperation); if (initialOperation != oldInitialOperation) { InternalEObject newInitialOperation = (InternalEObject) initialOperation; - NotificationChain msgs = oldInitialOperation.eInverseRemove(this, InternalEObject.EOPPOSITE_FEATURE_BASE - ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__INITIAL_OPERATION, - null, null); + NotificationChain msgs = oldInitialOperation.eInverseRemove(this, InternalEObject.EOPPOSITE_FEATURE_BASE - ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__INITIAL_OPERATION, null, + null); if (newInitialOperation.eInternalContainer() == null) { msgs = newInitialOperation.eInverseAdd(this, InternalEObject.EOPPOSITE_FEATURE_BASE - ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__INITIAL_OPERATION, null, msgs); } @@ -1171,8 +1172,8 @@ public class PaneBasedSelectionWizardDescriptionImpl extends AbstractToolDescrip case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__WINDOW_TITLE: return PaneBasedSelectionWizardDescriptionImpl.WINDOW_TITLE_EDEFAULT == null ? windowTitle != null : !PaneBasedSelectionWizardDescriptionImpl.WINDOW_TITLE_EDEFAULT.equals(windowTitle); case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__WINDOW_IMAGE_PATH: - return PaneBasedSelectionWizardDescriptionImpl.WINDOW_IMAGE_PATH_EDEFAULT == null ? windowImagePath != null : !PaneBasedSelectionWizardDescriptionImpl.WINDOW_IMAGE_PATH_EDEFAULT - .equals(windowImagePath); + return PaneBasedSelectionWizardDescriptionImpl.WINDOW_IMAGE_PATH_EDEFAULT == null ? windowImagePath != null + : !PaneBasedSelectionWizardDescriptionImpl.WINDOW_IMAGE_PATH_EDEFAULT.equals(windowImagePath); case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__MESSAGE: return PaneBasedSelectionWizardDescriptionImpl.MESSAGE_EDEFAULT == null ? message != null : !PaneBasedSelectionWizardDescriptionImpl.MESSAGE_EDEFAULT.equals(message); case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__CHOICE_OF_VALUES_MESSAGE: @@ -1184,11 +1185,11 @@ public class PaneBasedSelectionWizardDescriptionImpl extends AbstractToolDescrip case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__TREE: return tree != PaneBasedSelectionWizardDescriptionImpl.TREE_EDEFAULT; case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__ROOT_EXPRESSION: - return PaneBasedSelectionWizardDescriptionImpl.ROOT_EXPRESSION_EDEFAULT == null ? rootExpression != null : !PaneBasedSelectionWizardDescriptionImpl.ROOT_EXPRESSION_EDEFAULT - .equals(rootExpression); + return PaneBasedSelectionWizardDescriptionImpl.ROOT_EXPRESSION_EDEFAULT == null ? rootExpression != null + : !PaneBasedSelectionWizardDescriptionImpl.ROOT_EXPRESSION_EDEFAULT.equals(rootExpression); case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__CHILDREN_EXPRESSION: - return PaneBasedSelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT == null ? childrenExpression != null : !PaneBasedSelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT - .equals(childrenExpression); + return PaneBasedSelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT == null ? childrenExpression != null + : !PaneBasedSelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT.equals(childrenExpression); case ToolPackage.PANE_BASED_SELECTION_WIZARD_DESCRIPTION__SELECTED_VALUES_MESSAGE: return PaneBasedSelectionWizardDescriptionImpl.SELECTED_VALUES_MESSAGE_EDEFAULT == null ? selectedValuesMessage != null : !PaneBasedSelectionWizardDescriptionImpl.SELECTED_VALUES_MESSAGE_EDEFAULT.equals(selectedValuesMessage); diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/SelectionWizardDescriptionImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/SelectionWizardDescriptionImpl.java index 51d757f590..af25ecd106 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/SelectionWizardDescriptionImpl.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/tool/impl/SelectionWizardDescriptionImpl.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 @@ -16,6 +16,7 @@ import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.sirius.viewpoint.description.SelectionDescription; import org.eclipse.sirius.viewpoint.description.tool.ContainerViewVariable; @@ -269,10 +270,10 @@ public class SelectionWizardDescriptionImpl extends AbstractToolDescriptionImpl * ' attribute. <!-- begin-user-doc --> <!-- end-user-doc --> * * @see #getWindowTitle() - * @generated + * @not-generated * @ordered */ - protected static final String WINDOW_TITLE_EDEFAULT = "Selection Wizard"; + protected static final String WINDOW_TITLE_EDEFAULT = Messages.SelectionWizardDescriptionImpl_title; /** * The cached value of the '{@link #getWindowTitle() <em>Window Title</em>}' @@ -1038,8 +1039,8 @@ public class SelectionWizardDescriptionImpl extends AbstractToolDescriptionImpl public boolean eIsSet(int featureID) { switch (featureID) { case ToolPackage.SELECTION_WIZARD_DESCRIPTION__CANDIDATES_EXPRESSION: - return SelectionWizardDescriptionImpl.CANDIDATES_EXPRESSION_EDEFAULT == null ? candidatesExpression != null : !SelectionWizardDescriptionImpl.CANDIDATES_EXPRESSION_EDEFAULT - .equals(candidatesExpression); + return SelectionWizardDescriptionImpl.CANDIDATES_EXPRESSION_EDEFAULT == null ? candidatesExpression != null + : !SelectionWizardDescriptionImpl.CANDIDATES_EXPRESSION_EDEFAULT.equals(candidatesExpression); case ToolPackage.SELECTION_WIZARD_DESCRIPTION__MULTIPLE: return multiple != SelectionWizardDescriptionImpl.MULTIPLE_EDEFAULT; case ToolPackage.SELECTION_WIZARD_DESCRIPTION__TREE: @@ -1047,8 +1048,8 @@ public class SelectionWizardDescriptionImpl extends AbstractToolDescriptionImpl case ToolPackage.SELECTION_WIZARD_DESCRIPTION__ROOT_EXPRESSION: return SelectionWizardDescriptionImpl.ROOT_EXPRESSION_EDEFAULT == null ? rootExpression != null : !SelectionWizardDescriptionImpl.ROOT_EXPRESSION_EDEFAULT.equals(rootExpression); case ToolPackage.SELECTION_WIZARD_DESCRIPTION__CHILDREN_EXPRESSION: - return SelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT == null ? childrenExpression != null : !SelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT - .equals(childrenExpression); + return SelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT == null ? childrenExpression != null + : !SelectionWizardDescriptionImpl.CHILDREN_EXPRESSION_EDEFAULT.equals(childrenExpression); case ToolPackage.SELECTION_WIZARD_DESCRIPTION__MESSAGE: return SelectionWizardDescriptionImpl.MESSAGE_EDEFAULT == null ? message != null : !SelectionWizardDescriptionImpl.MESSAGE_EDEFAULT.equals(message); case ToolPackage.SELECTION_WIZARD_DESCRIPTION__ELEMENT: diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/validation/impl/ValidationRuleImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/validation/impl/ValidationRuleImpl.java index b1a6505692..65648fca22 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/validation/impl/ValidationRuleImpl.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/description/validation/impl/ValidationRuleImpl.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 @@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.impl.IdentifiedElementImpl; import org.eclipse.sirius.viewpoint.description.validation.ERROR_LEVEL; import org.eclipse.sirius.viewpoint.description.validation.RuleAudit; @@ -78,10 +79,10 @@ public abstract class ValidationRuleImpl extends IdentifiedElementImpl implement * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> * * @see #getMessage() - * @generated + * @not-generated * @ordered */ - protected static final String MESSAGE_EDEFAULT = "The element has..."; + protected static final String MESSAGE_EDEFAULT = Messages.ValidationRuleImpl_elementHas; /** * The cached value of the '{@link #getMessage() <em>Message</em>}' diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/AbstractExternalJavaAction.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/AbstractExternalJavaAction.java index bae4be4d1a..b7903040d8 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/AbstractExternalJavaAction.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/AbstractExternalJavaAction.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,9 +10,11 @@ *******************************************************************************/ package org.eclipse.sirius.business.api.action; +import java.text.MessageFormat; import java.util.Map; import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +import org.eclipse.sirius.viewpoint.Messages; /** * Abstract base class for {@link IExternalJavaAction} implementations, with @@ -69,7 +71,7 @@ public abstract class AbstractExternalJavaAction implements IExternalJavaAction T result; if (!parameters.containsKey(name)) { if (required) { - throw new IllegalArgumentException("Missing required parameter '" + name + "' for Java action " + this.getClass().getName()); + throw new IllegalArgumentException(MessageFormat.format(Messages.AbstractExternalJavaAction_parameterErrorMsg, name, this.getClass().getName())); } else { result = null; } @@ -80,8 +82,9 @@ public abstract class AbstractExternalJavaAction implements IExternalJavaAction } else if (value == null && !required) { result = null; } else { - String typeName = (value == null) ? "null" : ("a " + value.getClass().getSimpleName()); //$NON-NLS-1$ - throw new IllegalArgumentException("Type error: parameter '" + name + "' should be a " + type.getSimpleName() + " but is " + typeName); + String typeName = (value == null) ? Messages.AbstractExternalJavaAction_nullParameter + : (MessageFormat.format(Messages.AbstractExternalJavaAction_parameterType, value.getClass().getSimpleName())); + throw new IllegalArgumentException(MessageFormat.format(Messages.AbstractExternalJavaAction_parameterTypeErrorMsg, name, type.getSimpleName(), typeName)); } return result; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/MoveElementInListAction.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/MoveElementInListAction.java index 0dc3577ce6..24cf3e71cd 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/MoveElementInListAction.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/MoveElementInListAction.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.business.api.action; +import java.text.MessageFormat; import java.util.Collection; import java.util.Map; @@ -17,6 +18,7 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.base.Preconditions; @@ -59,20 +61,20 @@ public class MoveElementInListAction extends AbstractExternalJavaAction { String refName = getParameter(parameters, "referenceName", String.class); //$NON-NLS-1$ EObject pred = getOptionalParameter(parameters, "predecessor", EObject.class); //$NON-NLS-1$ if (pred != null) { - Preconditions.checkArgument(element != pred, "'element' and 'predecessor' must be different."); + Preconditions.checkArgument(element != pred, Messages.MoveElementInListAction_elementAndPredecessorShouldBeDiffErrorMsg); } EStructuralFeature feature = owner.eClass().getEStructuralFeature(refName); - Preconditions.checkArgument(feature != null, "Owner element type " + owner.eClass().getName() + " does not have a feature named " + refName); - String qName = feature.getEContainingClass().getName() + "." + feature.getName(); - Preconditions.checkArgument(feature instanceof EReference, "Feature " + qName + " is not an EReference"); - Preconditions.checkArgument(feature.isMany(), "Reference " + qName + " is not multi-valued"); - Preconditions.checkArgument(feature.isChangeable(), "Reference " + qName + " is not changeable"); + Preconditions.checkArgument(feature != null, MessageFormat.format(Messages.MoveElementInListAction_featureNotFoundErrorMsg, owner.eClass().getName(), refName)); + String qName = feature.getEContainingClass().getName() + "." + feature.getName(); //$NON-NLS-1$ + Preconditions.checkArgument(feature instanceof EReference, MessageFormat.format(Messages.MoveElementInListAction_notARefErrorMsg, qName)); + Preconditions.checkArgument(feature.isMany(), MessageFormat.format(Messages.MoveElementInListAction_notMultiValuedRefErrorMsg, qName)); + Preconditions.checkArgument(feature.isChangeable(), MessageFormat.format(Messages.MoveElementInListAction_referenceNotChangeableErrorMsg, qName)); @SuppressWarnings("unchecked") EList<EObject> list = (EList<EObject>) owner.eGet(feature); - Preconditions.checkArgument(pred == null || list.contains(pred), "'predecessor' parameter is not a member of the designated list."); - Preconditions.checkArgument(list.contains(element), "'element' parameter is not a member of the designated list."); + Preconditions.checkArgument(pred == null || list.contains(pred), Messages.MoveElementInListAction_predecessorParameterErrorMsg); + Preconditions.checkArgument(list.contains(element), Messages.MoveElementInListAction_notAMemberErrorMsg); moveElementAfter(element, pred, list); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/PrintInterpreterVariablesAction.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/PrintInterpreterVariablesAction.java index 4a9ad61abf..c50c5121e6 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/PrintInterpreterVariablesAction.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/action/PrintInterpreterVariablesAction.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 @@ -44,11 +44,12 @@ public class PrintInterpreterVariablesAction extends AbstractExternalJavaAction private static final String ENABLED_PARAM = "enabled"; //$NON-NLS-1$ - private static final String DEFAULT_TITLE = "<no title>"; + private static final String DEFAULT_TITLE = "<no title>"; //$NON-NLS-1$ /** * {@inheritDoc} */ + @Override public boolean canExecute(Collection<? extends EObject> selections) { return !selections.isEmpty(); } @@ -59,6 +60,7 @@ public class PrintInterpreterVariablesAction extends AbstractExternalJavaAction * <p> * {@inheritDoc} */ + @Override public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) { Boolean enabled = getOptionalParameter(parameters, ENABLED_PARAM, Boolean.class); if (enabled != null && !enabled.booleanValue()) { @@ -82,16 +84,17 @@ public class PrintInterpreterVariablesAction extends AbstractExternalJavaAction private void printVariables(String title, SortedMap<String, Object> allVariables) { if (allVariables.isEmpty()) { // CHECKSTYLE:OFF - System.out.println("[" + title + "] no variables available."); + System.out.println("[" + title + "] no variables available."); //$NON-NLS-1$ //$NON-NLS-2$ // CHECKSTYLE:ON } else { int maxLength = Ordering.natural().onResultOf(new Function<String, Integer>() { + @Override public Integer apply(String from) { return from.length(); } }).max(allVariables.keySet()).length(); // CHECKSTYLE:OFF - System.out.println("[" + title + "] variables available:"); + System.out.println("[" + title + "] variables available:"); //$NON-NLS-1$ //$NON-NLS-2$ int i = 1; for (Map.Entry<String, Object> variable : allVariables.entrySet()) { System.out.print(" " + i++ + ". " + variable.getKey()); //$NON-NLS-1$ //$NON-NLS-2$ diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java index 85e83a1808..a8e0ee3df9 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/componentization/ViewpointRegistryImpl.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 @@ -11,6 +11,7 @@ package org.eclipse.sirius.business.api.componentization; import java.io.IOException; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -54,6 +55,7 @@ import org.eclipse.sirius.ext.base.Options; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; import org.eclipse.sirius.tools.internal.uri.ViewpointProtocolException; import org.eclipse.sirius.tools.internal.uri.ViewpointProtocolParser; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.Component; import org.eclipse.sirius.viewpoint.description.Group; @@ -71,8 +73,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; public class ViewpointRegistryImpl extends ViewpointRegistry { - private static final String UNABLE_TO_LOAD_THIS_FILE = "The viewpoint registry was not able to load this file "; - private ResourceSet resourceSet; private Set<Viewpoint> viewpointsFromPlugin; @@ -98,6 +98,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { collectors = Maps.newHashMap(); collectors.put(SiriusUtil.DESCRIPTION_MODEL_EXTENSION, new ViewpointFileCollector() { + @Override public boolean isValid(final EObject descRoot) { boolean result; if (descRoot instanceof Group) { @@ -107,13 +108,14 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { if (descRoot == null) { // Nothing, already been log } else { - SiriusPlugin.getDefault().warning("The viewpoint specification model : " + descRoot.eResource().getURI() + " can't be loaded, it may need to be migrated.", - new RuntimeException("Can't deploy VSM.")); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.ViewpointRegistryImpl_cantLoadVSMErrorMsg, descRoot.eResource().getURI()), + new RuntimeException(Messages.ViewpointRegistryImpl_cantDeployVSMErrorMsg)); } } return result; } + @Override public Collection<Viewpoint> collect(EObject root) { return Lists.newArrayList(Iterators.filter(root.eAllContents(), Viewpoint.class)); } @@ -140,6 +142,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * @param size * the initial size. */ + @Override public void init(final int size) { this.viewpointsFromPlugin = new HashSet<Viewpoint>(size); this.viewpointsFromWorkspace = new HashSet<Viewpoint>(size); @@ -166,6 +169,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * found * @since 0.9.0 */ + @Override public Viewpoint getViewpoint(final URI viewpointUri) throws ViewpointProtocolException { return ViewpointProtocolParser.getViewpoint(viewpointUri); } @@ -177,6 +181,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { private LoadingCache<EObject, EObject> prepareFoundCache() { return CacheBuilder.newBuilder().weakKeys().build(CacheLoader.from(new Function<EObject, EObject>() { + @Override public EObject apply(EObject from) { return lookForEquivalentInRegistry(from); } @@ -192,6 +197,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * @return <code>true</code> if the filter was added, <code>false</code> * otherwise. */ + @Override public boolean addFilter(final ViewpointRegistryFilter filter) { if (filters == null) { filters = new HashSet<ViewpointRegistryFilter>(4); @@ -207,6 +213,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * the filter to remove * @return <code>true</code> if removed, <code>false</code> otherwise. */ + @Override public boolean removeFilter(final ViewpointRegistryFilter filter) { invalidateCache(); if (filters != null) { @@ -221,6 +228,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * @param id * the id of the filters to remove */ + @Override public void removeFilter(final String id) { if (filters != null) { @@ -245,6 +253,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * @return <code>true</code> if the listener was added, <code>false</code> * otherwise. */ + @Override public boolean addListener(final ViewpointRegistryListener2 listener) { if (newListeners == null) { newListeners = new HashSet<ViewpointRegistryListener2>(4); @@ -259,6 +268,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * the listener to remove * @return <code>true</code> if removed, <code>false</code> otherwise. */ + @Override public boolean removeListener(final ViewpointRegistryListener2 listener) { if (newListeners != null) { return newListeners.remove(listener); @@ -274,6 +284,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * the platform file path ("pluginname/rep1/rep2/file.odesign) * @return the added Viewpoints; */ + @Override public Set<Viewpoint> registerFromPlugin(final String modelerModelResourcePath) { final Set<Viewpoint> addedSirius = new HashSet<Viewpoint>(); @@ -296,13 +307,13 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { } } catch (final IOException e) { - SiriusPlugin.getDefault().error(UNABLE_TO_LOAD_THIS_FILE + modelerModelResourcePath, e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ViewpointRegistryImpl_FileLoadingErrorMsg, modelerModelResourcePath), e); } catch (final WrappedException e) { - SiriusPlugin.getDefault().warning(UNABLE_TO_LOAD_THIS_FILE + modelerModelResourcePath, e.exception()); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.ViewpointRegistryImpl_FileLoadingErrorMsg, modelerModelResourcePath), e.exception()); /* CHECKSTYLE:OFF -> we should handle this kind of exception */ } catch (final RuntimeException e) { /* CHECKSTYLE:ON */ - SiriusPlugin.getDefault().warning(UNABLE_TO_LOAD_THIS_FILE + modelerModelResourcePath, e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.ViewpointRegistryImpl_FileLoadingErrorMsg, modelerModelResourcePath), e); } invalidateCache(); return addedSirius; @@ -333,6 +344,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * @param <T> * the type */ + @Override public <T extends Component> void registerFromWorkspace(final Set<T> components) { viewpointsFromWorkspace.clear(); for (final Component c : components) { @@ -352,6 +364,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * @param viewpoint * the viewpoint to dispose */ + @Override public void disposeFromPlugin(final Viewpoint viewpoint) { viewpointsFromPlugin.remove(viewpoint); @@ -368,6 +381,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { if (vpName != null && pluginName != null) { Iterable<Viewpoint> sameNameAndPluginViewpoints = Iterables.filter(viewpointsFromPlugin, new Predicate<Viewpoint>() { + @Override public boolean apply(final Viewpoint input) { return vpName.equals(input.getName()) && pluginName.equals(input.eResource().getURI().segment(1)); } @@ -400,6 +414,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * * @return the viewpoints registered */ + @Override public Set<Viewpoint> getViewpoints() { final Set<Viewpoint> all = new HashSet<Viewpoint>(this.viewpointsFromPlugin.size() + this.viewpointsFromWorkspace.size()); all.addAll(this.viewpointsFromWorkspace); @@ -443,6 +458,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * <code>null</code> if it could not be found. * @since 0.9.0 */ + @Override public Viewpoint getViewpoint(final RepresentationDescription description) { return new RepresentationDescriptionQuery(description).getParentViewpoint(); } @@ -455,6 +471,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * @return <code>true</code> if the plug-in comes from plug-in false if it * comes from workspace. */ + @Override public boolean isFromPlugin(final Viewpoint viewpoint) { if (viewpointsFromPlugin != null) { return viewpointsFromPlugin.contains(viewpoint); @@ -465,6 +482,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { /** * Dispose the registry. */ + @Override public void dispose() { disposeViewpointsFromPlugins(); viewpointsFromWorkspace.clear(); @@ -526,7 +544,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { // CHECKSTYLE:OFF } catch (final RuntimeException e) { // CHECKSTYLE:ON - SiriusPlugin.getDefault().error(UNABLE_TO_LOAD_THIS_FILE + res.getURI().toString(), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ViewpointRegistryImpl_FileLoadingErrorMsg, res.getURI().toString()), e); } DslCommonPlugin.PROFILER.stopWork(SiriusTasksKey.RESOLVE_ALL_KEY); } @@ -578,9 +596,9 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { try { resource.unload(); } catch (final IllegalArgumentException e) { - SiriusPlugin.getDefault().error("The viewpoint registry was not able to unload this file " + resource.getURI().toString(), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ViewpointRegistryImpl_unableToUnloadFileErrorMsg, resource.getURI().toString()), e); } catch (final NullPointerException e) { - SiriusPlugin.getDefault().error("The viewpoint registry was not able to unload this file " + resource.getURI().toString(), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ViewpointRegistryImpl_unableToUnloadFileErrorMsg, resource.getURI().toString()), e); } resourceSet.getResources().remove(resource); } @@ -591,13 +609,13 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { final URI fileURI = URI.createPlatformResourceURI(file.getFullPath().toOSString(), true); return load(fileURI, set); } catch (final IOException e) { - SiriusPlugin.getDefault().error(UNABLE_TO_LOAD_THIS_FILE + file.getName(), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ViewpointRegistryImpl_FileLoadingErrorMsg, file.getName()), e); } catch (final WrappedException e) { - SiriusPlugin.getDefault().warning(UNABLE_TO_LOAD_THIS_FILE + file.getName(), e.exception()); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.ViewpointRegistryImpl_FileLoadingErrorMsg, file.getName()), e.exception()); /* CHECKSTYLE:OFF -> we should handle this kind of exception */ } catch (final RuntimeException e) { /* CHECKSTYLE:ON */ - SiriusPlugin.getDefault().warning(UNABLE_TO_LOAD_THIS_FILE + file.getName(), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.ViewpointRegistryImpl_FileLoadingErrorMsg, file.getName()), e); } return null; } @@ -625,6 +643,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) */ + @Override public void resourceChanged(final IResourceChangeEvent event) { /* * Refresh the registry when an odesign resource changed, is added or @@ -854,6 +873,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * * @return the cross referencer. */ + @Override public ECrossReferenceAdapter getCrossReferencer() { return crossReferencer; } @@ -866,6 +886,7 @@ public class ViewpointRegistryImpl extends ViewpointRegistry { * the emf object to look for * @return the eObject instance if found, the given object otherwise */ + @Override public EObject find(final EObject eObject) { try { return foundCache.get(eObject); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java index 2f0d9b6f6e..74a46b2684 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java @@ -35,6 +35,7 @@ import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.ViewpointFactory; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -139,7 +140,7 @@ public class SiriusControlCommand extends ControlCommand { @Override protected void doExecute() { try { - monitor.beginTask("Control resource", 3); + monitor.beginTask(Messages.SiriusControlCommand_controlResourceMsg, 3); super.doExecute(); // Control the semantic model monitor.worked(1); markContainerResourceAsModified(semanticObjectToControl.eContainer()); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusUncontrolCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusUncontrolCommand.java index 03e7528774..79fc95cdf9 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusUncontrolCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusUncontrolCommand.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 @@ -28,6 +28,7 @@ import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession; import org.eclipse.sirius.business.internal.command.control.UncontrolCommand; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.collect.Iterables; @@ -54,7 +55,7 @@ public class SiriusUncontrolCommand extends UncontrolCommand { * to the semantic elements. */ private final boolean uncontrolRepresentations; - + /** * A boolean to set if the session should be save at the end of this * command. @@ -83,7 +84,7 @@ public class SiriusUncontrolCommand extends UncontrolCommand { public SiriusUncontrolCommand(final EObject semanticRoot, final boolean uncontrolRepresentations, IProgressMonitor monitor) { this(semanticRoot, uncontrolRepresentations, true, monitor); } - + /** * Create a new {@link SiriusUncontrolCommand}. * @@ -105,6 +106,7 @@ public class SiriusUncontrolCommand extends UncontrolCommand { this.shouldEndBySaving = shouldEndBySaving; this.monitor = monitor; } + /** * Get root container of specified object.<br> * Default implementation consists in getting the resource container i.e the @@ -124,7 +126,7 @@ public class SiriusUncontrolCommand extends UncontrolCommand { @Override protected void doExecute() { try { - monitor.beginTask("Uncontrol resource", 4); + monitor.beginTask(Messages.SiriusUncontrolCommand_label, 4); Resource childSemanticResource = semanticElementToUncontrol.eResource(); Resource childAirdResource = getChildAirdResource(); @@ -277,7 +279,7 @@ public class SiriusUncontrolCommand extends UncontrolCommand { res.save(Collections.emptyMap()); res.delete(Collections.emptyMap()); } catch (IOException e) { - SiriusPlugin.getDefault().error("Resource deletion failed", e); + SiriusPlugin.getDefault().error(Messages.SiriusUncontrolCommand_resourceDeletionFailedMsg, e); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/AbstractRepresentationDialectServices.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/AbstractRepresentationDialectServices.java index 0a708b9659..e603fedb9b 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/AbstractRepresentationDialectServices.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/AbstractRepresentationDialectServices.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.business.api.dialect; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -39,6 +40,7 @@ import org.eclipse.sirius.tools.api.command.CommandContext; import org.eclipse.sirius.tools.api.command.ui.UICallBack; import org.eclipse.sirius.tools.api.interpreter.InterpreterUtil; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.ViewpointPackage; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -94,6 +96,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public void notify(RepresentationNotification notification) { // Empty default implementation. } @@ -101,6 +104,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public boolean canCreateIdentifier(EObject representationElement) { // No support for identifiers by default. return false; @@ -109,6 +113,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public RepresentationElementIdentifier createIdentifier(EObject representationElement, Map<EObject, RepresentationElementIdentifier> elementToIdentifier) { // No support for identifiers by default. return null; @@ -117,6 +122,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public void updateRepresentationsExtendedBy(Session session, Viewpoint viewpoint, boolean activated) { // No support for representation extension by default. } @@ -124,6 +130,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public void refreshEffectiveRepresentationDescription(DRepresentation representation, IProgressMonitor monitor) { // Do nothing by default, not all dialects have effective representation // descriptions. @@ -143,6 +150,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public Collection<DRepresentation> getRepresentations(EObject semantic, Session session) { return getRepresentations(session, CustomDataConstants.DREPRESENTATION, semantic); } @@ -150,6 +158,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public Collection<DRepresentation> getAllRepresentations(Session session) { return getRepresentations(session, CustomDataConstants.DREPRESENTATION, null); } @@ -157,6 +166,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public Collection<DRepresentation> getRepresentations(RepresentationDescription representationDescription, Session session) { return getRepresentations(session, CustomDataConstants.DREPRESENTATION_FROM_DESCRIPTION, representationDescription); } @@ -164,6 +174,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public boolean canRefresh(DRepresentation representation) { return isSupported(representation); } @@ -171,6 +182,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public DRepresentation copyRepresentation(final DRepresentation representation, final String name, final Session session, final IProgressMonitor monitor) { EcoreUtil.Copier copier = new EcoreUtil.Copier(); DRepresentation newRepresentation = (DRepresentation) copier.copy(representation); @@ -184,6 +196,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public boolean deleteRepresentation(DRepresentation representation, Session session) { if (isSupported(representation)) { SiriusUtil.delete(representation, session); @@ -195,10 +208,11 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public DRepresentation createRepresentation(String name, EObject semantic, RepresentationDescription description, Session session, IProgressMonitor monitor) { DRepresentation representation = null; try { - monitor.beginTask("Create representation : " + name, 2); + monitor.beginTask(MessageFormat.format(Messages.AbstractRepresentationDialectServices_createRepresentationMsg, name), 2); representation = createRepresentation(name, semantic, description, new SubProgressMonitor(monitor, 1)); if (representation != null) { session.getServices().putCustomData(CustomDataConstants.DREPRESENTATION, semantic, representation); @@ -231,6 +245,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe /** * {@inheritDoc} */ + @Override public Collection<RepresentationDescription> getAvailableRepresentationDescriptions(Collection<Viewpoint> vps, EObject semantic) { final Collection<RepresentationDescription> result = Lists.newArrayList(); for (Viewpoint vp : vps) { @@ -279,6 +294,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe protected Iterable<RepresentationDescription> getAvailableRepresentationDescriptions(Viewpoint vp, final EObject semantic) { Iterable<RepresentationDescription> candidates = new ViewpointQuery(vp).getAllRepresentationDescriptions(); return Iterables.filter(candidates, new Predicate<RepresentationDescription>() { + @Override public boolean apply(RepresentationDescription input) { return canCreate(semantic, input); } @@ -431,7 +447,7 @@ public abstract class AbstractRepresentationDialectServices implements DialectSe return; } try { - monitor.beginTask("Representations initialization : ", descriptions.size()); + monitor.beginTask(Messages.AbstractRepresentationDialectServices_initRepresentationMsg, descriptions.size()); for (final RepresentationDescription desc : descriptions) { initRepresentationForElement(desc, rootSemanticElement, monitor); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CopyRepresentationCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CopyRepresentationCommand.java index f51e6714d3..bad000a6a7 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CopyRepresentationCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CopyRepresentationCommand.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 @@ -17,6 +17,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; /** * Specific command to copy requested representations. @@ -45,7 +46,7 @@ public class CopyRepresentationCommand extends RecordingCommand { * the current session. */ public CopyRepresentationCommand(TransactionalEditingDomain domain, Collection<DRepresentation> representations, String newName, Session session) { - super(domain, "Copy representations"); + super(domain, Messages.CopyRepresentationCommand_label); this.representations = representations; this.newName = newName; this.session = session; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CreateRepresentationCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CreateRepresentationCommand.java index 22dab89a74..a92b14b6da 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CreateRepresentationCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/CreateRepresentationCommand.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.business.api.dialect.command; +import java.text.MessageFormat; import java.util.Collection; import java.util.Set; @@ -23,6 +24,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.sirius.viewpoint.description.tool.RepresentationCreationDescription; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; @@ -69,7 +71,7 @@ public class CreateRepresentationCommand extends RecordingCommand { * representation creation */ public CreateRepresentationCommand(Session session, RepresentationDescription description, EObject eObject, String name, IProgressMonitor monitor) { - super(session.getTransactionalEditingDomain(), "Create representation"); + super(session.getTransactionalEditingDomain(), Messages.CreateRepresentationCommand_label); this.session = session; this.description = description; this.semantic = eObject; @@ -171,8 +173,8 @@ public class CreateRepresentationCommand extends RecordingCommand { RuntimeLoggerManager.INSTANCE.warning(newRepresentationRoot, ToolPackage.eINSTANCE.getRepresentationCreationDescription_BrowseExpression(), e); } if (newRepresentationRoot == null) { - RuntimeLoggerManager.INSTANCE.warning(initialRoot, ToolPackage.eINSTANCE.getRepresentationCreationDescription_BrowseExpression(), "Browse expression " + desc.getBrowseExpression() - + " evaluated to null."); + RuntimeLoggerManager.INSTANCE.warning(initialRoot, ToolPackage.eINSTANCE.getRepresentationCreationDescription_BrowseExpression(), + MessageFormat.format(Messages.CreateRepresentationCommand_nullExpresionWarningMsg, desc.getBrowseExpression())); } } return newRepresentationRoot; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/DeleteRepresentationCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/DeleteRepresentationCommand.java index f2b794b132..ceb8d89426 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/DeleteRepresentationCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/DeleteRepresentationCommand.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 org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; /** * Specific command to delete the given representations. @@ -40,7 +41,7 @@ public class DeleteRepresentationCommand extends RecordingCommand { * {@link Set} of {@link DRepresentation}s to delete. */ public DeleteRepresentationCommand(Session session, Set<DRepresentation> representations) { - super(session.getTransactionalEditingDomain(), "Delete representation"); + super(session.getTransactionalEditingDomain(), Messages.DeleteRepresentationCommand_label); this.session = session; this.representations = representations; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/MoveRepresentationCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/MoveRepresentationCommand.java index 06e261921f..4d2ac47c8f 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/MoveRepresentationCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/MoveRepresentationCommand.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.business.api.dialect.command; +import java.text.MessageFormat; import java.util.Collection; import org.eclipse.emf.transaction.RecordingCommand; @@ -17,6 +18,7 @@ import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; /** * Specific command to move the given representations. @@ -43,7 +45,7 @@ public class MoveRepresentationCommand extends RecordingCommand { * the representations to move */ public MoveRepresentationCommand(Session session, DAnalysis targetAnalysis, Collection<DRepresentation> movableRepresentations) { - super(session.getTransactionalEditingDomain(), "Move representation to " + targetAnalysis.eResource().getURI().toString()); + super(session.getTransactionalEditingDomain(), MessageFormat.format(Messages.MoveRepresentationCommand_label, targetAnalysis.eResource().getURI().toString())); this.representations = movableRepresentations; this.targetAnalysis = targetAnalysis; this.session = session; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.java index 511647a304..859a9946d4 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.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 @@ -19,6 +19,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.collect.Lists; @@ -53,7 +54,7 @@ public class RefreshRepresentationsCommand extends RecordingCommand { * the representations to refresh. */ public RefreshRepresentationsCommand(TransactionalEditingDomain domain, boolean fullRefresh, IProgressMonitor monitor, Collection<DRepresentation> representationsToRefresh) { - super(domain, "Refresh representation"); + super(domain, Messages.RefreshRepresentationsCommand_label); this.fullRefresh = fullRefresh; this.monitor = monitor; this.representations = representationsToRefresh; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RenameRepresentationCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RenameRepresentationCommand.java index 077084b9da..6214c6b8b0 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RenameRepresentationCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RenameRepresentationCommand.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.business.api.dialect.command; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; /** * Specific command to rename the given representation. @@ -37,7 +38,7 @@ public class RenameRepresentationCommand extends RecordingCommand { * the new name. */ public RenameRepresentationCommand(TransactionalEditingDomain transDomain, DRepresentation selection, String name) { - super(transDomain, "Rename representation"); + super(transDomain, Messages.RenameRepresentationCommand_label); this.representation = selection; this.newName = name; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/DeleteEObjectTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/DeleteEObjectTask.java index 20bbebc07c..bdfc610265 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/DeleteEObjectTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/DeleteEObjectTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2014 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 @@ -21,6 +21,7 @@ import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.Feature import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaClassNotFoundException; import org.eclipse.sirius.ext.emf.EReferencePredicate; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; /** * A task allowing to delete any DRepresentationElement or any EObject. @@ -68,8 +69,8 @@ public class DeleteEObjectTask extends AbstractCommandTask { this.danglingEReferencesToIgnores = new EReferencePredicate() { @Override public boolean apply(EReference ref) { - return DanglingRefRemovalTrigger.DSEMANTICDECORATOR_REFERENCE_TO_IGNORE_PREDICATE.apply(ref) - || DanglingRefRemovalTrigger.NOTATION_VIEW_ELEMENT_REFERENCE_TO_IGNORE_PREDICATE.apply(ref) || (eReferencesToIgnores != null && eReferencesToIgnores.apply(ref)); + return DanglingRefRemovalTrigger.DSEMANTICDECORATOR_REFERENCE_TO_IGNORE_PREDICATE.apply(ref) || DanglingRefRemovalTrigger.NOTATION_VIEW_ELEMENT_REFERENCE_TO_IGNORE_PREDICATE.apply(ref) + || (eReferencesToIgnores != null && eReferencesToIgnores.apply(ref)); } }; } @@ -80,6 +81,7 @@ public class DeleteEObjectTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() throws MetaClassNotFoundException, FeatureNotFoundException { Session session = null; @@ -113,8 +115,9 @@ public class DeleteEObjectTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "Delete EObject task"; + return Messages.DeleteEObjectTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/InitInterpreterVariablesTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/InitInterpreterVariablesTask.java index 6317871f62..bbbac1a36e 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/InitInterpreterVariablesTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/InitInterpreterVariablesTask.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 @@ -30,6 +30,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.common.tools.api.util.EObjectCollectionWrapper; import org.eclipse.sirius.tools.api.command.ui.UICallBack; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.AbstractVariable; import org.eclipse.sirius.viewpoint.description.tool.AcceleoVariable; import org.eclipse.sirius.viewpoint.description.tool.SelectModelElementVariable; @@ -109,6 +110,7 @@ public class InitInterpreterVariablesTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { interpreter.clearVariables(); /* @@ -207,8 +209,9 @@ public class InitInterpreterVariablesTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "Init Acceleo variables"; + return Messages.InitInterpreterVariablesTask_label; } /** @@ -237,6 +240,7 @@ public class InitInterpreterVariablesTask extends AbstractCommandTask { * * @see java.util.Comparator#compare(T, T) */ + @Override public int compare(final AbstractVariable variable0, final AbstractVariable variable1) { if (EcoreUtil.isAncestor(variable0, variable1) || EcoreUtil.isAncestor(variable1, variable0)) { @@ -245,7 +249,7 @@ public class InitInterpreterVariablesTask extends AbstractCommandTask { final EObject commonAncestor = ModelVariableComparator.getCommonAncestor(variable0, variable1); if (commonAncestor == null) { - throw new RuntimeException("Invalid Model"); + throw new RuntimeException(Messages.InitInterpreterVariablesTask_invalidModelErrorMsg); } int result = 0; final Iterator<EObject> iterContents = commonAncestor.eContents().iterator(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/LaunchRunnableTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/LaunchRunnableTask.java index 2e2d3d5778..d3925e7690 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/LaunchRunnableTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/LaunchRunnableTask.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.business.api.helper.task; +import org.eclipse.sirius.viewpoint.Messages; + /** * A task to launch a runnable. * @@ -35,6 +37,7 @@ public class LaunchRunnableTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { runnable.run(); } @@ -45,8 +48,9 @@ public class LaunchRunnableTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "launch a runnable task"; + return Messages.LaunchRunnableTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/NotificationTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/NotificationTask.java index 198e069a57..95ecff2498 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/NotificationTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/NotificationTask.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 @@ -12,6 +12,7 @@ package org.eclipse.sirius.business.api.helper.task; import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.common.tools.api.listener.NotificationUtil; +import org.eclipse.sirius.viewpoint.Messages; /** * This task is useful to send a notification. @@ -49,6 +50,7 @@ public class NotificationTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { NotificationUtil.sendNotification(element, kind, notification); } @@ -58,8 +60,9 @@ public class NotificationTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "notification task"; + return Messages.NotificationTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskExecutor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskExecutor.java index bad831c6a9..d3b67065d3 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskExecutor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/TaskExecutor.java @@ -15,6 +15,7 @@ import java.util.List; 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.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -62,9 +63,9 @@ public final class TaskExecutor { try { task.execute(); } catch (MetaClassNotFoundException e) { - SiriusPlugin.getDefault().error("Error while modifying model", e); + SiriusPlugin.getDefault().error(Messages.TaskExecutor_errorModifyingModelMsg, e); } catch (FeatureNotFoundException e) { - SiriusPlugin.getDefault().error("Error while modifying model", e); + SiriusPlugin.getDefault().error(Messages.TaskExecutor_errorModifyingModelMsg, e); } if (!task.executeMyselfChildrenTasks()) { TaskExecutor.execute(task.getChildrenTasks()); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/UnexecutableTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/UnexecutableTask.java index f592413e02..d5f9ef5a76 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/UnexecutableTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/UnexecutableTask.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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.business.api.helper.task; +import org.eclipse.sirius.viewpoint.Messages; + /** * A singleton {@link UnexecutableTask#INSTANCE} that cannot execute. * @@ -31,6 +33,7 @@ public final class UnexecutableTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { } @@ -50,8 +53,9 @@ public final class UnexecutableTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "unexecutable task"; + return Messages.UnexecutableTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask.java index bfe7387b6b..7b5117338b 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask.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 @@ -15,6 +15,7 @@ import java.text.ParseException; import org.eclipse.sirius.business.api.helper.task.AbstractCommandTask; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; +import org.eclipse.sirius.viewpoint.Messages; /** * Task to init interreter variables. @@ -50,6 +51,7 @@ public class InitInterpreterFromParsedVariableTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { if (message != null && message.length() == 0) { setVariable(Integer.valueOf(0), ""); //$NON-NLS-1$ @@ -103,7 +105,8 @@ public class InitInterpreterFromParsedVariableTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "Init Acceleo interpreter with parsed variables"; + return Messages.InitInterpreterFromParsedVariableTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask2.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask2.java index 8f25b7d4e8..0d66d52caf 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask2.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/helper/task/label/InitInterpreterFromParsedVariableTask2.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 @@ -15,6 +15,7 @@ import java.text.ParseException; import org.eclipse.sirius.business.api.helper.task.AbstractCommandTask; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; +import org.eclipse.sirius.viewpoint.Messages; /** * Task to init interpeter variables. This task is like @@ -54,6 +55,7 @@ public class InitInterpreterFromParsedVariableTask2 extends AbstractCommandTask * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { if (message == null || (message instanceof String && ((String) message).length() == 0)) { setVariable(Integer.valueOf(0), ""); //$NON-NLS-1$ @@ -113,7 +115,8 @@ public class InitInterpreterFromParsedVariableTask2 extends AbstractCommandTask * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "Init Acceleo interpreter with parsed variables"; + return Messages.InitInterpreterFromParsedVariableTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/modelingproject/ModelingProject.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/modelingproject/ModelingProject.java index 9031329dc4..87c18e272d 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/modelingproject/ModelingProject.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/modelingproject/ModelingProject.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 @@ -26,6 +26,7 @@ import org.eclipse.sirius.business.internal.modelingproject.marker.ModelingMarke import org.eclipse.sirius.business.internal.query.ModelingProjectQuery; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -68,6 +69,7 @@ public class ModelingProject implements IProjectNature, IModelingElement { * * @see org.eclipse.core.resources.IProjectNature#configure() */ + @Override public void configure() throws CoreException { /* do nothing */ } @@ -77,6 +79,7 @@ public class ModelingProject implements IProjectNature, IModelingElement { * * @see org.eclipse.core.resources.IProjectNature#deconfigure() */ + @Override public void deconfigure() throws CoreException { /* do nothing */ } @@ -86,6 +89,7 @@ public class ModelingProject implements IProjectNature, IModelingElement { * * @see org.eclipse.core.resources.IProjectNature#getProject() */ + @Override public IProject getProject() { return project; } @@ -95,6 +99,7 @@ public class ModelingProject implements IProjectNature, IModelingElement { * * @see org.eclipse.core.resources.IProjectNature#setProject(org.eclipse.core.resources.IProject) */ + @Override public void setProject(IProject project) { this.project = project; } @@ -209,7 +214,7 @@ public class ModelingProject implements IProjectNature, IModelingElement { public Option<URI> getMainRepresentationsFileURI(IProgressMonitor monitor, boolean force, boolean throwException) throws IllegalArgumentException { Option<URI> mainRepresentationsFileURIOption = Options.newNone(); try { - monitor.beginTask("Get main representations resource URI", 1); + monitor.beginTask(Messages.ModelingProject_getMainRepFileURIMsg, 1); if (force) { setValid(true); mainRepresentationsFileURI = null; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/EObjectQuery.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/EObjectQuery.java index 9424472b82..36461425b1 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/EObjectQuery.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/query/EObjectQuery.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 @@ -38,6 +38,7 @@ import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; import org.eclipse.sirius.ext.emf.EClassQuery; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.Group; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -158,6 +159,7 @@ public class EObjectQuery { public Collection<EObject> getInverseReferences(final String featureName) { Preconditions.checkNotNull(featureName); return getInverseReferences(new Predicate<EStructuralFeature.Setting>() { + @Override public boolean apply(Setting input) { return input != null && input.getEStructuralFeature().getName().equals(featureName); } @@ -177,6 +179,7 @@ public class EObjectQuery { public Collection<EObject> getInverseReferences(final EReference ref) { Preconditions.checkNotNull(ref); return getInverseReferences(new Predicate<EStructuralFeature.Setting>() { + @Override public boolean apply(Setting input) { return input != null && input.getEStructuralFeature().equals(ref); } @@ -196,6 +199,7 @@ public class EObjectQuery { public Collection<EObject> getInverseReferences(final Set<EReference> refs) { Preconditions.checkNotNull(refs); return getInverseReferences(new Predicate<EStructuralFeature.Setting>() { + @Override public boolean apply(Setting input) { return input != null && refs.contains(input.getEStructuralFeature()); } @@ -365,7 +369,7 @@ public class EObjectQuery { if (ref.isMany()) { Object rawValue = eObject.eGet(ref); if (rawValue != null && !(rawValue instanceof EList<?>)) { - throw new RuntimeException(MessageFormat.format("Expected a collection from many-valued reference {0} but got a {1}", ref.getName(), rawValue.getClass())); + throw new RuntimeException(MessageFormat.format(Messages.EObjectQuery_valuesErrorMsg, ref.getName(), rawValue.getClass())); } if (rawValue != null) { result = Lists.newArrayList((EList<EObject>) rawValue); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.java index 7de0e603d6..dcc2b1b69a 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.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 @@ -12,6 +12,7 @@ package org.eclipse.sirius.business.api.repair; import java.io.IOException; import java.io.InputStream; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -59,6 +60,7 @@ import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -80,7 +82,7 @@ public class SiriusRepairProcess { /** * Message use when something goes wrong during repair process. */ - public static final String ERROR_MSG = "An error occurs during repair process."; + public static final String ERROR_MSG = Messages.SiriusRepairProcess_errorMsg; /** * Quote for messages. @@ -119,7 +121,7 @@ public class SiriusRepairProcess { } } catch (CoreException e) { - SiriusPlugin.getDefault().getLog().log(new Status(Status.WARNING, SiriusPlugin.ID, "Cannot instanciate migration contribution", e)); + SiriusPlugin.getDefault().getLog().log(new Status(Status.WARNING, SiriusPlugin.ID, Messages.SiriusRepairProcess_contributionInstantationErrorMsg, e)); } } return participants; @@ -136,7 +138,7 @@ public class SiriusRepairProcess { public void run(final IProgressMonitor monitor) throws InterruptedException { final URI resourceURI = URI.createPlatformResourceURI(this.file.getFullPath().toOSString(), true); try { - monitor.beginTask("Repair in progress...", 1); + monitor.beginTask(Messages.SiriusRepairProcess_inProgressMsg, 1); repair(resourceURI, new SubProgressMonitor(monitor, 1)); } catch (CoreException e) { SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, ERROR_MSG, e)); @@ -163,30 +165,31 @@ public class SiriusRepairProcess { Map<IFile, IFile> originalToBackupFiles = new HashMap<IFile, IFile>(); try { monitor.beginTask("", 4); //$NON-NLS-1$ - monitor.subTask("Loading model"); + monitor.subTask(Messages.SiriusRepairProcess_loadingModelMsg); session = SessionFactory.INSTANCE.createSession(sessionResourceURI, new SubProgressMonitor(monitor, 1)); session.setReloadingPolicy(new ReloadingPolicy() { + @Override public List<Action> getActions(Session session, Resource resource, ResourceStatus newStatus) { return Collections.emptyList(); } }); checkCancel(monitor); - monitor.subTask("Opening session"); + monitor.subTask(Messages.SiriusRepairProcess_openingsessionMsg); session.open(new SubProgressMonitor(monitor, 1)); checkCancel(monitor); - monitor.subTask("Resolving references"); + monitor.subTask(Messages.SiriusRepairProcess_resolvingReferencesMsg); ModelUtils.resolveAll(session.getSessionResource()); workMonitorAndCheckCancel(monitor, 1); final List<Resource> fragmentedResources = getFragmentedResources(session.getSessionResource()); IProgressMonitor monitorForMainModel = new SubProgressMonitor(monitor, fragmentedResources.size() + 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); try { - monitorForMainModel.beginTask("Repair model " + QUOTE + session.getSessionResource().getURI().lastSegment() + QUOTE, 10); + monitorForMainModel.beginTask(MessageFormat.format(Messages.SiriusRepairProcess_repairModelMsg, QUOTE, session.getSessionResource().getURI().lastSegment(), QUOTE), 10); if (backup) { - monitorForMainModel.subTask("--> Backup file"); + monitorForMainModel.subTask(Messages.SiriusRepairProcess_backupMsg); originalToBackupFiles.put(this.file, backupFile(this.file, new SubProgressMonitor(monitorForMainModel, 1))); } checkCancel(monitorForMainModel); @@ -195,9 +198,9 @@ public class SiriusRepairProcess { for (Resource fragment : fragmentedResources) { IProgressMonitor monitorForFragmentedModel = new SubProgressMonitor(monitorForMainModel, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); try { - monitorForFragmentedModel.beginTask("Repair model " + QUOTE + fragment.getURI().lastSegment() + QUOTE, 10); + monitorForFragmentedModel.beginTask(MessageFormat.format(Messages.SiriusRepairProcess_repairModelMsg, QUOTE, fragment.getURI().lastSegment(), QUOTE), 10); if (backup) { - monitorForFragmentedModel.subTask("--> Backup file"); + monitorForFragmentedModel.subTask(Messages.SiriusRepairProcess_backupMsg); IFile fragmentedFile = (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember(fragment.getURI().toPlatformString(true)); IFile fragmentedFileBackup = backupFile(fragmentedFile, new SubProgressMonitor(monitorForFragmentedModel, 1)); originalToBackupFiles.put(fragmentedFile, fragmentedFileBackup); @@ -214,11 +217,11 @@ public class SiriusRepairProcess { // pref is at true, wait the SaveSessionJob before calling // session.save() to avoid concurrent save. Job.getJobManager().join(SaveSessionJob.FAMILY, new SubProgressMonitor(monitorForMainModel, 1)); - monitorForMainModel.subTask("Saving session"); + monitorForMainModel.subTask(Messages.SiriusRepairProcess_savingSessionMsg); session.save(new SubProgressMonitor(monitorForMainModel, 1)); } finally { - monitorForMainModel.subTask("Closing session"); + monitorForMainModel.subTask(Messages.SiriusRepairProcess_closingSessionMsg); // In case the // {DesignerUIPreferencesKeys#PREF_SAVE_WHEN_NO_EDITOR} // pref is at true, wait the SaveSessionJob before closing it to @@ -325,18 +328,18 @@ public class SiriusRepairProcess { // handle view: see #handleView method comments for more // details. - monitor.subTask("--> Handling view"); + monitor.subTask(Messages.SiriusRepairProcess_handlingViewMsg); migrationCommandExecutor.execute(transactionalEditingDomain, handleViewCommand); monitor.worked(1); // save elements state - monitor.subTask("--> Saving elements state"); + monitor.subTask(Messages.SiriusRepairProcess_savingElementsStateMsg); saveModelElementState(view, new SubProgressMonitor(monitor, 1)); // monitor.subTask("Migrating elements"); // Remove elements (this method calls a recording command) - monitor.subTask("--> Removing elements"); + monitor.subTask(Messages.SiriusRepairProcess_removingElementsMsg); removeElements(view, new SubProgressMonitor(monitor, 1)); if (monitor.isCanceled()) { @@ -345,7 +348,7 @@ public class SiriusRepairProcess { // Refresh representation (this method calls a recording // command) - monitor.subTask("--> Refreshing representations"); + monitor.subTask(Messages.SiriusRepairProcess_refreshingRepresentationsMsg); refreshRepresentations(dAnalysis, view); monitor.worked(1); @@ -354,13 +357,13 @@ public class SiriusRepairProcess { } // call post refresh on each participants - monitor.subTask("--> Post refresh"); + monitor.subTask(Messages.SiriusRepairProcess_postRefreshMsg); postRefresh(model); monitor.worked(1); // Restore model element state. This method called a recording // command - monitor.subTask("--> Restoring element stats"); + monitor.subTask(Messages.SiriusRepairProcess_restoringElementStatsMsg); restoreModelElementState(view, new SubProgressMonitor(monitor, 1)); for (IRepairParticipant participant : repairParticipants) { participant.endRepairOnView(); @@ -460,7 +463,7 @@ public class SiriusRepairProcess { * The view which state is to be saved. */ private void saveModelElementState(final DView view, final IProgressMonitor monitor) { - monitor.beginTask("save Model Element State", this.repairParticipants.size()); + monitor.beginTask(Messages.SiriusRepairProcess_saveModelElementStateMsg, this.repairParticipants.size()); TransactionalEditingDomain transactionalEditingDomain = TransactionUtil.getEditingDomain(view); for (final IRepairParticipant participant : this.repairParticipants) { Command saveModelElementStateCommand = new SaveModelElementStateCommand(participant, view, new NullProgressMonitor()); @@ -472,7 +475,7 @@ public class SiriusRepairProcess { } private void removeElements(DView view, SubProgressMonitor monitor) { - monitor.beginTask("Remove elements", this.repairParticipants.size()); + monitor.beginTask(Messages.SiriusRepairProcess_removeElementsMsg, this.repairParticipants.size()); TransactionalEditingDomain transactionalEditingDomain = TransactionUtil.getEditingDomain(view); for (final IRepairParticipant participant : this.repairParticipants) { participant.removeElements(view, transactionalEditingDomain, monitor); @@ -490,6 +493,7 @@ public class SiriusRepairProcess { private List<Resource> getFragmentedResources(final Resource modelResource) { return Lists.newArrayList(Collections2.filter(modelResource.getResourceSet().getResources(), new Predicate<Resource>() { + @Override public boolean apply(Resource resource) { return !resource.equals(modelResource) && resource instanceof AirdResource && resource.getURI().isPlatformResource(); } @@ -510,7 +514,7 @@ public class SiriusRepairProcess { try { return ResourceUtil.createBackupFile(fileToBackup, monitor); } catch (final CoreException e) { - SiriusPlugin.getDefault().error("Error while creating backup file", e); + SiriusPlugin.getDefault().error(Messages.SiriusRepairProcess_bckupCreationErrorMsg, e); } return null; } @@ -534,7 +538,7 @@ public class SiriusRepairProcess { try { backupedFile.setContents(inpstrBackupFile, IResource.FORCE, new SubProgressMonitor(monitor, 1)); } catch (CoreException e) { - SiriusPlugin.getDefault().error("Error while restoring backup file", e); + SiriusPlugin.getDefault().error(Messages.SiriusRepairProcess_restoringBckErrorMsg, e); } finally { inpstrBackupFile.close(); } @@ -543,7 +547,7 @@ public class SiriusRepairProcess { // Refresh local container backupedFile.getParent().refreshLocal(IResource.DEPTH_ONE, new SubProgressMonitor(monitor, 1)); } catch (final CoreException e) { - SiriusPlugin.getDefault().error("Error while restoring backup file", e); + SiriusPlugin.getDefault().error(Messages.SiriusRepairProcess_restoringBckErrorMsg, e); } monitor.done(); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/resource/LoadEMFResource.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/resource/LoadEMFResource.java index 80e593a5eb..d8110363a4 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/resource/LoadEMFResource.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/resource/LoadEMFResource.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2010, 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 @@ -11,6 +11,7 @@ package org.eclipse.sirius.business.api.resource; import java.io.IOException; +import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; @@ -23,6 +24,7 @@ import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl; import org.eclipse.sirius.business.internal.resource.parser.XMIModelFileSaxParser; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.base.Preconditions; @@ -88,7 +90,7 @@ public class LoadEMFResource implements Runnable { } private void error(String path, Exception e) { - SiriusPlugin.getDefault().error("Unable to load resource " + path, e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.LoadEMFResource_loadingErrorMsg, path), e); unload(); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/AbstractSavingPolicy.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/AbstractSavingPolicy.java index 05c04e3178..ceb2fa7256 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/AbstractSavingPolicy.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/AbstractSavingPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Obeo. + * Copyright (c) 2014, 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 @@ -21,6 +21,7 @@ import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.common.tools.api.resource.ResourceSetSync; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.base.Preconditions; @@ -52,7 +53,7 @@ public abstract class AbstractSavingPolicy implements SavingPolicy { public Collection<Resource> save(final Iterable<Resource> allResources, final Map<?, ?> options, IProgressMonitor monitor) { final Collection<Resource> resourcesToSave = Lists.newArrayList(); try { - monitor.beginTask("Save Session", IProgressMonitor.UNKNOWN); + monitor.beginTask(Messages.AbstractSavingPolicy_saveMsg, IProgressMonitor.UNKNOWN); resourcesToSave.addAll(computeResourcesToSave(Sets.newLinkedHashSet(allResources), options, monitor)); if (options == null) { ResourceSetSync.getOrInstallResourceSetSync(domain).save(resourcesToSave, allResources, getDefaultSaveOptions()); @@ -60,9 +61,9 @@ public abstract class AbstractSavingPolicy implements SavingPolicy { ResourceSetSync.getOrInstallResourceSetSync(domain).save(resourcesToSave, allResources, options); } } catch (final IOException e) { - SiriusPlugin.getDefault().error("error while saving session", e); + SiriusPlugin.getDefault().error(Messages.AbstractSavingPolicy_savingErrorMsg, e); } catch (final InterruptedException e) { - SiriusPlugin.getDefault().error("error while saving session", e); + SiriusPlugin.getDefault().error(Messages.AbstractSavingPolicy_savingErrorMsg, e); } finally { monitor.done(); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java index 8c6cd92aad..6d267f4818 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/DefaultLocalSessionCreationOperation.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 @@ -16,6 +16,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.emf.common.util.URI; import org.eclipse.sirius.business.api.session.factory.SessionFactory; +import org.eclipse.sirius.viewpoint.Messages; /** * A common operation to create a session and open it. @@ -57,17 +58,18 @@ public class DefaultLocalSessionCreationOperation implements SessionCreationOper * * @see org.eclipse.sirius.business.api.session.SessionCreationOperation#execute() */ + @Override public void execute() throws CoreException { if (monitor == null) { monitor = new NullProgressMonitor(); } try { - monitor.beginTask("Representations resource creation", 3); - monitor.subTask("Session creation"); + monitor.beginTask(Messages.DefaultLocalSessionCreationOperation_createResoureMsg, 3); + monitor.subTask(Messages.DefaultLocalSessionCreationOperation_createSessionMsg); session = SessionFactory.INSTANCE.createSession(sessionResourceURI, new SubProgressMonitor(monitor, 1)); - monitor.subTask("Session opening"); + monitor.subTask(Messages.DefaultLocalSessionCreationOperation_sessionOpenMsg); session.open(new SubProgressMonitor(monitor, 1)); - monitor.subTask("Session saving"); + monitor.subTask(Messages.DAnalysisSessionImpl_saveMsg); session.save(new SubProgressMonitor(monitor, 1)); } finally { monitor.done(); @@ -79,6 +81,7 @@ public class DefaultLocalSessionCreationOperation implements SessionCreationOper * * @see org.eclipse.sirius.business.api.session.SessionCreationOperation#getCreatedSession() */ + @Override public Session getCreatedSession() { return session; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SavingPolicyImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SavingPolicyImpl.java index 3dda61c63f..56b60edc8b 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SavingPolicyImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/SavingPolicyImpl.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 @@ -22,6 +22,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.business.internal.session.danalysis.ResourceSaveDiagnose; import org.eclipse.sirius.common.tools.api.resource.ResourceSetSync; import org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.ResourceStatus; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.base.Predicate; @@ -58,6 +59,7 @@ public class SavingPolicyImpl extends AbstractSavingPolicy { protected Collection<Resource> computeResourcesToSave(Set<Resource> scope, Map<?, ?> options, IProgressMonitor monitor) { this.saveOptions = options; final Predicate<Resource> savingFilter = new Predicate<Resource>() { + @Override public boolean apply(final Resource input) { return shouldSave(input); } @@ -83,7 +85,7 @@ public class SavingPolicyImpl extends AbstractSavingPolicy { } hasChangesToSave = diagnose.isSaveable() && diagnose.hasDifferentSerialization(mergedOptions); } catch (final IOException e) { - SiriusPlugin.getDefault().error("Error saving resource", e); + SiriusPlugin.getDefault().error(Messages.SavingPolicyImpl_savingErrorMsg, e); } return hasChangesToSave; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSelectorService.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSelectorService.java index 030b5d899c..8eb1ea612b 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSelectorService.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSelectorService.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,12 +10,14 @@ *******************************************************************************/ package org.eclipse.sirius.business.api.session.danalysis; +import java.text.MessageFormat; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.eclipse.sirius.common.tools.api.util.EclipseUtil; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.collect.Lists; @@ -100,13 +102,13 @@ public final class DAnalysisSelectorService { Map<String, Collection<DAnalysisSelectorProvider>> providers = EclipseUtil.getExtensionPluginsByKey(DAnalysisSelectorProvider.class, ID, CLASS_ATTRIBUTE, "id"); //$NON-NLS-1$ Collection<DAnalysisSelectorProvider> defaults = providers.get(DAnalysisSelectorService.DEFAULT_PROVIDER_ID); if (defaults == null || defaults.isEmpty()) { - SiriusPlugin.getDefault().warning(String.format("No default analysis selector provider found at extension point \"%s\", using the DefaultAnalysisSelectorProvider instead.", ID), null); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.DAnalysisSelectorService_noDefaultWaringMsg, ID), null); defaultSiriusProvider = new DefaultAnalysisSelectorProvider(); } else if (defaultSiriusProvider == null) { defaultSiriusProvider = defaults.iterator().next(); } if (defaults != null && defaults.size() > 1) { - SiriusPlugin.getDefault().error(String.format("Multiple default analysis selector providers found at extension point \"%s\": took only the first found.", ID), null); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.DAnalysisSelectorService_multipleDefaultErrorMsg, ID), null); } customerProviders = Lists.newArrayList(); for (Entry<String, Collection<DAnalysisSelectorProvider>> entry : providers.entrySet()) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/command/control/ControlCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/command/control/ControlCommand.java index 142bf6eb73..b1574f9984 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/command/control/ControlCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/command/control/ControlCommand.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,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.command.control; +import java.text.MessageFormat; + import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; @@ -17,6 +19,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.sirius.viewpoint.Messages; /** * A recording version of the standard EMF "Control" action. In addition to @@ -104,7 +107,7 @@ public class ControlCommand extends RecordingCommand { if (controlledResource != null) { controlledResource.getContents().add(root); } else { - throw new RuntimeException("Invalid target URI for control: could not load or create " + uri); + throw new RuntimeException(MessageFormat.format(Messages.ControlCommand_moveErrorMsg, uri)); } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/FeatureContributor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/FeatureContributor.java index 9eeedbd58f..d9039319cb 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/FeatureContributor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/FeatureContributor.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 @@ -27,6 +27,7 @@ import org.eclipse.sirius.description.contribution.ResetFeatureContribution; import org.eclipse.sirius.description.contribution.SetFeatureContribution; import org.eclipse.sirius.description.contribution.util.ContributionSwitch; import org.eclipse.sirius.ext.emf.EStructuralFeatureQuery; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; @@ -41,10 +42,6 @@ import com.google.common.collect.Iterables; * @author pierre-charles.david@obeo.fr */ public class FeatureContributor { - private static final String TARGET_OBJECT = "Target object"; - - private static final String SOURCE_OBJECT = "Source object"; - private final FeatureContribution contribution; private Set<EObject> additions; @@ -59,9 +56,10 @@ public class FeatureContributor { this.contribution = Preconditions.checkNotNull(contribution); // Preconditions.checkArgument(contribution.getSourceFeature() != null, // "No source feature specified."); - Preconditions.checkArgument(contribution.getTargetFeature() != null, "No target feature specified."); - Preconditions.checkArgument(contribution.getTargetFeature().isChangeable(), "Target feature not modifiable."); - Preconditions.checkArgument(new EStructuralFeatureQuery(contribution.getTargetFeature()).isAssignableFrom(contribution.getSourceFeature()), "Incompatible source and target features."); + Preconditions.checkArgument(contribution.getTargetFeature() != null, Messages.FeatureContributor_noTargetFeatureErrorMsg); + Preconditions.checkArgument(contribution.getTargetFeature().isChangeable(), Messages.FeatureContributor_unmodifiableFeatureErrorMsg); + Preconditions.checkArgument(new EStructuralFeatureQuery(contribution.getTargetFeature()).isAssignableFrom(contribution.getSourceFeature()), + Messages.FeatureContributor_imcompatibleFeaturesErrorMsg); } /** @@ -75,8 +73,8 @@ public class FeatureContributor { * last application. */ public Set<EObject> apply(final EObject target, final EObject source) { - Preconditions.checkNotNull(source, "No source object specified."); - Preconditions.checkNotNull(target, "No target object specified."); + Preconditions.checkNotNull(source, Messages.FeatureContributor_noSourceSpefifiedErrorMsg); + Preconditions.checkNotNull(target, Messages.FeatureContributor_noTargetSpecifiedErrorMsg); this.additions = Collections.emptySet(); ContributionSwitch<Void> contributionSwitch = new ContributionSwitch<Void>() { @Override @@ -135,12 +133,12 @@ public class FeatureContributor { EStructuralFeature sourceFeature = afc.getSourceFeature(); if (sourceFeature != null) { Preconditions.checkArgument(sourceFeature.isMany()); - checkFeatureIsPresent(source, sourceFeature, SOURCE_OBJECT); + checkFeatureIsPresent(source, sourceFeature, Messages.FeatureContributor_sourceObject); } EStructuralFeature targetFeature = afc.getTargetFeature(); Preconditions.checkArgument(targetFeature.isMany()); - checkFeatureIsPresent(target, targetFeature, TARGET_OBJECT); + checkFeatureIsPresent(target, targetFeature, Messages.FeatureContributor_targetObject); Collection<Object> targetValues = getMany(target, targetFeature); Collection<Object> sourceValues; @@ -163,12 +161,12 @@ public class FeatureContributor { EStructuralFeature sourceFeature = afc.getSourceFeature(); if (sourceFeature != null) { Preconditions.checkArgument(sourceFeature.isMany()); - checkFeatureIsPresent(source, sourceFeature, SOURCE_OBJECT); + checkFeatureIsPresent(source, sourceFeature, Messages.FeatureContributor_sourceObject); } EStructuralFeature targetFeature = afc.getTargetFeature(); Preconditions.checkArgument(targetFeature.isMany()); - checkFeatureIsPresent(target, targetFeature, TARGET_OBJECT); + checkFeatureIsPresent(target, targetFeature, Messages.FeatureContributor_targetObject); Collection<Object> targetValues = getMany(target, targetFeature); Collection<Object> sourceValues; @@ -183,7 +181,7 @@ public class FeatureContributor { private void doClear(EObject target, ClearFeatureContribution cfc) { EStructuralFeature targetFeature = cfc.getTargetFeature(); Preconditions.checkArgument(targetFeature.isMany()); - checkFeatureIsPresent(target, targetFeature, TARGET_OBJECT); + checkFeatureIsPresent(target, targetFeature, Messages.FeatureContributor_targetObject); Collection<Object> targetValues = getMany(target, targetFeature); targetValues.clear(); @@ -191,7 +189,7 @@ public class FeatureContributor { private void doReset(EObject target, ResetFeatureContribution rfc) { EStructuralFeature targetFeature = rfc.getTargetFeature(); - checkFeatureIsPresent(target, targetFeature, TARGET_OBJECT); + checkFeatureIsPresent(target, targetFeature, Messages.FeatureContributor_targetObject); target.eUnset(targetFeature); } @@ -202,7 +200,7 @@ public class FeatureContributor { private Collection<Object> getMany(EObject target, EStructuralFeature targetFeature) { Object rawValue = target.eGet(targetFeature); if (rawValue != null && !(rawValue instanceof Collection<?>)) { - throw new RuntimeException(MessageFormat.format("Expected a collection from many-valued feature {0} but got a {1}", featureString(targetFeature), rawValue.getClass())); + throw new RuntimeException(MessageFormat.format(Messages.FeatureContributor_unexpectedTypeErrorMsg, featureString(targetFeature), rawValue.getClass())); } return (Collection<Object>) rawValue; } @@ -213,7 +211,7 @@ public class FeatureContributor { private void checkFeatureIsPresent(EObject obj, EStructuralFeature feature, String name) { boolean present = new EStructuralFeatureQuery(feature).existsIn(obj); - Preconditions.checkArgument(present, MessageFormat.format("{0} ({1}) does not have feature {2}", name, obj, featureString(feature))); + Preconditions.checkArgument(present, MessageFormat.format(Messages.FeatureContributor_featureMissingMsg, name, obj, featureString(feature))); } private boolean isAddition() { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/Updater.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/Updater.java index 97651b3ba9..0757ccc7d2 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/Updater.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/contribution/Updater.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Obeo. + * Copyright (c) 2011, 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 @@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.sirius.ext.emf.AllContents; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.base.Function; import com.google.common.base.Functions; @@ -36,6 +37,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; + /** * An updater can modify a model in place to match the structure of a new * version of that model. @@ -100,9 +102,9 @@ public class Updater { public EObject update() { orphaned = Sets.newHashSet(); if (!matcher.areSameLogicalElement(element, reference)) { - throw new IllegalArgumentException("Can not update an element using a logically different element as reference."); + throw new IllegalArgumentException(Messages.Updater_updateElementLogicallyDifferentErrorMsg); } else if (element.eClass() != reference.eClass()) { - String msg = MessageFormat.format("Can not update an element using a reference element of a different type. Expected {0} but got a {1}", element.eClass(), reference.eClass()); + String msg = MessageFormat.format(Messages.Updater_updateElementDifferentReferenceTypeErrorMsg, element.eClass(), reference.eClass()); throw new IllegalArgumentException(msg); } else { updateAttributes(); @@ -313,7 +315,7 @@ public class Updater { private Collection<Object> getMany(EObject target, EStructuralFeature targetFeature) { Object rawValue = target.eGet(targetFeature); if (rawValue != null && !(rawValue instanceof Collection<?>)) { - throw new RuntimeException(MessageFormat.format("Expected a collection from many-valued feature {0} but got a {1}", targetFeature.getName(), rawValue.getClass())); + throw new RuntimeException(MessageFormat.format(Messages.FeatureContributor_unexpectedTypeErrorMsg, targetFeature.getName(), rawValue.getClass())); } return (Collection<Object>) rawValue; } @@ -325,7 +327,7 @@ public class Updater { private EList<EObject> getManyEObjects(EObject target, EReference ref) { Object rawValue = target.eGet(ref); if (rawValue != null && !(rawValue instanceof EList<?>)) { - throw new RuntimeException(MessageFormat.format("Expected a collection from many-valued feature {0} but got a {1}", ref.getName(), rawValue.getClass())); + throw new RuntimeException(MessageFormat.format(Messages.FeatureContributor_unexpectedTypeErrorMsg, ref.getName(), rawValue.getClass())); } return (EList<EObject>) rawValue; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java index 5fbd019241..f8fbb32703 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.dialect; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -40,6 +41,7 @@ import org.eclipse.sirius.ext.base.Options; import org.eclipse.sirius.tools.api.command.CommandContext; import org.eclipse.sirius.tools.api.command.ui.UICallBack; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.ViewpointPackage; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; @@ -80,6 +82,7 @@ public class DialectManagerImpl implements DialectManager { * * {@inheritDoc} */ + @Override public Collection<RepresentationDescription> getAvailableRepresentationDescriptions(final Collection<Viewpoint> vp, final EObject semantic) { final Collection<RepresentationDescription> descs = new ArrayList<RepresentationDescription>(); for (final Dialect dialect : dialects.values()) { @@ -91,6 +94,7 @@ public class DialectManagerImpl implements DialectManager { /** * {@inheritDoc} */ + @Override public void refreshEffectiveRepresentationDescription(DRepresentation representation, IProgressMonitor monitor) { if (Movida.isEnabled()) { for (Dialect dialect : dialects.values()) { @@ -102,6 +106,7 @@ public class DialectManagerImpl implements DialectManager { /** * {@inheritDoc} */ + @Override public void refresh(final DRepresentation representation, final IProgressMonitor monitor) { refresh(representation, false, monitor); } @@ -112,7 +117,7 @@ public class DialectManagerImpl implements DialectManager { @Override public void refresh(DRepresentation representation, boolean doFullRefresh, IProgressMonitor monitor) { try { - monitor.beginTask("Refresh representation", 1); + monitor.beginTask(Messages.DialectManagerImpl_refreshMsg, 1); for (final Dialect dialect : dialects.values()) { if (dialect.getServices().canRefresh(representation)) { dialect.getServices().refresh(representation, doFullRefresh, new SubProgressMonitor(monitor, 1)); @@ -126,7 +131,7 @@ public class DialectManagerImpl implements DialectManager { @Override public void refreshImpactedElements(DRepresentation representation, Collection<Notification> notifications, IProgressMonitor monitor) { try { - monitor.beginTask("Refresh impacted representation elements", 1); + monitor.beginTask(Messages.DialectManagerImpl_refreshImpactedMsg, 1); for (final Dialect dialect : dialects.values()) { if (dialect.getServices().canRefresh(representation)) { dialect.getServices().refreshImpactedElements(representation, notifications, new SubProgressMonitor(monitor, 1)); @@ -148,10 +153,11 @@ public class DialectManagerImpl implements DialectManager { * * {@inheritDoc} */ + @Override public DRepresentation createRepresentation(final String name, final EObject semantic, final RepresentationDescription description, final Session session, final IProgressMonitor monitor) { DRepresentation created = null; try { - monitor.beginTask("Create representation : " + name, 12); + monitor.beginTask(MessageFormat.format(Messages.AbstractRepresentationDialectServices_createRepresentationMsg, name), 12); Dialect invokedDialect = null; for (final Dialect dialect : dialects.values()) { @@ -188,6 +194,7 @@ public class DialectManagerImpl implements DialectManager { * java.lang.String, org.eclipse.sirius.business.api.session.Session, * org.eclipse.core.runtime.IProgressMonitor) */ + @Override public DRepresentation copyRepresentation(final DRepresentation representation, final String name, final Session session, final IProgressMonitor monitor) { Dialect invokedDialect = null; DRepresentation copy = null; @@ -216,6 +223,7 @@ public class DialectManagerImpl implements DialectManager { * * {@inheritDoc} */ + @Override public boolean canRefresh(final DRepresentation representation) { for (final Dialect dialect : dialects.values()) { if (dialect.getServices().canRefresh(representation)) { @@ -229,6 +237,7 @@ public class DialectManagerImpl implements DialectManager { * * {@inheritDoc} */ + @Override public boolean canCreate(final EObject semantic, final RepresentationDescription desc) { boolean canCreate = false; @@ -249,6 +258,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectManager#disableDialect(org.eclipse.sirius.business.api.dialect.Dialect) */ + @Override public void disableDialect(final Dialect dialect) { dialects.remove(dialect.getName()); } @@ -258,6 +268,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectManager#enableDialect(org.eclipse.sirius.business.api.dialect.Dialect) */ + @Override public void enableDialect(final Dialect dialect) { dialects.put(dialect.getName(), dialect); } @@ -267,6 +278,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectServices#notify(org.eclipse.sirius.business.api.dialect.RepresentationNotification) */ + @Override public void notify(final RepresentationNotification representation) { for (final Dialect dialect : dialects.values()) { dialect.getServices().notify(representation); @@ -280,6 +292,7 @@ public class DialectManagerImpl implements DialectManager { * @see org.eclipse.sirius.business.api.dialect.DialectServices#getRepresentations(org.eclipse.emf.ecore.EObject, * org.eclipse.sirius.business.api.session.Session) */ + @Override public synchronized Collection<DRepresentation> getRepresentations(final EObject semantic, final Session session) { if (semantic != null) { return findAllRepresentations(semantic, session); @@ -309,6 +322,7 @@ public class DialectManagerImpl implements DialectManager { * @see org.eclipse.sirius.business.api.dialect.DialectServices#getRepresentations(org.eclipse.sirius.viewpoint.description.RepresentationDescription, * org.eclipse.sirius.business.api.session.Session) */ + @Override public Collection<DRepresentation> getRepresentations(final RepresentationDescription representationDescription, final Session session) { final Collection<DRepresentation> reps = new ArrayList<DRepresentation>(); for (final Dialect dialect : dialects.values()) { @@ -322,6 +336,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectServices#getAllRepresentations(org.eclipse.sirius.business.api.session.Session) */ + @Override public Collection<DRepresentation> getAllRepresentations(final Session session) { final Collection<DRepresentation> reps = new ArrayList<DRepresentation>(); for (final Dialect dialect : dialects.values()) { @@ -336,6 +351,7 @@ public class DialectManagerImpl implements DialectManager { * @see org.eclipse.sirius.business.api.dialect.DialectServices#deleteRepresentation(org.eclipse.sirius.viewpoint.DRepresentation, * org.eclipse.sirius.business.api.session.Session) */ + @Override public boolean deleteRepresentation(final DRepresentation representation, final Session session) { Dialect deleter = null; final Iterator<Dialect> it = dialects.values().iterator(); @@ -362,6 +378,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectServices#getDescription(org.eclipse.sirius.viewpoint.DRepresentation) */ + @Override public RepresentationDescription getDescription(final DRepresentation representation) { RepresentationDescription result = null; final Iterator<Dialect> it = dialects.values().iterator(); @@ -381,6 +398,7 @@ public class DialectManagerImpl implements DialectManager { /** * {@inheritDoc} */ + @Override public void initRepresentations(final Viewpoint vp, final EObject semantic, IProgressMonitor monitor) { for (final Dialect dialect : dialects.values()) { dialect.getServices().initRepresentations(vp, semantic, monitor); @@ -392,6 +410,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectServices#canCreateIdentifier(org.eclipse.emf.ecore.EObject) */ + @Override public boolean canCreateIdentifier(final EObject representationElement) { for (final Dialect dialect : dialects.values()) { if (dialect.getServices().canCreateIdentifier(representationElement)) { @@ -407,6 +426,7 @@ public class DialectManagerImpl implements DialectManager { * @see org.eclipse.sirius.business.api.dialect.DialectServices#createIdentifier(org.eclipse.emf.ecore.EObject, * java.util.Map) */ + @Override public RepresentationElementIdentifier createIdentifier(final EObject representationElement, final Map<EObject, RepresentationElementIdentifier> elementToIdentifier) { for (final Dialect dialect : dialects.values()) { if (dialect.getServices().canCreateIdentifier(representationElement)) { @@ -423,6 +443,7 @@ public class DialectManagerImpl implements DialectManager { * @see org.eclipse.sirius.business.api.dialect.DialectServices#updateRepresentationsExtendedBy(Session, * Viewpoint, boolean) */ + @Override public void updateRepresentationsExtendedBy(final Session session, final Viewpoint viewpoint, final boolean activated) { for (final Dialect dialect : dialects.values()) { dialect.getServices().updateRepresentationsExtendedBy(session, viewpoint, activated); @@ -436,6 +457,7 @@ public class DialectManagerImpl implements DialectManager { * @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) { IInterpretedExpressionQuery returnedQuery = null; @@ -461,6 +483,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectServices#handles(org.eclipse.sirius.viewpoint.description.RepresentationDescription) */ + @Override public boolean handles(RepresentationDescription representationDescription) { for (Dialect dialect : dialects.values()) { if (dialect.getServices().handles(representationDescription)) { @@ -520,6 +543,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectServices#handles(org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription) */ + @Override public boolean handles(RepresentationExtensionDescription representationExtensionDescription) { for (Dialect dialect : dialects.values()) { if (dialect.getServices().handles(representationExtensionDescription)) { @@ -535,6 +559,7 @@ public class DialectManagerImpl implements DialectManager { * * @see org.eclipse.sirius.business.api.dialect.DialectServices#invalidateMappingCache() */ + @Override public void invalidateMappingCache() { for (Dialect dialect : dialects.values()) { dialect.getServices().invalidateMappingCache(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/command/RefreshImpactedElementsCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/command/RefreshImpactedElementsCommand.java index f77a23ffdc..eea0b4b27e 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/command/RefreshImpactedElementsCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/command/RefreshImpactedElementsCommand.java @@ -21,6 +21,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; /** * This command performs a refresh only for impacted elements. @@ -49,7 +50,7 @@ public class RefreshImpactedElementsCommand extends RecordingCommand { * not contain touch notifications. */ public RefreshImpactedElementsCommand(TransactionalEditingDomain domain, IProgressMonitor monitor, Collection<DRepresentation> representationsToRefresh, Collection<Notification> notifications) { - super(domain, "Refresh impacted representation elements"); + super(domain, Messages.RefreshImpactedElementsCommand_label); this.monitor = monitor; this.representations = representationsToRefresh; this.notifications = notifications; @@ -65,7 +66,7 @@ public class RefreshImpactedElementsCommand extends RecordingCommand { } try { - monitor.beginTask("Refresh impacted representation elements", representations.size()); + monitor.beginTask(Messages.RefreshImpactedElementsCommand_label, representations.size()); for (DRepresentation representation : representations) { if (safeRefresh(representation)) { DialectManager.INSTANCE.refreshImpactedElements(representation, notifications, new SubProgressMonitor(monitor, 1)); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/delete/EclipseDeleteHookDescriptor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/delete/EclipseDeleteHookDescriptor.java index ae8c3c2ef4..7b4b862042 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/delete/EclipseDeleteHookDescriptor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/delete/EclipseDeleteHookDescriptor.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,17 +10,20 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.helper.delete; +import java.text.MessageFormat; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.sirius.business.api.delete.IDeleteHook; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** - * Describes a extension as contributed to the - * "org.eclipse.sirius.deleteHook" extension point. + * Describes a extension as contributed to the "org.eclipse.sirius.deleteHook" + * extension point. * * @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a> */ @@ -51,6 +54,7 @@ public class EclipseDeleteHookDescriptor implements IDeleteHookDescriptor { /** * {@inheritDoc} */ + @Override public String getId() { return id; } @@ -58,14 +62,15 @@ public class EclipseDeleteHookDescriptor implements IDeleteHookDescriptor { /** * {@inheritDoc} */ + @Override public IDeleteHook getIDeleteHook() { if (extension == null) { if (Platform.isRunning()) { try { extension = (IDeleteHook) element.createExecutableExtension(DELETE_HOOK_CLASS_ATTRIBUTE); } catch (CoreException e) { - SiriusPlugin.getDefault().getLog() - .log(new Status(IStatus.ERROR, SiriusPlugin.ID, "Error while loading the extension " + element.getDeclaringExtension().getUniqueIdentifier(), e)); + SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, + MessageFormat.format(Messages.EclipseDeleteHookDescriptor_extensionLoadingErrorMsg, element.getDeclaringExtension().getUniqueIdentifier()), e)); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/refresh/AbstractProviderDescriptor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/refresh/AbstractProviderDescriptor.java index 554a1a4fee..fd7bf1e5f3 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/refresh/AbstractProviderDescriptor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/refresh/AbstractProviderDescriptor.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 @@ -10,8 +10,11 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.helper.refresh; +import java.text.MessageFormat; + import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.sirius.business.api.refresh.RefreshConstants; +import org.eclipse.sirius.viewpoint.Messages; /** * The provider descriptor for the refresh API. @@ -72,7 +75,7 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP if (defaultValue != null) { return defaultValue; } - throw new IllegalArgumentException("The " + name + " attribute is missing"); //$NON-NLS-1$ + throw new IllegalArgumentException(MessageFormat.format(Messages.AbstractProviderDescriptor_attributeMissingMsg, name)); } /** @@ -85,13 +88,16 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP } /** - * Returns the value of the priority described by the given {@link String}.<br/> + * Returns the value of the priority described by the given {@link String}. + * <br/> * Returned values according to <code>priorityString</code> value : * <ul> - * <li>"lowest" => {@value RefreshConstants#PRIORITY_LOWEST}</li> + * <li>"lowest" => {@value RefreshConstants#PRIORITY_LOWEST} + * </li> * <li>"low" => {@value RefreshConstants#PRIORITY_LOW}</li> * <li>"high" => {@value RefreshConstants#PRIORITY_HIGH}</li> - * <li>"highest" => {@value RefreshConstants#PRIORITY_HIGHEST}</li> + * <li>"highest" => {@value RefreshConstants#PRIORITY_HIGHEST} + * </li> * <li>anything else => {@value RefreshConstants#PRIORITY_NORMAL}</li> * </ul> * @@ -119,6 +125,7 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP * * @see java.lang.Comparable#compareTo(T) */ + @Override public int compareTo(final AbstractProviderDescriptor other) { return doCompareTo(other); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationElementsTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationElementsTask.java index caad72178b..a748b34c72 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationElementsTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationElementsTask.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 @@ -27,6 +27,7 @@ import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.tools.api.command.DCommand; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.collect.Iterators; @@ -127,7 +128,7 @@ public class DeleteDRepresentationElementsTask extends AbstractCompoundTask { */ @Override public String getLabel() { - return "Delete representation elements task"; + return Messages.DeleteDRepresentationElementsTask_label; } private Set<EObject> completeCollection(final Collection<EObject> semantics) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationTask.java index 3103d30b84..6294a34ede 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteDRepresentationTask.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,8 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.helper.task; +import java.text.MessageFormat; + import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.sirius.business.api.helper.task.AbstractCommandTask; import org.eclipse.sirius.business.api.session.Session; @@ -17,6 +19,7 @@ import org.eclipse.sirius.business.api.session.SessionManager; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -47,6 +50,7 @@ public class DeleteDRepresentationTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { /* only destroy attached elements */ @@ -80,10 +84,11 @@ public class DeleteDRepresentationTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { if (representation != null) { - return "Delete " + representation.getName(); + return MessageFormat.format(Messages.DeleteDRepresentationTask_label, representation.getName()); } - return "Delete representation"; + return Messages.DeleteRepresentationCommand_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteWithoutToolTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteWithoutToolTask.java index 91373b7ab8..41ec6f5354 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteWithoutToolTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/DeleteWithoutToolTask.java @@ -24,6 +24,7 @@ import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; @@ -84,7 +85,7 @@ public class DeleteWithoutToolTask extends AbstractCompoundTask { @Override public String getLabel() { - return "Delete without tool"; + return Messages.DeleteWithoutToolTask_label; } @Override diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/ExecuteToolOperationTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/ExecuteToolOperationTask.java index 9feed75ea5..69cdf041a0 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/ExecuteToolOperationTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/ExecuteToolOperationTask.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 @@ -25,6 +25,7 @@ import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaCla import org.eclipse.sirius.tools.api.command.CommandContext; import org.eclipse.sirius.tools.api.command.ui.UICallBack; import org.eclipse.sirius.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.tool.ContainerModelOperation; import org.eclipse.sirius.viewpoint.description.tool.ModelOperation; @@ -83,6 +84,7 @@ public class ExecuteToolOperationTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { final CommandContext context = this.rootOperationTask.getContext(); executeTask(this.rootOperationTask, context); @@ -93,8 +95,9 @@ public class ExecuteToolOperationTask extends AbstractCommandTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "the main tool operation task"; + return Messages.ExecuteToolOperationTask_label; } private void executeTask(final ICommandTask task, final CommandContext context) { @@ -102,9 +105,9 @@ public class ExecuteToolOperationTask extends AbstractCommandTask { try { task.execute(); } catch (MetaClassNotFoundException e) { - SiriusPlugin.getDefault().error("Error while modifying model", e); + SiriusPlugin.getDefault().error(Messages.TaskExecutor_errorModifyingModelMsg, e); } catch (FeatureNotFoundException e) { - SiriusPlugin.getDefault().error("Error while modifying model", e); + SiriusPlugin.getDefault().error(Messages.TaskExecutor_errorModifyingModelMsg, e); } if (!(task instanceof ForTask)) { final Iterator<ICommandTask> itTasks = task.getChildrenTasks().iterator(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ChangeContextTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ChangeContextTask.java index 92b1a10521..c49ea4b172 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ChangeContextTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ChangeContextTask.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 @@ -16,6 +16,7 @@ import org.eclipse.sirius.business.api.logger.RuntimeLoggerManager; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.tools.api.command.CommandContext; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.ChangeContext; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; @@ -66,7 +67,8 @@ public class ChangeContextTask extends AbstractOperationTask { * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "change the context"; + return Messages.ChangeContextTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/CreateInstanceTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/CreateInstanceTask.java index 0a3ee07719..4860c68a31 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/CreateInstanceTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/CreateInstanceTask.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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.helper.task.operations; +import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -24,6 +25,7 @@ import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.Feature import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaClassNotFoundException; import org.eclipse.sirius.tools.api.command.CommandContext; import org.eclipse.sirius.viewpoint.DRepresentationElement; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.tool.CreateInstance; @@ -67,13 +69,14 @@ public class CreateInstanceTask extends AbstractOperationTask implements ICreati * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() throws MetaClassNotFoundException, FeatureNotFoundException { target = context.getCurrentTarget(); final String typeName = getFeatureName(target, createOp, createOp.getTypeName()); instance = extPackage.createInstance(typeName); if (instance == null) { // the creation failed - SiriusPlugin.getDefault().error("Impossible to create a " + typeName, new RuntimeException()); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.CreateInstanceTask_creationErrorMsg, typeName), new RuntimeException()); return; } if (!StringUtil.isEmpty(createOp.getVariableName())) { @@ -87,7 +90,7 @@ public class CreateInstanceTask extends AbstractOperationTask implements ICreati // already specified. final Object value = extPackage.eGet(target, referenceName); if (value != null) { - SiriusPlugin.getDefault().error("Impossible to add a value to the reference " + referenceName + " of the object " + target, new RuntimeException()); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.CreateInstanceTask_addToRefErrorMsg, referenceName, target), new RuntimeException()); return; } } @@ -101,8 +104,9 @@ public class CreateInstanceTask extends AbstractOperationTask implements ICreati * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "Create a new instance"; + return Messages.CreateInstanceTask_label; } /** @@ -110,6 +114,7 @@ public class CreateInstanceTask extends AbstractOperationTask implements ICreati * * @see org.eclipse.sirius.business.api.helper.task.ICreationTask#getCreatedElements() */ + @Override public Collection<EObject> getCreatedElements() { final Collection<EObject> result = new HashSet<EObject>(1); if (instance != null) { @@ -123,6 +128,7 @@ public class CreateInstanceTask extends AbstractOperationTask implements ICreati * * @see org.eclipse.sirius.business.internal.helper.task.IModificationTask#getAffectedElements() */ + @Override public Collection<EObject> getAffectedElements() { final Collection<EObject> result = new HashSet<EObject>(1); if (target != null) { @@ -136,6 +142,7 @@ public class CreateInstanceTask extends AbstractOperationTask implements ICreati * * @see org.eclipse.sirius.business.internal.helper.task.IModificationTask#getCreatedReferences() */ + @Override public Collection<EObject> getCreatedReferences() { // not applicable return Collections.emptySet(); @@ -146,6 +153,7 @@ public class CreateInstanceTask extends AbstractOperationTask implements ICreati * * @see org.eclipse.sirius.business.api.helper.task.ICreationTask#getCreatedRepresentationElements() */ + @Override public Collection<DRepresentationElement> getCreatedRepresentationElements() { // nothing return Collections.emptySet(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ExternalJavaActionTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ExternalJavaActionTask.java index f40af9cf42..3f67fa7859 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ExternalJavaActionTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ExternalJavaActionTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 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.business.internal.helper.task.operations; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -25,6 +26,7 @@ import org.eclipse.sirius.tools.api.command.CommandContext; import org.eclipse.sirius.tools.api.command.ui.UICallBack; import org.eclipse.sirius.tools.api.ui.ExternalJavaActionProvider; import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.ExternalJavaAction; import org.eclipse.sirius.viewpoint.description.tool.ExternalJavaActionParameter; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; @@ -94,7 +96,7 @@ public class ExternalJavaActionTask extends AbstractOperationTask { @Override public String getLabel() { - return "Execute external java action \"" + externalJavaAction.getName() + "\""; + return MessageFormat.format(Messages.ExternalJavaActionTask_label, externalJavaAction.getName()); } @Override diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ForTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ForTask.java index 3b702fac14..39ba3f820d 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ForTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/ForTask.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 @@ -29,6 +29,7 @@ import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaCla import org.eclipse.sirius.tools.api.command.CommandContext; import org.eclipse.sirius.tools.api.command.ui.UICallBack; import org.eclipse.sirius.viewpoint.DRepresentationElement; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.For; import org.eclipse.sirius.viewpoint.description.tool.ModelOperation; @@ -104,7 +105,7 @@ public class ForTask extends AbstractOperationTask implements ICreationTask, IDe @Override public String getLabel() { - return "a for task"; + return Messages.ForTask_label; } @Override diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/IfTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/IfTask.java index baed9776e6..d35f9cc5de 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/IfTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/IfTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 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 @@ -10,11 +10,14 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.helper.task.operations; +import java.text.MessageFormat; + import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.business.api.logger.RuntimeLoggerManager; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.tools.api.command.CommandContext; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.tool.If; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; @@ -58,6 +61,6 @@ public class IfTask extends AbstractOperationTask { @Override public String getLabel() { - return "Evaluate : " + ifOperation.getConditionExpression(); + return MessageFormat.format(Messages.IfTask_label, ifOperation.getConditionExpression()); } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/InterpretedExpressionVariableTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/InterpretedExpressionVariableTask.java index c3842c6ccb..5dbb2cec6f 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/InterpretedExpressionVariableTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/InterpretedExpressionVariableTask.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.business.internal.helper.task.operations; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.tools.api.command.CommandContext; +import org.eclipse.sirius.viewpoint.Messages; /** * A task to use an interpreted expression variable. @@ -66,6 +67,7 @@ public final class InterpretedExpressionVariableTask extends AbstractOperationTa * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { switch (kind) { @@ -88,8 +90,9 @@ public final class InterpretedExpressionVariableTask extends AbstractOperationTa * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "set or unset an acceleo variable task"; + return Messages.InterpretedExpressionVariableTask_label; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/MoveElementTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/MoveElementTask.java index 64e67ad1a8..fbbe065b8c 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/MoveElementTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/MoveElementTask.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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.helper.task.operations; +import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; @@ -21,6 +22,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException; import org.eclipse.sirius.tools.api.command.CommandContext; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.tool.MoveElement; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; @@ -72,7 +74,7 @@ public class MoveElementTask extends AbstractOperationTask implements IModificat // already specified. final Object value = extPackage.eGet(container, featureName); if (value != null) { - SiriusPlugin.getDefault().error("Impossible to add a value to the reference " + featureName + " of the object " + container, new RuntimeException()); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.MoveElementTask_ImpossibleToAddValueErrorMsg, featureName, container), new RuntimeException()); return; } } @@ -84,7 +86,7 @@ public class MoveElementTask extends AbstractOperationTask implements IModificat @Override public String getLabel() { - return "Move an element"; + return Messages.MoveElementTask_label; } /** diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/RemoveElementTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/RemoveElementTask.java index fe6378d5b3..fe1b1a6638 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/RemoveElementTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/RemoveElementTask.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 @@ -20,6 +20,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.tools.api.command.CommandContext; import org.eclipse.sirius.viewpoint.DRepresentationElement; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.tool.DeleteView; import org.eclipse.sirius.viewpoint.description.tool.RemoveElement; @@ -75,7 +76,7 @@ public class RemoveElementTask extends AbstractOperationTask implements IDeletio this.toBeRemoved = context.getCurrentTarget(); if (deleteView) { if (!(toBeRemoved instanceof DRepresentationElement)) { - SiriusPlugin.getDefault().warning("The element is not a view ! Do not delete !", new IllegalArgumentException()); + SiriusPlugin.getDefault().warning(Messages.RemoveElementTask_notAViewErrorMsg, new IllegalArgumentException()); return; } } @@ -86,7 +87,7 @@ public class RemoveElementTask extends AbstractOperationTask implements IDeletio @Override public String getLabel() { - return "Remove an element"; + return Messages.RemoveElementTask_label; } @Override diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/SetValueTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/SetValueTask.java index 253e3813d5..02f237982d 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/SetValueTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/SetValueTask.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 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.interpreter.IInterpreter; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException; import org.eclipse.sirius.tools.api.command.CommandContext; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.SetObject; import org.eclipse.sirius.viewpoint.description.tool.SetValue; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; @@ -83,7 +84,7 @@ public class SetValueTask extends AbstractOperationTask implements IModification @Override public String getLabel() { - return "Set a value"; + return Messages.SetValueTask_label; } @Override diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/UnsetTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/UnsetTask.java index 53a62d7907..b1117db59e 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/UnsetTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/helper/task/operations/UnsetTask.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 @@ -24,6 +24,7 @@ import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException; import org.eclipse.sirius.tools.api.command.CommandContext; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; import org.eclipse.sirius.viewpoint.description.tool.Unset; @@ -52,14 +53,14 @@ public class UnsetTask extends AbstractOperationTask { public UnsetTask(CommandContext context, ModelAccessor extPackage, Unset unsetOp, IInterpreter interpreter) { super(context, extPackage, interpreter); if (unsetOp == null) { - throw new IllegalArgumentException("unsetOp is null"); + throw new IllegalArgumentException(Messages.UnsetTask_nullOperationErrorMsg); } this.unsetOp = unsetOp; } @Override public String getLabel() { - return "unset the value"; + return Messages.UnsetTask_label; } @Override diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/MarkerRuntimeLoggerImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/MarkerRuntimeLoggerImpl.java index 0d51a9579b..7ef3f9bf36 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/MarkerRuntimeLoggerImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/MarkerRuntimeLoggerImpl.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.logger; +import java.text.MessageFormat; + import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; @@ -22,6 +24,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.sirius.business.api.logger.MarkerRuntimeLogger; import org.eclipse.sirius.business.api.logger.RuntimeLogger; import org.eclipse.sirius.common.tools.api.util.StringUtil; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -36,6 +39,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg * @see org.eclipse.sirius.business.api.logger.RuntimeLogger#error(org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature, java.lang.String) */ + @Override public void error(final EObject odesignObject, final EStructuralFeature feature, final String message) { MarkerRuntimeLoggerImpl.addMarkerFor(odesignObject, feature, message, IMarker.SEVERITY_ERROR); } @@ -46,6 +50,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg * @see org.eclipse.sirius.business.api.logger.RuntimeLogger#error(org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature, java.lang.Throwable) */ + @Override public void error(final EObject odesignObject, final EStructuralFeature feature, final Throwable exception) { String message = StringUtil.EMPTY_STRING; if (exception != null) { @@ -60,6 +65,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg * @see org.eclipse.sirius.business.api.logger.RuntimeLogger#info(org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature, java.lang.Throwable) */ + @Override public void info(final EObject odesignObject, final EStructuralFeature feature, final Throwable exception) { String message = StringUtil.EMPTY_STRING; if (exception != null) { @@ -74,6 +80,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg * @see org.eclipse.sirius.business.api.logger.RuntimeLogger#info(org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature, java.lang.String) */ + @Override public void info(final EObject odesignObject, final EStructuralFeature feature, final String message) { MarkerRuntimeLoggerImpl.addMarkerFor(odesignObject, feature, message, IMarker.SEVERITY_INFO); } @@ -84,6 +91,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg * @see org.eclipse.sirius.business.api.logger.RuntimeLogger#warning(org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature, java.lang.Throwable) */ + @Override public void warning(final EObject odesignObject, final EStructuralFeature feature, final Throwable exception) { String message = StringUtil.EMPTY_STRING; if (exception != null) { @@ -98,6 +106,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg * @see org.eclipse.sirius.business.api.logger.RuntimeLogger#warning(org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature, java.lang.String) */ + @Override public void warning(final EObject odesignObject, final EStructuralFeature feature, final String message) { MarkerRuntimeLoggerImpl.addMarkerFor(odesignObject, feature, message, IMarker.SEVERITY_WARNING); } @@ -105,6 +114,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg /** * Clears all errors in the loggers. */ + @Override public void clearAll() { // Nothing happens } @@ -115,6 +125,7 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg * @param object * EObject we want to clearAll logged entries */ + @Override public void clear(final EObject object) { if (object != null) { Resource objectResource = object.eResource(); @@ -163,10 +174,12 @@ public class MarkerRuntimeLoggerImpl implements RuntimeLogger, MarkerRuntimeLogg marker.setAttribute(MarkerRuntimeLogger.URI_MARKER_ATTRIBUTE, EcoreUtil.getURI(markerTarget).toString()); String markerMessage = StringUtil.EMPTY_STRING; if (feature != null) { - markerMessage += "Feature: " + feature.getName() + " "; - } - if (message != null) { - markerMessage += message; + markerMessage = MessageFormat.format(Messages.MarkerRuntimeLoggerImpl_feature, feature.getName()); + if (message != null) { + markerMessage = MessageFormat.format(Messages.MarkerRuntimeLoggerImpl_featureWithMessage, feature.getName(), message); + } + } else if (message != null) { + markerMessage = message; } marker.setAttribute(IMarker.MESSAGE, markerMessage); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/RuntimeLoggerInterpreterImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/RuntimeLoggerInterpreterImpl.java index 682240bbcd..2da65dacfe 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/RuntimeLoggerInterpreterImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/logger/RuntimeLoggerInterpreterImpl.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 @@ -19,6 +19,7 @@ import org.eclipse.sirius.business.api.logger.RuntimeLoggerInterpreter; import org.eclipse.sirius.business.api.logger.RuntimeLoggerManager; import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -28,8 +29,6 @@ import org.eclipse.sirius.viewpoint.SiriusPlugin; */ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { - private static final String EVALUATION_CONDITION_ERROR = "Evaluation condition error"; - private IInterpreter interpreter; /** @@ -49,6 +48,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { * org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature) */ + @Override public Object evaluate(final EObject context, final EObject descriptionObject, final EStructuralFeature descriptionFeature) { final String expression = (String) descriptionObject.eGet(descriptionFeature); try { @@ -68,6 +68,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { * org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature) */ + @Override public boolean evaluateBoolean(final EObject context, final EObject descriptionObject, final EStructuralFeature descriptionFeature) { return evaluateBoolean(context, descriptionObject, descriptionFeature, false); } @@ -80,6 +81,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { * org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature, boolean) */ + @Override public boolean evaluateBoolean(final EObject context, final EObject descriptionObject, final EStructuralFeature descriptionFeature, final boolean flagCondition) { final String expression = (String) descriptionObject.eGet(descriptionFeature); try { @@ -88,7 +90,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { } catch (final EvaluationException e) { RuntimeLoggerManager.INSTANCE.error(descriptionObject, descriptionFeature, e); if (flagCondition) { - SiriusPlugin.getDefault().error(EVALUATION_CONDITION_ERROR, e); + SiriusPlugin.getDefault().error(Messages.RuntimeLoggerInterpreterImpl_evaluationConditionErrorMsg, e); } } return false; @@ -101,6 +103,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { * org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature) */ + @Override public Integer evaluateInteger(final EObject context, final EObject descriptionObject, final EStructuralFeature descriptionFeature) { final String expression = (String) descriptionObject.eGet(descriptionFeature); try { @@ -119,6 +122,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { * org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature) */ + @Override public String evaluateString(final EObject context, final EObject descriptionObject, final EStructuralFeature descriptionFeature) { final String expression = (String) descriptionObject.eGet(descriptionFeature); try { @@ -137,6 +141,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { * org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature) */ + @Override public EObject evaluateEObject(final EObject context, final EObject descriptionObject, final EStructuralFeature descriptionFeature) { final String expression = (String) descriptionObject.eGet(descriptionFeature); try { @@ -155,6 +160,7 @@ public class RuntimeLoggerInterpreterImpl implements RuntimeLoggerInterpreter { * org.eclipse.emf.ecore.EObject, * org.eclipse.emf.ecore.EStructuralFeature) */ + @Override public Collection<EObject> evaluateCollection(final EObject context, final EObject descriptionObject, final EStructuralFeature descriptionFeature) { final String expression = (String) descriptionObject.eGet(descriptionFeature); try { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/validation/operations/ValidationRuleSpecOperations.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/validation/operations/ValidationRuleSpecOperations.java index 82a543b7c8..97661dbe35 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/validation/operations/ValidationRuleSpecOperations.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/validation/operations/ValidationRuleSpecOperations.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 @@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.business.api.logger.RuntimeLoggerManager; import org.eclipse.sirius.common.tools.api.interpreter.EvaluationException; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.validation.RuleAudit; import org.eclipse.sirius.viewpoint.description.validation.ValidationPackage; @@ -76,7 +77,7 @@ public final class ValidationRuleSpecOperations { try { message = acceleoInterpreter.evaluateString(eObj, message); } catch (final EvaluationException e) { - SiriusPlugin.getDefault().error("Error while evaluating audit message.", e); + SiriusPlugin.getDefault().error(Messages.ValidationRuleSpecOperations_evaluationErrorMsg, e); } return message; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractSiriusMigrationService.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractSiriusMigrationService.java index b7e217ac04..4b6c9f3de7 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractSiriusMigrationService.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractSiriusMigrationService.java @@ -31,6 +31,7 @@ import org.eclipse.sirius.business.api.migration.IMigrationParticipant; import org.eclipse.sirius.common.tools.api.util.EclipseUtil; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.osgi.framework.Version; import org.xml.sax.Attributes; @@ -85,7 +86,7 @@ public abstract class AbstractSiriusMigrationService implements IMigrationPartic } } catch (CoreException e) { - SiriusPlugin.getDefault().getLog().log(new Status(Status.WARNING, SiriusPlugin.ID, "Cannot instanciate migration contribution", e)); + SiriusPlugin.getDefault().getLog().log(new Status(Status.WARNING, SiriusPlugin.ID, Messages.AbstractSiriusMigrationService_contributionInstantiationErrorMsg, e)); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractVersionSAXParser.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractVersionSAXParser.java index f422af06dd..f2173abdbf 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractVersionSAXParser.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/AbstractVersionSAXParser.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 @@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl; import org.eclipse.sirius.business.internal.session.parser.SiriusSaxParserNormalAbortException; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -64,7 +65,7 @@ public abstract class AbstractVersionSAXParser { * @return the version */ public String getVersion(final IProgressMonitor monitor) { - monitor.beginTask("Get version number of representations file", 1); + monitor.beginTask(Messages.AbstractVersionSAXParser_getVersionMsg, 1); VersionHandler versionHandler = new VersionHandler(); ExtensibleURIConverterImpl uriConverterImpl = new ExtensibleURIConverterImpl(); @@ -112,7 +113,7 @@ public abstract class AbstractVersionSAXParser { public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (qName.equals(getVersionedElementQualifiedName())) { version = attributes.getValue("version"); //$NON-NLS-1$ - throw new SiriusSaxParserNormalAbortException("All needed informations have been reached. Stop the parsing."); + throw new SiriusSaxParserNormalAbortException(Messages.AbstractVersionSAXParser_stopParsingMsg); } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java index bfdc893f07..986633f076 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/MigrationUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007-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 @@ -37,6 +37,7 @@ import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.emf.ecore.xmi.impl.BasicResourceHandler; import org.eclipse.emf.ecore.xml.type.AnyType; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -101,7 +102,7 @@ public final class MigrationUtil { qualifiedAttributeName = featureMappings.get(name); } final String[] decomposedName = qualifiedAttributeName.split(Pattern.quote(DOT)); - assert decomposedName.length == 2 : "the mapping is not valid"; + assert decomposedName.length == 2 : Messages.MigrationUtil_invalidMappingErrorMsg; EStructuralFeature result = null; final EClass classifier = MigrationUtil.findEClass(eClass.getEPackage(), decomposedName[0]); result = classifier.getEStructuralFeature(decomposedName[1]); @@ -125,12 +126,12 @@ public final class MigrationUtil { try { result.load(in); } catch (final IOException e) { - SiriusPlugin.getDefault().error("I/O Error", e); + SiriusPlugin.getDefault().error(Messages.MigrationUtil_IOErrorMsg, e); } finally { try { in.close(); } catch (final IOException e) { - SiriusPlugin.getDefault().error("I/O Error", e); + SiriusPlugin.getDefault().error(Messages.MigrationUtil_IOErrorMsg, e); } } final Map<String, String> resultMap = new HashMap<String, String>(); @@ -152,10 +153,10 @@ public final class MigrationUtil { * @return the contents of the file. */ public static String getContents(final File file, final IProgressMonitor monitor) { - monitor.subTask("Loading File"); + monitor.subTask(Messages.MigrationUtil_loadingMsg); if (file.length() > Integer.MAX_VALUE) { // file length is too big to get contents - SiriusPlugin.getDefault().error("The size of the file is too big to get its contents.", null); + SiriusPlugin.getDefault().error(Messages.MigrationUtil_toBigErrorMsg, null); } else { int fileLenght = (int) file.length(); byte[] b = new byte[fileLenght]; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/session/commands/MigrationCommandExecutor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/session/commands/MigrationCommandExecutor.java index fe33264439..792c521631 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/session/commands/MigrationCommandExecutor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/migration/resource/session/commands/MigrationCommandExecutor.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.business.internal.migration.resource.session.commands; +import java.text.MessageFormat; import java.util.HashMap; import java.util.Map; @@ -20,6 +21,7 @@ import org.eclipse.emf.transaction.RollbackException; import org.eclipse.emf.transaction.Transaction; import org.eclipse.emf.transaction.TransactionalCommandStack; import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -53,9 +55,9 @@ public class MigrationCommandExecutor { try { commandStack.execute(command, OPTIONS); } catch (InterruptedException e) { - SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, "Migration error " + e.getLocalizedMessage())); + SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, MessageFormat.format(Messages.MigrationCommandExecutor_migrationErrorMsg, e.getLocalizedMessage()))); } catch (RollbackException e) { - SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, "Migration error " + e.getLocalizedMessage())); + SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, MessageFormat.format(Messages.MigrationCommandExecutor_migrationErrorMsg, e.getLocalizedMessage()))); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/AttachSemanticResourcesJob.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/AttachSemanticResourcesJob.java index 3bd625ae74..c65aa4b2b7 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/AttachSemanticResourcesJob.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/AttachSemanticResourcesJob.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 @@ -25,6 +25,7 @@ import org.eclipse.emf.common.util.URI; import org.eclipse.sirius.business.api.modelingproject.AbstractRepresentationsFileJob; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.tools.api.command.semantic.AddSemanticResourceCommand; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -34,8 +35,6 @@ import org.eclipse.sirius.viewpoint.SiriusPlugin; */ public class AttachSemanticResourcesJob extends Job { - private static final String ACTION_NAME = "Attach semantic resources"; - private Map<Session, Set<URI>> semanticResourcesURIsToAttachPerSession; /** @@ -46,7 +45,7 @@ public class AttachSemanticResourcesJob extends Job { * resource {@link URI} to attach to it */ public AttachSemanticResourcesJob(Map<Session, Set<URI>> semanticResourcesURIsToAddPerSession) { - super(ACTION_NAME); + super(Messages.AttachSemanticResourcesJob_name); this.semanticResourcesURIsToAttachPerSession = semanticResourcesURIsToAddPerSession; } @@ -58,7 +57,7 @@ public class AttachSemanticResourcesJob extends Job { @Override public IStatus run(IProgressMonitor monitor) { try { - monitor.beginTask(ACTION_NAME, 6 * semanticResourcesURIsToAttachPerSession.size()); + monitor.beginTask(Messages.AttachSemanticResourcesJob_name, 6 * semanticResourcesURIsToAttachPerSession.size()); for (Entry<Session, Set<URI>> entry : semanticResourcesURIsToAttachPerSession.entrySet()) { Session session = entry.getKey(); if (session != null && session.isOpen()) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/InitializeModelingProjectJob.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/InitializeModelingProjectJob.java index 09616c04b0..4a5eb80742 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/InitializeModelingProjectJob.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/modelingproject/manager/InitializeModelingProjectJob.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 @@ -25,6 +25,7 @@ import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.sirius.business.api.modelingproject.ModelingProject; import org.eclipse.sirius.business.internal.modelingproject.marker.ModelingMarker; import org.eclipse.sirius.ext.base.Option; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.base.Predicate; @@ -41,7 +42,7 @@ public class InitializeModelingProjectJob extends WorkspaceJob { /** * The label of the job. */ - public static final String JOB_LABEL = "Initializing Modeling Projects"; + public static final String JOB_LABEL = Messages.InitializeModelingProjectJob_label; /** * The label of the job (if all projects are empty, ie containing only @@ -50,7 +51,7 @@ public class InitializeModelingProjectJob extends WorkspaceJob { * empty project (in case of importing simultaneously several projects). See * ModelingProjectResourceListener for more details. */ - public static final String JOB_LABEL_FOR_EMPTY_PROJECTS = "Initializing Empty Modeling Projects"; + public static final String JOB_LABEL_FOR_EMPTY_PROJECTS = Messages.InitializeModelingProjectJob_labelEmptyProject; /** * The family id for this kind of job. @@ -84,6 +85,7 @@ public class InitializeModelingProjectJob extends WorkspaceJob { */ public InitializeModelingProjectJob(List<IProject> projects) { this(Iterators.all(projects.iterator(), new Predicate<IProject>() { + @Override public boolean apply(IProject input) { try { return input.members().length == 1; @@ -155,9 +157,9 @@ public class InitializeModelingProjectJob extends WorkspaceJob { IStatus result = Status.OK_STATUS; if (errorStatus.size() == 1) { - result = new MultiStatus(SiriusPlugin.ID, IStatus.ERROR, errorStatus.toArray(new IStatus[0]), "One modeling project is invalid.", null); + result = new MultiStatus(SiriusPlugin.ID, IStatus.ERROR, errorStatus.toArray(new IStatus[0]), Messages.InitializeModelingProjectJob_invalidModelingProjectErrorMsg, null); } else if (errorStatus.size() > 1) { - result = new MultiStatus(SiriusPlugin.ID, IStatus.ERROR, errorStatus.toArray(new IStatus[0]), "Several modeling projects are invalid.", null); + result = new MultiStatus(SiriusPlugin.ID, IStatus.ERROR, errorStatus.toArray(new IStatus[0]), Messages.InitializeModelingProjectJob_invalidModelingProjectsErrorMsg, null); } return result; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/DynamicVSMLoader.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/DynamicVSMLoader.java index 12e34e66d5..bc771ea66c 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/DynamicVSMLoader.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/DynamicVSMLoader.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 @@ -25,6 +25,7 @@ import com.google.common.base.Joiner; import com.google.common.base.Preconditions; import com.google.common.collect.Sets; import com.google.common.collect.Sets.SetView; + /** * A VSM Reloader is responsible for keeping the VSM resources loaded in a * resource set in sync with the logical Viewpoints actually needed in the @@ -127,7 +128,7 @@ public class DynamicVSMLoader implements ViewpointRegistryListener { public synchronized void require(URI viewpoint) { Preconditions.checkNotNull(viewpoint); Option<URI> provider = registry.getProvider(viewpoint); - Preconditions.checkState(provider.some(), MessageFormat.format("The specified viewpoint {0} is not available.", viewpoint.toString())); + Preconditions.checkState(provider.some(), MessageFormat.format("The specified viewpoint {0} is not available.", viewpoint.toString())); //$NON-NLS-1$ boolean added = this.requiredViewpoints.add(viewpoint); if (added) { refresh(); @@ -162,6 +163,7 @@ public class DynamicVSMLoader implements ViewpointRegistryListener { /** * {@inheritDoc} */ + @Override public synchronized void registryChanged(ViewpointRegistry reg, Set<URI> removed, Set<URI> added, Set<URI> changed) { assert reg == this.registry; SetView<URI> absentRequirements = Sets.intersection(requiredViewpoints, removed); @@ -169,7 +171,7 @@ public class DynamicVSMLoader implements ViewpointRegistryListener { if (errorHandler != null) { errorHandler.run(); } else { - throw new IllegalStateException("The required viewpoints " + Joiner.on(", ").join(absentRequirements) + " are not available anymore."); + throw new IllegalStateException("The required viewpoints " + Joiner.on(", ").join(absentRequirements) + " are not available anymore."); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ } } refresh(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/VSMResolver.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/VSMResolver.java index 4480737337..3a6ae710f8 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/VSMResolver.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/VSMResolver.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 @@ -25,9 +25,10 @@ import com.google.common.base.Predicates; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Sets; + /** - * Resolves a set of logical Sirius URIs into the complete set of physical - * VSM resources required to be loaded to provide all these Viewpoints. + * Resolves a set of logical Sirius URIs into the complete set of physical VSM + * resources required to be loaded to provide all these Viewpoints. * * @author pierre-charles.david@obeo.fr */ @@ -65,6 +66,7 @@ public class VSMResolver { Set<URI> allLogical = computeAllLogicalRequirements(logicalURIs); final Set<URI> missing = Sets.newHashSet(); Iterable<URI> allPhysical = Iterables.transform(allLogical, new Function<URI, URI>() { + @Override public URI apply(URI from) { Option<URI> provider = registry.getProvider(from); if (provider.some()) { @@ -76,7 +78,7 @@ public class VSMResolver { } }); if (!missing.isEmpty()) { - String msg = MessageFormat.format("Some of the required logical Sirius URIs could not be resolved to physical resources: {0}.", Joiner.on(", ").join(missing)); //$NON-NLS-2$ + String msg = MessageFormat.format("Some of the required logical Sirius URIs could not be resolved to physical resources: {0}.", Joiner.on(", ").join(missing)); //$NON-NLS-1$//$NON-NLS-2$ throw new IllegalArgumentException(msg); } else { return ImmutableSet.copyOf(Iterables.filter(allPhysical, Predicates.notNull())); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/ViewpointSelection.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/ViewpointSelection.java index 562a2e5f62..4450b3da2c 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/ViewpointSelection.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/ViewpointSelection.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 @@ -36,7 +36,7 @@ import com.google.common.collect.Sets; * @author pierre-charles.david@obeo.fr */ public class ViewpointSelection { - private static final String INVALID_VIEWPOINT_URI = "Selection must contain only logical Viewpoint URIs"; + private static final String INVALID_VIEWPOINT_URI = "Selection must contain only logical Viewpoint URIs"; //$NON-NLS-1$ /** * The set of logical Sirius URIs which make up the selection itself. @@ -65,12 +65,14 @@ public class ViewpointSelection { private Set<URI> conflicts = Collections.emptySet(); private final Predicate<URI> isValidViewpointURI = new Predicate<URI>() { + @Override public boolean apply(URI input) { return ViewpointURIQuery.isValidViewpointURI(input); } }; private final Function<URI, Viewpoint> viewpointImplementation = new Function<URI, Viewpoint>() { + @Override public Viewpoint apply(URI from) { return registry.getViewpoint(from); } @@ -189,6 +191,7 @@ public class ViewpointSelection { public String getErrorMessage() { validate(); Function<URI, String> shortName = new Function<URI, String>() { + @Override public String apply(URI uri) { return new ViewpointURIQuery(uri).getViewpointName(); } @@ -196,10 +199,10 @@ public class ViewpointSelection { // CHECKSTYLE:OFF StringBuilder sb = new StringBuilder(); if (conflicts != null && !conflicts.isEmpty()) { - sb.append("Conflicts with: " + Joiner.on(", ").join(Iterables.transform(conflicts, shortName))).append("\n"); //$NON-NLS-2$ //$NON-NLS-3$ + sb.append("Conflicts with: " + Joiner.on(", ").join(Iterables.transform(conflicts, shortName))).append("\n"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ } if (unavailable != null && !unavailable.isEmpty()) { - sb.append("Missing: " + Joiner.on(", ").join(Iterables.transform(unavailable, shortName))).append("\n"); //$NON-NLS-2$ //$NON-NLS-3$ + sb.append("Missing: " + Joiner.on(", ").join(Iterables.transform(unavailable, shortName))).append("\n"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ } // CHECKSTYLE:ON return sb.toString(); @@ -207,6 +210,7 @@ public class ViewpointSelection { private boolean allRequiredViewpointAreAvailable() { unavailable = Sets.newHashSet(Iterables.filter(logicalViewpoints, new Predicate<URI>() { + @Override public boolean apply(URI input) { return viewpointImplementation.apply(input) == null; } @@ -233,6 +237,6 @@ public class ViewpointSelection { public String toString() { List<URI> uris = Lists.newArrayList(logicalViewpoints); Collections.sort(uris, Ordering.usingToString()); - return "Viewpoint Selection: " + Joiner.on(", ").join(uris); //$NON-NLS-2$ + return "Viewpoint Selection: " + Joiner.on(", ").join(uris); //$NON-NLS-1$//$NON-NLS-2$ } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/MaskingPolicy.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/MaskingPolicy.java index 3fade4a948..c0d322969e 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/MaskingPolicy.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/MaskingPolicy.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 @@ -36,6 +36,7 @@ import com.google.common.collect.Iterables; import com.google.common.collect.ListMultimap; import com.google.common.collect.Ordering; import com.google.common.collect.Sets; + /** * The masking policy keeps track of which of the loaded resources are masked * and which actually contribute visible Sirius definitions. Only Viewpoints @@ -67,10 +68,10 @@ public class MaskingPolicy { } /** - * A simple descriptor of the concrete implementation of a logical Sirius - * by a specific resource. We use such an descriptor instead of referencing - * the Viewpoints themselves so that the descriptors stay usable event when - * the Sirius's resource has been unloaded. + * A simple descriptor of the concrete implementation of a logical Sirius by + * a specific resource. We use such an descriptor instead of referencing the + * Viewpoints themselves so that the descriptors stay usable event when the + * Sirius's resource has been unloaded. */ private static class SiriusImplementation { /** The logical Sirius URI. */ @@ -119,19 +120,19 @@ public class MaskingPolicy { /** * All the Viewpoints from all the loaded VSMs, whether they are visible or - * not, organized by their Sirius URI. For each logical Sirius URI, - * the providers are ordered using <code>viewpointComparator</code>, putting - * the higher priority at the beginning. + * not, organized by their Sirius URI. For each logical Sirius URI, the + * providers are ordered using <code>viewpointComparator</code>, putting the + * higher priority at the beginning. */ private final ListMultimap<URI, SiriusImplementation> viewpointImplementations = ArrayListMultimap.create(); /** * For each loaded resource A, gives the sum of the number of Viewpoints - * from another resource which masks an equivalent Sirius from the - * resource A. A resource (and all the Viewpoints it defines) is visible if - * and only if this sum is 0. + * from another resource which masks an equivalent Sirius from the resource + * A. A resource (and all the Viewpoints it defines) is visible if and only + * if this sum is 0. */ - private final LoadingCache<Resource, Integer> score = CacheBuilder.newBuilder().<Resource, Integer>build(CacheLoader.from(Functions.constant(0))); + private final LoadingCache<Resource, Integer> score = CacheBuilder.newBuilder().<Resource, Integer> build(CacheLoader.from(Functions.constant(0))); /** * The handler used to find Sirius instances inside loaded resources. @@ -150,6 +151,7 @@ public class MaskingPolicy { */ public MaskingPolicy(Comparator<URI> comparator, ViewpointResourceHandler resourceHandler) { this.viewpointComparator = Ordering.from(comparator).onResultOf(new Function<SiriusImplementation, URI>() { + @Override public URI apply(SiriusImplementation vp) { // The ordering used for masking depends only on the resource's // priority (as defined by the supplied comparator). @@ -170,12 +172,12 @@ public class MaskingPolicy { */ public synchronized MaskingChange resourceLoaded(Resource loaded) { Preconditions.checkNotNull(loaded); - Preconditions.checkState(loaded.isLoaded(), "The resource is not loaded: " + loaded); + Preconditions.checkState(loaded.isLoaded(), "The resource is not loaded: " + loaded); //$NON-NLS-1$ MaskingChange change = new MaskingChange(); for (Viewpoint viewpoint : resourceHandler.collectViewpointDefinitions(loaded)) { Option<URI> uri = new ViewpointQuery(viewpoint).getViewpointURI(); - Preconditions.checkState(uri.some(), "Could not identify logical Sirius URI for Sirius " + viewpoint); + Preconditions.checkState(uri.some(), "Could not identify logical Sirius URI for Sirius " + viewpoint); //$NON-NLS-1$ SiriusImplementation vi = new SiriusImplementation(uri.get(), loaded); List<SiriusImplementation> implementations = viewpointImplementations.get(vi.logicalURI); int insertionPoint = insertSorted(implementations, vi); @@ -212,10 +214,11 @@ public class MaskingPolicy { */ public synchronized MaskingChange aboutToUnload(final Resource unloaded) { Preconditions.checkNotNull(unloaded); - Preconditions.checkState(unloaded.isLoaded(), "The resource is not loaded: " + unloaded); + Preconditions.checkState(unloaded.isLoaded(), "The resource is not loaded: " + unloaded); //$NON-NLS-1$ MaskingChange change = new MaskingChange(); Set<SiriusImplementation> viewpointsFromUnloadedResource = ImmutableSet.copyOf(Iterables.filter(this.viewpointImplementations.values(), new Predicate<SiriusImplementation>() { + @Override public boolean apply(SiriusImplementation input) { return input.provider == unloaded; } @@ -241,12 +244,12 @@ public class MaskingPolicy { * whole list sorted (by viewpointComparator). * * @param providers - * the list of existing implementers of the logical Sirius. - * The list must be sorted according to viewpointComparator. + * the list of existing implementers of the logical Sirius. The + * list must be sorted according to viewpointComparator. * @param viewpoint * a new concrete implementer of the same logical Sirius. - * @return the index in the list at which the new Sirius has been - * inserted to keep the whole properly sorted. + * @return the index in the list at which the new Sirius has been inserted + * to keep the whole properly sorted. */ private int insertSorted(List<SiriusImplementation> providers, SiriusImplementation viewpoint) { assert viewpointComparator.isOrdered(providers); @@ -258,7 +261,7 @@ public class MaskingPolicy { // ignored/masked. return -1; } else { - assert x < 0 : "The viewpoint should not already be present in the list"; + assert x < 0 : "The viewpoint should not already be present in the list"; //$NON-NLS-1$ int insertionPoint = -x - 1; // See Collections.binarySearch((). providers.add(insertionPoint, viewpoint); assert viewpointComparator.isOrdered(providers); @@ -270,14 +273,14 @@ public class MaskingPolicy { * Removes the viewpoint from the sorted list of providers. * * @param providers - * the list of existing implementers of the logical Sirius. - * The list must be sorted according to viewpointComparator. + * the list of existing implementers of the logical Sirius. The + * list must be sorted according to viewpointComparator. * @param viewpoint * a concrete implementer of the logical Sirius to be removed. * @return the index in the list at which the Sirius removed was before. */ private int removeSorted(List<SiriusImplementation> providers, SiriusImplementation viewpoint) { - assert providers != null && providers.contains(viewpoint) : "Trying to remove unknown viewpoint implementation " + viewpoint; + assert providers != null && providers.contains(viewpoint) : "Trying to remove unknown viewpoint implementation " + viewpoint; //$NON-NLS-1$ assert viewpointComparator.isOrdered(providers); int index = viewpointComparator.binarySearch(providers, viewpoint); providers.remove(viewpoint); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/StatusUpdater.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/StatusUpdater.java index 3f60fddde0..31435eff53 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/StatusUpdater.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/StatusUpdater.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 @@ -36,7 +36,7 @@ import com.google.common.collect.Sets.SetView; * @author pierre-charles.david@obeo.fr */ public class StatusUpdater { - private static final String DIAGNOSTICS_SOURCE = "Sirius Registry"; + private static final String DIAGNOSTICS_SOURCE = "Sirius Registry"; //$NON-NLS-1$ private static final int UNDECLARED_DEPENDENCY = 0; @@ -115,11 +115,13 @@ public class StatusUpdater { private void checkAllActualDependenciesAreAvailable(Entry entry) { Set<URI> actualPhysical = ImmutableSet.copyOf(Iterables.transform(entry.getActualDependencies(), new Function<URI, URI>() { + @Override public URI apply(URI from) { return resourceSet.getURIConverter().normalize(from); } })); Set<URI> availablePhysical = ImmutableSet.copyOf(Iterables.transform(entries.values(), new Function<Entry, URI>() { + @Override public URI apply(Entry from) { return from.getResource().getURI(); }; @@ -128,7 +130,7 @@ public class StatusUpdater { if (!unavailable.isEmpty()) { entry.setState(ViewpointState.INVALID); Object[] data = Iterables.toArray(Iterables.transform(unavailable, Functions.toStringFunction()), String.class); - addDiagnostic(entry, Diagnostic.ERROR, PHYSICAL_DEPENDENCY_UNAVAILABLE, "Sirius definition depends on resources not available.", data); + addDiagnostic(entry, Diagnostic.ERROR, PHYSICAL_DEPENDENCY_UNAVAILABLE, "Sirius definition depends on resources not available.", data); //$NON-NLS-1$ } } @@ -142,7 +144,7 @@ public class StatusUpdater { for (URI dependency : entry.getDeclaredDependencies()) { if (!entries.containsKey(dependency)) { entry.setState(ViewpointState.INVALID); - addDiagnostic(entry, Diagnostic.ERROR, DECLARED_DEPENDENCY_UNAVAILABLE, "Invalid dependency declared to unavailable Sirius.", new Object[] { dependency }); + addDiagnostic(entry, Diagnostic.ERROR, DECLARED_DEPENDENCY_UNAVAILABLE, "Invalid dependency declared to unavailable Sirius.", new Object[] { dependency }); //$NON-NLS-1$ } } } @@ -158,6 +160,7 @@ public class StatusUpdater { // Include both the logical URIs and their corresponding physical URIs // in the declared set. Set<URI> declaredResolved = Sets.newHashSet(Iterables.transform(declared, new Function<URI, URI>() { + @Override public URI apply(URI from) { return resourceSet.getURIConverter().normalize(from); } @@ -168,7 +171,7 @@ public class StatusUpdater { if (!undeclared.isEmpty()) { entry.setState(ViewpointState.INVALID); Object[] data = Iterables.toArray(Iterables.transform(undeclared, Functions.toStringFunction()), String.class); - addDiagnostic(entry, Diagnostic.ERROR, UNDECLARED_DEPENDENCY, "Sirius has undeclared dependencies to other resources.", data); + addDiagnostic(entry, Diagnostic.ERROR, UNDECLARED_DEPENDENCY, "Sirius has undeclared dependencies to other resources.", data); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/ViewpointRegistry.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/ViewpointRegistry.java index 66d22e6c1c..5b80fc6c9f 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/ViewpointRegistry.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/ViewpointRegistry.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 @@ -73,7 +73,7 @@ import com.google.common.collect.Sets; * @author pierre-charles.david@obeo.fr */ public class ViewpointRegistry extends org.eclipse.sirius.business.api.componentization.ViewpointRegistry implements ViewpointResourceListener { - private static final String UNABLE_TO_LOAD_THIS_FILE = "The viewpoint registry was not able to load this file "; + private static final String UNABLE_TO_LOAD_THIS_FILE = "The viewpoint registry was not able to load this file "; //$NON-NLS-1$ /** * Internal class used to record entries changes. @@ -99,9 +99,9 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component public String toString() { StringBuilder sb = new StringBuilder(); // CHECKSTYLE:OFF - sb.append("Removed:\n\t").append(Joiner.on("\n\t").join(removed)).append("\n"); //$NON-NLS-2$ //$NON-NLS-3$ - sb.append("Added:\n\t").append(Joiner.on("\n\t").join(added)).append("\n"); //$NON-NLS-2$ //$NON-NLS-3$ - sb.append("Changed:\n\t").append(Joiner.on("\n\t").join(changed)).append("\n"); //$NON-NLS-2$ //$NON-NLS-3$ + sb.append("Removed:\n\t").append(Joiner.on("\n\t").join(removed)).append("\n"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ + sb.append("Added:\n\t").append(Joiner.on("\n\t").join(added)).append("\n"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ + sb.append("Changed:\n\t").append(Joiner.on("\n\t").join(changed)).append("\n"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ // CHECKSTYLE:ON return sb.toString(); } @@ -185,7 +185,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component compositeResourceHandler.addResourceType((ViewpointResourceHandler) handler); } } catch (CoreException e) { - reportWarning("Could not instantiate contributed Sirius Resource Type handler " + element.getAttribute("class")); //$NON-NLS-2$ + reportWarning("Could not instantiate contributed Sirius Resource Type handler " + element.getAttribute("class")); //$NON-NLS-1$//$NON-NLS-2$ } } } @@ -267,6 +267,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public void resourceEvent(ViewpointResourceMonitor origin, Set<URI> removed, Set<URI> added, Set<URI> changed) { /* * This method is the only one from which the content of the registry @@ -356,7 +357,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component updateResourcesStatus(change); resourceSet.getResources().remove(res.get()); } else { - warning(MessageFormat.format("Inconsistent notification: can not remove unknown resource at {0}", uri), null); + warning(MessageFormat.format("Inconsistent notification: can not remove unknown resource at {0}", uri), null); //$NON-NLS-1$ } } @@ -401,6 +402,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component private Option<Resource> findResource(final URI uri) { try { Resource match = Iterables.find(resourceSet.getResources(), new Predicate<Resource>() { + @Override public boolean apply(Resource input) { return input.getURI().equals(uri); } @@ -419,17 +421,17 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component */ private Option<Resource> load(URI uri) { Preconditions.checkNotNull(uri); - Preconditions.checkArgument(uri.isPlatform(), "Unsupported URI scheme: " + uri); + Preconditions.checkArgument(uri.isPlatform(), "Unsupported URI scheme: " + uri); //$NON-NLS-1$ final Option<Resource> result; Resource vsm; try { vsm = resourceSet.getResource(uri, true); if (vsm == null) { - warning(MessageFormat.format("Unable to load the VSM at {0}", uri), null); + warning(MessageFormat.format("Unable to load the VSM at {0}", uri), null); //$NON-NLS-1$ result = Options.newNone(); } else if (!vsm.getErrors().isEmpty()) { - warning(MessageFormat.format("Errors occured while trying to load the VSM at {0}", uri), null); + warning(MessageFormat.format("Errors occured while trying to load the VSM at {0}", uri), null); //$NON-NLS-1$ vsm.unload(); resourceSet.getResources().remove(vsm); result = Options.newNone(); @@ -452,7 +454,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component try { unmasked.load(Collections.emptyMap()); } catch (IOException e) { - warning(MessageFormat.format("Unable to load the VSM at {0}", unmasked.getURI()), e); + warning(MessageFormat.format("Unable to load the VSM at {0}", unmasked.getURI()), e); //$NON-NLS-1$ } } } @@ -610,8 +612,10 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public synchronized Set<Viewpoint> getViewpoints() { return ImmutableSet.copyOf(Iterables.transform(entries.values(), new Function<Entry, Viewpoint>() { + @Override public Viewpoint apply(Entry from) { return from.getSirius(); } @@ -621,6 +625,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public boolean isFromPlugin(Viewpoint viewpoint) { if (viewpoint != null) { Resource viewpointResource = viewpoint.eResource(); @@ -635,6 +640,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public EObject find(EObject eObject) { EObject eObj = null; try { @@ -648,6 +654,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public ECrossReferenceAdapter getCrossReferencer() { return crossReferencer; } @@ -655,6 +662,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public Viewpoint getViewpoint(RepresentationDescription description) { return new RepresentationDescriptionQuery(description).getParentViewpoint(); } @@ -662,6 +670,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public Viewpoint getViewpoint(URI viewpointUri) { if (entries.containsKey(viewpointUri)) { return (entries.get(viewpointUri)).getSirius(); @@ -673,6 +682,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public boolean addListener(ViewpointRegistryListener2 listener) { return legacyListeners.addIfAbsent(listener); } @@ -680,6 +690,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public boolean removeListener(ViewpointRegistryListener2 listener) { return legacyListeners.remove(listener); } @@ -687,6 +698,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public Set<Viewpoint> registerFromPlugin(String modelerModelResourcePath) { try { return legacyMonitor.registerFromPlugin(modelerModelResourcePath); @@ -703,6 +715,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public void disposeFromPlugin(Viewpoint viewpoint) { legacyMonitor.disposeFromPlugin(viewpoint); } @@ -710,6 +723,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public boolean addFilter(ViewpointRegistryFilter filter) { return this.filters.add(filter); } @@ -717,6 +731,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public boolean removeFilter(ViewpointRegistryFilter filter) { return this.filters.remove(filter); } @@ -724,6 +739,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public void removeFilter(String id) { Iterator<ViewpointRegistryFilter> iter = filters.iterator(); while (iter.hasNext()) { @@ -737,6 +753,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public <T extends Component> void registerFromWorkspace(Set<T> components) { } @@ -752,6 +769,7 @@ public class ViewpointRegistry extends org.eclipse.sirius.business.api.component /** * {@inheritDoc} */ + @Override public void dispose() { if (isRunning()) { stop(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/CompositeResourceMonitor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/CompositeResourceMonitor.java index fc222fc1b5..17c49129c2 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/CompositeResourceMonitor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/CompositeResourceMonitor.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,12 +10,14 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.movida.registry.monitoring; +import java.text.MessageFormat; import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.emf.common.util.URI; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; @@ -59,9 +61,9 @@ public class CompositeResourceMonitor extends AbstractViewpointResourceMonitor i * in use. */ public synchronized void addMonitor(String name, ViewpointResourceMonitor monitor) throws IllegalStateException { - Preconditions.checkState(!this.isRunning() && !monitor.isRunning(), "New monitors can not be added while running."); - Preconditions.checkState(!monitors.contains(monitor), "The monitor is already registered in the composite."); - Preconditions.checkState(!names.contains(name), "A monitor is already registered under the name " + name); + Preconditions.checkState(!this.isRunning() && !monitor.isRunning(), Messages.CompositeResourceMonitor_addMonitorErrorMsg); + Preconditions.checkState(!monitors.contains(monitor), Messages.CompositeResourceMonitor_alreadyRegisteredErrorMsg); + Preconditions.checkState(!names.contains(name), MessageFormat.format(Messages.CompositeResourceMonitor_alreadyUsedNameErrorMsg, name)); monitors.add(monitor); names.add(name); @@ -71,6 +73,7 @@ public class CompositeResourceMonitor extends AbstractViewpointResourceMonitor i /** * {@inheritDoc} */ + @Override public synchronized void start() { this.running = true; for (ViewpointResourceMonitor monitor : monitors) { @@ -81,6 +84,7 @@ public class CompositeResourceMonitor extends AbstractViewpointResourceMonitor i /** * {@inheritDoc} */ + @Override public synchronized void stop() { for (ViewpointResourceMonitor monitor : monitors) { monitor.stop(); @@ -115,6 +119,7 @@ public class CompositeResourceMonitor extends AbstractViewpointResourceMonitor i * <p> * {@inheritDoc} */ + @Override public synchronized void resourceEvent(ViewpointResourceMonitor origin, Set<URI> removed, Set<URI> added, Set<URI> changed) { if (this.listener != null) { for (URI a : Iterables.concat(added, changed)) { @@ -139,6 +144,7 @@ public class CompositeResourceMonitor extends AbstractViewpointResourceMonitor i * <p> * {@inheritDoc} */ + @Override public synchronized int compare(URI uri1, URI uri2) { ViewpointResourceMonitor src1 = origins.get(uri1); ViewpointResourceMonitor src2 = origins.get(uri2); @@ -149,6 +155,6 @@ public class CompositeResourceMonitor extends AbstractViewpointResourceMonitor i return index1 - index2; } } - throw new IllegalArgumentException("Can only compare URIs from detected resources."); + throw new IllegalArgumentException(Messages.CompositeResourceMonitor_uriCompareErrorMsg); } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/PluginMonitor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/PluginMonitor.java index 0638430823..5b58517581 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/PluginMonitor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/movida/registry/monitoring/PluginMonitor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 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 @@ -52,6 +52,7 @@ public class PluginMonitor extends AbstractViewpointResourceMonitor { /** * {@inheritDoc} */ + @Override public void bundleChanged(BundleEvent event) { Bundle bundle = event.getBundle(); // FIXME Study OSGi's bundle life-cycle to understand which state @@ -113,6 +114,7 @@ public class PluginMonitor extends AbstractViewpointResourceMonitor { /** * {@inheritDoc} */ + @Override public void start() { this.running = true; detectRegisteredVSMs(); @@ -122,6 +124,7 @@ public class PluginMonitor extends AbstractViewpointResourceMonitor { /** * {@inheritDoc} */ + @Override public void stop() { unregisterBundleListener(); this.running = false; @@ -168,25 +171,25 @@ public class PluginMonitor extends AbstractViewpointResourceMonitor { String contributingPlugin = element.getContributor().getName(); String localPath = element.getAttribute("path"); //$NON-NLS-1$ if (localPath == null) { - reportWarning("Missing 'path' attribute for VSM definition in " + contributingPlugin + "; ignoring this definition."); + reportWarning("Missing 'path' attribute for VSM definition in " + contributingPlugin + "; ignoring this definition."); //$NON-NLS-1$//$NON-NLS-2$ continue; } try { URI uri = URI.createPlatformPluginURI("/" + contributingPlugin + "/" + localPath, true); //$NON-NLS-1$ //$NON-NLS-2$ if (!pluginResourceExists(contributingPlugin, localPath)) { - reportWarning("Not resource found at specified location " + uri + " in " + contributingPlugin); + reportWarning("Not resource found at specified location " + uri + " in " + contributingPlugin); //$NON-NLS-1$//$NON-NLS-2$ continue; } if (!resourceHandler.handles(uri)) { - reportWarning("Registered resource is not of a supported type: " + uri); + reportWarning("Registered resource is not of a supported type: " + uri); //$NON-NLS-1$ continue; } boolean newEntry = discovered.add(uri); if (!newEntry) { - reportWarning("Duplicate registration of " + uri + " in " + contributingPlugin); + reportWarning("Duplicate registration of " + uri + " in " + contributingPlugin); //$NON-NLS-1$//$NON-NLS-2$ } } catch (IllegalArgumentException iea) { - reportWarning("Invalid 'path' attribute for VSM definition in " + contributingPlugin + "; ignoring this definition."); + reportWarning("Invalid 'path' attribute for VSM definition in " + contributingPlugin + "; ignoring this definition."); //$NON-NLS-1$//$NON-NLS-2$ } } return discovered; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/query/ModelingProjectQuery.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/query/ModelingProjectQuery.java index 795bcfa5f6..454a6f1d31 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/query/ModelingProjectQuery.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/query/ModelingProjectQuery.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2012 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.business.internal.query; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -26,6 +27,7 @@ import org.eclipse.sirius.business.api.helper.SiriusUtil; import org.eclipse.sirius.business.api.modelingproject.ModelingProject; import org.eclipse.sirius.business.internal.session.parser.RepresentationsFileSaxParser; import org.eclipse.sirius.common.tools.api.util.WorkspaceUtil; +import org.eclipse.sirius.viewpoint.Messages; /** * A class aggregating all the queries (read-only!) having a @@ -36,14 +38,14 @@ import org.eclipse.sirius.common.tools.api.util.WorkspaceUtil; public class ModelingProjectQuery { /** - * error message when no representation file found. + * Error code when no representation file found. */ - public static final String ZERO_REPRESENTATIONS_FILE_FOUND_IN = "Zero representations file found in \""; + public static final String ZERO_REPRESENTATIONS_FILE_FOUND_IN = "0"; //$NON-NLS-1$ /** - * error message when several representation files found. + * Error code when several representation files found. */ - public static final String A_MODELING_PROJECT_MUST_CONTAIN_ONLY_ONE = ". A modeling project must contain only one."; + public static final String A_MODELING_PROJECT_MUST_CONTAIN_ONLY_ONE = "*"; //$NON-NLS-1$ private final ModelingProject modelingProject; @@ -109,12 +111,14 @@ public class ModelingProjectQuery { monitor.worked(1); if (notReferencedURIs.isEmpty()) { - throw new IllegalArgumentException(ZERO_REPRESENTATIONS_FILE_FOUND_IN + modelingProject.getProject().getName() + "\". A modeling project must contain one."); + throw new IllegalArgumentException(MessageFormat.format(Messages.ModelingProjectQuery_mustContainOneRepFileMsg, modelingProject.getProject().getName()), + new Throwable(ZERO_REPRESENTATIONS_FILE_FOUND_IN)); } else if (notReferencedURIs.size() == 1) { result = notReferencedURIs.get(0); } else { - throw new IllegalArgumentException("Found " + notReferencedURIs.size() + " main representations files (that means not referenced by another) in \"" - + modelingProject.getProject().getName() + "\": " + getFragments(notReferencedURIs) + A_MODELING_PROJECT_MUST_CONTAIN_ONLY_ONE); + throw new IllegalArgumentException( + MessageFormat.format(Messages.ModelingProjectQuery_severalRepresentationsFiles, notReferencedURIs.size(), modelingProject.getProject().getName(), getFragments(notReferencedURIs)), + new Throwable(A_MODELING_PROJECT_MUST_CONTAIN_ONLY_ONE)); } monitor.done(); return result; @@ -136,7 +140,7 @@ public class ModelingProjectQuery { if (!iterator.hasNext()) { // Replace the last comma by a and result.delete(result.length() - 2, result.length()); - result.append(" and "); + result.append(Messages.ModelingProjectQuery_and); } result.append(uri.lastSegment()); if (iterator.hasNext()) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/repair/commands/RestoreModelElementStateCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/repair/commands/RestoreModelElementStateCommand.java index 6eb6e5bd39..dafc3f8785 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/repair/commands/RestoreModelElementStateCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/repair/commands/RestoreModelElementStateCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 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 @@ -17,6 +17,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.emf.common.command.IdentityCommand; import org.eclipse.sirius.business.api.repair.IRepairParticipant; import org.eclipse.sirius.viewpoint.DView; +import org.eclipse.sirius.viewpoint.Messages; /** * RestoreModelElementStateRecordingCommand. @@ -53,7 +54,7 @@ public class RestoreModelElementStateCommand extends IdentityCommand { */ @Override public void execute() { - monitor.beginTask("restor model elements", repairParticipants.size()); + monitor.beginTask(Messages.RestoreModelElementStateCommand_label, repairParticipants.size()); for (final IRepairParticipant participant : repairParticipants) { participant.restoreModelElementState(view, new NullProgressMonitor()); monitor.worked(1); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/XMIModelFileHandler.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/XMIModelFileHandler.java index 4b8381e492..b4cf87a30b 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/XMIModelFileHandler.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/resource/parser/XMIModelFileHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2012, 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 @@ -15,6 +15,7 @@ import java.io.IOException; import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.emf.ecore.xmi.impl.XMLContentHandlerImpl.XMI; import org.eclipse.sirius.common.tools.api.util.StringUtil; +import org.eclipse.sirius.viewpoint.Messages; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -48,7 +49,7 @@ public class XMIModelFileHandler extends DefaultHandler { @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (firstElementRead) { - throw new XMIModelFileSaxParserNormalAbortException("All needed informations have been reached. Stop the parsing."); + throw new XMIModelFileSaxParserNormalAbortException(Messages.XMIModelFileHandler_parsingStopedMsg); } firstElementRead = true; @@ -63,7 +64,7 @@ public class XMIModelFileHandler extends DefaultHandler { @Override public void endElement(String uri, String localName, String qName) throws SAXException { if (firstElementRead) { - throw new XMIModelFileSaxParserNormalAbortException("All needed informations have been reached. Stop the parsing."); + throw new XMIModelFileSaxParserNormalAbortException(Messages.XMIModelFileHandler_parsingStopedMsg); } super.endElement(uri, localName, qName); @@ -76,7 +77,7 @@ public class XMIModelFileHandler extends DefaultHandler { */ @Override public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException { - throw new XMIModelFileSaxParserNormalAbortException("We try to access external elements. Stop the parsing."); + throw new XMIModelFileSaxParserNormalAbortException(Messages.XMIModelFileHandler_stopTheParsingMsg); } private boolean lookForXMI(Attributes attributes) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/IsModifiedSavingPolicy.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/IsModifiedSavingPolicy.java index d24c731f52..884c8d3a6a 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/IsModifiedSavingPolicy.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/IsModifiedSavingPolicy.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 @@ -33,6 +33,7 @@ import org.eclipse.sirius.business.internal.session.danalysis.ResourceSaveDiagno import org.eclipse.sirius.common.tools.api.resource.ResourceMigrationMarker; import org.eclipse.sirius.common.tools.api.resource.ResourceSetSync; import org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.ResourceStatus; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.base.Predicate; @@ -165,14 +166,14 @@ public class IsModifiedSavingPolicy extends AbstractSavingPolicy { Predicate<Resource> exists = new Predicate<Resource>() { private URIConverter defaultConverter; - + @Override public boolean apply(Resource resourcetoSave) { ResourceSet rs = resourcetoSave.getResourceSet(); URIConverter uriConverter = rs == null ? getDefaultURIConverter() : rs.getURIConverter(); return uriConverter.exists(resourcetoSave.getURI(), mergedOptions); } - + private URIConverter getDefaultURIConverter() { if (defaultConverter == null) { defaultConverter = new ResourceSetImpl().getURIConverter(); @@ -209,7 +210,7 @@ public class IsModifiedSavingPolicy extends AbstractSavingPolicy { try { return diagnose.isSaveable() && diagnose.hasDifferentSerialization(options); } catch (final IOException e) { - SiriusPlugin.getDefault().error("Error saving resource", e); + SiriusPlugin.getDefault().error(Messages.SavingPolicyImpl_savingErrorMsg, e); } return false; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java index 3c2283e690..05d9f6e969 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionFactoryImpl.java @@ -35,6 +35,7 @@ import org.eclipse.sirius.common.tools.api.editing.EditingDomainFactoryService; import org.eclipse.sirius.common.tools.api.resource.ResourceSetFactory; import org.eclipse.sirius.tools.internal.resource.ResourceSetUtil; import org.eclipse.sirius.viewpoint.DAnalysis; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.ViewpointFactory; import org.eclipse.sirius.viewpoint.description.util.DescriptionResourceImpl; @@ -112,7 +113,7 @@ public final class SessionFactoryImpl implements SessionFactory { Session session = null; try { - monitor.beginTask("Session loading", 4); + monitor.beginTask(Messages.SessionFactoryImpl_sessionLoadingMsg, 4); // Get resource final Resource sessionModelResource = resourceSet.getResource(sessionResourceURI, true); if (sessionModelResource != null) { @@ -126,7 +127,7 @@ public final class SessionFactoryImpl implements SessionFactory { } } } catch (WrappedException e) { - throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, "Error while loading representations file", e)); + throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, Messages.SessionFactoryImpl_loadingError, e)); } finally { monitor.done(); ResourceSetUtil.resetProgressMonitor(resourceSet); @@ -137,20 +138,20 @@ public final class SessionFactoryImpl implements SessionFactory { private Session createSessionResource(final URI sessionResourceURI, final TransactionalEditingDomain transactionalEditingDomain, IProgressMonitor monitor) throws CoreException { Session session = null; try { - monitor.beginTask("Session creation", 2); + monitor.beginTask(Messages.SessionFactoryImpl_sessionCreation, 2); Resource sessionModelResource = new ResourceSetImpl().createResource(sessionResourceURI); DAnalysis analysis = ViewpointFactory.eINSTANCE.createDAnalysis(); sessionModelResource.getContents().add(analysis); try { sessionModelResource.save(Collections.emptyMap()); } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, "session creation failed", e)); + throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, Messages.SessionFactoryImpl_creationFailedErrorMsg, e)); } monitor.worked(1); // Now load it from the TED sessionModelResource = transactionalEditingDomain.getResourceSet().getResource(sessionResourceURI, true); if (sessionModelResource.getContents().isEmpty()) { - throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, "session creation failed: the resource content is empty.")); + throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, Messages.SessionFactoryImpl_EmptyContentErrorMsg)); } analysis = (DAnalysis) sessionModelResource.getContents().get(0); session = new DAnalysisSessionImpl(analysis); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java index 101834baab..9e4047a509 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/SessionManagerImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2012 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.business.internal.session; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -40,6 +41,7 @@ import org.eclipse.sirius.common.tools.api.util.EclipseUtil; import org.eclipse.sirius.common.tools.api.util.MarkerUtil; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.DAnalysisSessionEObject; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.Viewpoint; import org.eclipse.sirius.viewpoint.impl.SessionManagerEObjectImpl; @@ -103,7 +105,7 @@ public class SessionManagerImpl extends SessionManagerEObjectImpl implements Ses @Override public void add(final Session newSession) { - Assert.isNotNull(newSession, "SessionManager can't add a null Session"); + Assert.isNotNull(newSession, Messages.SessionManagerImpl_cantAddNullSessionErrorMsg); if (!doGetSessions().contains(newSession)) { if (newSession instanceof DAnalysisSessionEObject) { getOwnedSessions().add((DAnalysisSessionEObject) newSession); @@ -209,7 +211,7 @@ public class SessionManagerImpl extends SessionManagerEObjectImpl implements Ses // An issue has been encountered while connecting to remote // CDO server if (SiriusPlugin.getDefault().isDebugging()) { - SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, "Error while connecting to remote CDO server")); + SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, Messages.SessionManagerImpl_remoteServerConnectionErrorMsg)); } } } @@ -250,14 +252,12 @@ public class SessionManagerImpl extends SessionManagerEObjectImpl implements Ses try { session = SessionFactory.INSTANCE.createSession(sessionModelURI, monitor); } catch (CoreException e) { - SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, "Error while loading representations file " + sessionModelURI.toPlatformString(true), e)); + SiriusPlugin.getDefault().getLog().log( + new Status(IStatus.ERROR, SiriusPlugin.ID, MessageFormat.format(Messages.SessionManagerImpl_representationsFileLoadingErrorMsg, sessionModelURI.toPlatformString(true)), e)); if (optionalResource.some()) { - String message = "Error while loading representations file"; - if (e != null) { - message += ": " + (e.getCause() != null ? e.getCause().getMessage() : e.getMessage()); - } - message += ". See error log for more details"; - MarkerUtil.addMarkerFor(optionalResource.get(), message, IMarker.SEVERITY_ERROR, MarkerRuntimeLogger.MARKER_TYPE); + MarkerUtil.addMarkerFor(optionalResource.get(), + MessageFormat.format(Messages.SessionManagerImpl_representationsFileLoadingSeeErrorLogMsg, e.getCause() != null ? e.getCause().getMessage() : e.getMessage()), + IMarker.SEVERITY_ERROR, MarkerRuntimeLogger.MARKER_TYPE); } return null; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/AnalysisResourceReloadedCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/AnalysisResourceReloadedCommand.java index 6d4ab778d7..545a8ddb38 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/AnalysisResourceReloadedCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/AnalysisResourceReloadedCommand.java @@ -10,12 +10,15 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.session.danalysis; +import java.text.MessageFormat; + import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.viewpoint.DAnalysis; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.base.Preconditions; @@ -43,7 +46,7 @@ public class AnalysisResourceReloadedCommand extends RecordingCommand { * resource to reload */ public AnalysisResourceReloadedCommand(DAnalysisSessionImpl session, TransactionalEditingDomain domain, Resource analysisResource) { - super(domain, "Reload " + analysisResource.getURI() + " file"); + super(domain, MessageFormat.format(Messages.AnalysisResourceReloadedCommand_label, analysisResource.getURI())); this.session = Preconditions.checkNotNull(session); this.resource = analysisResource; EList<EObject> contents = analysisResource.getContents(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/ControlledResourcesDetector.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/ControlledResourcesDetector.java index d21d997e6c..83820249cd 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/ControlledResourcesDetector.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/ControlledResourcesDetector.java @@ -24,6 +24,7 @@ import org.eclipse.emf.transaction.ResourceSetChangeEvent; import org.eclipse.emf.transaction.ResourceSetListenerImpl; import org.eclipse.emf.transaction.RollbackException; import org.eclipse.sirius.business.api.session.SessionListener; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; @@ -155,7 +156,7 @@ public class ControlledResourcesDetector extends ResourceSetListenerImpl { private final DAnalysisSessionImpl session; public RefreshControlledResourcesCommand(DAnalysisSessionImpl session) { - super(session.getTransactionalEditingDomain(), "Controlled resource detection"); + super(session.getTransactionalEditingDomain(), Messages.ControlledResourcesDetector_refreshCommandLabel); this.session = session; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java index cbb0055061..3067a08dfa 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.session.danalysis; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -92,6 +93,7 @@ import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -174,8 +176,8 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements public DAnalysisSessionImpl(DAnalysis mainDAnalysis) { Preconditions.checkNotNull(mainDAnalysis); this.sessionResource = mainDAnalysis.eResource(); - Preconditions.checkNotNull(this.sessionResource, "A session must be inside a resource."); - this.transactionalEditingDomain = Preconditions.checkNotNull(TransactionUtil.getEditingDomain(mainDAnalysis), "A session must be associated to an EditingDomain"); + Preconditions.checkNotNull(this.sessionResource, Messages.DAnalysisSessionImpl_noRessourceErrorMsg); + this.transactionalEditingDomain = Preconditions.checkNotNull(TransactionUtil.getEditingDomain(mainDAnalysis), Messages.DAnalysisSessionImpl_noEditingDomainErrorMsg); this.mainDAnalysis = mainDAnalysis; this.saver = new Saver(this); this.interpreter = new ODesignGenericInterpreter(); @@ -371,7 +373,7 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements notifyListeners(SessionListener.REPRESENTATION_CHANGE); } else { - throw new IllegalStateException("Cant add a referenced analysis if no parent analysis exists"); + throw new IllegalStateException(Messages.DAnalysisSessionImpl_addNoParentAnalysisErrorMsg); } } @@ -391,7 +393,7 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements removeAdaptersOnAnalysis(analysis); notifyListeners(SessionListener.REPRESENTATION_CHANGE); } else { - throw new IllegalStateException("Cant remove a referenced analysis if no parent analysis exists"); + throw new IllegalStateException(Messages.DAnalysisSessionImpl_removeNoParentAnalysisErrorMsg); } } @@ -543,15 +545,15 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements public synchronized void addSemanticResource(URI semanticModelURI, IProgressMonitor monitor) { if (semanticModelURI != null) { if (new FileQuery(semanticModelURI.fileExtension()).isSessionResourceFile()) { - throw new IllegalArgumentException("A representation file cannot be added as semantic resource."); + throw new IllegalArgumentException(Messages.DAnalysisSessionImpl_addSemanticErrorMsg); } - monitor.beginTask("Semantic resource addition : " + semanticModelURI.lastSegment(), 3); + monitor.beginTask(MessageFormat.format(Messages.DAnalysisSessionImpl_addSemanticResourceMsg, semanticModelURI.lastSegment()), 3); ResourceSet resourceSet = transactionalEditingDomain.getResourceSet(); // Make ResourceSet aware of resource loading with progress // monitor ResourceSetUtil.setProgressMonitor(resourceSet, new SubProgressMonitor(monitor, 2)); try { - monitor.beginTask("Semantic resource addition : " + semanticModelURI.lastSegment(), 3); + monitor.beginTask(MessageFormat.format(Messages.DAnalysisSessionImpl_addSemanticResourceMsg, semanticModelURI.lastSegment()), 3); Resource newSemanticResource = resourceSet.getResource(semanticModelURI, false); if (newSemanticResource != null && newSemanticResource.getContents().isEmpty()) { @@ -590,7 +592,7 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements */ protected void doAddSemanticResource(final Resource newResource, final ResourceSet set) { if (new ResourceQuery(newResource).isRepresentationsResource()) { - throw new IllegalArgumentException("A representation file cannot be added as semantic resource."); + throw new IllegalArgumentException(Messages.DAnalysisSessionImpl_addSemanticErrorMsg); } if (newResource.getResourceSet() != set) { set.getResources().add(newResource); @@ -772,7 +774,7 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements */ protected void doSave(final Map<?, ?> options, final IProgressMonitor monitor, boolean runExclusive) { try { - monitor.beginTask("Session saving", 3); + monitor.beginTask(Messages.DAnalysisSessionImpl_saveMsg, 3); final Collection<Resource> allResources = Lists.newArrayList(); allResources.addAll(getAllSessionResources()); Collection<Resource> semanticResourcesCollection = getSemanticResources(); @@ -811,7 +813,7 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements monitor.worked(1); } } catch (InterruptedException e) { - SiriusPlugin.getDefault().warning("save interrupted", e); + SiriusPlugin.getDefault().warning(Messages.DAnalysisSessionImpl_saveInterruptedMsg, e); } finally { monitor.done(); } @@ -1123,7 +1125,7 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements @Override public void open(IProgressMonitor monitor) { try { - monitor.beginTask("Open session", 33); + monitor.beginTask(Messages.DAnalysisSessionImpl_openMsg, 33); SessionManager.INSTANCE.add(this); monitor.worked(1); notifyListeners(SessionListener.OPENING); @@ -1333,7 +1335,8 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements } catch (final IllegalStateException e) { // we might have an exception unloading a resource already // unaccessible - SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, "Error while unloading an unaccessible resource:\n" + e.getMessage(), e)); + SiriusPlugin.getDefault().getLog() + .log(new Status(IStatus.WARNING, SiriusPlugin.ID, MessageFormat.format(Messages.DAnalysisSessionImpl_unloadingErrorMsg, e.getMessage()), e)); } rs.getResources().remove(res); } @@ -1371,7 +1374,7 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements @Override public String toString() { - return "Local Session: " + getID(); + return MessageFormat.format(Messages.DAnalysisSessionImpl_toStringMsg, getID()); } /** diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java index 793aae4a5c..8dee48b1d1 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.session.danalysis; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -37,6 +38,7 @@ import org.eclipse.sirius.ecore.extender.business.api.accessor.MetamodelDescript import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DView; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.ViewpointFactory; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -106,7 +108,7 @@ final class DViewOperations { public void createView(final Viewpoint viewpoint, final Collection<EObject> semantics, final boolean createNewRepresentations, IProgressMonitor monitor) { try { - monitor.beginTask("View creation for Sirius : " + viewpoint.getName(), 3 + 10 * semantics.size()); + monitor.beginTask(MessageFormat.format(Messages.DViewOperations_createViewMsg, viewpoint.getName()), 3 + 10 * semantics.size()); Set<DView> intializedDViews = new LinkedHashSet<DView>(); for (DAnalysis analysis : session.allAnalyses()) { if (!hasAlreadyDViewForViewpoint(analysis, viewpoint)) { @@ -121,7 +123,7 @@ final class DViewOperations { session.configureInterpreter(); if (createNewRepresentations) { - monitor.subTask("Initialize representations"); + monitor.subTask(Messages.DViewOperations_initRepresentationMsg); for (final EObject semantic : semantics) { DialectManager.INSTANCE.initRepresentations(viewpoint, semantic, new SubProgressMonitor(monitor, 10)); } @@ -140,7 +142,7 @@ final class DViewOperations { public void addSelectedView(DView view, IProgressMonitor monitor) throws IllegalArgumentException { try { - monitor.beginTask("View selection", 3); + monitor.beginTask(Messages.DViewOperations_addSelectedViewMsg, 3); DAnalysis foundAnalysis = null; for (final DAnalysis dAnalysis : session.allAnalyses()) { if (dAnalysis.getOwnedViews().contains(view)) { @@ -149,7 +151,7 @@ final class DViewOperations { } } if (foundAnalysis == null) { - throw new IllegalArgumentException("The view is not contained in the analysis"); + throw new IllegalArgumentException(Messages.DViewOperations_notContainedErrorMsg); } foundAnalysis.getSelectedViews().add(view); monitor.worked(1); @@ -165,7 +167,7 @@ final class DViewOperations { public void removeSelectedView(final DView view, IProgressMonitor monitor) { try { - monitor.beginTask("View unselection", 1); + monitor.beginTask(Messages.DViewOperations_removeSelectedViewMsg, 1); session.getMainAnalysis().getSelectedViews().remove(view); updateSelectedViewpointsData(new SubProgressMonitor(monitor, 1)); session.notifyListeners(SessionListener.SELECTED_VIEWS_CHANGE_KIND); @@ -194,7 +196,7 @@ final class DViewOperations { } } SetView<Viewpoint> difference = Sets.difference(Sets.newHashSet(session.getActivatedViewpoints()), Sets.newHashSet(selectedViewpoints)); - monitor.beginTask("Update selected Viewpoints data", selectedViewpoints.size() + difference.size() + 1); + monitor.beginTask(Messages.DViewOperations_updateSelectedVPDataMsg, selectedViewpoints.size() + difference.size() + 1); // FIXME : it is useful? for (Viewpoint viewpoint : selectedViewpoints) { Resource viewpointResource = viewpoint.eResource(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DanglingRefRemovalTrigger.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DanglingRefRemovalTrigger.java index f61794d700..71989da9f0 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DanglingRefRemovalTrigger.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DanglingRefRemovalTrigger.java @@ -34,6 +34,7 @@ import org.eclipse.sirius.ext.base.Options; import org.eclipse.sirius.ext.emf.EReferencePredicate; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; import org.eclipse.sirius.tools.api.ui.RefreshEditorsPrecommitListener; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.ViewpointPackage; import com.google.common.base.Predicate; @@ -309,7 +310,7 @@ public class DanglingRefRemovalTrigger implements ModelChangeTrigger { */ public RemoveDanglingReferencesCommand(TransactionalEditingDomain domain, ModelAccessor accessor, ECrossReferenceAdapter xRef, Collection<Resource> semanticResources, RefreshEditorsPrecommitListener refreshEditorsPrecommitListener, Collection<EObject> toRemoveXRefFrom, EReferencePredicate isReferenceToIgnore) { - super(domain, "Remove dangling references"); + super(domain, Messages.DanglingRefRemovalTrigger_removeDanglingCmdLabel); this.modelAccessor = accessor; this.xReferencer = xRef; this.semanticResources = semanticResources; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SaveSessionJob.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SaveSessionJob.java index a9b5f9b243..17081fa026 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SaveSessionJob.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SaveSessionJob.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 @@ -16,6 +16,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionStatus; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -30,8 +31,6 @@ public class SaveSessionJob extends Job { */ public static final String FAMILY = SiriusPlugin.ID + ".saveSessionJob"; //$NON-NLS-1$ - private static final String ACTION_NAME = "Session saving"; - private Session session; /** @@ -41,14 +40,14 @@ public class SaveSessionJob extends Job { * the {@link Session} to save */ public SaveSessionJob(Session session) { - super(ACTION_NAME); + super(Messages.SaveSessionJob_sessionSavingMsg); this.session = session; } @Override public IStatus run(IProgressMonitor monitor) { try { - monitor.beginTask(ACTION_NAME, IProgressMonitor.UNKNOWN); + monitor.beginTask(Messages.SaveSessionJob_sessionSavingMsg, IProgressMonitor.UNKNOWN); if (session != null && session.isOpen() && SessionStatus.DIRTY == session.getStatus()) { if (session instanceof DAnalysisSessionImpl) { /* diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/Saver.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/Saver.java index 1ff2611600..2df67981b8 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/Saver.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/Saver.java @@ -27,6 +27,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomainListenerImpl; import org.eclipse.emf.transaction.impl.InternalTransaction; import org.eclipse.emf.transaction.impl.InternalTransactionalEditingDomain; import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -122,7 +123,7 @@ final class Saver extends TransactionalEditingDomainListenerImpl { } }, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } catch (final CoreException e) { - SiriusPlugin.getDefault().error("Core exception while saving session", e); + SiriusPlugin.getDefault().error(Messages.Saver_savingErrorMsg, e); } } else { wrappedSave(options, monitor, runExclusive); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesSynchronizer.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesSynchronizer.java index 6d641bb70b..df75d22624 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesSynchronizer.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesSynchronizer.java @@ -11,6 +11,7 @@ package org.eclipse.sirius.business.internal.session.danalysis; import java.io.IOException; +import java.text.MessageFormat; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -34,6 +35,7 @@ import org.eclipse.sirius.common.tools.api.resource.ResourceSetSync; import org.eclipse.sirius.common.tools.api.resource.ResourceSetSync.ResourceStatus; import org.eclipse.sirius.common.tools.api.resource.ResourceSyncClient; import org.eclipse.sirius.tools.api.command.semantic.RemoveSemanticResourceCommand; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.SyncStatus; @@ -108,7 +110,7 @@ public class SessionResourcesSynchronizer implements ResourceSyncClient { // CHECKSTYLE:OFF } catch (final Exception e) { // CHECKSTYLE:ON - SiriusPlugin.getDefault().error("Can't handle resource change : " + resource.getURI(), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.SessionResourcesSynchronizer_cantHandleResourceChangeMsg, resource.getURI()), e); } } @@ -208,7 +210,7 @@ public class SessionResourcesSynchronizer implements ResourceSyncClient { if (reload.getResult() != null) { throw (IOException) reload.getResult(); } else if (!reload.getStatus().isOK()) { - SiriusPlugin.getDefault().error("a reload operation failed for unknown reason", null); + SiriusPlugin.getDefault().error(Messages.SessionResourcesSynchronizer_reloadOperationFailErrorMsg, null); } else { if (representationsResource) { ted.getCommandStack().execute(reloadingAnalysisCmd); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesTracker.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesTracker.java index c1fa77e0b3..657d3f39c7 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesTracker.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionResourcesTracker.java @@ -35,6 +35,7 @@ import org.eclipse.sirius.ext.emf.EReferencePredicate; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DView; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.base.Preconditions; @@ -147,7 +148,7 @@ class SessionResourcesTracker { try { TransactionUtil.runExclusive(session.getTransactionalEditingDomain(), semanticResourcesGetter); } catch (InterruptedException e) { - SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, "Error while accessing semantic resources")); + SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, Messages.SessionResourcesTracker_semanticResourcesAccessErrorMsg)); } ((CopyOnWriteArrayList<Resource>) semanticResources).addAllAbsent(semanticResourcesGetter.getResult()); } @@ -275,7 +276,7 @@ class SessionResourcesTracker { } }); if (!Iterables.isEmpty(newSemanticResourcesIterator)) { - domain.getCommandStack().execute(new RecordingCommand(domain, "Add referenced semantic resources") { + domain.getCommandStack().execute(new RecordingCommand(domain, Messages.SessionResourcesTracker_addReferencedSemanticResourcesMsg) { @Override protected void doExecute() { for (Resource resource : newSemanticResourcesIterator) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionVSMUpdater.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionVSMUpdater.java index 3f6c2bc1e5..378b673e2b 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionVSMUpdater.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/SessionVSMUpdater.java @@ -23,6 +23,7 @@ import org.eclipse.sirius.business.api.helper.SiriusUtil; import org.eclipse.sirius.business.api.session.SessionListener; import org.eclipse.sirius.business.internal.migration.resource.ResourceFileExtensionPredicate; import org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import com.google.common.base.Preconditions; @@ -69,7 +70,7 @@ public class SessionVSMUpdater implements ViewpointRegistryListener2 { InterpreterRegistry.prepareImportsFromSession(session.getInterpreter(), session); } } catch (IOException e) { - SiriusPlugin.getDefault().warning(MessageFormat.format("Unable to load the VSM at {0}", res.getURI()), e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.SessionVSMUpdater_VSMLoadErrorMsg, res.getURI()), e); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/factory/EclipseSessionFactoryDescriptor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/factory/EclipseSessionFactoryDescriptor.java index be78b02e9f..8e2abf8068 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/factory/EclipseSessionFactoryDescriptor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/factory/EclipseSessionFactoryDescriptor.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,12 +10,15 @@ *******************************************************************************/ package org.eclipse.sirius.business.internal.session.factory; +import java.text.MessageFormat; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.sirius.business.api.session.factory.SessionFactory; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -24,7 +27,6 @@ import org.eclipse.sirius.viewpoint.SiriusPlugin; * @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a> */ public class EclipseSessionFactoryDescriptor extends AbstractSessionFactoryDescriptor implements SessionFactoryDescriptor { - /** Configuration element of this descriptor. */ private IConfigurationElement element; @@ -44,14 +46,15 @@ public class EclipseSessionFactoryDescriptor extends AbstractSessionFactoryDescr /** * {@inheritDoc} */ + @Override public SessionFactory getSessionFactory() { if (sessionFactory == null) { if (Platform.isRunning()) { try { sessionFactory = (SessionFactory) element.createExecutableExtension(SESSION_FACTORY_CLASS_ATTRIBUTE); } catch (CoreException e) { - SiriusPlugin.getDefault().getLog() - .log(new Status(IStatus.ERROR, SiriusPlugin.ID, "Error while loading the extension " + element.getDeclaringExtension().getUniqueIdentifier(), e)); + SiriusPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SiriusPlugin.ID, + MessageFormat.format(Messages.EclipseDeleteHookDescriptor_extensionLoadingErrorMsg, element.getDeclaringExtension().getUniqueIdentifier()), e)); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/parser/RepresentationsFileHandler.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/parser/RepresentationsFileHandler.java index b5c2546ce6..e436d8dce2 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/parser/RepresentationsFileHandler.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/parser/RepresentationsFileHandler.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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.business.internal.session.parser; import java.util.Set; import org.eclipse.emf.common.util.URI; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.ViewpointPackage; import org.xml.sax.Attributes; import org.xml.sax.SAXException; @@ -73,7 +74,7 @@ public class RepresentationsFileHandler extends DefaultHandler { referencedAnalysis.add(URI.createURI(hrefValue).resolve(sessionURI).trimFragment()); } } else if (qName.equals(ViewpointPackage.eINSTANCE.getDAnalysis_OwnedViews().getName()) && (dAnalysisReferencedAnalysis || dAnalysisModels)) { - throw new SiriusSaxParserNormalAbortException("All needed informations have been reached. Stop the parsing."); + throw new SiriusSaxParserNormalAbortException(Messages.XMIModelFileHandler_parsingStopedMsg); } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/AbstractCommandFactory.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/AbstractCommandFactory.java index 085a33c995..7fd71ce363 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/AbstractCommandFactory.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/AbstractCommandFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 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 @@ -26,6 +26,7 @@ import org.eclipse.sirius.tools.api.command.ui.UICallBack; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.tool.AbstractToolDescription; import org.eclipse.sirius.viewpoint.description.tool.RepresentationCreationDescription; @@ -44,7 +45,9 @@ public abstract class AbstractCommandFactory implements ICommandFactory { /** The model accessor (used for metamodel extensions). */ protected ModelAccessor modelAccessor; - /** This callback is used to exchange with the user interface when needed. */ + /** + * This callback is used to exchange with the user interface when needed. + */ protected UICallBack uiCallBack; /** @@ -65,6 +68,7 @@ public abstract class AbstractCommandFactory implements ICommandFactory { * org.eclipse.sirius.viewpoint.DRepresentationElement, * java.lang.String) */ + @Override public CreateRepresentationCommand buildCreateRepresentationFromDescription(final RepresentationCreationDescription desc, final DRepresentationElement element, final String newDiagramName) { final Session session = SessionManager.INSTANCE.getSession(element.getTarget()); final CreateRepresentationCommand cmd = new CreateRepresentationCommand(session, desc.getRepresentationDescription(), element.getTarget(), newDiagramName, new NullProgressMonitor()); @@ -78,6 +82,7 @@ public abstract class AbstractCommandFactory implements ICommandFactory { * @param newCB * the new user interface call back. */ + @Override public void setUserInterfaceCallBack(final UICallBack newCB) { this.uiCallBack = newCB; } @@ -87,6 +92,7 @@ public abstract class AbstractCommandFactory implements ICommandFactory { * * @see org.eclipse.sirius.tools.api.command.ICommandFactory#getUserInterfaceCallBack() */ + @Override public UICallBack getUserInterfaceCallBack() { return this.uiCallBack; } @@ -123,10 +129,12 @@ public abstract class AbstractCommandFactory implements ICommandFactory { if (semanticElement != null && session != null && representationToRefresh != null) { result.getTasks().add(new AbstractCommandTask() { + @Override public String getLabel() { - return "Set RefreshEditorsPrecommitListener options"; + return Messages.AbstractCommandFactory_refreshTasklabel; } + @Override public void execute() throws MetaClassNotFoundException, FeatureNotFoundException { if (toolDescription == null || toolDescription.isForceRefresh()) { // Set the RefreshEditorsListener in forceRefresh diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/EditingDomainUndoContext.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/EditingDomainUndoContext.java index d8e2df898d..07ea2c067a 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/EditingDomainUndoContext.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/EditingDomainUndoContext.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2006, 2010 IBM Corporation and others. + * Copyright (c) 2006, 2015 IBM Corporation 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.tools.api.command; import org.eclipse.core.commands.operations.IUndoContext; import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.sirius.viewpoint.Messages; /** * An {@link IUndoContext} that tags an EMF operation with the editing domain @@ -41,8 +42,9 @@ public final class EditingDomainUndoContext implements IUndoContext { * * @see org.eclipse.core.commands.operations.IUndoContext#getLabel() */ + @Override public String getLabel() { - return "Affected Editing Domain"; + return Messages.EditingDomainUndoContext_label; } /** @@ -54,6 +56,7 @@ public final class EditingDomainUndoContext implements IUndoContext { * <code>EditingDomainUndoContext</code> representing the same editing * domain as I. */ + @Override public boolean matches(final IUndoContext context) { return this.equals(context); } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/InvalidPermissionCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/InvalidPermissionCommand.java index 34ac4161eb..442ce6981d 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/InvalidPermissionCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/InvalidPermissionCommand.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,9 +10,12 @@ *******************************************************************************/ package org.eclipse.sirius.tools.api.command; +import java.text.MessageFormat; + import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.ecore.extender.business.api.permission.exception.LockedInstanceException; +import org.eclipse.sirius.viewpoint.Messages; /** * A command that throws a {@link LockedInstanceException} when it gets @@ -52,7 +55,7 @@ public class InvalidPermissionCommand extends SiriusCommand { * the elements that user tried to modify */ public InvalidPermissionCommand(TransactionalEditingDomain domain, EObject... lockedElements) { - super(domain, "Invalid Permission : cannot modify " + lockedElements); + super(domain, MessageFormat.format(Messages.InvalidPermissionCommand_label, lockedElements)); this.lockedElements = lockedElements; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/NoNullResourceCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/NoNullResourceCommand.java index 5f1c791505..c0b7163966 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/NoNullResourceCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/NoNullResourceCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 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 @@ -15,6 +15,7 @@ import org.eclipse.emf.common.command.AbstractCommand; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.sirius.viewpoint.Messages; /** * A command wrapper to avoid execution of command if a resource is null. @@ -41,7 +42,7 @@ public class NoNullResourceCommand extends AbstractCommand implements IAdaptable */ public NoNullResourceCommand(Command cmd, EObject element) { if (cmd instanceof RecordingCommand && !(cmd instanceof DCommand)) { - throw new UnsupportedOperationException("only instances of SiriusCommand are allowed for recording command"); + throw new UnsupportedOperationException(Messages.NoNullResourceCommand_instanceErrorMsg); } this.wrappedCommand = cmd; this.element = element; @@ -61,6 +62,7 @@ public class NoNullResourceCommand extends AbstractCommand implements IAdaptable /** * {@inheritDoc} */ + @Override public void execute() { if (element != null && element.eResource() != null) { this.wrappedCommand.execute(); @@ -86,6 +88,7 @@ public class NoNullResourceCommand extends AbstractCommand implements IAdaptable /** * {@inheritDoc} */ + @Override public void redo() { this.wrappedCommand.redo(); @@ -94,6 +97,7 @@ public class NoNullResourceCommand extends AbstractCommand implements IAdaptable /** * {@inheritDoc} */ + @Override public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) { Object object = null; if (adapter != null) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/AddSemanticResourceCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/AddSemanticResourceCommand.java index 876573038c..85705753ae 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/AddSemanticResourceCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/AddSemanticResourceCommand.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 @@ -18,6 +18,7 @@ import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.sirius.business.api.session.Session; +import org.eclipse.sirius.viewpoint.Messages; import com.google.common.collect.Sets; @@ -62,7 +63,7 @@ public class AddSemanticResourceCommand extends RecordingCommand { * resource addition */ public AddSemanticResourceCommand(Session session, URI semanticResourceURI, IProgressMonitor monitor) { - super(session.getTransactionalEditingDomain(), "Add Model"); + super(session.getTransactionalEditingDomain(), Messages.AddSemanticResourceCommand_label); this.session = session; this.semanticResourceURI = semanticResourceURI; this.monitor = monitor; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/RemoveSemanticResourceCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/RemoveSemanticResourceCommand.java index 379a2a4136..a032ffea34 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/RemoveSemanticResourceCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/semantic/RemoveSemanticResourceCommand.java @@ -15,6 +15,7 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.sirius.business.api.session.Session; +import org.eclipse.sirius.viewpoint.Messages; /** * Specific command do remove semantic resources from the given session. @@ -56,7 +57,7 @@ public class RemoveSemanticResourceCommand extends RecordingCommand { * indicates if the referencing resources are also to remove */ public RemoveSemanticResourceCommand(Session session, Resource semanticResource, IProgressMonitor monitor, boolean removeReferencingResources) { - super(session.getTransactionalEditingDomain(), "Remove model"); + super(session.getTransactionalEditingDomain(), Messages.RemoveSemanticResourceCommand_label); this.semanticResource = semanticResource; this.session = session; this.monitor = monitor; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/JavaActionFromToolCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/JavaActionFromToolCommand.java index 63a99ebfc4..3997be180e 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/JavaActionFromToolCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/command/view/JavaActionFromToolCommand.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.tools.api.command.view; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -24,6 +25,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.tools.api.interpreter.InterpreterUtil; import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.tool.ExternalJavaAction; import org.eclipse.sirius.viewpoint.description.tool.ExternalJavaActionParameter; import org.eclipse.sirius.viewpoint.description.tool.ToolPackage; @@ -54,7 +56,7 @@ public final class JavaActionFromToolCommand extends RecordingCommand { * the container views */ public JavaActionFromToolCommand(TransactionalEditingDomain domain, IExternalJavaAction javaAction, ExternalJavaAction tool, Collection<DSemanticDecorator> containerViews) { - super(domain, "Java action from tool: " + (javaAction != null ? javaAction.getClass().getSimpleName() : "")); //$NON-NLS-2$ + super(domain, MessageFormat.format(Messages.JavaActionFromToolCommand_label, javaAction != null ? javaAction.getClass().getSimpleName() : "")); //$NON-NLS-1$ this.action = javaAction; this.tool = tool; this.containerViews = containerViews; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/IInterpreterMessages.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/IInterpreterMessages.java index c37b14b22b..a3fc825844 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/IInterpreterMessages.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/IInterpreterMessages.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,8 @@ *******************************************************************************/ package org.eclipse.sirius.tools.api.interpreter; +import org.eclipse.sirius.viewpoint.Messages; + /** * All the Acceleo interpreter messages. * @@ -18,9 +20,9 @@ package org.eclipse.sirius.tools.api.interpreter; public interface IInterpreterMessages { /** Error while modifying model. */ - String EVALUATION_ERROR_ON_MODEL_MODIFICATION = "Error while modifying model"; + String EVALUATION_ERROR_ON_MODEL_MODIFICATION = Messages.TaskExecutor_errorModifyingModelMsg; /** Invalid feature as name. */ - String DEFAULT_NAME_ON_FACTORY_EXCEPTION = "Invalid feature as name"; + String DEFAULT_NAME_ON_FACTORY_EXCEPTION = Messages.IInterpreterMessages_invalidFeatureErrorMsg; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java index 3a62c602a8..3c675d5f66 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/interpreter/InterpreterRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 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.tools.api.interpreter; +import java.text.MessageFormat; import java.util.Collection; import java.util.LinkedHashSet; @@ -19,6 +20,7 @@ import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.common.tools.api.interpreter.CompoundInterpreter; import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.description.JavaExtension; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -38,7 +40,7 @@ public class InterpreterRegistry { * * @since 0.9.0 */ - public static final String ERROR_MSG_IMPOSSIBLE_TO_FIND_AN_INTERPRETER = "Impossible to find an interpreter"; + public static final String ERROR_MSG_IMPOSSIBLE_TO_FIND_AN_INTERPRETER = Messages.InterpreterRegistry_ImpossibleToFindInterpreterErrorMsg; /** * Return the model requests interpreter for the specified @@ -63,11 +65,11 @@ public class InterpreterRegistry { String reason; if (modelElement == null) { - reason = "Model element is null"; + reason = Messages.InterpreterRegistry_nullModelElementErrorMsg; } else { - reason = "Could not find a session for model element : " + modelElement; + reason = MessageFormat.format(Messages.InterpreterRegistry_sessionNotFoundErrorMsg, modelElement); } - SiriusPlugin.getDefault().error(ERROR_MSG_IMPOSSIBLE_TO_FIND_AN_INTERPRETER + " - " + reason, new RuntimeException()); + SiriusPlugin.getDefault().error(ERROR_MSG_IMPOSSIBLE_TO_FIND_AN_INTERPRETER + " - " + reason, new RuntimeException()); //$NON-NLS-1$ result = CompoundInterpreter.INSTANCE; } return result; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/profiler/SiriusTasksKey.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/profiler/SiriusTasksKey.java index b6ac6d3f01..e262c90fd4 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/profiler/SiriusTasksKey.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/profiler/SiriusTasksKey.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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.tools.api.profiler; +import org.eclipse.sirius.viewpoint.Messages; + /** * Profiling tasks Key sused. * @@ -17,7 +19,7 @@ package org.eclipse.sirius.tools.api.profiler; * */ public final class SiriusTasksKey { - + // CHECKSTYLE:OFF /** * DDiagram category. */ @@ -66,340 +68,340 @@ public final class SiriusTasksKey { /** * Metamodel extension category. */ - public static final String MM_EXTENSION_CAT = "Metamodel Extension"; + public static final String MM_EXTENSION_CAT = Messages.SiriusTasksKey_mmExtension; /** * Modeler Category. */ - public static final String GENERIC_MODELER_CAT = "Generic Modeler"; + public static final String GENERIC_MODELER_CAT = Messages.SiriusTasksKey_genericModeler; /** * Repair/migration Category. */ - public static final String REPAIR_MIGRATE = "Repair/migrate"; + public static final String REPAIR_MIGRATE = Messages.SiriusTasksKey_repairMigrate; /** * Task singleton. */ - public static final String CLEAN_DIAGRAM_KEY = "Cleaning a diagram"; + public static final String CLEAN_DIAGRAM_KEY = Messages.SiriusTasksKey_cleaningADiagram; /** * Task singleton. */ - public static final String UPDATING_DIAGRAM_KEY = "Updating a diagram"; + public static final String UPDATING_DIAGRAM_KEY = Messages.SiriusTasksKey_updatingADiagram; /** * Task singleton. */ - public static final String EVALUATING_ACCELEO_KEY = "Evaluating Acceleo expressions"; + public static final String EVALUATING_ACCELEO_KEY = Messages.SiriusTasksKey_evaluatingAcceleoExpression; /** * Task singleton. */ - public static final String EVALUATING_OCL_KEY = "Evaluating OCL expressions"; + public static final String EVALUATING_OCL_KEY = Messages.SiriusTasksKey_evaluatingOCLExpressions; /** * Task singleton. */ - public static final String CHECK_PRECONDITION_KEY = "Check precondition expressions"; + public static final String CHECK_PRECONDITION_KEY = Messages.SiriusTasksKey_checkPreconditionExpressions; /** * Task singleton. */ - public static final String INITIALIZE_ACCELEO_KEY = "Initialize Acceleo interpreter"; + public static final String INITIALIZE_ACCELEO_KEY = Messages.SiriusTasksKey_InitAcceleoInterpreter; /** * Task singleton. */ - public static final String UPDATE_ALL_EDGES_KEY = "Updating all edges"; + public static final String UPDATE_ALL_EDGES_KEY = Messages.SiriusTasksKey_updatingAllEdges; /** * Task singleton. */ - public static final String UPDATE_ALL_CONTAINERS_KEY = "Updating all containers"; + public static final String UPDATE_ALL_CONTAINERS_KEY = Messages.SiriusTasksKey_updateAllContainers; /** * Task singleton. */ - public static final String UPDATE_ALL_NODES_KEY = "Updating all nodes"; + public static final String UPDATE_ALL_NODES_KEY = Messages.SiriusTasksKey_updatingAllNodes; /** * Task singleton. */ - public static final String CREATE_MISSING_NODES_KEY = "Create missing node from viewpoint"; + public static final String CREATE_MISSING_NODES_KEY = Messages.SiriusTasksKey_createMissingNodeFromViewpoint; /** * Task singleton. */ - public static final String IS_VISIBLE_KEY = "Display Service : is the element displayed ?"; + public static final String IS_VISIBLE_KEY = Messages.SiriusTasksKey_isElementDisplayed; /** * Task singleton. * * @since 0.9.0 */ - public static final String REFRESH_VISIBILITY_KEY = "Display Service : check that the element has to be displayed"; + public static final String REFRESH_VISIBILITY_KEY = Messages.SiriusTasksKey_checkThatElementHasToBeDisplayed; /** * Task singleton. */ - public static final String IS_COLLAPSED_KEY = "FilterService : is the element collapsed ?"; + public static final String IS_COLLAPSED_KEY = Messages.SiriusTasksKey_isTheElementCollapsed; /** * Task singleton. */ - public static final String CREATE_MISSING_NODES_CONTAINER_KEY = "Create missing node from container"; + public static final String CREATE_MISSING_NODES_CONTAINER_KEY = Messages.SiriusTasksKey_createMissingNodeFromContainer; /** * Task singleton. */ - public static final String CREATE_MISSING_EDGES_KEY = "Create missing edges from viewpoint"; + public static final String CREATE_MISSING_EDGES_KEY = Messages.SiriusTasksKey_createMissingEdgesFromViewpoint; /** * Task singleton. */ - public static final String CREATE_MISSING_CONTAINER_KEY = "Create missing containers from viewpoint"; + public static final String CREATE_MISSING_CONTAINER_KEY = Messages.SiriusTasksKey_createMissingContainersFromViewpoint; /** * Task singleton. */ - public static final String REFRESH_DIAGRAM_KEY = "Refresh a diagram"; + public static final String REFRESH_DIAGRAM_KEY = Messages.SiriusTasksKey_refreshADiagram; /** * Task singleton. */ - public static final String CLEANING_REMOVEDANGLING_KEY = "Cleaning : remove dangling references"; + public static final String CLEANING_REMOVEDANGLING_KEY = Messages.SiriusTasksKey_CleaningRemoveDanglingRef; /** * Task singleton. */ - public static final String CLEANING_EDGES_KEY = "Cleaning all edges"; + public static final String CLEANING_EDGES_KEY = Messages.SiriusTasksKey_cleaningAllEdges; /** * Task singleton. */ - public static final String VALIDATE_NODE_KEY = "Validating the node"; + public static final String VALIDATE_NODE_KEY = Messages.SiriusTasksKey_validatingTheNode; /** * Task singleton. */ - public static final String VALIDATE_EDGE_KEY = "Validating the edge"; + public static final String VALIDATE_EDGE_KEY = Messages.SiriusTasksKey_validatingEdge; /** * Task singleton. */ - public static final String GET_NODE_CANDIDATES_KEY = "Get node's candidates"; + public static final String GET_NODE_CANDIDATES_KEY = Messages.SiriusTasksKey_getNodesCandidates; /** * Task singleton. */ - public static final String GET_EDGE_CANDIDATES_KEY = "Get edge's candidates"; + public static final String GET_EDGE_CANDIDATES_KEY = Messages.SiriusTasksKey_getEdgesCandidates; /** * Task singleton. */ - public static final String INSTANCE_OF_KEY = "EInstance of "; + public static final String INSTANCE_OF_KEY = Messages.SiriusTasksKey_instanceOf; /** * Task singleton. */ - public static final String GET_CONTAINER_CANDIDATES_KEY = "Get container candidates"; + public static final String GET_CONTAINER_CANDIDATES_KEY = Messages.SiriusTasksKey_getContainerCandidates; /** * Task singleton. */ - public static final String IS_FOLD_KEY = "Is fold"; + public static final String IS_FOLD_KEY = Messages.SiriusTasksKey_isFold; /** * Task singleton. */ - public static final String CACHE_ACCESS_KEY = "Cache access"; + public static final String CACHE_ACCESS_KEY = Messages.SiriusTasksKey_cacheAccess; /** * Task singleton. */ - public static final String VALIDATE_VIEWPOINT_KEY = "Validate all the DDiagram elements"; + public static final String VALIDATE_VIEWPOINT_KEY = Messages.SiriusTasksKey_validateAllDDiagramElements; /** * Task singleton. */ - public static final String REFRESH_GEF_KEY = "Big refresh"; + public static final String REFRESH_GEF_KEY = Messages.SiriusTasksKey_bigRefresh; /** * Task singleton. */ - public static final String CANONICAL_REFRESH_KEY = "Canonical refresh"; + public static final String CANONICAL_REFRESH_KEY = Messages.SiriusTasksKey_canonicalRefresh; /** * Task singleton. */ - public static final String LAUCNH_REFRESH_FROM_LISTENER_KEY = "Launch Refresh From Operation History Listener"; + public static final String LAUCNH_REFRESH_FROM_LISTENER_KEY = Messages.SiriusTasksKey_launchRefreshFromOperationHistoryListener; /** * Task singleton. */ - public static final String LAUNCH_REFRESH_FROM_LAYER_CHANGE_KEY = "Launch Refresh From Layer Change"; + public static final String LAUNCH_REFRESH_FROM_LAYER_CHANGE_KEY = Messages.SiriusTasksKey_launchRefreshFromLayerChange; /** * Task to check if a notation view is valid. */ - public static final String IS_VIEW_VALID_KEY = "Is the GMF view valid ?"; + public static final String IS_VIEW_VALID_KEY = Messages.SiriusTasksKey_isGMFViewValid; /** * Task EMF resolve all. */ - public static final String RESOLVE_ALL_KEY = "Resolve All"; + public static final String RESOLVE_ALL_KEY = Messages.SiriusTasksKey_resolveAll; /** * Task finding the .air from any model element. */ - public static final String GET_ACCELEO_INTERPRETER_FROM_MODEL_KEY = "Find .air from model element."; + public static final String GET_ACCELEO_INTERPRETER_FROM_MODEL_KEY = Messages.SiriusTasksKey_findAirFromModelElement; /** * Task finding new candidates on the list. */ - public static final String GET_ADDED_NODE_CANDIDATES_KEY = "Get Added nodes candidates"; + public static final String GET_ADDED_NODE_CANDIDATES_KEY = Messages.SiriusTasksKey_getAddedNodesCandidates; /** * Task finding kept candidates on the list. */ - public static final String GET_KEPT_NODE_CANDIDATES_KEY = "Get kept nodes candidates"; + public static final String GET_KEPT_NODE_CANDIDATES_KEY = Messages.SiriusTasksKey_getKeptNodesCandidates; /** * Task finding removed candidates in the list. */ - public static final String GET_REMOVED_NODE_CANDIDATES_KEY = "Get removed nodes candidates"; + public static final String GET_REMOVED_NODE_CANDIDATES_KEY = Messages.SiriusTasksKey_getRemovedNodesCandidates; /** * When retrieving candidates target views. */ - public static final String COMPUTE_TARGET_ELEMENTS_KEY = "Compute edge source/target views"; + public static final String COMPUTE_TARGET_ELEMENTS_KEY = Messages.SiriusTasksKey_computeEdgeSrcTgtViews; /** * When cleaning diagram. */ - public static final String CLEAN_ORPHANED_NODE_KEY = "Clean orphaned nodes"; + public static final String CLEAN_ORPHANED_NODE_KEY = Messages.SiriusTasksKey_cleanOrphanedNodes; /** * When removing dangling reference. */ - public static final String REMOVE_DANGLING_REFERENCE_KEY = "Remove dangling reference"; + public static final String REMOVE_DANGLING_REFERENCE_KEY = Messages.SiriusTasksKey_removeDanglingRef; /** * When opening diagram. */ - public static final String OPEN_DIAGRAM_KEY = "Open diagram"; + public static final String OPEN_DIAGRAM_KEY = Messages.SiriusTasksKey_openDiagram; /** * The action that load the aird resource and open the session. */ - public static final String OPEN_SESSION_ACTION_KEY = "Open Session Action"; + public static final String OPEN_SESSION_ACTION_KEY = Messages.SiriusTasksKey_openSessionAction; /** * When opening session. */ - public static final String OPEN_SESSION_KEY = "Open Session"; + public static final String OPEN_SESSION_KEY = Messages.SiriusTasksKey_openSession; /** * Semantic refresh. */ - public static final String SEMANTIC_REFRESH_KEY = "Semantic Refresh"; + public static final String SEMANTIC_REFRESH_KEY = Messages.SiriusTasksKey_semanticRefresh; /** * Semantic refresh. */ - public static final String SYNCHRONIZE_DIAGRAM_KEY = "Synchronize Diagram"; + public static final String SYNCHRONIZE_DIAGRAM_KEY = Messages.SiriusTasksKey_synchronizeDiagram; /** * When refreshing the table. */ - public static final String REFRESH_TABLE_KEY = "Refresh a table"; + public static final String REFRESH_TABLE_KEY = Messages.SiriusTasksKey_refreshTable; /** * When refreshing the tree. */ - public static final String REFRESH_TREE_KEY = "Refresh a tree"; + public static final String REFRESH_TREE_KEY = Messages.SiriusTasksKey_refreshATree; /** * When creating the SWT.table. */ - public static final String CREATE_TABLE_KEY = "Create the SWT table"; + public static final String CREATE_TABLE_KEY = Messages.SiriusTasksKey_createSWTTable; /** * When refreshing the table. */ - public static final String REFRESH_SWT_TABLE_KEY = "Refresh the SWT table"; + public static final String REFRESH_SWT_TABLE_KEY = Messages.SiriusTasksKey_refreshSWTTable; /** * When refreshing a line of the table. */ - public static final String REFRESH_SWT_LINE_KEY = "Refresh a line of the SWT table"; + public static final String REFRESH_SWT_LINE_KEY = Messages.SiriusTasksKey_refreshSWTTableLine; /** * When updating a line of the table. */ - public static final String UPDATE_SWT_LINE_KEY = "Update a line of the SWT table"; + public static final String UPDATE_SWT_LINE_KEY = Messages.SiriusTasksKey_updateSWTTableLine; /** * When collapsing or expanding a line of the table. */ @Deprecated - public static final String CHANGE_SWT_LINE_COLAPSE_STATE_KEY = "Change the collapse state of a line of the SWT table"; - + public static final String CHANGE_SWT_LINE_COLAPSE_STATE_KEY = Messages.SiriusTasksKey_changeSWTTableCollapseState; + /** * When collapsing or expanding a line of the table. */ - public static final String CHANGE_SWT_LINE_COLLAPSE_STATE_KEY = "Change the collapse state of a line of the SWT table"; + public static final String CHANGE_SWT_LINE_COLLAPSE_STATE_KEY = Messages.SiriusTasksKey_changeSWTTableCollapseState; /** * When refreshing a line of the table. */ - public static final String ADD_SWT_COLUMN_KEY = "Add a column in the SWT table"; + public static final String ADD_SWT_COLUMN_KEY = Messages.SiriusTasksKey_addAColumnInSWTTable; /** * When setting the name of a column. */ - public static final String SET_COLUMN_NAME_KEY = "Set the column name in the SWT table"; + public static final String SET_COLUMN_NAME_KEY = Messages.SiriusTasksKey_setColumnNameInSWTTable; /** * When refreshing the properties. */ - public static final String REFRESH_PROPERTIES_VIEW_KEY = "Refresh the properties view"; + public static final String REFRESH_PROPERTIES_VIEW_KEY = Messages.SiriusTasksKey_refreshPropertiesView; /** * When refreshing the properties. */ - public static final String REFRESH_PROPERTIES_VIEW_SECTION_KEY = "Refresh a section of the properties view"; + public static final String REFRESH_PROPERTIES_VIEW_SECTION_KEY = Messages.SiriusTasksKey_refreshPropertiesViewSection; /** * When opening table. */ - public static final String OPEN_TABLE_KEY = "Open table"; + public static final String OPEN_TABLE_KEY = Messages.SiriusTasksKey_openTable; /** * When opening tree. */ - public static final String OPEN_TREE_KEY = "Open tree"; + public static final String OPEN_TREE_KEY = Messages.SiriusTasksKey_openTree; /** * When showing or hiding a line of the table. */ - public static final String CHANGE_SWT_LINE_VISIBLE_STATE_KEY = "Change the visible state of a line of the SWT table"; + public static final String CHANGE_SWT_LINE_VISIBLE_STATE_KEY = Messages.SiriusTasksKey_changeSWTTableLineVisibleSate; /** * When showing or hiding a line of the table. */ - public static final String CHANGE_SWT_COLUMN_VISIBLE_STATE_KEY = "Change the visible state of a column of the SWT table"; + public static final String CHANGE_SWT_COLUMN_VISIBLE_STATE_KEY = Messages.SiriusTasksKey_changeSWTTableColumnVisibleState; /** * When showing or hiding a line of the table. */ - public static final String REFRESH_LOST_ELEMENTS_KEY = "Refresh elements lost by repair/migrate first pass"; + public static final String REFRESH_LOST_ELEMENTS_KEY = Messages.SiriusTasksKey_refreshRepairMigrateLostElements; /** * When loading an aird file. */ - public static final String LOAD_AIRD_KEY = "Load aird file"; + public static final String LOAD_AIRD_KEY = Messages.SiriusTasksKey_loadAirdFile; /** * avoid instanciation diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/property/IPropertiesProvider.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/property/IPropertiesProvider.java index 14b5535c98..1af53ec750 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/property/IPropertiesProvider.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/property/IPropertiesProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 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,8 @@ *******************************************************************************/ package org.eclipse.sirius.tools.api.ui.property; +import org.eclipse.sirius.viewpoint.Messages; + /** * Properties provider. * @@ -24,7 +26,7 @@ public interface IPropertiesProvider { /** * Exception when no property is found. */ - IllegalArgumentException EXCEPTION_PROPERTY_NOT_FOUND = new IllegalArgumentException("The property was not found"); + IllegalArgumentException EXCEPTION_PROPERTY_NOT_FOUND = new IllegalArgumentException(Messages.IPropertiesProvider_unfoundPropertyErrorMsg); /** * get the enablement of a property. diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/resource/ISiriusMessages.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/resource/ISiriusMessages.java index 063f9b291d..353c79e3a6 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/resource/ISiriusMessages.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/api/ui/resource/ISiriusMessages.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,8 @@ *******************************************************************************/ package org.eclipse.sirius.tools.api.ui.resource; +import org.eclipse.sirius.viewpoint.Messages; + /** * Common interface for Sirius messages. * @@ -18,11 +20,11 @@ package org.eclipse.sirius.tools.api.ui.resource; public interface ISiriusMessages { /** The given element is not a decorate semantic element. */ - String IS_NOT_A_DECORATE_SEMANTIC_ELEMENT = "The element is not a DSemanticDecorator"; + String IS_NOT_A_DECORATE_SEMANTIC_ELEMENT = Messages.ISiriusMessages_notADecoratorErrorMsg; /** the warning message if a .desc file could not be loaded. */ - String DESC_FILE_NOT_VAILD_MSG = "The following description file is not valid : "; + String DESC_FILE_NOT_VAILD_MSG = Messages.ISiriusMessages_invalidDescFileErrorMsg; /** the warning message if a .aird file could not be loaded. */ - String AIRD_FILE_NOT_VAILD_MSG = "The following diagram file is not valid : "; + String AIRD_FILE_NOT_VAILD_MSG = Messages.ISiriusMessages_invalidAirdFileErrorMsg; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/PrepareNewAnalysisCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/PrepareNewAnalysisCommand.java index 9f024ec7ef..f69a58ff4f 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/PrepareNewAnalysisCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/PrepareNewAnalysisCommand.java @@ -17,6 +17,7 @@ import org.eclipse.sirius.business.api.resource.ResourceDescriptor; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession; import org.eclipse.sirius.viewpoint.DAnalysis; +import org.eclipse.sirius.viewpoint.Messages; /** * Specific command to prepare the given analysis. It will be added to the @@ -46,7 +47,7 @@ public class PrepareNewAnalysisCommand extends RecordingCommand { * the current session. */ public PrepareNewAnalysisCommand(TransactionalEditingDomain domain, Resource resource, DAnalysis newAnalysis, Session session) { - super(domain, "Prepare new Analysis"); + super(domain, Messages.PrepareNewAnalysisCommand_label); this.slaveAnalysis = newAnalysis; this.resource = resource; this.session = session; diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/builders/ElementsToSelectTask.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/builders/ElementsToSelectTask.java index cc2e182f94..eff25f8e53 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/builders/ElementsToSelectTask.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/command/builders/ElementsToSelectTask.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.tools.internal.command.builders; +import java.text.MessageFormat; import java.util.Collection; import org.eclipse.emf.ecore.EObject; @@ -19,6 +20,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; 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.viewpoint.DRepresentation; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.UIState; import org.eclipse.sirius.viewpoint.ViewpointFactory; @@ -62,7 +64,7 @@ public final class ElementsToSelectTask extends AbstractCommandTask { @Override public String getLabel() { - return "Get result of Elements To Select interpreted expression"; + return Messages.ElementsToSelectTask_label; } @Override @@ -84,7 +86,7 @@ public final class ElementsToSelectTask extends AbstractCommandTask { uiState.getElementsToSelect().addAll(evaluateCollection); } } catch (EvaluationException e) { - SiriusPlugin.getDefault().warning("the following \"Elements To Select\" expression could not be correctly evaluated : " + elementsToSelectExpression, e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.ElementsToSelectTask_errorMsg, elementsToSelectExpression), e); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/ui/ExternalJavaActionDescriptor.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/ui/ExternalJavaActionDescriptor.java index 34c66b505d..6a57155513 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/ui/ExternalJavaActionDescriptor.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/ui/ExternalJavaActionDescriptor.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,9 +10,12 @@ *******************************************************************************/ package org.eclipse.sirius.tools.internal.ui; +import java.text.MessageFormat; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.sirius.tools.api.ui.IExternalJavaAction; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.SiriusPlugin; /** @@ -50,9 +53,9 @@ public class ExternalJavaActionDescriptor { try { return (IExternalJavaAction) element.createExecutableExtension(CLASS_ATTRIBUTE); } catch (final CoreException e) { - SiriusPlugin.getDefault().error("Impossible to create the action " + element.getAttribute(CLASS_ATTRIBUTE), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ExternalJavaActionDescriptor_actionCreationErrorMsg, element.getAttribute(CLASS_ATTRIBUTE)), e); } catch (final ClassCastException e) { - SiriusPlugin.getDefault().error("Impossible to create the action " + element.getAttribute(CLASS_ATTRIBUTE), e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ExternalJavaActionDescriptor_actionCreationErrorMsg, element.getAttribute(CLASS_ATTRIBUTE)), e); } return null; } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/uri/ViewpointProtocolParser.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/uri/ViewpointProtocolParser.java index 10340353ef..6171829cc5 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/uri/ViewpointProtocolParser.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/uri/ViewpointProtocolParser.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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.tools.internal.uri; +import java.text.MessageFormat; import java.util.LinkedHashSet; import java.util.Set; import java.util.regex.PatternSyntaxException; @@ -17,6 +18,7 @@ import java.util.regex.PatternSyntaxException; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.sirius.business.api.componentization.ViewpointRegistry; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.Viewpoint; import org.eclipse.sirius.viewpoint.description.util.DescriptionResourceFactoryImpl; @@ -29,6 +31,7 @@ public class ViewpointProtocolParser extends DescriptionResourceFactoryImpl { /** * {@inheritDoc} */ + @Override public Resource createResource(final URI uri) { ViewpointProtocolParser.getViewpoint(uri); return super.createResource(uri); @@ -57,9 +60,9 @@ public class ViewpointProtocolParser extends DescriptionResourceFactoryImpl { return vpWithGoodName.iterator().next(); } } else { - throw new ViewpointProtocolException("URI " + uri + " is not valid."); + throw new ViewpointProtocolException(MessageFormat.format(Messages.ViewpointProtocolParser_invalidURIErrorMsg, uri)); } - throw new ViewpointProtocolException("No viewpoint is corresponding to " + uri); + throw new ViewpointProtocolException(MessageFormat.format(Messages.ViewpointProtocolParser_noViewpointErrorMsg, uri)); } private static Set<Viewpoint> filterByNameAndId(final Set<Viewpoint> viewpoints, final String viewpointName, final String pluginId) { @@ -143,7 +146,7 @@ public class ViewpointProtocolParser extends DescriptionResourceFactoryImpl { name = name.substring(0, name.indexOf(viewpointNameSeparator)); return name; } else { - return "unnamed"; + return Messages.ViewpointProtocolParser_unamed; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/AbstractCommonToolToAppliedOnConstraint.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/AbstractCommonToolToAppliedOnConstraint.java index d90efe1eb8..8660d82711 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/AbstractCommonToolToAppliedOnConstraint.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/AbstractCommonToolToAppliedOnConstraint.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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.tools.internal.validation.description.constraints; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.AbstractModelConstraint; import org.eclipse.sirius.business.api.query.IdentifiedElementQuery; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.IdentifiedElement; import org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription; @@ -49,7 +50,7 @@ public abstract class AbstractCommonToolToAppliedOnConstraint extends AbstractMo * @return the label of the given object */ protected String getLabel(final EObject eObject) { - String label = "Element whithout name"; + String label = Messages.AbstractCommonToolToAppliedOnConstraint_label; if (eObject instanceof IdentifiedElement) { label = new IdentifiedElementQuery((IdentifiedElement) eObject).getLabel(); } else if (eObject instanceof RepresentationExtensionDescription) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint.java index b0771a8f9b..aeb6c77bca 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint.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,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.tools.internal.validation.description.constraints; +import java.text.MessageFormat; import java.util.Iterator; import org.eclipse.core.runtime.IStatus; @@ -18,6 +19,7 @@ import org.eclipse.emf.ecore.EClassifier; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.EAttributeCustomization; /** @@ -33,8 +35,6 @@ import org.eclipse.sirius.viewpoint.description.EAttributeCustomization; */ public class EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint extends AbstractEStructuralFeatureCustomizationFeatureNameCommonToAppliedOnConstraint { - private static final String EATTRIBUTE_NAME_ON = " EAttribute name on "; - @Override public IStatus validate(IValidationContext ctx) { IStatus status = null; @@ -56,16 +56,19 @@ public class EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint ext if (appliedOnIterator.hasNext()) { EObject firstStyleDescriptionElt = appliedOnIterator.next(); if (!isStyleDescriptionElt(firstStyleDescriptionElt)) { - status = ctx.createFailureStatus(getPath(firstStyleDescriptionElt) + " doesn't concerns a style description or a style description element"); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationStyleDescriptionErrorMsg, getPath(firstStyleDescriptionElt))); } else { EStructuralFeature eStructuralFeature = firstStyleDescriptionElt.eClass().getEStructuralFeature(attributeName); if (eStructuralFeature instanceof EAttribute) { EClassifier firstEType = eStructuralFeature.getEType(); status = validateFollowingStyleDescriptionElts(appliedOnIterator, firstStyleDescriptionElt, firstEType, attributeName, ctx); } else if (eStructuralFeature == null) { - status = ctx.createFailureStatus(attributeName + EATTRIBUTE_NAME_ON + getPath(firstStyleDescriptionElt) + " doesn't exists"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationNotExistErrorMsg, attributeName, + getPath(firstStyleDescriptionElt))); } else { - status = ctx.createFailureStatus(attributeName + EATTRIBUTE_NAME_ON + getPath(firstStyleDescriptionElt) + " concerns " + eStructuralFeature + " which is not a EAttribute"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_notEAttributeErrorMsg, attributeName, + getPath(firstStyleDescriptionElt), eStructuralFeature)); } } } @@ -77,19 +80,22 @@ public class EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint ext while (appliedOnIterator.hasNext()) { EObject next = appliedOnIterator.next(); if (!isStyleDescriptionElt(next)) { - status = ctx.createFailureStatus(getPath(next) + " doesn't concerns a style description or a style description element"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationStyleDescriptionErrorMsg, getPath(next))); break; } else { EStructuralFeature eStructuralFeature = next.eClass().getEStructuralFeature(attributeName); if (eStructuralFeature instanceof EAttribute) { if (firstEType != eStructuralFeature.getEType()) { - status = ctx.createFailureStatus(getPath(firstStyleDescriptionElt) + " and " + getPath(next) + "have each a EAttribute named " + attributeName + " but with differents types"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_EAttributeDiffernentTypesErrorMsg, + getPath(firstStyleDescriptionElt), getPath(next), attributeName)); break; } } else if (eStructuralFeature == null) { - status = ctx.createFailureStatus(attributeName + EATTRIBUTE_NAME_ON + getPath(next) + " doesn't exists"); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationNotExistErrorMsg, attributeName, getPath(next))); } else { - status = ctx.createFailureStatus(attributeName + EATTRIBUTE_NAME_ON + getPath(next) + " concerns " + eStructuralFeature + " which is not a EAttribute"); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_notEAttributeErrorMsg, attributeName, getPath(next), eStructuralFeature)); break; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint.java index b38f5dd9ea..ce55b7e15f 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint.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,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.tools.internal.validation.description.constraints; +import java.text.MessageFormat; import java.util.Iterator; import org.eclipse.core.runtime.IStatus; @@ -18,6 +19,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.validation.IValidationContext; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.EReferenceCustomization; /** @@ -37,8 +39,6 @@ import org.eclipse.sirius.viewpoint.description.EReferenceCustomization; */ public class EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint extends AbstractEStructuralFeatureCustomizationFeatureNameCommonToAppliedOnConstraint { - private static final String EREFERENCE_NAME_ON = " EReference name on "; - @Override public IStatus validate(IValidationContext ctx) { IStatus status = null; @@ -60,16 +60,19 @@ public class EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint ext if (appliedOnIterator.hasNext()) { EObject firstStyleDescriptionElt = appliedOnIterator.next(); if (!isStyleDescriptionElt(firstStyleDescriptionElt)) { - status = ctx.createFailureStatus(getPath(firstStyleDescriptionElt) + " doesn't concerns a style description or a style description element"); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationStyleDescriptionErrorMsg, getPath(firstStyleDescriptionElt))); } else { EStructuralFeature eStructuralFeature = firstStyleDescriptionElt.eClass().getEStructuralFeature(referenceName); if (eStructuralFeature instanceof EReference) { EClassifier firstEType = eStructuralFeature.getEType(); status = validateFollowingStyleDescriptionElts(appliedOnIterator, firstStyleDescriptionElt, firstEType, referenceName, ctx); } else if (eStructuralFeature == null) { - status = ctx.createFailureStatus(referenceName + EREFERENCE_NAME_ON + getPath(firstStyleDescriptionElt) + " doesn't exists"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_validationNotExistErrorMsg, referenceName, + getPath(firstStyleDescriptionElt))); } else { - status = ctx.createFailureStatus(referenceName + EREFERENCE_NAME_ON + getPath(firstStyleDescriptionElt) + " concerns " + eStructuralFeature + " which is not a EReference"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_notAReferenceErrorMsg, referenceName, + getPath(firstStyleDescriptionElt), eStructuralFeature)); } } } @@ -81,19 +84,22 @@ public class EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint ext while (appliedOnIterator.hasNext()) { EObject next = appliedOnIterator.next(); if (!isStyleDescriptionElt(next)) { - status = ctx.createFailureStatus(getPath(next) + " doesn't concerns a style description or a style description element"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationStyleDescriptionErrorMsg, getPath(next))); break; } else { EStructuralFeature eStructuralFeature = next.eClass().getEStructuralFeature(referenceName); if (eStructuralFeature instanceof EReference) { if (firstEType != eStructuralFeature.getEType()) { - status = ctx.createFailureStatus(getPath(firstStyleDescriptionElt) + " and " + getPath(next) + "have each a EAttribute named " + referenceName + " but with differents types"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_EAttributeDiffernentTypesErrorMsg, + getPath(firstStyleDescriptionElt), getPath(next), referenceName)); break; } } else if (eStructuralFeature == null) { - status = ctx.createFailureStatus(referenceName + EREFERENCE_NAME_ON + getPath(next) + " doesn't exists"); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_validationNotExistErrorMsg, referenceName, getPath(next))); } else { - status = ctx.createFailureStatus(referenceName + EREFERENCE_NAME_ON + getPath(next) + " concerns " + eStructuralFeature + " which is not a EAttribute"); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_notAReferenceErrorMsg, referenceName, getPath(next), eStructuralFeature)); break; } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EmptyAppliedOnListConstraint.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EmptyAppliedOnListConstraint.java index 7c8aafe2ae..fbccb21bed 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EmptyAppliedOnListConstraint.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/EmptyAppliedOnListConstraint.java @@ -1,9 +1,12 @@ /***************************************************************************************** - * Copyright (c) 2013 THALES GLOBAL SERVICES - * All rights reserved. + * 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 + * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Obeo - Initial API and implementation + * Obeo - initial API and implementation *****************************************************************************************/ package org.eclipse.sirius.tools.internal.validation.description.constraints; @@ -11,6 +14,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.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.EStructuralFeatureCustomization; /** @@ -23,11 +27,6 @@ import org.eclipse.sirius.viewpoint.description.EStructuralFeatureCustomization; */ public class EmptyAppliedOnListConstraint extends AbstractModelConstraint { - /** - * Error message for this constraint. - */ - private static final String ERROR_MESSAGE = "This customization has no style to customize."; - @Override public IStatus validate(IValidationContext ctx) { @@ -38,7 +37,7 @@ public class EmptyAppliedOnListConstraint extends AbstractModelConstraint { if (!eStructuralFeatureCustomization.isApplyOnAll()) { if (eStructuralFeatureCustomization.getAppliedOn().isEmpty()) { - status = ctx.createFailureStatus(ERROR_MESSAGE); + status = ctx.createFailureStatus(Messages.EmptyAppliedOnListConstraint_errorMsg); } } } @@ -47,4 +46,4 @@ public class EmptyAppliedOnListConstraint extends AbstractModelConstraint { } return status; } -}
\ No newline at end of file +} diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementCustomizationReuseValidConstraint.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementCustomizationReuseValidConstraint.java index 2e7bc194e7..a543d2175f 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementCustomizationReuseValidConstraint.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementCustomizationReuseValidConstraint.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,11 +10,14 @@ *******************************************************************************/ package org.eclipse.sirius.tools.internal.validation.description.constraints; +import java.text.MessageFormat; + import org.eclipse.core.runtime.IStatus; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.IValidationContext; import org.eclipse.sirius.business.internal.query.EAttributeCustomizationQuery; import org.eclipse.sirius.business.internal.query.EReferenceCustomizationQuery; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.EAttributeCustomization; import org.eclipse.sirius.viewpoint.description.EReferenceCustomization; import org.eclipse.sirius.viewpoint.description.EStructuralFeatureCustomization; @@ -37,20 +40,22 @@ public class VSMElementCustomizationReuseValidConstraint extends AbstractEStruct VSMElementCustomizationReuse vsmElementCustomizationReuse = (VSMElementCustomizationReuse) target; for (EObject eObject : vsmElementCustomizationReuse.getAppliedOn()) { if (!isStyleDescriptionElt(eObject)) { - status = ctx.createFailureStatus(getPath(eObject) + " doesn't concerns a style description or a style description element"); + status = ctx.createFailureStatus(MessageFormat.format(Messages.VSMElementCustomizationReuseValidConstraint_doesntConcernsStyleDescErrorMsg, getPath(eObject))); } else { for (EStructuralFeatureCustomization featureCustomization : vsmElementCustomizationReuse.getReuse()) { if (featureCustomization instanceof EAttributeCustomization) { EAttributeCustomization eAttributeCustomization = (EAttributeCustomization) featureCustomization; EAttributeCustomizationQuery eAttributeCustomizationQuery = new EAttributeCustomizationQuery(eAttributeCustomization); if (!eAttributeCustomizationQuery.isStyleDescriptionEltConformToEAttributeCustomization(eObject)) { - status = ctx.createFailureStatus(getPath(eObject) + " doesn't have EAttribute named " + eAttributeCustomization.getAttributeName()); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.VSMElementCustomizationReuseValidConstraint_noEAttributeErrorMsg, getPath(eObject), eAttributeCustomization.getAttributeName())); } } else if (featureCustomization instanceof EReferenceCustomization) { EReferenceCustomization eReferenceCustomization = (EReferenceCustomization) featureCustomization; EReferenceCustomizationQuery eReferenceCustomizationQuery = new EReferenceCustomizationQuery(eReferenceCustomization); if (!eReferenceCustomizationQuery.isStyleDescriptionEltConformToEReferenceCustomization(eObject)) { - status = ctx.createFailureStatus(getPath(eObject) + " doesn't have EReference named " + eReferenceCustomization.getReferenceName()); + status = ctx.createFailureStatus( + MessageFormat.format(Messages.VSMElementCustomizationReuseValidConstraint_noEReferenceErrorMsg, getPath(eObject), eReferenceCustomization.getReferenceName())); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementNameValidConstraint.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementNameValidConstraint.java index 47891a153a..c375fde33c 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementNameValidConstraint.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/VSMElementNameValidConstraint.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 Obeo. + * Copyright (c) 2014, 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 @@ -14,6 +14,7 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.validation.IValidationContext; import org.eclipse.sirius.common.tools.api.util.StringUtil; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.IdentifiedElement; /** @@ -23,11 +24,6 @@ import org.eclipse.sirius.viewpoint.description.IdentifiedElement; */ public class VSMElementNameValidConstraint extends AbstractCommonToolToAppliedOnConstraint { - /** - * Error message for this constraint. - */ - private static final String ERROR_MESSAGE = " is not a valid name, it must be different of empty or null."; - @Override public IStatus validate(IValidationContext ctx) { IStatus status = null; @@ -35,7 +31,7 @@ public class VSMElementNameValidConstraint extends AbstractCommonToolToAppliedOn if (target instanceof IdentifiedElement) { String elementName = ((IdentifiedElement) target).getName(); if (StringUtil.isEmpty(elementName)) { - status = ctx.createFailureStatus(getPath(target) + ERROR_MESSAGE); + status = ctx.createFailureStatus(getPath(target) + Messages.VSMElementNameValidConstraint_invalidNameErrorMsg); } } if (status == null) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/ValidImageConstraint.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/ValidImageConstraint.java index 4b6607ed50..6f5c085041 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/ValidImageConstraint.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/tools/internal/validation/description/constraints/ValidImageConstraint.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.tools.internal.validation.description.constraints; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; @@ -27,6 +28,7 @@ import org.eclipse.emf.validation.model.ConstraintStatus; import org.eclipse.sirius.common.tools.api.resource.ImageFileFormat; import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.tools.internal.validation.AbstractConstraint; +import org.eclipse.sirius.viewpoint.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import com.google.common.collect.Lists; @@ -67,10 +69,10 @@ public class ValidImageConstraint extends AbstractConstraint { // there is another validation rule for that) if (!StringUtil.isEmpty(path)) { if (!validateExtension(path)) { - failures.add(ctx.createFailureStatus(new Object[] { "The path '" + path + "' does not correspond to an image." })); + failures.add(ctx.createFailureStatus(new Object[] { MessageFormat.format(Messages.ValidImageConstraint_invalidPathErrorMsg, path) })); } if (!validateExistence(path, rs)) { - failures.add(ctx.createFailureStatus(new Object[] { "The image '" + path + "' does not exist." })); + failures.add(ctx.createFailureStatus(new Object[] { MessageFormat.format(Messages.ValidImageConstraint_imageDoesntExistErrorMsg, path) })); } } if (failures.isEmpty()) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/viewpoint/Messages.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/viewpoint/Messages.java new file mode 100644 index 0000000000..f17f868695 --- /dev/null +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/viewpoint/Messages.java @@ -0,0 +1,846 @@ +/******************************************************************************* + * 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.viewpoint; + +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, SiriusPlugin.INSTANCE); + } + + // CHECKSTYLE:OFF + + @TranslatableMessage + public static String AbstractCommandFactory_refreshTasklabel; + + @TranslatableMessage + public static String AbstractCommonToolToAppliedOnConstraint_label; + + @TranslatableMessage + public static String AbstractExternalJavaAction_nullParameter; + + @TranslatableMessage + public static String AbstractExternalJavaAction_parameterErrorMsg; + + @TranslatableMessage + public static String AbstractExternalJavaAction_parameterType; + + @TranslatableMessage + public static String AbstractExternalJavaAction_parameterTypeErrorMsg; + + @TranslatableMessage + public static String AbstractProviderDescriptor_attributeMissingMsg; + + @TranslatableMessage + public static String AbstractRepresentationDialectServices_createRepresentationMsg; + + @TranslatableMessage + public static String AbstractRepresentationDialectServices_initRepresentationMsg; + + @TranslatableMessage + public static String AbstractSavingPolicy_saveMsg; + + @TranslatableMessage + public static String AbstractSavingPolicy_savingErrorMsg; + + @TranslatableMessage + public static String AbstractSiriusMigrationService_contributionInstantiationErrorMsg; + + @TranslatableMessage + public static String AbstractVersionSAXParser_getVersionMsg; + + @TranslatableMessage + public static String AbstractVersionSAXParser_stopParsingMsg; + + @TranslatableMessage + public static String AddSemanticResourceCommand_label; + + @TranslatableMessage + public static String AnalysisResourceReloadedCommand_label; + + @TranslatableMessage + public static String AttachSemanticResourcesJob_name; + + @TranslatableMessage + public static String ChangeContextTask_label; + + @TranslatableMessage + public static String CompositeResourceMonitor_addMonitorErrorMsg; + + @TranslatableMessage + public static String CompositeResourceMonitor_alreadyRegisteredErrorMsg; + + @TranslatableMessage + public static String CompositeResourceMonitor_alreadyUsedNameErrorMsg; + + @TranslatableMessage + public static String CompositeResourceMonitor_uriCompareErrorMsg; + + @TranslatableMessage + public static String ControlCommand_moveErrorMsg; + + @TranslatableMessage + public static String ControlledResourcesDetector_refreshCommandLabel; + + @TranslatableMessage + public static String CopyRepresentationCommand_label; + + @TranslatableMessage + public static String CreateInstanceTask_addToRefErrorMsg; + + @TranslatableMessage + public static String CreateInstanceTask_creationErrorMsg; + + @TranslatableMessage + public static String CreateInstanceTask_label; + + @TranslatableMessage + public static String CreateRepresentationCommand_label; + + @TranslatableMessage + public static String CreateRepresentationCommand_nullExpresionWarningMsg; + + @TranslatableMessage + public static String DAnalysisSelectorService_multipleDefaultErrorMsg; + + @TranslatableMessage + public static String DAnalysisSelectorService_noDefaultWaringMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_addNoParentAnalysisErrorMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_addSemanticErrorMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_addSemanticResourceMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_noEditingDomainErrorMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_noRessourceErrorMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_openMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_removeNoParentAnalysisErrorMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_saveInterruptedMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_saveMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_toStringMsg; + + @TranslatableMessage + public static String DAnalysisSessionImpl_unloadingErrorMsg; + + @TranslatableMessage + public static String DanglingRefRemovalTrigger_removeDanglingCmdLabel; + + @TranslatableMessage + public static String DefaultLocalSessionCreationOperation_createResoureMsg; + + @TranslatableMessage + public static String DefaultLocalSessionCreationOperation_createSessionMsg; + + @TranslatableMessage + public static String DefaultLocalSessionCreationOperation_sessionOpenMsg; + + @TranslatableMessage + public static String DeleteDRepresentationElementsTask_label; + + @TranslatableMessage + public static String DeleteDRepresentationTask_label; + + @TranslatableMessage + public static String DeleteEObjectTask_label; + + @TranslatableMessage + public static String DeleteRepresentationCommand_label; + + @TranslatableMessage + public static String DeleteWithoutToolTask_label; + + @TranslatableMessage + public static String DialectManagerImpl_refreshImpactedMsg; + + @TranslatableMessage + public static String DialectManagerImpl_refreshMsg; + + @TranslatableMessage + public static String DViewOperations_addSelectedViewMsg; + + @TranslatableMessage + public static String DViewOperations_createViewMsg; + + @TranslatableMessage + public static String DViewOperations_initRepresentationMsg; + + @TranslatableMessage + public static String DViewOperations_notContainedErrorMsg; + + @TranslatableMessage + public static String DViewOperations_removeSelectedViewMsg; + + @TranslatableMessage + public static String DViewOperations_updateSelectedVPDataMsg; + + @TranslatableMessage + public static String EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_EAttributeDiffernentTypesErrorMsg; + + @TranslatableMessage + public static String EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_notEAttributeErrorMsg; + + @TranslatableMessage + public static String EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationNotExistErrorMsg; + + @TranslatableMessage + public static String EAttributeCustomizationAttributeNameCommonToAppliedOnConstraint_validationStyleDescriptionErrorMsg; + + @TranslatableMessage + public static String EclipseDeleteHookDescriptor_extensionLoadingErrorMsg; + + @TranslatableMessage + public static String EObjectQuery_valuesErrorMsg; + + @TranslatableMessage + public static String EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_validationNotExistErrorMsg; + + @TranslatableMessage + public static String EReferenceCustomizationReferenceNameCommonToAppliedOnConstraint_notAReferenceErrorMsg; + + @TranslatableMessage + public static String EditingDomainUndoContext_label; + + @TranslatableMessage + public static String ElementsToSelectTask_errorMsg; + + @TranslatableMessage + public static String ElementsToSelectTask_label; + + @TranslatableMessage + public static String EmptyAppliedOnListConstraint_errorMsg; + + @TranslatableMessage + public static String TaskExecutor_errorModifyingModelMsg; + + @TranslatableMessage + public static String ExecuteToolOperationTask_label; + + @TranslatableMessage + public static String ExternalJavaActionDescriptor_actionCreationErrorMsg; + + @TranslatableMessage + public static String ExternalJavaActionTask_label; + + @TranslatableMessage + public static String FeatureContributor_targetObject; + + @TranslatableMessage + public static String FeatureContributor_sourceObject; + + @TranslatableMessage + public static String FeatureContributor_featureMissingMsg; + + @TranslatableMessage + public static String FeatureContributor_unexpectedTypeErrorMsg; + + @TranslatableMessage + public static String FeatureContributor_noTargetSpecifiedErrorMsg; + + @TranslatableMessage + public static String FeatureContributor_noSourceSpefifiedErrorMsg; + + @TranslatableMessage + public static String FeatureContributor_imcompatibleFeaturesErrorMsg; + + @TranslatableMessage + public static String FeatureContributor_unmodifiableFeatureErrorMsg; + + @TranslatableMessage + public static String FeatureContributor_noTargetFeatureErrorMsg; + + @TranslatableMessage + public static String ForTask_label; + + @TranslatableMessage + public static String IInterpreterMessages_invalidFeatureErrorMsg; + + @TranslatableMessage + public static String IPropertiesProvider_unfoundPropertyErrorMsg; + + @TranslatableMessage + public static String ISiriusMessages_invalidAirdFileErrorMsg; + + @TranslatableMessage + public static String ISiriusMessages_invalidDescFileErrorMsg; + + @TranslatableMessage + public static String ISiriusMessages_notADecoratorErrorMsg; + + @TranslatableMessage + public static String IfTask_label; + + @TranslatableMessage + public static String InitInterpreterFromParsedVariableTask_label; + + @TranslatableMessage + public static String InitInterpreterVariablesTask_label; + + @TranslatableMessage + public static String InitInterpreterVariablesTask_invalidModelErrorMsg; + + @TranslatableMessage + public static String InitializeModelingProjectJob_invalidModelingProjectsErrorMsg; + + @TranslatableMessage + public static String InitializeModelingProjectJob_invalidModelingProjectErrorMsg; + + @TranslatableMessage + public static String InitializeModelingProjectJob_label; + + @TranslatableMessage + public static String InitializeModelingProjectJob_labelEmptyProject; + + @TranslatableMessage + public static String InterpretedExpressionVariableTask_label; + + @TranslatableMessage + public static String InterpreterRegistry_sessionNotFoundErrorMsg; + + @TranslatableMessage + public static String InterpreterRegistry_nullModelElementErrorMsg; + + @TranslatableMessage + public static String InterpreterRegistry_ImpossibleToFindInterpreterErrorMsg; + + @TranslatableMessage + public static String InvalidPermissionCommand_label; + + @TranslatableMessage + public static String SavingPolicyImpl_savingErrorMsg; + + @TranslatableMessage + public static String JavaActionFromToolCommand_label; + + @TranslatableMessage + public static String LaunchRunnableTask_label; + + @TranslatableMessage + public static String LoadEMFResource_loadingErrorMsg; + + @TranslatableMessage + public static String MarkerRuntimeLoggerImpl_feature; + + @TranslatableMessage + public static String MarkerRuntimeLoggerImpl_featureWithMessage; + + @TranslatableMessage + public static String MigrationCommandExecutor_migrationErrorMsg; + + @TranslatableMessage + public static String MigrationUtil_toBigErrorMsg; + + @TranslatableMessage + public static String MigrationUtil_loadingMsg; + + @TranslatableMessage + public static String MigrationUtil_IOErrorMsg; + + @TranslatableMessage + public static String MigrationUtil_invalidMappingErrorMsg; + + @TranslatableMessage + public static String ModelingProject_getMainRepFileURIMsg; + + @TranslatableMessage + public static String ModelingProjectQuery_severalRepresentationsFiles; + + @TranslatableMessage + public static String ModelingProjectQuery_mustContainOneRepFileMsg; + + @TranslatableMessage + public static String ModelingProjectQuery_and; + + @TranslatableMessage + public static String MoveElementInListAction_notAMemberErrorMsg; + + @TranslatableMessage + public static String MoveElementInListAction_predecessorParameterErrorMsg; + + @TranslatableMessage + public static String MoveElementInListAction_elementAndPredecessorShouldBeDiffErrorMsg; + + @TranslatableMessage + public static String MoveElementInListAction_referenceNotChangeableErrorMsg; + + @TranslatableMessage + public static String MoveElementInListAction_notMultiValuedRefErrorMsg; + + @TranslatableMessage + public static String MoveElementInListAction_notARefErrorMsg; + + @TranslatableMessage + public static String MoveElementInListAction_featureNotFoundErrorMsg; + + @TranslatableMessage + public static String MoveElementTask_label; + + @TranslatableMessage + public static String MoveElementTask_ImpossibleToAddValueErrorMsg; + + @TranslatableMessage + public static String MoveRepresentationCommand_label; + + @TranslatableMessage + public static String NoNullResourceCommand_instanceErrorMsg; + + @TranslatableMessage + public static String NotificationTask_label; + + @TranslatableMessage + public static String PaneBasedSelectionWizardDescriptionImpl_choiceOfValuesMsg; + + @TranslatableMessage + public static String PaneBasedSelectionWizardDescriptionImpl_selectedValuesMsg; + + @TranslatableMessage + public static String PrepareNewAnalysisCommand_label; + + @TranslatableMessage + public static String RefreshImpactedElementsCommand_label; + + @TranslatableMessage + public static String RefreshRepresentationsCommand_label; + + @TranslatableMessage + public static String RemoveElementTask_label; + + @TranslatableMessage + public static String RemoveElementTask_notAViewErrorMsg; + + @TranslatableMessage + public static String RemoveSemanticResourceCommand_label; + + @TranslatableMessage + public static String RenameRepresentationCommand_label; + + @TranslatableMessage + public static String XMIModelFileHandler_parsingStopedMsg; + + @TranslatableMessage + public static String RestoreModelElementStateCommand_label; + + @TranslatableMessage + public static String RuntimeLoggerInterpreterImpl_evaluationConditionErrorMsg; + + @TranslatableMessage + public static String SaveSessionJob_sessionSavingMsg; + + @TranslatableMessage + public static String Saver_savingErrorMsg; + + @TranslatableMessage + public static String SelectionWizardDescriptionImpl_title; + + @TranslatableMessage + public static String SessionFactoryImpl_EmptyContentErrorMsg; + + @TranslatableMessage + public static String SessionFactoryImpl_creationFailedErrorMsg; + + @TranslatableMessage + public static String SessionFactoryImpl_sessionCreation; + + @TranslatableMessage + public static String SessionFactoryImpl_loadingError; + + @TranslatableMessage + public static String SessionFactoryImpl_sessionLoadingMsg; + + @TranslatableMessage + public static String SessionManagerImpl_remoteServerConnectionErrorMsg; + + @TranslatableMessage + public static String SessionManagerImpl_cantAddNullSessionErrorMsg; + + @TranslatableMessage + public static String SessionManagerImpl_representationsFileLoadingErrorMsg; + + @TranslatableMessage + public static String SessionManagerImpl_representationsFileLoadingSeeErrorLogMsg; + + @TranslatableMessage + public static String SessionResourcesSynchronizer_cantHandleResourceChangeMsg; + + @TranslatableMessage + public static String SessionResourcesSynchronizer_reloadOperationFailErrorMsg; + + @TranslatableMessage + public static String SessionResourcesTracker_addReferencedSemanticResourcesMsg; + + @TranslatableMessage + public static String SessionResourcesTracker_semanticResourcesAccessErrorMsg; + + @TranslatableMessage + public static String SessionVSMUpdater_VSMLoadErrorMsg; + + @TranslatableMessage + public static String SetValueTask_label; + + @TranslatableMessage + public static String SiriusControlCommand_controlResourceMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_errorMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_contributionInstantationErrorMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_inProgressMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_closingSessionMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_savingSessionMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_repairModelMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_backupMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_resolvingReferencesMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_openingsessionMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_loadingModelMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_restoringBckErrorMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_bckupCreationErrorMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_removeElementsMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_saveModelElementStateMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_restoringElementStatsMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_postRefreshMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_refreshingRepresentationsMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_removingElementsMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_savingElementsStateMsg; + + @TranslatableMessage + public static String SiriusRepairProcess_handlingViewMsg; + + @TranslatableMessage + public static String SiriusTasksKey_mmExtension; + + @TranslatableMessage + public static String SiriusTasksKey_genericModeler; + + @TranslatableMessage + public static String SiriusTasksKey_repairMigrate; + + @TranslatableMessage + public static String SiriusTasksKey_cleaningADiagram; + + @TranslatableMessage + public static String SiriusTasksKey_updatingADiagram; + + @TranslatableMessage + public static String SiriusTasksKey_evaluatingAcceleoExpression; + + @TranslatableMessage + public static String SiriusTasksKey_evaluatingOCLExpressions; + + @TranslatableMessage + public static String SiriusTasksKey_checkPreconditionExpressions; + + @TranslatableMessage + public static String SiriusTasksKey_InitAcceleoInterpreter; + + @TranslatableMessage + public static String SiriusTasksKey_isGMFViewValid; + + @TranslatableMessage + public static String SiriusTasksKey_getNodesCandidates; + + @TranslatableMessage + public static String SiriusTasksKey_canonicalRefresh; + + @TranslatableMessage + public static String SiriusTasksKey_validateAllDDiagramElements; + + @TranslatableMessage + public static String SiriusTasksKey_cacheAccess; + + @TranslatableMessage + public static String SiriusTasksKey_getEdgesCandidates; + + @TranslatableMessage + public static String SiriusTasksKey_validatingTheNode; + + @TranslatableMessage + public static String SiriusTasksKey_validatingEdge; + + @TranslatableMessage + public static String SiriusTasksKey_cleaningAllEdges; + + @TranslatableMessage + public static String SiriusTasksKey_getContainerCandidates; + + @TranslatableMessage + public static String SiriusTasksKey_createMissingContainersFromViewpoint; + + @TranslatableMessage + public static String SiriusTasksKey_refreshADiagram; + + @TranslatableMessage + public static String SiriusTasksKey_CleaningRemoveDanglingRef; + + @TranslatableMessage + public static String SiriusTasksKey_createMissingEdgesFromViewpoint; + + @TranslatableMessage + public static String SiriusTasksKey_createMissingNodeFromContainer; + + @TranslatableMessage + public static String SiriusTasksKey_isTheElementCollapsed; + + @TranslatableMessage + public static String SiriusTasksKey_checkThatElementHasToBeDisplayed; + + @TranslatableMessage + public static String SiriusTasksKey_isElementDisplayed; + + @TranslatableMessage + public static String SiriusTasksKey_createMissingNodeFromViewpoint; + + @TranslatableMessage + public static String SiriusTasksKey_updatingAllNodes; + + @TranslatableMessage + public static String SiriusTasksKey_updateAllContainers; + + @TranslatableMessage + public static String SiriusTasksKey_updatingAllEdges; + + @TranslatableMessage + public static String SiriusTasksKey_getRemovedNodesCandidates; + + @TranslatableMessage + public static String SiriusTasksKey_synchronizeDiagram; + + @TranslatableMessage + public static String SiriusTasksKey_openSession; + + @TranslatableMessage + public static String SiriusTasksKey_openDiagram; + + @TranslatableMessage + public static String SiriusTasksKey_computeEdgeSrcTgtViews; + + @TranslatableMessage + public static String SiriusTasksKey_cleanOrphanedNodes; + + @TranslatableMessage + public static String SiriusTasksKey_removeDanglingRef; + + @TranslatableMessage + public static String SiriusTasksKey_getKeptNodesCandidates; + + @TranslatableMessage + public static String SiriusTasksKey_launchRefreshFromOperationHistoryListener; + + @TranslatableMessage + public static String SiriusTasksKey_bigRefresh; + + @TranslatableMessage + public static String SiriusTasksKey_isFold; + + @TranslatableMessage + public static String SiriusTasksKey_instanceOf; + + @TranslatableMessage + public static String SiriusTasksKey_addAColumnInSWTTable; + + @TranslatableMessage + public static String SiriusTasksKey_setColumnNameInSWTTable; + + @TranslatableMessage + public static String SiriusTasksKey_openSessionAction; + + @TranslatableMessage + public static String SiriusTasksKey_refreshATree; + + @TranslatableMessage + public static String SiriusTasksKey_refreshSWTTable; + + @TranslatableMessage + public static String SiriusTasksKey_changeSWTTableCollapseState; + + @TranslatableMessage + public static String SiriusTasksKey_refreshSWTTableLine; + + @TranslatableMessage + public static String SiriusTasksKey_createSWTTable; + + @TranslatableMessage + public static String SiriusTasksKey_refreshTable; + + @TranslatableMessage + public static String SiriusTasksKey_getAddedNodesCandidates; + + @TranslatableMessage + public static String SiriusTasksKey_findAirFromModelElement; + + @TranslatableMessage + public static String SiriusTasksKey_resolveAll; + + @TranslatableMessage + public static String SiriusTasksKey_launchRefreshFromLayerChange; + + @TranslatableMessage + public static String SiriusTasksKey_openTable; + + @TranslatableMessage + public static String SiriusTasksKey_refreshPropertiesViewSection; + + @TranslatableMessage + public static String SiriusTasksKey_refreshPropertiesView; + + @TranslatableMessage + public static String SiriusTasksKey_updateSWTTableLine; + + @TranslatableMessage + public static String SiriusTasksKey_semanticRefresh; + + @TranslatableMessage + public static String SiriusTasksKey_loadAirdFile; + + @TranslatableMessage + public static String SiriusTasksKey_refreshRepairMigrateLostElements; + + @TranslatableMessage + public static String SiriusTasksKey_changeSWTTableColumnVisibleState; + + @TranslatableMessage + public static String SiriusTasksKey_changeSWTTableLineVisibleSate; + + @TranslatableMessage + public static String SiriusTasksKey_openTree; + + @TranslatableMessage + public static String SiriusUncontrolCommand_label; + + @TranslatableMessage + public static String SiriusUncontrolCommand_resourceDeletionFailedMsg; + + @TranslatableMessage + public static String UnexecutableTask_label; + + @TranslatableMessage + public static String UnsetTask_nullOperationErrorMsg; + + @TranslatableMessage + public static String UnsetTask_label; + + @TranslatableMessage + public static String Updater_updateElementDifferentReferenceTypeErrorMsg; + + @TranslatableMessage + public static String Updater_updateElementLogicallyDifferentErrorMsg; + + @TranslatableMessage + public static String VSMElementCustomizationReuseValidConstraint_noEReferenceErrorMsg; + + @TranslatableMessage + public static String VSMElementCustomizationReuseValidConstraint_noEAttributeErrorMsg; + + @TranslatableMessage + public static String VSMElementCustomizationReuseValidConstraint_doesntConcernsStyleDescErrorMsg; + + @TranslatableMessage + public static String VSMElementNameValidConstraint_invalidNameErrorMsg; + + @TranslatableMessage + public static String ValidImageConstraint_imageDoesntExistErrorMsg; + + @TranslatableMessage + public static String ValidImageConstraint_invalidPathErrorMsg; + + @TranslatableMessage + public static String ValidationRuleImpl_elementHas; + + @TranslatableMessage + public static String ValidationRuleSpecOperations_evaluationErrorMsg; + + @TranslatableMessage + public static String ViewpointProtocolParser_noViewpointErrorMsg; + + @TranslatableMessage + public static String ViewpointProtocolParser_invalidURIErrorMsg; + + @TranslatableMessage + public static String ViewpointProtocolParser_unamed; + + @TranslatableMessage + public static String ViewpointRegistryImpl_FileLoadingErrorMsg; + + @TranslatableMessage + public static String ViewpointRegistryImpl_cantDeployVSMErrorMsg; + + @TranslatableMessage + public static String ViewpointRegistryImpl_cantLoadVSMErrorMsg; + + @TranslatableMessage + public static String ViewpointRegistryImpl_unableToUnloadFileErrorMsg; + + @TranslatableMessage + public static String XMIModelFileHandler_stopTheParsingMsg; + + // CHECKSTYLE:ON + private Messages() { + // Prevents instanciation. + } +} |
