diff options
| author | Maxime Porhel | 2015-09-14 12:47:36 +0000 |
|---|---|---|
| committer | Laurent Redor | 2015-09-18 15:35:18 +0000 |
| commit | 89341fa61d235ce851c5b85a347ec2fe30c8a7db (patch) | |
| tree | 87b3035642036b06e029eaeb15bd4a4d41d37011 | |
| parent | 34738eaa91c0c09cef7671a7c1866ecdd9b75ed4 (diff) | |
| download | org.eclipse.sirius-89341fa61d235ce851c5b85a347ec2fe30c8a7db.tar.gz org.eclipse.sirius-89341fa61d235ce851c5b85a347ec2fe30c8a7db.tar.xz org.eclipse.sirius-89341fa61d235ce851c5b85a347ec2fe30c8a7db.zip | |
[472057] i18n - org.eclipse.sirius.diagram.ui
Bug: 472057
Change-Id: Ic61481ced6448eba663428ab3dfd931c7b12859e
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
206 files changed, 3236 insertions, 1444 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.sirius.diagram.ui/.settings/org.eclipse.jdt.core.prefs index fc8c7f3ddc..39e1d0d4d4 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.sirius.diagram.ui/.settings/org.eclipse.jdt.core.prefs @@ -32,7 +32,7 @@ org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error org.eclipse.jdt.core.compiler.problem.nullReference=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore diff --git a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF index 891319f678..76ec8471b0 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.sirius.diagram.ui/META-INF/MANIFEST.MF @@ -189,7 +189,7 @@ Export-Package: org.eclipse.sirius.diagram.description.concern.provider;version= org.eclipse.sirius.diagram.ui.tools.internal.views.providers.outline;x-internal:=true;version="2.0.4" Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-ActivationPolicy: lazy -Import-Package: org.eclipse.sirius.ext.base;version="2.0.0", +Import-Package: org.eclipse.sirius.ext.base;version="2.1.0", org.eclipse.sirius.ext.draw2d.figure;version="2.0.0", org.eclipse.sirius.ext.emf;version="2.0.0", org.eclipse.sirius.ext.emf.ui.properties;version="3.0.0", diff --git a/plugins/org.eclipse.sirius.diagram.ui/plugin.properties b/plugins/org.eclipse.sirius.diagram.ui/plugin.properties index f14f802f14..6c2b6646d6 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/plugin.properties +++ b/plugins/org.eclipse.sirius.diagram.ui/plugin.properties @@ -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 @@ -741,3 +741,346 @@ _UI_HideLabelCapabilityStyleDescription_hideLabelByDefault_description = Define _UI_BorderedStyle_borderLineStyle_feature = Border Line Style _UI_BorderedStyleDescription_borderLineStyle_feature = Border Line Style _UI_BorderedStyleDescription_borderLineStyle_description = The style of the border line. + + +AbstractDDiagramElementLabelItemProvider_emptyLabel = Empty label +AbstractDDiagramElementLabelItemProvider_label = {0} label +AbstractExtendedContentOutlinePage_setSelectionJobName = Refreshing outline +AbstractLayoutProvider_arrangeAllCommandLabel = Arrange all +AbstractLayoutProvider_arrangeAllProfilerTaskCategory = Generic Modeler +AbstractLayoutProvider_arrangeAllProfilerTaskName = Arrange All +AbstractLayoutProvider_layoutError = Layout Error +AbstractModelChangeOperation_name = Unnamed operation +AbstractParser_setValuesCmdLabel = Set Values +AbstractProviderDescriptor_missingAttributeMsg = The {0} attribute is missing +AbstractSiriusLayoutDataManager_unhandledDiagramElementKind = This kind of diagram element ({0}) is not yet managed by the LayoutDataManager. +ActivateBehaviorToolsCommand_label = Activate behavior tools +ActivateFiltersCommand_label = Activate filters +ActivateRulesCommand_label = Activate validation rules +AddErrorCommand_label = Navigate to another representation +AirResizableEditPolicy_autoSizeCommandLabel = Auto Size +AnonymousUserFixedColorName = <anonymous> +ArrangeBorderNodesAction_actionText = Linked Border Nodes +ArrangeBorderNodesAction_commandLabel = Arrange Linked Border Nodes +ArrangeBorderNodesAction_toolbarActionText = Arrange Linked Border Nodes +ArrangeBorderNodesAction_toolTipText = Arrange all the linked border nodes of the diagram. +BehaviorsPropertySection_activatedBehaviorsLabel = Activated Behaviors +BehaviorsPropertySection_availableBehaviorsLabel = Available Behaviors +BorderItemAwareLayoutProvider_invalidItemsPosition = Invalid items position. +BorderItemAwareLayoutProvider_setBoundsCommandLabel = Set Bounds +BorderItemLayoutData_movedBorderItemSincePreviousLayout = Border item has been moved since previous layout. {0} +BorderItemLayoutData_unmovedBorderItemSincePreviousLayout = Border item has not been moved since previous layout. {0} +BracketBendpointEditPolicy_moveBrackedCommandLabel = Move bracket connection +BracketBendpointEditPolicy_rotateBracketCommandLabel = Rotate bracket connection +BundledImageEditPart_notBundleImageMsg = The element is not a BundledImage +CenterEditPartEdgesCommand_label = Center Edges +ChangeBendpointsOfEdgesCommand_label = Adapt bendpoints of edges +ChangeBendpointsOfEdgesCommand_mapGmfAnchorToDraw2dAnchorCommandLabel = Map GMF anchor to Draw2D anchor +ChangeBendpointsOfEdgesCommand_mapGmfPointsToDraw2dPoints = Map GMF points to Draw2D points +ChangeBendpointsOfEdgesCommand_mapGmfToDraw2dCommandLabel = Map GMF to Draw2D +ChangeBendpointsOfEdgesCommand_updateLabelsOffsetCmdLabel = Update offset of labels +ChangeBendpointsOfEdgesCommand_warningCommandResultMessage = The adaptation of edges according to shape move can not be done. +ChangeFilterActivation_activateFilter = Activate {0} filter +ChangeFilterActivation_deactivateFilter = Dectivate {0} filter +ChangeFilterActivation_label = hide or show filter +ChangeSynchronizedDagramStatusCommand_label = Change Synchronized status +ChildrenAdjustmentCommand_errorMsg = The adaptation of children location to shape move can not be done. +ChildrenAdjustmentCommand_label = Adapt children location +Column_wrongColumnViewError = The view is not in the column +CommandFactory_doNothingLabel = Do nothing +CompoundEditPolicy_nullEditPolicyMsg = the edit policy is null +ConcernComboContributionItem_tooltip = Current concern +ConnectionsFactory_edgeNotCreatedMsg = GMF Edge not created between source element : {0}, and target element : {1} +CopyLayoutAction_clrearPreviousLayoutDateCommandLabel = Clear previous layout data +CopyLayoutAction_commandLabel = Copy layout +CopyLayoutAction_storeLayoutCommandLabel = Store layouts +CopyLayoutAction_text = Copy layout +CopyLayoutAction_toolTipText = Copy the layout of the selected diagram elements +CopyLayoutDataCommand_label = Copy layout data +CopyToSiriusClipboardCommand_label = Copy to clipboard +CreateAndStoreGMFDiagramCommand_label = Refresh diagram on opening +CreateRepresentationFromRepresentationCreationDescription_cmdLabel = Create and open representation +CustomSiriusDocumentProvider_noCorrespondingResourceMsg = No resource in resourceSet corresponding to {0} +CustomSiriusDocumentProvider_useModelExplorerToOpenMsg = You should use the Model Explorer view and the Design perspective to open aird files. +CustomTreeSelectionDialog_checkAllButtonTooltip = Check All +CustomTreeSelectionDialog_collapaseAllTooltip = Collapse All +CustomTreeSelectionDialog_expandAllButtonTooltip = Expand All +CustomTreeSelectionDialog_regexpExplanations = ? = any character, * = any String +CustomTreeSelectionDialog_regexpTitle = Filter elements by name +CustomTreeSelectionDialog_regexpTooltip = Expression that will be used to filer elements by name (for example 'abc', 'a?c', '*c'...) +CustomTreeSelectionDialog_showLabelText = Show +CustomTreeSelectionDialog_uncheckAllButtonTooltip = Uncheck All +DDiagramEditorImpl_cdoServerConnectionPbMsg = Error while connecting to remote CDO server +DDiagramEditorImpl_noAssociatedGMFDiagramMsg = The gmf diagram is expected to be created before calling setInput() on the editor +DDiagramEditorImpl_noSessionMsg = Error while getting the session. +DDiagramEditorImpl_refreshJobInterruptedMsg = Refresh job got interrupted +DDiagramEditorImpl_refreshJobLabel = Refresh +DeactivateBehaviorToolsCommand_label = Deactivate behavior tools +DeactivateFiltersCommand_label = Deactivate filters +DeactivateRulesCommand_label = Dectivate validation rules +DEdgeCreateCommand_executionErrorMsg = Invalid arguments in create link command +DEdgeLabelItemProvider_label = label +DefaultLayerName = Default +DeleteRelatedNoteAttachmentsTask_label = Delete Related GMF note attachments +DeleteRelatedNotesTask_label = Delete Related GMF notes +DeselectAllAction_label = Deselect All +DeselectAllAction_tooltip = Deselect all selected diagram elements. +DiagramAppearancePreferencePage_displayHeaderGroupText = Display header +DiagramAppearancePreferencePage_displayHeaderLabel = Display header +DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel = Hide label icons on connectors +DiagramAppearancePreferencePage_hideShapeLabelIconsLabel = Hide label icons on shapes +DiagramAppearancePreferencePage_labelIconsGroupText = Label icons (does not affect existing elements of opened diagrams) +DiagramConnectionsPreferencePage_enableOverrideLabel = Enable user specifc default values. These setting apply to all diagrams (does not affect existing elements). +DiagramDialectEditorDialogFactory_forbiddenOperation = Forbidden operation +DiagramDialectUIServices_diagramDescription = \n . {0}: diagram.DDiagram | the diagram of the current potential edge. +DiagramDialectUIServices_diagramEditorClosingError = Error while closing the representation, the remote server may be unreachable. +DiagramDialectUIServices_diagramEditorOpeningError = diagram editor opening error +DiagramDialectUIServices_diagramEditorOpeningMonitorTaskName = diagram editor opening: {0} +DiagramDialectUIServices_diagramEditPartDeactivationError = Error while deactivating the representation, the remote server may be unreachable. +DiagramDialectUIServices_diagramOpeningMonitorTaskName = diagram opening +DiagramDialectUIServices_exportedDiagramImageCreationError = The program was not able to create image file {0} +DiagramDialectUIServices_refreshDiagram = Refresh diagram +DiagramDialectUIServices_representationWithEmptyNameEditorName = New Diagram +DiagramDialectUIServices_requiredViewpointsDialogMessage = The current diagram requires some viewpoints selected ({0}), because some activated layers are contributed by these viewpoints +DiagramDialectUIServices_requiredViewpointsDialogTitle = Viewpoints selection +DiagramDialectUIServices_sourcePreDescription = \n . {0}: ecore.EObject | (edge only) the semantic element of $preSourceView. +DiagramDialectUIServices_sourceViewPreDescription = \n . {0}: diagram.EdgeTarget | (edge only) the source view of the current potential edge. +DiagramDialectUIServices_targetPreDescription = \n . {0}: ecore.EObject | (edge only) the semantic element of $preTargetView. +DiagramDialectUIServices_targetViewPreDescription = \n . {0}: diagram.EdgeTarget | (edge only) the target view of the current potential edge. +DiagramEdgeEditPartOperation_unknownRountingStyle = Unknown routing style: {0} +DiagramEditorContextMenuProvider_arrangeMenuRenameError = Arrange menu is not renamed in Layout +DiagramEditorContextMenuProvider_arrangeMenuText = Layout +DiagramEditPartService_imageExportException = Cannot export image ({0}) +DiagramElementEditPartOperation_partDeactivationError = Error while connecting to remote CDO server +DiagramElementsSelectionDialog_grayedElementDialogMessage = The wizard will have no effect on grayed elements. +DiagramGeneralPreferencePage_arrangeAndAutoSizeContainersLabel = Auto-size containers during arrange-all action. +DiagramGeneralPreferencePage_moveUnlinkedNodeLabel = Move unlinked notes during layout +DiagramGeneralPreferencePage_pinMovedElementsLabel = Automatically mark moved elements as pinned +DiagramGeneralPreferencePage_removeHideNoteLabel = Remove/hide note when the annotated element is removed/hidden +DiagramGeneralPreferencePage_synchronizedModeLabel = Synchronized mode for new diagrams +DiagramOutlineWithBookPages_filtersTooltip = Filters +DiagramOutlineWithBookPages_layersTooltip = Layers +DiagramRepairParticipant_removeDiagramElementTaskName = remove Diagram Elements +DiagramRepairParticipant_restoreModelStateTaskName = Restoring model state +DiagramRepairParticipant_saveModelStateTaskName = Saving model state +DiagramSelectionWizardPage_message = Select Diagrams to export +DiagramSelectionWizardPage_title = Select diagrams to export +DiagramSelectionWizardPage_titleFor = Select diagrams to export for {0} +DistributeAction_centersHorizontallyLabel = Centers Horizontally +DistributeAction_centersVerticallyLabel = Centers Vertically +DistributeAction_distributeCentersHorizontallyLabel = Distribute Centers Horizontally +DistributeAction_distributeCentersHorizontallyTooltip = Distribute Centers Evenly Horizontally +DistributeAction_distributeCentersVerticallyLabel = Distribute Centers Vertically +DistributeAction_distributeCentersVerticallyTooltip = Distribute Centers Evenly Vertically +DistributeAction_distributeGapsHorizontallyLabel = Distribute Gaps Horizontally +DistributeAction_distributeGapsHorizontallyTooltip = Distribute With Uniform Gaps Horizontally +DistributeAction_distributeGapsVerticallyLabel = Distribute Gaps Vertically +DistributeAction_distributeGapsVerticallyTooltip = Distribute With Uniform Gaps Vertically +DistributeAction_gapsHorizontallyLabel = Gaps Horizontally +DistributeAction_gapsVerticallyLabel = Gaps Vertically +DistributeCommand_errorMsg = The distribution of selected elements can not be done. +DistributeMenuAction_text = &Distribute +DistributeMenuAction_tooltip = Distribute selected shapes +DNodeLayoutDataKey_wrongKeyMsg = The key uses to store this layout data can only be an AbstractDNode or a DDiagram. +DocumentationPropertySection_defaultLabel = Documentation: +DocumentationPropertySection_description = Use this field to save notes about this representation. +EclipseImageSelectorDescriptor_extensionLoadingError = Error while loading the extension {0} +EdgeReconnectionHelper_invalidReconnectionKind = reconnectionKind must be ReconnectionKind.RECONNECT_SOURCE or ReconnectionKind.RECONNECT_TARGET +EdgeRoutingStyleChangedCommand_label = Change routing style +EditPartTools_nullParameterMsg = root or editPartType is null +ExtendedPropertyDescriptor_categoryName = Extended +ExtendedPropertyDescriptor_description = Property source for the extension framework +ExtendedPropertyDescriptor_errorGettingValueMsg = Error while getting the property value +ExtendedPropertyDescriptor_errorRetrievingValueMsg = Error while retrieving reference values +ExtendedPropertyDescriptor_unknownExtensionMsg = unknown extension +ExtendedPropertySource_errorSettingValueMsg = Error while setting the property value +FilteringMode_allElements = all elements +FilteringMode_onlyCheckedElements = only checked elements +FilteringMode_onlyUncheckedElements = only unchecked elements +FiltersContributionItem_label = Filters +FiltersPropertySection_addButtonLabel = Add > +FiltersPropertySection_appliedFiltersLabel = Applied filters +FiltersPropertySection_availableFiltersLabel = Available filters +FiltersPropertySection_removeButtonLabel = < Remove +FiltersTableViewer_columnName = Filter +FontPropertySection_strikeThrough = StrikeThrough +FontPropertySection_underline = Underline +GMFCommandWrapper_label = GMF Command Wrapper +GMFCommandWrapper_nullCommand = the command is null +GMFCommandWrapper_nullDomain = the domain is null +GMFHelper_invalidEdgeModelAndFigure = The model of the edgeEditPart should be a org.eclipse.gmf.runtime.notation.Edge and the figure of this edgeEditPart should be a org.eclipse.draw2d.Connection. +GMFNotationUtilities_edgeOnEdgeNotManaged = Edge on edge not managed +GridLayoutProvider_unknownMode = Unknown mode: {0} +HiddenElementsSelectionCommand_dialogMessage = Visible diagram elements are checked. +HiddenElementsSelectionCommand_dialogTitle = Diagram elements visibility +HierarchyLabelProvider_elementWihtoutNameLabel = Element whithout name +IAbstractDiagramNodeEditPart_createViewCommandLabel = Create View +IAbstractDiagramNodeEditPart_resizeCommandLabel = Resize +IBorderItemLocatorWrapper_nullLocator = The locator is null +Identifier_invalidNullObject = {0} cannot be null +IDiagramOutlinePage_outlineTooltip = Outline +IDiagramOutlinePage_overviewTooltip = Overview +InitializeHiddenElementsCommand_label = Initialize hidden elements +InitializeLayoutCommand_label = Initialize layout +ItemProvider_elementBasedEdge = Element Based Edge +ItemProvider_foregroundBackgroundLabel = {0} {1} to {2} +ItemProvider_relationBasedEdge = Relation Based Edge +LaunchBehaviorContributionItem_launchBehaviorButtonLabel = Launch Behavior +LaunchBehaviorToolAction_label = Launch behavior rules +LayersCellModifier_layerSelectionChangesTaskName = Apply layer modifications... +LayersContribution_label = Layers +LayersTableViewer_columnName = Layer +LayoutData_illegalTarget = The target of a LayoutData can only be an AbstractDNode, a DEdge or a DDiagram. +LayoutData_unhandledDiagramElementKind = This kind of diagram element ({0}) is not yet managed by the LayoutDataManager. +LayoutDataHelperImpl_unkownLayoutData = Layoutdata of type {0} is unknown +LayoutingModeSwitchingAction_activate = Activate Layouting Mode +LayoutingModeSwitchingAction_deactivate = Deactivate Layouting Mode +LayoutingModeSwitchingAction_statusOn = Layouting Mode +LayoutProviderDescriptor_initializationErrorMsg = CoreException during the initialization of the AIR Layout Provider {0} +MarkerObserver_validationMarkerFailureMsg = Validation marker refresh failure +MiscPropertySection_nullObject = null object +MiscPropertySource_errorGettingValueMsg = Error while getting property value +MoveViewOperation_nullMoveDeltaError = moveDelta cannot be null +MoveViewOperation_nullViewError = view cannot be null +NavigationItemProvider_labelWithDescriptionName = {0} to {1} +NodeDeletionEditPolicy_deleteElementCommandLabel = Delete element +NodeMappingItemProvider_borderedLabel = Bordered {0} +OpenDiagramCommand_creationErrorMsg = Can''t create diagram of ''{0}'' kind +OpenDiagramCommand_exceptionMsg = Can't open diagram +OpenDiagramCommand_notDiagramElementErrorMsg = Can't open diagram -- getElement() is not an instance of Sirius +OpenDiagramCommand_saveFailedMsg = Save operation failed +OpenMenuContribution_menuLabel = Open +PaletteImageProvider_noIconFor = No icon is available for the tool {0}. A default icon has been set instead. +PaletteManagerImpl_alreadyExistingEntry = An existing palette entry with name {0} already exists but it is another kind of entry. +PaletteManagerImpl_severalCandidatesInPalette = Several {0}s with identical id '{1}' have been found in the palette. Please fix your VSM by whether set a different ID for these Palette entries or ensuring that they cannot be available in the same time. +PasteFromSiriusClipboardCommand_label = Generic Paste from clipboard +PasteLayoutAction_commandLabel = Paste layout +PasteLayoutAction_restoreLayoutCommandLabel = Restore layouts +PasteLayoutAction_text = Paste Layout +PasteLayoutAction_toolTipText = Paste the current recorded layout to the selected diagram +PasteLayoutDataCommand_label = Paste layout data +PinElementsEclipseAction_text = Pin selected elements +PinnedElementsHandler_notMovableMsg = Pinned elements can not move +PinnedElementsHandler_remainOverlapsMsg = solvable but unsolved overlaps remain +PinnedElementsHandler_unknownDirection = Unknown direction +PinnedElementsSelectionCommand_dialogMessage = Pinned diagram elements are checked. +PopupMenuContribution_storeMouseLocationCmdLabel = Store mouse location +RefreshDiagramAction_cancelled = Cancelled +RefreshDiagramAction_error = Error +RefreshDiagramAction_refreshDiagramError = Error while refreshing diagram +RefreshDiagramOnOpeningCommand_label = Refresh diagram on opening +RefreshRunnableWithProgress_commandLabel = Refresh +RefreshRunnableWithProgress_taskName = Refresh +RegionContainerResizableEditPolicy_regionContainerAutoSizeCommandLabel = Region Container Auto Size Command +RegionContainerUpdateLayoutOperation_name = Layout Regions Operations +RegionResizableEditPolicy_regionAutoSizeCommandLabel = Region Auto Size Composite Command +RemoveBendpointsHandler_cmdLabel = Remove Bend-points +RemoveInvalidViewsCommand_label = Remove invalid views +ResetOriginChangeModelOperation_name = Reset Origin +ResetOriginChangeModelOperation_nameOnContainer = Reset Container Origin +ResetOriginChangeModelOperation_nameOnDiagram = Reset Diagram Origin +ResetStylePropertiesToDefaultValuesAction_text = Reset style properties to default values +ResizeImageCommand_label = Update visibility +ResourceMissingDocumentProvider_defaultMessage = This diagram was not saved. You can close the editor +RevealOutlineElementsAction_label = Show element +RevealOutlineLabelsAction_label = Show label +RootLayoutData_unhandledDiagramElementKind = This kind of diagram element ({0}) is not yet managed by the LayoutDataManager. +SafeStyleConfiguration_customStyleInvocationError = Error while invoking custom style configuration: {0} +SaveAsImageFileAction_label = Export diagram as image +SelectDiagramElementBackgroundImageDialog_browseButtonText = Browse +SelectDiagramElementBackgroundImageDialog_pathLabelText = Path: +SelectDiagramElementBackgroundImageDialog_title = Select background image from workspace +SelectHiddenElementsAction_tooltip = Show/Hide +SelectionWizardCommand_cancelExceptionMsg = User cancel operation +SelectPinnedElementsAction_label = Diagram elements pinning +SelectPinnedElementsAction_tooltip = Pin/Unpin +SetBestHeightHeaderCommand_label = Refresh graphical layout +SetConnectionBendpointsAccordingToExtremityMoveCommmand_sourceSidedLabel = Move first segment (on source side) +SetConnectionBendpointsAccordingToExtremityMoveCommmand_targetSidedLabel = Move last segment (on target side) +SetCurrentConcernCommand_label = Set current concern +SetDefaultConcernCommand_label = Set current concern to default +SetLabelsOffsetCommmand_label = Update labels offset +SetLayoutingModeCommand_activateLabel = Activating Layouting mode +SetLayoutingModeCommand_deactivateLabel = Deactivating Layouting mode +SetLayoutingModeCommandAndUpdateActionImage_activateLabel = Activating Layouting mode +SetLayoutingModeCommandAndUpdateActionImage_deactivateLabel = Deactivating Layouting mode +SetStyleToWorkspaceImageAction_text = Set style to workspace image +ShiftDirectBorderedNodesOperation_name = Shift bordered nodes'' positions by {0} +SimpleImageTranscoder_svgImageTranscodingError = Error transcoding SVG image +SimpleStyleConfiguration_iconFileNotFound = Icon file \"{0}\" not found +SiriusBaseItemSemanticEditPolicy_deleteCmdLabel = Delete element +SiriusBaseItemSemanticEditPolicy_deleteFromDiagramCmdLabel = Delete element from diagram +SiriusCanonicalLayoutCommand_label = Arrange Created views +SiriusClipboardGlobalActionHandler_addLayoutDataCommandLabel = Add layout data +SiriusClipboardGlobalActionHandler_pasteCommandLabel = Paste ... +SiriusClipboardGlobalActionHandler_severalFoundPasteToolError = There are more than one paste description that match the target container: {1} ({2} and {3}). +SiriusContainerDropPolicy_dropElementsCommandLabel = Drop Elements +SiriusContainerDropPolicy_saveEditPartLayoutCommandLabel = Save layout for edit part +SiriusDiagramActionBarContributor_deleteFromDiagram = Delete from Diagram +SiriusDiagramActionBarContributor_deleteFromModel = Delete from Model +SiriusDiagramActionBarContributor_hideElement = Hide element +SiriusDiagramActionBarContributor_hideLabel = Hide label +SiriusDiagramActionBarContributor_launchBehavior = Launch behavior +SiriusDiagramActionBarContributor_refreshDiagram = Refresh diagram +SiriusDiagramActionBarContributor_revealElement = Reveal elements +SiriusDiagramEditorUtil_charsetError = Unable to set charset for file {0} +SiriusDiagramEditorUtil_defaultFileName = default +SiriusDiagramEditorUtil_modelAndDiagramCreationError = Unable to create model and diagram +SiriusDiagramEditorUtil_modelAndDiagramResourceSaveError = Unable to store model and diagram resources +SiriusDiagramSelectionCheckStateListener_errorMsg = You must select Diagrams +SiriusDiagramSelectionCheckStateListener_unknwonCodeResult = Unknown code result +SiriusEnhancedPrintActionHelper_invalidIworkbenchPart = Invalid IWorkbenchPart +SiriusInitDiagramFileAction_loadResourceError = Unable to load resource: {0} +SiriusLayoutDataManagerImpl_addCenterLayoutMarkerCommandLabel = Add center layout marker on view +SiriusLayoutDataManagerImpl_addLayoutMarkerCommandLabel = Add layout marker on view +SiriusLayoutDataManagerImpl_addLayoutMarkerOnOpeningCommandLabel = Add layout marker on view on opening diagram +SiriusLayoutDataManagerImpl_createdViewsArrangCommandLabel = Arrange created views +SiriusLayoutDataManagerImpl_unhandledContainerKind = This kind of container ({0}) is not yet managed by the LayoutDataManager. +SiriusMarkerNavigationProvider_validationMarkerCreationError = Failed to create validation marker +SiriusNewDiagramFileWizard_errorDuringCreation = Unable to create model and diagram +SiriusNewDiagramFileWizard_errorDuringOpening = Unable to open editor +SiriusNewDiagramFileWizard_invalidDiagramRootElement = Diagram root element must be specified +SiriusNewDiagramFileWizard_invalidDomainModelURI = Domain model uri must be specified +SiriusNewDiagramFileWizard_invalidEditingDomain = Editing domain must be specified +SiriusNewDiagramFileWizard_saveFailed = Save operation failed for: {0} +SiriusNewDiagramFileWizard_unsupportedURI = Unsupported URI: {0} +SiriusPropertyHandlerEditPolicy_applyAppearancePropertiesCommandLabel = Apply appearance properties +SiriusPropertyHandlerEditPolicy_applyTabbarPropertiesCommandLabel = Apply toolbar properties +SiriusPropertyHandlerEditPolicy_chainedStyleCommandDebugLabel = Chained Style Command +SiriusReorientConnectionViewCommand_nullChild = Null child in SiriusReorientConnectionViewCommand +SiriusReorientConnectionViewCommand_nullEdge = Null edge in SiriusReorientConnectionViewCommand +SiriusSWTRenderedDiagramPrinter_jobLabel = Printing +SiriusSWTRenderedDiagramPrinter_printerNotSetMsg = printer must be set +SiriusValidationDecoratorProvider_refreshFailureMsg = Decorator refresh failure +SiriusValidationProvider_validationFailed = Validation action failed +SiriusVisualIDRegistry_parseError = Unable to parse view type as a visualID number: {0} +SpecificationMenuContribution_openDefinitionMenuLabel = Open Definition +StatusDecorator_validationMarkersFailureMsg = Validation markers refresh failure +StatusDecorator_viewIdAccessFailureMsg = ViewID access failure +StyleConfigurationRegistry_disableStyleConfigurationProviderInError = The style configuration provider {0} has thrown an exception in its provides method and has been deactivated. +StyleConfigurationRegistry_profilerTaskName = get style configuration +StyleConfigurationRegistry_styleConfigurationProviderLoadError = Impossible to load the style configuration provider: {0} +SubDiagramDecorator_taskName = SubDiagramDecorator refresh +SubDiagramMenu_newLabel = New +SVGFigure_loadError = Error loading SVG file +SynchronizedDiagramCommand_unsynchronizedLabel = Unsynchronized +SynchronizeGMFModelCommand_label = Synchronize GMF Notation Model +ToggleFoldingStateCommand_label = Toggle edges folding state +ToggleUpdateManager_fieldAccessError = Error while getting the {0} field. +TreeLayoutSetConnectionAnchorsCommand_nullChildInSetConnectionAnchorsCommand = Null child in SetConnectionAnchorsCommand +TreeLayoutSetConnectionAnchorsCommand_nullEdgeInSetConnectionAnchorsCommand = Null edge in SetConnectionAnchorsCommand +UnpinElementsEclipseAction_text = Unpin selected elements +UpdateGMFEdgeStyleCommand_label = Update GMF Edge Style +UpdateVisibilityCommand_label = Update visibility +ValidateAction_failureMessage = Validation action failed +ValidationFixResolution_editorOpeningError = Can't open editor for {0} +ValidationPropertySection_activatedRulesLabel = Activated rules +ValidationPropertySection_availableRulesLabel = Available rules +ViewOrderingProviderRegistry_viewOrderingProvider_loadingProblem = Impossible to load the view ordering provider : {0} +VisibilityUpdateCommand_label = Update view visibility +WorkspaceImageChangeDetector_invalidUri = Invalid uri: {0} +WorkspaceImageFigureRefresher_imageDescriptorUpdateError = Update image descriptor failed. +WorkspaceImagePathSelector_dialogMessage = Select the image file: +WorkspaceImagePathSelector_dialogTitle = Background image +WorkspacePathValidator_invalidPahtStatusMessage = NonExistingImageResource +WorkspacePathValidator_invalidPathDecorationDescriptionText = The specified path does not correspond to an image in the workspace or in the runtime diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/CreateAndStoreGMFDiagramCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/CreateAndStoreGMFDiagramCommand.java index 03a18d1d76..3152d9986d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/CreateAndStoreGMFDiagramCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/CreateAndStoreGMFDiagramCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -14,6 +14,7 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.business.internal.dialect.DiagramDialectServices; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to create and store gmf diagram. @@ -35,7 +36,7 @@ public final class CreateAndStoreGMFDiagramCommand extends RecordingCommand { * the diagram to refresh. */ public CreateAndStoreGMFDiagramCommand(Session session, DSemanticDiagram diag) { - super(session.getTransactionalEditingDomain(), "Refresh diagram on opening"); + super(session.getTransactionalEditingDomain(), Messages.CreateAndStoreGMFDiagramCommand_label); this.session = session; this.diag = diag; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/RefreshDiagramOnOpeningCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/RefreshDiagramOnOpeningCommand.java index b6909212dd..e6fd12b399 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/RefreshDiagramOnOpeningCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/RefreshDiagramOnOpeningCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -18,6 +18,7 @@ import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.business.api.helper.display.DisplayMode; import org.eclipse.sirius.diagram.business.api.helper.display.DisplayServiceManager; import org.eclipse.sirius.diagram.ui.business.api.helper.graphicalfilters.CompositeFilterApplicationBuilder; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to refresh a diagram on opening. @@ -37,7 +38,7 @@ public final class RefreshDiagramOnOpeningCommand extends RecordingCommand { * the diagram to refresh. */ public RefreshDiagramOnOpeningCommand(TransactionalEditingDomain domain, DSemanticDiagram diag) { - super(domain, "Refresh diagram on opening"); + super(domain, Messages.RefreshDiagramOnOpeningCommand_label); this.diag = diag; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/TreeLayoutSetConnectionAnchorsCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/TreeLayoutSetConnectionAnchorsCommand.java index 75c17db273..dc8846dfe1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/TreeLayoutSetConnectionAnchorsCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/command/TreeLayoutSetConnectionAnchorsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * 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 @@ -29,6 +29,7 @@ import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.IdentityAnchor; import org.eclipse.gmf.runtime.notation.NotationFactory; import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.util.GMFNotationUtilities; import org.eclipse.sirius.ext.base.Option; @@ -134,10 +135,10 @@ public class TreeLayoutSetConnectionAnchorsCommand extends SetConnectionAnchorsC @Override protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { - assert null != getEdgeAdaptor() : "Null child in SetConnectionAnchorsCommand"; //$NON-NLS-1$ + assert null != getEdgeAdaptor() : Messages.TreeLayoutSetConnectionAnchorsCommand_nullChildInSetConnectionAnchorsCommand; Edge edge = (Edge) getEdgeAdaptor().getAdapter(Edge.class); - assert null != edge : "Null edge in SetConnectionAnchorsCommand"; //$NON-NLS-1$ + assert null != edge : Messages.TreeLayoutSetConnectionAnchorsCommand_nullEdgeInSetConnectionAnchorsCommand; // Retrieve old source anchor corresponding before move source point IdentityAnchor oldSourceAnchor = null; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/DiagramDialectUIServices.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/DiagramDialectUIServices.java index 9130921969..86c8d2a5a1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/DiagramDialectUIServices.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/DiagramDialectUIServices.java @@ -11,6 +11,7 @@ package org.eclipse.sirius.diagram.ui.business.internal.dialect; import java.io.File; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -88,6 +89,7 @@ import org.eclipse.sirius.diagram.ui.business.api.view.SiriusGMFHelper; import org.eclipse.sirius.diagram.ui.business.internal.command.CreateAndStoreGMFDiagramCommand; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.api.part.DiagramEditPartService; import org.eclipse.sirius.ext.base.Option; @@ -124,7 +126,7 @@ import com.google.common.collect.Sets; /** * The default diagram ui services. - * + * * @author cbrun */ public class DiagramDialectUIServices implements DialectUIServices { @@ -132,9 +134,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * The label used for the action which refreshes a diagram. */ - public static final String REFRESH_DIAGRAM = "Refresh diagram"; - - private static final String EXPORT_DIAGRAM_AS_IMAGE_ERROR_ON_CREATE_IMAGE = "The program was not able to create image file "; + public static final String REFRESH_DIAGRAM = Messages.DiagramDialectUIServices_refreshDiagram; /** * {@inheritDoc} @@ -143,7 +143,7 @@ public class DiagramDialectUIServices implements DialectUIServices { public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) { DialectEditor result = null; try { - monitor.beginTask("diagram opening", 15); + monitor.beginTask(Messages.DiagramDialectUIServices_diagramOpeningMonitorTaskName, 15); DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.OPEN_DIAGRAM_KEY); if (dRepresentation instanceof DSemanticDiagram) { @@ -196,7 +196,7 @@ public class DiagramDialectUIServices implements DialectUIServices { String editorName = DialectUIManager.INSTANCE.getEditorName(dRepresentation); monitor.worked(1); final IEditorInput editorInput = new SessionEditorInput(uri, editorName, session); - monitor.subTask("diagram editor opening : " + dRepresentation.getName()); + monitor.subTask(MessageFormat.format(Messages.DiagramDialectUIServices_diagramEditorOpeningMonitorTaskName, dRepresentation.getName())); RunnableWithResult<DialectEditor> runnable = new RunnableWithResult.Impl<DialectEditor>() { @Override @@ -208,7 +208,7 @@ public class DiagramDialectUIServices implements DialectUIServices { setResult((DialectEditor) editorPart); } } catch (final PartInitException e) { - DiagramPlugin.getDefault().logError("diagram editor opening error", e); + DiagramPlugin.getDefault().logError(Messages.DiagramDialectUIServices_diagramEditorOpeningError, e); } } @@ -257,8 +257,8 @@ public class DiagramDialectUIServices implements DialectUIServices { @Override public void run() { - MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Viewpoints selection", - "The current diagram requires some viewpoints selected (" + description + "), because some activated layers are contributed by these viewpoints"); + MessageDialog.openInformation(PlatformUI.getWorkbench().getDisplay().getActiveShell(), Messages.DiagramDialectUIServices_requiredViewpointsDialogTitle, + MessageFormat.format(Messages.DiagramDialectUIServices_requiredViewpointsDialogMessage, description)); } }); @@ -267,7 +267,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * Synchronizes the GMF diagram model according to the viewpoint * DSemanticDiagram model. - * + * * @param diagram * the GMF diagram model to synchronize. */ @@ -279,7 +279,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandleEditor(org.eclipse.ui.IEditorPart) */ @Override @@ -289,7 +289,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#closeEditor(org.eclipse.ui.IEditorPart, * boolean) */ @@ -302,7 +302,7 @@ public class DiagramDialectUIServices implements DialectUIServices { } catch (final NullPointerException e) { // we might have an exception closing an editor which is // already in trouble - DiagramPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, DiagramPlugin.ID, "Error while deactivating the representation, the remote server may be unreachable.")); + DiagramPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, DiagramPlugin.ID, Messages.DiagramDialectUIServices_diagramEditPartDeactivationError)); } try { @@ -311,7 +311,7 @@ public class DiagramDialectUIServices implements DialectUIServices { // we might have an exception closing an editor which is // already in trouble if (DiagramUIPlugin.getPlugin().isDebugging()) { - DiagramUIPlugin.getPlugin().getLog().log(new Status(IStatus.WARNING, DiagramUIPlugin.ID, "Error while closing the representation, the remote server may be unreachable.")); + DiagramUIPlugin.getPlugin().getLog().log(new Status(IStatus.WARNING, DiagramUIPlugin.ID, Messages.DiagramDialectUIServices_diagramEditorClosingError)); } } @@ -322,7 +322,7 @@ public class DiagramDialectUIServices implements DialectUIServices { } /** - * + * * {@inheritDoc} */ @Override @@ -333,7 +333,7 @@ public class DiagramDialectUIServices implements DialectUIServices { } /** - * + * * {@inheritDoc} */ @Override @@ -344,7 +344,7 @@ public class DiagramDialectUIServices implements DialectUIServices { } /** - * + * * {@inheritDoc} */ @Override @@ -355,7 +355,7 @@ public class DiagramDialectUIServices implements DialectUIServices { } /** - * + * * {@inheritDoc} */ @Override @@ -378,7 +378,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationManagedByEditor(org.eclipse.sirius.viewpoint.DRepresentation, * org.eclipse.ui.IEditorPart) */ @@ -401,7 +401,7 @@ public class DiagramDialectUIServices implements DialectUIServices { // FXIME unit test this /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationDescriptionManagedByEditor(org.eclipse.sirius.viewpoint.description.RepresentationDescription, * org.eclipse.ui.IEditorPart) */ @@ -421,7 +421,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.DRepresentation) */ @Override @@ -431,7 +431,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.description.RepresentationDescription) */ @Override @@ -441,7 +441,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription) * ) */ @@ -463,7 +463,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#export(org.eclipse.sirius.viewpoint.DRepresentation, * org.eclipse.sirius.business.api.session.Session) */ @@ -513,13 +513,13 @@ public class DiagramDialectUIServices implements DialectUIServices { // We finally ensure that the image has been created if (!new File(correctPath.toOSString()).exists()) { - throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, EXPORT_DIAGRAM_AS_IMAGE_ERROR_ON_CREATE_IMAGE + correctPath)); + throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, MessageFormat.format(Messages.DiagramDialectUIServices_exportedDiagramImageCreationError, correctPath))); } } catch (final CoreException exception) { if (exception instanceof SizeTooLargeException) { throw (SizeTooLargeException) exception; } - SiriusPlugin.getDefault().error(EXPORT_DIAGRAM_AS_IMAGE_ERROR_ON_CREATE_IMAGE + correctPath, exception); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.DiagramDialectUIServices_exportedDiagramImageCreationError, correctPath), exception); } finally { diagramEditPart.deactivate(); // Memory leak : also disposing the @@ -565,7 +565,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * Returns command parameters to create diagram type description. - * + * * @return command parameters to create diagram type description. */ private Collection<CommandParameter> getDiagramTypesCreation() { @@ -575,7 +575,7 @@ public class DiagramDialectUIServices implements DialectUIServices { specificDiagramDescription.setEnablePopupBars(true); if (specificDiagramDescription.getDefaultLayer() == null) { Layer layer = DescriptionFactory.eINSTANCE.createLayer(); - layer.setName("Default"); + layer.setName(Messages.DefaultLayerName); specificDiagramDescription.setDefaultLayer(layer); } final CommandParameter typeCommandParameter = new CommandParameter(null, DescriptionPackage.Literals.VIEWPOINT__OWNED_REPRESENTATIONS, specificDiagramDescription); @@ -586,14 +586,14 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getEditorName(org.eclipse.sirius.viewpoint.DRepresentation) */ @Override public String getEditorName(final DRepresentation representation) { String editorName = representation.getName(); if (StringUtil.isEmpty(editorName)) { - editorName = "New Diagram"; + editorName = Messages.DiagramDialectUIServices_representationWithEmptyNameEditorName; } return editorName; } @@ -630,9 +630,9 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getHierarchyLabelProvider(ILabelProvider) - * + * */ @Override public ILabelProvider getHierarchyLabelProvider(ILabelProvider currentLabelProvider) { @@ -680,7 +680,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getSelection(org.eclipse.sirius.ui.business.api.dialect.DialectEditor) */ @Override @@ -705,14 +705,14 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * Get the editPart corresponding to this diagram element.<BR> * The editPart is search in the active editor. - * + * * @param diagramElement * the diagram element * @param graphicalViewer * the editor containing the editPart * @param session * the current session - * + * * @return the editPart corresponding to the diagram element given as * parameter or null if any */ @@ -741,7 +741,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#completeToolTipText(String, * EObject, EStructuralFeature) */ @@ -752,12 +752,11 @@ public class DiagramDialectUIServices implements DialectUIServices { if (feature != null && feature.equals(ToolPackage.Literals.ABSTRACT_TOOL_DESCRIPTION__PRECONDITION)) { StringBuilder sb = new StringBuilder(); sb.append(toolTipText); - String cr = "\n . "; //$NON-NLS-1$ - sb.append(cr + IInterpreterSiriusVariables.SOURCE_VIEW_PRE + ": diagram.EdgeTarget | (edge only) the source view of the current potential edge."); - sb.append(cr + IInterpreterSiriusVariables.SOURCE_PRE + ": ecore.EObject | (edge only) the semantic element of $preSourceView."); - sb.append(cr + IInterpreterSiriusVariables.TARGET_VIEW_PRE + ": diagram.EdgeTarget | (edge only) the target view of the current potential edge."); - sb.append(cr + IInterpreterSiriusVariables.TARGET_PRE + ": ecore.EObject | (edge only) the semantic element of $preTargetView."); - sb.append(cr + IInterpreterSiriusVariables.DIAGRAM + ": diagram.DDiagram | the diagram of the current potential edge"); + sb.append(MessageFormat.format(Messages.DiagramDialectUIServices_sourceViewPreDescription, IInterpreterSiriusVariables.SOURCE_VIEW_PRE)); + sb.append(MessageFormat.format(Messages.DiagramDialectUIServices_sourcePreDescription, IInterpreterSiriusVariables.SOURCE_PRE)); + sb.append(MessageFormat.format(Messages.DiagramDialectUIServices_targetViewPreDescription, IInterpreterSiriusVariables.TARGET_VIEW_PRE)); + sb.append(MessageFormat.format(Messages.DiagramDialectUIServices_targetPreDescription, IInterpreterSiriusVariables.TARGET_PRE)); + sb.append(MessageFormat.format(Messages.DiagramDialectUIServices_diagramDescription, IInterpreterSiriusVariables.DIAGRAM)); toolTip = sb.toString(); } } @@ -785,7 +784,7 @@ public class DiagramDialectUIServices implements DialectUIServices { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#completeToolTipText(String, * EObject) * @deprecated this method has not access to the feature of eObject. This is diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java index 0e3fc14ea7..6dbd9a3b73 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/HierarchyLabelProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.sirius.business.api.query.IdentifiedElementQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.sirius.viewpoint.description.IdentifiedElement; import org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription; @@ -83,7 +84,7 @@ public class HierarchyLabelProvider extends LabelProvider { } private String getLabel(final EObject eObject) { - String label = "Element whithout name"; + String label = Messages.HierarchyLabelProvider_elementWihtoutNameLabel; if (eObject instanceof IdentifiedElement) { label = new IdentifiedElementQuery((IdentifiedElement) eObject).getLabel(); } else if (eObject instanceof RepresentationExtensionDescription) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/SetBestHeightHeaderCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/SetBestHeightHeaderCommand.java index 727e1b850f..5f0261d5cf 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/SetBestHeightHeaderCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/dialect/SetBestHeightHeaderCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -21,6 +21,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.business.api.diagramtype.DiagramTypeDescriptorRegistry; import org.eclipse.sirius.diagram.business.api.diagramtype.HeaderData; import org.eclipse.sirius.diagram.business.api.diagramtype.IDiagramTypeDescriptor; +import org.eclipse.sirius.diagram.ui.provider.Messages; import com.google.common.collect.Lists; @@ -44,7 +45,7 @@ public class SetBestHeightHeaderCommand extends RecordingCommand { * {@inheritDoc} */ public SetBestHeightHeaderCommand(TransactionalEditingDomain domain, Diagram diagram) { - super(domain, "Refresh graphical layout"); + super(domain, Messages.SetBestHeightHeaderCommand_label); this.diagram = diagram; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/edit/helpers/EdgeReconnectionHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/edit/helpers/EdgeReconnectionHelper.java index ad6120f011..360aed31ae 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/edit/helpers/EdgeReconnectionHelper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/edit/helpers/EdgeReconnectionHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -23,6 +23,7 @@ import org.eclipse.sirius.diagram.AbstractDNode; import org.eclipse.sirius.diagram.DNode; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.description.tool.ReconnectionKind; +import org.eclipse.sirius.diagram.ui.provider.Messages; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; @@ -66,8 +67,7 @@ public class EdgeReconnectionHelper { public EdgeReconnectionHelper(View reconnectionTarget, List<Edge> reconnectionTargetEdges, ReconnectionKind reconnectionKind) { this.reconnectionTarget = reconnectionTarget; this.reconnectionTargetEdges = new ArrayList<Edge>(reconnectionTargetEdges); - assert reconnectionKind == ReconnectionKind.RECONNECT_SOURCE_LITERAL - || reconnectionKind == ReconnectionKind.RECONNECT_TARGET_LITERAL : "reconnectionKind must be ReconnectionKind.RECONNECT_SOURCE or ReconnectionKind.RECONNECT_TARGET"; + assert reconnectionKind == ReconnectionKind.RECONNECT_SOURCE_LITERAL || reconnectionKind == ReconnectionKind.RECONNECT_TARGET_LITERAL : Messages.EdgeReconnectionHelper_invalidReconnectionKind; this.reconnectionKind = reconnectionKind; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/EclipseImageSelectorDescriptor.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/EclipseImageSelectorDescriptor.java index cd4fcf7d26..92ead8c8a9 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/EclipseImageSelectorDescriptor.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/EclipseImageSelectorDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * 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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.internal.image; +import java.text.MessageFormat; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IStatus; @@ -17,6 +19,7 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Status; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.ui.business.api.image.ImageSelector; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin; /** @@ -45,6 +48,7 @@ public class EclipseImageSelectorDescriptor extends AbstractImageSelectorDescrip /** * {@inheritDoc} */ + @Override public ImageSelector getImageSelector() { if (imageSelector == null) { if (Platform.isRunning()) { @@ -52,7 +56,7 @@ public class EclipseImageSelectorDescriptor extends AbstractImageSelectorDescrip imageSelector = (ImageSelector) element.createExecutableExtension(IMAGE_SELECTOR_CLASS_ATTRIBUTE); } catch (CoreException e) { SiriusEditPlugin.getPlugin().getLog() - .log(new Status(IStatus.ERROR, DiagramPlugin.ID, "Error while loading the extension " + element.getDeclaringExtension().getUniqueIdentifier(), e)); + .log(new Status(IStatus.ERROR, DiagramPlugin.ID, MessageFormat.format(Messages.EclipseImageSelectorDescriptor_extensionLoadingError, element.getDeclaringExtension().getUniqueIdentifier()), e)); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageChangeDetector.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageChangeDetector.java index bb26a8ca40..b96d683704 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageChangeDetector.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageChangeDetector.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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.ui.business.internal.image.refresh; import java.io.File; import java.net.MalformedURLException; import java.net.URL; +import java.text.MessageFormat; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceDelta; @@ -23,6 +24,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.sirius.common.tools.api.resource.ImageFileFormat; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.SVGWorkspaceImageFigure; import org.eclipse.sirius.diagram.ui.tools.api.figure.WorkspaceImageFigure; import org.eclipse.sirius.ext.base.Option; @@ -41,6 +43,7 @@ public class WorkspaceImageChangeDetector implements IResourceDeltaVisitor { * * {@inheritDoc} */ + @Override public boolean visit(IResourceDelta delta) throws CoreException { boolean continueToVisit = true; boolean isWorkspaceImageChange = false; @@ -128,7 +131,7 @@ public class WorkspaceImageChangeDetector implements IResourceDeltaVisitor { try { url = new File(ResourcesPlugin.getWorkspace().getRoot().getLocation().append(resource.getFullPath()).toOSString()).toURI().toURL(); } catch (MalformedURLException e) { - DiagramPlugin.getDefault().logError("Invalid uri : " + e.getMessage()); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.WorkspaceImageChangeDetector_invalidUri, e.getMessage())); return false; } ImageDescriptor bundledImageDescriptor = ImageDescriptor.createFromURL(url); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageFigureRefresher.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageFigureRefresher.java index 1012504c10..1a85847c05 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageFigureRefresher.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/image/refresh/WorkspaceImageFigureRefresher.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 @@ -20,6 +20,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart; import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor; import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; import org.eclipse.sirius.diagram.DiagramPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; @@ -47,6 +48,7 @@ public class WorkspaceImageFigureRefresher implements IResourceChangeListener { * * {@inheritDoc} */ + @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); if (delta != null) { @@ -58,7 +60,7 @@ public class WorkspaceImageFigureRefresher implements IResourceChangeListener { refreshOpenedEditors(); } } catch (CoreException e) { - DiagramPlugin.getDefault().logError("Update image descriptor failed.", e); + DiagramPlugin.getDefault().logError(Messages.WorkspaceImageFigureRefresher_imageDescriptorUpdateError, e); } } @@ -69,6 +71,7 @@ public class WorkspaceImageFigureRefresher implements IResourceChangeListener { */ private void refreshOpenedEditors() { EclipseUIUtil.displayAsyncExec(new Runnable() { + @Override public void run() { IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (activeWorkbenchWindow != null) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/AbstractModelChangeOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/AbstractModelChangeOperation.java index c9a4e3ed95..3f5b5a7e32 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/AbstractModelChangeOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/AbstractModelChangeOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.internal.operation; +import org.eclipse.sirius.diagram.ui.provider.Messages; + /** * Abstract base class for operations which will need to modify an EMF Model. * This is defined independently of any command/action framework so that it can @@ -29,7 +31,7 @@ public abstract class AbstractModelChangeOperation<T> { * Constructor. */ protected AbstractModelChangeOperation() { - this("Unnamed operation"); + this(Messages.AbstractModelChangeOperation_name); } /** diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/MoveViewOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/MoveViewOperation.java index bee206a33f..3cda9748da 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/MoveViewOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/MoveViewOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.notation.Location; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.NotationPackage; import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Shift a view by the delta. @@ -43,8 +44,8 @@ public class MoveViewOperation extends AbstractModelChangeOperation<Void> { */ public MoveViewOperation(String label, IAdaptable adapter, Point moveDelta) { super(label); - Assert.isNotNull(adapter, "view cannot be null"); //$NON-NLS-1$ - Assert.isNotNull(moveDelta, "moveDelta cannot be null"); //$NON-NLS-1$ + Assert.isNotNull(adapter, Messages.MoveViewOperation_nullViewError); + Assert.isNotNull(moveDelta, Messages.MoveViewOperation_nullMoveDeltaError); this.adapter = adapter; this.moveDelta = moveDelta; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/ShiftDirectBorderedNodesOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/ShiftDirectBorderedNodesOperation.java index 9a3353c8d3..b933865277 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/ShiftDirectBorderedNodesOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/operation/ShiftDirectBorderedNodesOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -10,12 +10,14 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.internal.operation; +import java.text.MessageFormat; import java.util.List; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.gmf.runtime.notation.LayoutConstraint; import org.eclipse.gmf.runtime.notation.Location; import org.eclipse.gmf.runtime.notation.Node; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This command moves the specified bordered nodes of a given EditPart @@ -46,7 +48,7 @@ public class ShiftDirectBorderedNodesOperation extends AbstractModelChangeOperat * (in logical space). */ public ShiftDirectBorderedNodesOperation(List<Node> children, Dimension delta) { - super("Shift bordered nodes' positions by " + delta); + super(MessageFormat.format(Messages.ShiftDirectBorderedNodesOperation_name, delta)); this.children = children; this.delta = delta; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/LayoutData.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/LayoutData.java index 83027d2ed5..badec48f8a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/LayoutData.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/LayoutData.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.internal.view; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; @@ -32,6 +33,7 @@ import org.eclipse.sirius.diagram.DNodeListElement; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.EdgeTarget; import org.eclipse.sirius.diagram.ui.business.api.view.SiriusGMFHelper; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Store the layout information of an AbstractDNode at a given time. @@ -104,7 +106,7 @@ public class LayoutData extends AbstractLayoutData { } else if (target instanceof DNodeList) { addNodeListChildren(); } else { - DiagramPlugin.getDefault().logWarning("This kind of diagram element (" + target.getClass().getName() + ") is not yet managed by the LayoutDataManager."); + DiagramPlugin.getDefault().logWarning(MessageFormat.format(Messages.LayoutData_unhandledDiagramElementKind, target.getClass().getName())); } if (target instanceof EdgeTarget) { addOutgoingEdge(); @@ -333,7 +335,7 @@ public class LayoutData extends AbstractLayoutData { */ protected void setTarget(final EObject target) { if (!(target instanceof AbstractDNode || target instanceof DDiagram || target instanceof DEdge)) { - throw new IllegalArgumentException("The target of a LayoutData can only be an AbstractDNode, a DEdge or a DDiagram."); + throw new IllegalArgumentException(Messages.LayoutData_illegalTarget); } this.target = target; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/RootLayoutData.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/RootLayoutData.java index 0f2b114bc2..987a815742 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/RootLayoutData.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/RootLayoutData.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.internal.view; +import java.text.MessageFormat; import java.util.ArrayList; import org.eclipse.draw2d.geometry.Dimension; @@ -24,6 +25,7 @@ import org.eclipse.sirius.diagram.AbstractDNode; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.DiagramPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.util.EditPartTools; /** @@ -33,6 +35,7 @@ import org.eclipse.sirius.diagram.ui.tools.api.util.EditPartTools; * */ public class RootLayoutData extends LayoutData { + private EditPartViewer viewer; /** @@ -62,7 +65,7 @@ public class RootLayoutData extends LayoutData { } else if (adaptObject instanceof DEdge) { init((DEdge) adaptObject, location, size); } else { - DiagramPlugin.getDefault().logWarning("This kind of diagram element (" + adaptObject.getClass().getName() + ") is not yet managed by the LayoutDataManager."); + DiagramPlugin.getDefault().logWarning(MessageFormat.format(Messages.RootLayoutData_unhandledDiagramElementKind, adaptObject.getClass().getName())); } } @@ -111,7 +114,7 @@ public class RootLayoutData extends LayoutData { } else if (adaptObject instanceof DEdge) { init((DEdge) adaptObject, location, size); } else { - DiagramPlugin.getDefault().logWarning("This kind of diagram element (" + adaptObject.getClass().getName() + ") is not yet managed by the LayoutDataManager."); + DiagramPlugin.getDefault().logWarning(MessageFormat.format(Messages.RootLayoutData_unhandledDiagramElementKind, adaptObject.getClass().getName())); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/SiriusLayoutDataManagerImpl.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/SiriusLayoutDataManagerImpl.java index cf3cf860a2..0ab92e69c3 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/SiriusLayoutDataManagerImpl.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/business/internal/view/SiriusLayoutDataManagerImpl.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.internal.view; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -63,6 +64,7 @@ import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.EdgeTarget; import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager; import org.eclipse.sirius.diagram.ui.graphical.figures.SiriusLayoutHelper; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; @@ -78,23 +80,25 @@ import com.google.common.collect.Lists; @SuppressWarnings("restriction") public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManager { - private static final String ARRANGE_COMMAND_LABEL = "Arrange created views"; - /** * An adapter to mark the View as layout by the SiriusLayoutDataManager. */ private static final Adapter LAYOUT_MARKER_ADAPTER = new Adapter() { + @Override public void setTarget(final Notifier newTarget) { } + @Override public void notifyChanged(final Notification notification) { } + @Override public boolean isAdapterForType(final Object type) { return type instanceof SiriusLayoutDataManager; } + @Override public Notifier getTarget() { return null; } @@ -106,16 +110,20 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage */ private static final Adapter LAYOUT_MARKER_ADAPTER_ON_OPENING = new Adapter() { + @Override public void setTarget(final Notifier newTarget) { } + @Override public void notifyChanged(final Notification notification) { }; + @Override public boolean isAdapterForType(final Object type) { return type instanceof SiriusLayoutDataManager; } + @Override public Notifier getTarget() { return null; } @@ -127,16 +135,20 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage */ private static final Adapter CENTER_LAYOUT_MARKER_ADAPTER = new Adapter() { + @Override public void setTarget(final Notifier newTarget) { } + @Override public void notifyChanged(final Notification notification) { } + @Override public boolean isAdapterForType(final Object type) { return type instanceof SiriusLayoutDataManager; } + @Override public Notifier getTarget() { return null; } @@ -155,6 +167,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage */ Predicate<View> predicate = new Predicate<View>() { + @Override public boolean apply(View input) { return hasToArrange(input); } @@ -199,6 +212,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * @param aLayoutData * The rootLayoutData */ + @Override public void addData(final AbstractLayoutData aLayoutData) { // if a rootLayoutData exist with the same target, we delete the // previous rootLayoutData @@ -227,6 +241,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * true if the data must be retrieve from the node parent * @return the corresponding LayoutData or null if not found. */ + @Override public LayoutData getData(final AbstractDNode node, final boolean searchParent) { LayoutData result = null; if (node != null) { @@ -237,7 +252,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage } else if (node.eContainer() instanceof DDiagram) { result = getData((DDiagram) node.eContainer()); } else { - DiagramPlugin.getDefault().logWarning("This kind of container (" + node.eContainer().getClass().getName() + ") is not yet managed by the LayoutDataManager."); + DiagramPlugin.getDefault().logWarning(MessageFormat.format(Messages.SiriusLayoutDataManagerImpl_unhandledContainerKind, node.eContainer().getClass().getName())); } } if (result == null) { @@ -299,6 +314,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * true if the data must be retrieve from the node parent * @return the corresponding EdgeLayoutData or null if not found. */ + @Override public EdgeLayoutData getData(final DEdge edge, final boolean searchParent) { Option<EdgeLayoutData> noEdgeLayoutData = Options.newNone(); return getData(edge, searchParent, noEdgeLayoutData); @@ -398,6 +414,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getData(org.eclipse.sirius.viewpoint.AbstractDNode) */ + @Override public LayoutData getData(final AbstractDNode node) { return getData(node, false); } @@ -407,6 +424,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getAdapterMarker() */ + @Override public Adapter getAdapterMarker() { return LAYOUT_MARKER_ADAPTER; } @@ -416,6 +434,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getCenterAdapterMarker() */ + @Override public Adapter getCenterAdapterMarker() { return CENTER_LAYOUT_MARKER_ADAPTER; } @@ -426,8 +445,9 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getAddAdapterMakerCommand(org.eclipse.emf.transaction.TransactionalEditingDomain, * org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor) */ + @Override public AbstractTransactionalCommand getAddAdapterMakerCommand(final TransactionalEditingDomain domain, final IAdaptable viewAdapter) { - return new AbstractTransactionalCommand(domain, "Add layout marker on view", null) { + return new AbstractTransactionalCommand(domain, Messages.SiriusLayoutDataManagerImpl_addLayoutMarkerCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { final View view = (View) viewAdapter.getAdapter(View.class); @@ -445,8 +465,9 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getAddAdapterMakerCommand(org.eclipse.emf.transaction.TransactionalEditingDomain, * org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor) */ + @Override public AbstractTransactionalCommand getAddCenterAdapterMakerCommand(final TransactionalEditingDomain domain, final IAdaptable viewAdapter) { - return new AbstractTransactionalCommand(domain, "Add center layout marker on view", null) { + return new AbstractTransactionalCommand(domain, Messages.SiriusLayoutDataManagerImpl_addCenterLayoutMarkerCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { final View view = (View) viewAdapter.getAdapter(View.class); @@ -465,7 +486,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * org.eclipse.gmf.runtime.notation.View) */ public AbstractTransactionalCommand getAddAdapterMakerOnOpeningCommand(final TransactionalEditingDomain domain, final IAdaptable viewAdapter) { - return new AbstractTransactionalCommand(domain, "Add layout marker on view on opening diagram", null) { + return new AbstractTransactionalCommand(domain, Messages.SiriusLayoutDataManagerImpl_addLayoutMarkerOnOpeningCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { final View view = (View) viewAdapter.getAdapter(View.class); @@ -483,8 +504,9 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getAddAdapterMakerOnOpeningCommand(org.eclipse.emf.transaction.TransactionalEditingDomain, * org.eclipse.gmf.runtime.notation.View) */ + @Override public AbstractTransactionalCommand getAddAdapterMakerOnOpeningCommand(final TransactionalEditingDomain domain, final View view) { - return new AbstractTransactionalCommand(domain, "Add layout marker on view on opening diagram", null) { + return new AbstractTransactionalCommand(domain, Messages.SiriusLayoutDataManagerImpl_addLayoutMarkerOnOpeningCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { if (view != null && !view.eAdapters().contains(LAYOUT_MARKER_ADAPTER_ON_OPENING)) { @@ -498,6 +520,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage /** * {@inheritDoc} */ + @Override public EdgeLabelLayoutData getLabelData(final DEdge edge) { EdgeLabelLayoutData result = null; @@ -524,6 +547,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#arrangeCreatedViews(java.util.List, * org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) */ + @Override public Command getArrangeCreatedViewsCommand(List<IAdaptable> createdViews, List<IAdaptable> createdViewsWithCenterLayout, IGraphicalEditPart host) { // Layout only the views that are not // already layout (by a drag'n'drop for example) @@ -639,8 +663,9 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#arrangeCreatedViewsOnOpening(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) */ + @Override public Command getArrangeCreatedViewsOnOpeningCommand(final IGraphicalEditPart host) { - CompoundCommand cc = new CompoundCommand(ARRANGE_COMMAND_LABEL); + CompoundCommand cc = new CompoundCommand(Messages.SiriusLayoutDataManagerImpl_createdViewsArrangCommandLabel); View containerView = (View) host.getModel(); Command layoutCommand = getlayoutCommand(host, containerView); if (layoutCommand instanceof CompoundCommand && !((CompoundCommand) layoutCommand).isEmpty()) { @@ -671,7 +696,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * @return the layout commands */ private Command getlayoutCommand(final IGraphicalEditPart host, View containerView) { - CompoundCommand cc = new CompoundCommand(ARRANGE_COMMAND_LABEL); + CompoundCommand cc = new CompoundCommand(Messages.SiriusLayoutDataManagerImpl_createdViewsArrangCommandLabel); // get the created views and remove the layout adapter @SuppressWarnings("unchecked") @@ -757,6 +782,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * The view to check * @return true if this view is to arrange, false otherwise */ + @Override public boolean hasToArrange(View view) { boolean arranged = false; if (view != null) { @@ -813,9 +839,10 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getArrangeCommand(org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest, * org.eclipse.gef.EditPart) */ - // CHECKSTYLE:OFF + @Override @SuppressWarnings({ "unchecked" }) public Command getArrangeCommand(ArrangeRequest request, EditPart host) { + Command arrangeCommand = null; // layout new created views at diagram // opening : launch arrange selection even if there is only one new @@ -832,41 +859,40 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage offsetFromBoundingBox = true; } - if (editparts.isEmpty()) { - return null; - } - List<LayoutNode> nodes = new ArrayList<LayoutNode>(editparts.size()); - ListIterator<EditPart> li = editparts.listIterator(); - while (li.hasNext()) { - IGraphicalEditPart ep = (IGraphicalEditPart) li.next(); - View view = ep.getNotationView(); - if (view instanceof Node) { - Rectangle bounds = ep.getFigure().getBounds(); - nodes.add(new LayoutNode((Node) view, bounds.width, bounds.height)); + if (!editparts.isEmpty()) { + List<LayoutNode> nodes = new ArrayList<LayoutNode>(editparts.size()); + ListIterator<EditPart> li = editparts.listIterator(); + while (li.hasNext()) { + IGraphicalEditPart ep = (IGraphicalEditPart) li.next(); + View view = ep.getNotationView(); + if (view instanceof Node) { + Rectangle bounds = ep.getFigure().getBounds(); + nodes.add(new LayoutNode((Node) view, bounds.width, bounds.height)); + } + // remove adapters + removeAlreadyArrangeMarkeronOpening(view); } - // remove adapters - removeAlreadyArrangeMarkeronOpening(view); - } - - List<Object> hints = new ArrayList<Object>(2); - hints.add(layoutDesc); - hints.add(host); - IAdaptable layoutHint = new ObjectAdapter(hints); - final Runnable layoutRun = layoutNodes(nodes, offsetFromBoundingBox, layoutHint); - if (layoutRun instanceof IInternalLayoutRunnable) { - return ((IInternalLayoutRunnable) layoutRun).getCommand(); - } else { - TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) host).getEditingDomain(); - - return new ICommandProxy(new AbstractTransactionalCommand(editingDomain, "", null) {//$NON-NLS-1$ - @Override - protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { - layoutRun.run(); - return CommandResult.newOKCommandResult(); - } - }); + List<Object> hints = new ArrayList<Object>(2); + hints.add(layoutDesc); + hints.add(host); + IAdaptable layoutHint = new ObjectAdapter(hints); + final Runnable layoutRun = layoutNodes(nodes, offsetFromBoundingBox, layoutHint); + + if (layoutRun instanceof IInternalLayoutRunnable) { + arrangeCommand = ((IInternalLayoutRunnable) layoutRun).getCommand(); + } else { + TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) host).getEditingDomain(); + arrangeCommand = new ICommandProxy(new AbstractTransactionalCommand(editingDomain, "", null) { //$NON-NLS-1$ + @Override + protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { + layoutRun.run(); + return CommandResult.newOKCommandResult(); + } + }); + } } + return arrangeCommand; } /** @@ -903,8 +929,6 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage super.finalize(); } - // CHECKSTYLE:ON - /** * Layout nodes. * @@ -924,6 +948,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage /** * {@inheritDoc} */ + @Override public void addCreatedViewsToLayout(Diagram gmfDiagram, LinkedHashSet<View> createdViewsToLayout) { createdViewToLayout.put(gmfDiagram, createdViewsToLayout); } @@ -931,6 +956,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage /** * {@inheritDoc} */ + @Override public Map<Diagram, Set<View>> getCreatedViewsToLayout() { return createdViewToLayout; } @@ -940,6 +966,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#setIgnoreConsumeState(boolean) */ + @Override public void setIgnoreConsumeState(boolean ignoreConsumeState) { this.ignoreConsumeState = ignoreConsumeState; } @@ -949,6 +976,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getData() */ + @Override public Option<AbstractLayoutData> getData() { if (!rootsLayoutData.isEmpty()) { return Options.newSome(rootsLayoutData.iterator().next()); @@ -961,6 +989,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#getCreatedViewWithSpecialLayout() */ + @Override public Map<Diagram, Set<View>> getCreatedViewWithCenterLayout() { return createdViewWithCenterLayout; } @@ -970,6 +999,7 @@ public final class SiriusLayoutDataManagerImpl implements SiriusLayoutDataManage * * @see org.eclipse.sirius.diagram.business.api.view.SiriusLayoutDataManager#addCreatedViewWithCenterLayout(org.eclipse.gmf.runtime.notation.View) */ + @Override public void addCreatedViewWithCenterLayout(Diagram gmfDiagram, LinkedHashSet<View> createdViewsToLayout) { this.createdViewWithCenterLayout.put(gmfDiagram, createdViewsToLayout); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractBorderedDiagramElementEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractBorderedDiagramElementEditPart.java index a7735eeda9..2fa9d6b834 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractBorderedDiagramElementEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractBorderedDiagramElementEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2013, 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 diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java index 8ef98fa28b..2faf21ea63 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDDiagramEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES. + * 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 diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramBorderNodeEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramBorderNodeEditPart.java index 1c26490c32..4224edee2d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramBorderNodeEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramBorderNodeEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -62,6 +62,7 @@ import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper; import org.eclipse.sirius.diagram.ui.edit.internal.validators.ResizeValidator; import org.eclipse.sirius.diagram.ui.graphical.edit.policies.SpecificBorderItemSelectionEditPolicy; import org.eclipse.sirius.diagram.ui.internal.view.factories.ViewLocationHint; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils; import org.eclipse.sirius.diagram.ui.tools.api.permission.EditPartAuthorityListener; import org.eclipse.sirius.diagram.ui.tools.internal.ui.SiriusDragEditPartsTrackerEx; @@ -275,7 +276,7 @@ public abstract class AbstractDiagramBorderNodeEditPart extends BorderedBorderIt * @return a command to create port which wrap the original command */ protected Command getPortCreationCommand(final Command originalCommand, final CreateViewRequest request) { - final CompositeCommand compositeCommand = new CompositeCommand("Create View"); + final CompositeCommand compositeCommand = new CompositeCommand(Messages.IAbstractDiagramNodeEditPart_createViewCommandLabel); compositeCommand.compose(new CommandProxy(originalCommand)); LayoutUtils.prepareFigureForDummyAdds(this.getBorderedFigure().getBorderItemContainer()); for (ViewDescriptor viewDescriptor : Iterables.filter(request.getViewDescriptors(), ViewDescriptor.class)) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java index 09a28a1d3c..12cad8b841 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramContainerEditPart.java @@ -52,6 +52,7 @@ import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper; import org.eclipse.sirius.diagram.ui.graphical.edit.policies.ResetOriginEditPolicy; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDiagramElementContainerNameEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.policies.DNodeContainerItemSemanticEditPolicy; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils; import org.eclipse.sirius.diagram.ui.tools.api.policy.CompoundEditPolicy; import org.eclipse.sirius.diagram.ui.tools.internal.figure.LabelBorderStyleIds; @@ -76,6 +77,7 @@ public abstract class AbstractDiagramContainerEditPart extends AbstractDiagramEl super(view); } + @Override public Class<?> getMetamodelType() { return DNodeContainer.class; } @@ -128,7 +130,7 @@ public abstract class AbstractDiagramContainerEditPart extends AbstractDiagramEl * @return a command to create port which wrap the original command */ protected Command getPortCreationCommand(final Command originalCommand, final CreateViewRequest request) { - final CompositeCommand compositeCommand = new CompositeCommand("Create View"); + final CompositeCommand compositeCommand = new CompositeCommand(Messages.IAbstractDiagramNodeEditPart_createViewCommandLabel); compositeCommand.compose(new CommandProxy(originalCommand)); final Iterator<? extends ViewDescriptor> iterDescriptor = request.getViewDescriptors().iterator(); LayoutUtils.prepareFigureForDummyAdds(this.getBorderedFigure().getBorderItemContainer()); @@ -191,6 +193,7 @@ public abstract class AbstractDiagramContainerEditPart extends AbstractDiagramEl * * @was-generated */ + @Override protected void createDefaultEditPolicies() { super.createDefaultEditPolicies(); installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new DNodeContainerItemSemanticEditPolicy()); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java index 014d5bc0a5..650fea8eb0 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramElementContainerEditPart.java @@ -74,6 +74,7 @@ import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNode4EditPart; import org.eclipse.sirius.diagram.ui.internal.edit.policies.NonResizableAndNonDuplicableEditPolicy; import org.eclipse.sirius.diagram.ui.internal.edit.policies.RegionGraphicalNodeEditPolicy; import org.eclipse.sirius.diagram.ui.internal.view.factories.ViewLocationHint; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.AlphaDropShadowBorder; import org.eclipse.sirius.diagram.ui.tools.api.figure.FoldingToggleAwareClippingStrategy; import org.eclipse.sirius.diagram.ui.tools.api.figure.FoldingToggleImageFigure; @@ -787,8 +788,8 @@ public abstract class AbstractDiagramElementContainerEditPart extends AbstractBo break; } } - final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "Resize", new EObjectAdapter(graphicalEditPart.getNotationView()), new Rectangle(position, - dimension)); + final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), Messages.IAbstractDiagramNodeEditPart_resizeCommandLabel, new EObjectAdapter( + graphicalEditPart.getNotationView()), new Rectangle(position, dimension)); cmd = new ICommandProxy(setBoundsCommand); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramNodeEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramNodeEditPart.java index f13f0477a4..73b056e99f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramNodeEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/api/part/AbstractDiagramNodeEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -67,6 +67,7 @@ import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper; import org.eclipse.sirius.diagram.ui.edit.internal.validators.ResizeValidator; import org.eclipse.sirius.diagram.ui.graphical.edit.policies.SpecificBorderItemSelectionEditPolicy; import org.eclipse.sirius.diagram.ui.internal.view.factories.ViewLocationHint; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.AirDefaultSizeNodeFigure; import org.eclipse.sirius.diagram.ui.tools.api.figure.anchor.AnchorProvider; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IStyleConfigurationRegistry; @@ -160,7 +161,7 @@ public abstract class AbstractDiagramNodeEditPart extends AbstractBorderedDiagra * @return a command to create port which wrap the original command */ protected Command getPortCreationCommand(final Command originalCommand, final CreateViewRequest request) { - final CompositeCommand compositeCommand = new CompositeCommand("Create View"); + final CompositeCommand compositeCommand = new CompositeCommand(Messages.IAbstractDiagramNodeEditPart_createViewCommandLabel); compositeCommand.compose(new CommandProxy(originalCommand)); final Iterator<?> iterDescriptor = request.getViewDescriptors().iterator(); LayoutUtils.prepareFigureForDummyAdds(this.getBorderedFigure().getBorderItemContainer()); @@ -249,7 +250,7 @@ public abstract class AbstractDiagramNodeEditPart extends AbstractBorderedDiagra break; } } - final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), "Resize", new EObjectAdapter(graphicalEditPart.getNotationView()), + final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(getEditingDomain(), Messages.IAbstractDiagramNodeEditPart_resizeCommandLabel, new EObjectAdapter(graphicalEditPart.getNotationView()), new Rectangle(position, dimension)); cmd = new ICommandProxy(setBoundsCommand); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramBorderNodeEditPartOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramBorderNodeEditPartOperation.java index 74b0613285..e1e1bce199 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramBorderNodeEditPartOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramBorderNodeEditPartOperation.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 @@ -41,6 +41,7 @@ import org.eclipse.sirius.diagram.business.api.query.DNodeQuery; import org.eclipse.sirius.diagram.ui.edit.api.part.DiagramNameEditPartOperation; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramBorderNodeEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramNameEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.ITransparentFigure; import org.eclipse.sirius.diagram.ui.tools.api.figure.StyledFigure; import org.eclipse.sirius.diagram.ui.tools.internal.figure.ICollapseMode; @@ -279,7 +280,7 @@ public final class DiagramBorderNodeEditPartOperation { break; } } - SetBoundsCommand setBoundsCommand = new SetBoundsCommand(part.getEditingDomain(), "Resize", new EObjectAdapter(part.getNotationView()), new Rectangle(position, dimension)); + SetBoundsCommand setBoundsCommand = new SetBoundsCommand(part.getEditingDomain(), Messages.IAbstractDiagramNodeEditPart_resizeCommandLabel, new EObjectAdapter(part.getNotationView()), new Rectangle(position, dimension)); result = new ICommandProxy(setBoundsCommand); } else { result = null; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramEdgeEditPartOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramEdgeEditPartOperation.java index 5b8d83194e..ce020dd3d4 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramEdgeEditPartOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramEdgeEditPartOperation.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.edit.internal.part; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -62,6 +63,7 @@ import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramEdgeEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramNameEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DEdgeNameEditPart; import org.eclipse.sirius.diagram.ui.part.SiriusVisualIDRegistry; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.PolygoneAndPolylineDecoraction; import org.eclipse.sirius.diagram.ui.tools.internal.commands.EdgeRoutingStyleChangedCommand; import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuthority; @@ -174,7 +176,7 @@ public final class DiagramEdgeEditPartOperation { routing = EdgeRouting.TREE_LITERAL; break; default: - SiriusPlugin.getDefault().warning("Unknown routing style: " + rstyle.getRouting().getName(), null); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.DiagramEdgeEditPartOperation_unknownRountingStyle, rstyle.getRouting().getName()), null); routing = EdgeRouting.STRAIGHT_LITERAL; } return routing; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java index 69af47f08a..573b3eb359 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/edit/internal/part/DiagramElementEditPartOperation.java @@ -53,6 +53,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.query.StyleConfigurationQ import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IStyleEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; import org.eclipse.sirius.diagram.ui.tools.api.figure.StyledFigure; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IStyleConfigurationRegistry; @@ -385,7 +386,7 @@ public final class DiagramElementEditPartOperation { // An issue has been encountered while connecting to // remote if (DiagramUIPlugin.getPlugin().isDebugging()) { - DiagramUIPlugin.getPlugin().getLog().log(new Status(IStatus.WARNING, DiagramUIPlugin.ID, "Error while connecting to remote CDO server")); + DiagramUIPlugin.getPlugin().getLog().log(new Status(IStatus.WARNING, DiagramUIPlugin.ID, Messages.DiagramElementEditPartOperation_partDeactivationError)); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirResizableEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirResizableEditPolicy.java index c3c40f2728..1360cdef67 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirResizableEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/AirResizableEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -47,6 +47,7 @@ import org.eclipse.sirius.diagram.ui.edit.internal.validators.ResizeValidator; import org.eclipse.sirius.diagram.ui.internal.edit.commands.CenterEditPartEdgesCommand; import org.eclipse.sirius.diagram.ui.internal.edit.commands.ChangeBendpointsOfEdgesCommand; import org.eclipse.sirius.diagram.ui.internal.edit.commands.ChildrenAdjustmentCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IStyleConfigurationRegistry; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.StyleConfiguration; @@ -92,7 +93,7 @@ public class AirResizableEditPolicy extends ResizableShapeEditPolicy { final StyleConfiguration styleConfiguration = IStyleConfigurationRegistry.INSTANCE.getStyleConfiguration(mapping, style); final Dimension newDim = styleConfiguration.fitToText(viewNode, label, defaultSizeNodeFigure); final TransactionalEditingDomain transactionalEditingDomain = TransactionUtil.getEditingDomain(viewNode); - final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(transactionalEditingDomain, "Auto Size", + final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(transactionalEditingDomain, Messages.AirResizableEditPolicy_autoSizeCommandLabel, new EObjectAdapter(((IGraphicalEditPart) this.getHost()).getNotationView()), newDim); return new ICommandProxy(setBoundsCommand); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/BracketBendpointEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/BracketBendpointEditPolicy.java index 0a983aaf98..9e5f29c01c 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/BracketBendpointEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/BracketBendpointEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES. + * 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 @@ -46,6 +46,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.bracket.handles.Bendpoint import org.eclipse.sirius.diagram.ui.graphical.edit.part.specific.BracketEdgeEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDEdgeNameEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.locator.EdgeLabelQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper; import org.eclipse.sirius.diagram.ui.tools.api.requests.RequestConstants; import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper; @@ -61,10 +62,10 @@ import org.eclipse.swt.graphics.Cursor; public class BracketBendpointEditPolicy extends BendpointEditPolicy { /** The label used for the bracket edge move command. */ - public static final String MOVE_COMMAND_LABEL = "Move bracket connection"; + public static final String MOVE_COMMAND_LABEL = Messages.BracketBendpointEditPolicy_moveBrackedCommandLabel; /** The label used for the bracket edge rotate command. */ - public static final String ROTATE_COMMAND_LABEL = "Rotate bracket connection"; + public static final String ROTATE_COMMAND_LABEL = Messages.BracketBendpointEditPolicy_rotateBracketCommandLabel; /** The background feedback color as in GMF. */ private static final Color GRAY = new Color(null, 200, 200, 200); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeDeletionEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeDeletionEditPolicy.java index 828c7fee6a..460ef4cd94 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeDeletionEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/NodeDeletionEditPolicy.java @@ -30,6 +30,7 @@ import org.eclipse.sirius.diagram.ui.internal.edit.policies.SiriusComponentEditP import org.eclipse.sirius.diagram.ui.part.SiriusDiagramUpdater; import org.eclipse.sirius.diagram.ui.part.SiriusNodeDescriptor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.graphical.edit.policies.DeleteHelper; @@ -81,7 +82,7 @@ public class NodeDeletionEditPolicy extends SiriusComponentEditPolicy { } private Command buildGlobalDeleteCommand(final IDiagramCommandFactory commandFactory, final View view, final DDiagramElement diagramElement) { - final CompositeCommand compositeCommand = new CompositeCommand("Delete element"); + final CompositeCommand compositeCommand = new CompositeCommand(Messages.NodeDeletionEditPolicy_deleteElementCommandLabel); org.eclipse.emf.common.command.Command buildedCommand = commandFactory.buildDeleteDiagramElement(diagramElement); boolean removeHideNote = DiagramUIPlugin.getPlugin().getPreferenceStore().getBoolean(SiriusDiagramUiInternalPreferencesKeys.PREF_REMOVE_HIDE_NOTE_WHEN_ANNOTED_ELEMENT_HIDDEN_OR_REMOVE.name()); if (removeHideNote) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionContainerResizableEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionContainerResizableEditPolicy.java index f1233ef1b7..e17969b7a1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionContainerResizableEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionContainerResizableEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 THALES GLOBAL SERVICES. + * Copyright (c) 2013, 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 @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.commands.ChildrenAdjustmentCommand; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeContainerCompartmentEditPart; import org.eclipse.sirius.diagram.ui.internal.operation.RegionContainerUpdateLayoutOperation; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.edit.command.CommandFactory; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; @@ -56,17 +57,17 @@ public class RegionContainerResizableEditPolicy extends AirResizableEditPolicy { /** * Key to store the part responsible for auto-size propagation. */ - protected static final String REGION_AUTO_SIZE_PROPAGATOR = "region_auto-size_propagator"; //$NON-NLS-1$ + protected static final String REGION_AUTO_SIZE_PROPAGATOR = "sirius.region.auto.size.propagator"; //$NON-NLS-1$ /** * Key to store the part responsible for resize propagation. */ - protected static final String REGION_RESIZE_PROPAGATOR = "region_resize_propagator"; + protected static final String REGION_RESIZE_PROPAGATOR = "sirius.region.resize.propagator"; //$NON-NLS-1$ /** * Key to store the initial request for resize propragation. */ - protected static final String REGION_RESIZE_INITIAL_REQUEST = "region_resize_initial_request"; + protected static final String REGION_RESIZE_INITIAL_REQUEST = "sirius.region.resize.initial.request"; //$NON-NLS-1$ @Override protected Command getAutoSizeCommand(Request request) { @@ -92,7 +93,7 @@ public class RegionContainerResizableEditPolicy extends AirResizableEditPolicy { protected Command getRegionContainerAutoSizeCommand(Request request, Command autoSizeCommand) { IDiagramElementEditPart host = (IDiagramElementEditPart) getHost(); TransactionalEditingDomain domain = host.getEditingDomain(); - CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(domain, "Region Container Auto Size Command"); + CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(domain, Messages.RegionContainerResizableEditPolicy_regionContainerAutoSizeCommandLabel); ctc.add(new CommandProxy(autoSizeCommand)); Command regionContainerAutoSizeCommand = new ICommandProxy(ctc); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionResizableEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionResizableEditPolicy.java index 2e374577df..622ea6509a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionResizableEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/RegionResizableEditPolicy.java @@ -34,6 +34,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.query.RequestQuery; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramElementContainerEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeContainerCompartmentEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; @@ -107,7 +108,7 @@ public class RegionResizableEditPolicy extends AirResizableEditPolicy { Command regionContainerAutoSizeCommand = regionContainerPart.getCommand(req); if (getHost() instanceof IDiagramElementEditPart && regionContainerAutoSizeCommand != null) { - CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(((IDiagramElementEditPart) getHost()).getEditingDomain(), "Region Auto Size Composite Command"); + CompositeTransactionalCommand ctc = new CompositeTransactionalCommand(((IDiagramElementEditPart) getHost()).getEditingDomain(), Messages.RegionResizableEditPolicy_regionAutoSizeCommandLabel); ctc.add(new CommandProxy(autoSizeCommand)); ctc.add(new CommandProxy(regionContainerAutoSizeCommand)); autoSizeCommand = new ICommandProxy(ctc); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java index 4ddc530b23..220c4c47fb 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SetConnectionBendpointsAccordingToExtremityMoveCommmand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -22,6 +22,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.gmf.runtime.draw2d.ui.geometry.LineSeg; import org.eclipse.gmf.runtime.draw2d.ui.geometry.PointListUtilities; import org.eclipse.sirius.diagram.ui.business.api.query.ConnectionEditPartQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper; @@ -426,9 +427,9 @@ public class SetConnectionBendpointsAccordingToExtremityMoveCommmand extends Set public void setSourceMove(boolean sourceMove) { this.sourceMove = sourceMove; if (sourceMove) { - setLabel("Move first segment (on source side)"); + setLabel(Messages.SetConnectionBendpointsAccordingToExtremityMoveCommmand_sourceSidedLabel); } else { - setLabel("Move last segment (on target side)"); + setLabel(Messages.SetConnectionBendpointsAccordingToExtremityMoveCommmand_targetSidedLabel); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java index c9b32e13a8..bdb6d035e4 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusContainerDropPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES. + * 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 @@ -55,6 +55,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.view.RootLayoutData; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEditPart; import org.eclipse.sirius.diagram.ui.graphical.edit.internal.policies.validators.DragAndDropValidator; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeContainerCompartmentEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper; import org.eclipse.sirius.diagram.ui.tools.api.draw2d.ui.figures.FigureUtilities; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; @@ -74,7 +75,7 @@ public class SiriusContainerDropPolicy extends DragDropEditPolicy { /** * The name of the Drag'n'Drop command. */ - public static final String DROP_ELEMENTS_CMD_NAME = "Drop Elements"; + public static final String DROP_ELEMENTS_CMD_NAME = Messages.SiriusContainerDropPolicy_dropElementsCommandLabel; /** The background feedback color as in GMF. */ private static final Color GRAY = new Color(null, 200, 200, 200); @@ -360,7 +361,7 @@ public class SiriusContainerDropPolicy extends DragDropEditPolicy { } private org.eclipse.emf.common.command.Command getSaveLayoutCommand(ChangeBoundsRequest request, final Iterable<IGraphicalEditPart> editPartsToDrop, TransactionalEditingDomain editingDomain) { - org.eclipse.emf.common.command.CompoundCommand saveLayoutCommand = new org.eclipse.emf.common.command.CompoundCommand("Save layout for edit part"); + org.eclipse.emf.common.command.CompoundCommand saveLayoutCommand = new org.eclipse.emf.common.command.CompoundCommand(Messages.SiriusContainerDropPolicy_saveEditPartLayoutCommandLabel); EditPartViewer viewer = getHost().getViewer(); Point moveDelta = request.getMoveDelta().getCopy(); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusPropertyHandlerEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusPropertyHandlerEditPolicy.java index dc4a67691e..1abb194228 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusPropertyHandlerEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/SiriusPropertyHandlerEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008, 2009 THALES GLOBAL SERVICES. + * 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 @@ -41,6 +41,7 @@ import org.eclipse.sirius.diagram.NodeStyle; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.internal.refresh.diagram.ViewPropertiesSynchronizer; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.DStylizable; import org.eclipse.sirius.viewpoint.Style; import org.eclipse.sirius.viewpoint.description.DescriptionFactory; @@ -59,10 +60,6 @@ import org.eclipse.swt.graphics.RGB; @SuppressWarnings("restriction") public class SiriusPropertyHandlerEditPolicy extends PropertyHandlerEditPolicy { - private static final String APPLY_VIEWPOINT_APPEARANCE_PROPERTIES_UNDO_COMMAND_NAME = "Apply viewpoint appearance properties"; //$NON-NLS-1$ - - private static final String APPLY_VIEWPOINT_TOOLBAR_PROPERTIES_UNDO_COMMAND_NAME = "Apply viewpoint toolbar properties"; //$NON-NLS-1$ - /** * * {@inheritDoc} @@ -83,7 +80,7 @@ public class SiriusPropertyHandlerEditPolicy extends PropertyHandlerEditPolicy { if (styleCommand != null) { final CompoundCommand cc = new CompoundCommand(); - cc.setDebugLabel("Chained Style Command"); //$NON-NLS-1$ + cc.setDebugLabel(Messages.SiriusPropertyHandlerEditPolicy_chainedStyleCommandDebugLabel); cc.add(c); cc.add(styleCommand); return cc; @@ -114,7 +111,7 @@ public class SiriusPropertyHandlerEditPolicy extends PropertyHandlerEditPolicy { final DEdge edge = (DEdge) styleReceiver; final EdgeStyle edgeStyle = (EdgeStyle) styleToCopy; - viewStyleCommand = new AbstractTransactionalCommand(getEditingDomain(), APPLY_VIEWPOINT_APPEARANCE_PROPERTIES_UNDO_COMMAND_NAME, null) { + viewStyleCommand = new AbstractTransactionalCommand(getEditingDomain(), Messages.SiriusPropertyHandlerEditPolicy_applyAppearancePropertiesCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor progressMonitor, final IAdaptable info) throws ExecutionException { edge.setOwnedStyle(edgeStyle); @@ -125,7 +122,7 @@ public class SiriusPropertyHandlerEditPolicy extends PropertyHandlerEditPolicy { final DNode node = (DNode) styleReceiver; final NodeStyle nodeStyle = (NodeStyle) styleToCopy; - viewStyleCommand = new AbstractTransactionalCommand(getEditingDomain(), APPLY_VIEWPOINT_APPEARANCE_PROPERTIES_UNDO_COMMAND_NAME, null) { + viewStyleCommand = new AbstractTransactionalCommand(getEditingDomain(), Messages.SiriusPropertyHandlerEditPolicy_applyAppearancePropertiesCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor progressMonitor, final IAdaptable info) throws ExecutionException { node.setOwnedStyle(nodeStyle); @@ -136,7 +133,7 @@ public class SiriusPropertyHandlerEditPolicy extends PropertyHandlerEditPolicy { final DDiagramElementContainer container = (DDiagramElementContainer) styleReceiver; final ContainerStyle containerStyle = (ContainerStyle) styleToCopy; - viewStyleCommand = new AbstractTransactionalCommand(getEditingDomain(), APPLY_VIEWPOINT_APPEARANCE_PROPERTIES_UNDO_COMMAND_NAME, null) { + viewStyleCommand = new AbstractTransactionalCommand(getEditingDomain(), Messages.SiriusPropertyHandlerEditPolicy_applyAppearancePropertiesCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor progressMonitor, final IAdaptable info) throws ExecutionException { container.setOwnedStyle(containerStyle); @@ -168,13 +165,13 @@ public class SiriusPropertyHandlerEditPolicy extends PropertyHandlerEditPolicy { private Command buildColorPropertyChangeCommand(final View view, final ChangePropertyValueRequest cpvr, final EditPart ep) { if (view != null && ViewUtil.isPropertySupported(view, cpvr.getPropertyID()) && ep instanceof IDiagramElementEditPart) { - ICommand colorCommand = new AbstractTransactionalCommand(getEditingDomain(), APPLY_VIEWPOINT_TOOLBAR_PROPERTIES_UNDO_COMMAND_NAME, null) { + ICommand colorCommand = new AbstractTransactionalCommand(getEditingDomain(), Messages.SiriusPropertyHandlerEditPolicy_applyTabbarPropertiesCommandLabel, null) { @Override protected CommandResult doExecuteWithResult(final IProgressMonitor progressMonitor, final IAdaptable info) throws ExecutionException { if (cpvr.getValue() instanceof Integer) { final RGB finalColor = FigureUtilities.integerToRGB((Integer) cpvr.getValue()); final UserFixedColor newColor = DescriptionFactory.eINSTANCE.createUserFixedColor(); - newColor.setName("<anonymous>"); //$NON-NLS-1$ + newColor.setName(Messages.AnonymousUserFixedColorName); newColor.setBlue(finalColor.blue); newColor.setGreen(finalColor.green); newColor.setRed(finalColor.red); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/TreeLayoutConnectionLineSegEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/TreeLayoutConnectionLineSegEditPolicy.java index f0906b3ec4..ec0d5de723 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/TreeLayoutConnectionLineSegEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/graphical/edit/policies/TreeLayoutConnectionLineSegEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES. + * 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 @@ -202,10 +202,10 @@ public class TreeLayoutConnectionLineSegEditPolicy extends SiriusConnectionBendp protected void showMoveOrthogonalBendpointFeedback2(BendpointRequest request) { // Change visibility of super method and call it. The bugzilla 331779 // exists to make this method protected. - if (!ReflectionHelper.invokeMethodWithoutException(this, org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.ConnectionBendpointEditPolicy.class, "showMoveOrthogonalBenspointFeedback", + if (!ReflectionHelper.invokeMethodWithoutException(this, org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.ConnectionBendpointEditPolicy.class, "showMoveOrthogonalBenspointFeedback", //$NON-NLS-1$ new Class[] { BendpointRequest.class }, new Object[] { request }, true)) { DiagramUIPlugin.INSTANCE.log(new Status(IStatus.WARNING, DiagramUIPlugin.ID, - "Impossible to call showMoveOrthogonalBenspointFeedback by reflection to handle edge label correctly during edge move (bug 465328).")); + "Impossible to call showMoveOrthogonalBenspointFeedback by reflection to handle edge label correctly during edge move (bug 465328).")); //$NON-NLS-1$ } else { initialPointsManager.storeInitialPointsInRequest(request, (ConnectionEditPart) getHost()); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/CenterEditPartEdgesCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/CenterEditPartEdgesCommand.java index 873f00e098..dcb5b740e3 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/CenterEditPartEdgesCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/CenterEditPartEdgesCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -30,6 +30,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.sirius.diagram.ui.internal.operation.CenterEdgeEndModelChangeOperation; +import org.eclipse.sirius.diagram.ui.provider.Messages; import com.google.common.collect.Iterables; @@ -57,7 +58,7 @@ public class CenterEditPartEdgesCommand extends AbstractTransactionalCommand { * because of this kind of request. Can be null. */ public CenterEditPartEdgesCommand(IGraphicalEditPart graphicalEditPart, ChangeBoundsRequest request) { - super(graphicalEditPart.getEditingDomain(), "Center Edges", null); + super(graphicalEditPart.getEditingDomain(), Messages.CenterEditPartEdgesCommand_label, null); editPart = graphicalEditPart; this.request = request; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChangeBendpointsOfEdgesCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChangeBendpointsOfEdgesCommand.java index 4e86306150..c8edd9d872 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChangeBendpointsOfEdgesCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChangeBendpointsOfEdgesCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -40,6 +40,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.bracket.BracketConnection import org.eclipse.sirius.diagram.ui.graphical.edit.part.specific.BracketEdgeEditPart; import org.eclipse.sirius.diagram.ui.graphical.edit.policies.SetConnectionBendpointsAccordingToDraw2DCommand; import org.eclipse.sirius.diagram.ui.graphical.edit.policies.SetConnectionBendpointsAccordingToExtremityMoveCommmand; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; @@ -70,7 +71,7 @@ public class ChangeBendpointsOfEdgesCommand extends AbstractTransactionalCommand * The move delta */ public ChangeBendpointsOfEdgesCommand(IGraphicalEditPart movedPart, PrecisionPoint moveDelta) { - super(movedPart.getEditingDomain(), "Adapt bendpoints of edges", null); + super(movedPart.getEditingDomain(), Messages.ChangeBendpointsOfEdgesCommand_label, null); this.movedPart = movedPart; this.moveDelta = moveDelta; } @@ -130,7 +131,7 @@ public class ChangeBendpointsOfEdgesCommand extends AbstractTransactionalCommand } } else { // Not expected to be there - result = CommandResult.newWarningCommandResult("The adaptation of edges according to shape move can not be done.", null); + result = CommandResult.newWarningCommandResult(Messages.ChangeBendpointsOfEdgesCommand_warningCommandResultMessage, null); } } return result; @@ -232,16 +233,17 @@ public class ChangeBendpointsOfEdgesCommand extends AbstractTransactionalCommand // layout component ConnectionEditPartQuery connectionEditPartQuery = new ConnectionEditPartQuery(connectionEditPart); if (new ConnectionQuery(connectionFigure).isOrthogonalTreeBranch(connectionFigure.getPoints()) && connectionEditPartQuery.isLayoutComponent()) { - CompositeTransactionalCommand command = new CompositeTransactionalCommand(transactionalEditingDomain, "Map GMF to Draw2D"); + CompositeTransactionalCommand command = new CompositeTransactionalCommand(transactionalEditingDomain, Messages.ChangeBendpointsOfEdgesCommand_mapGmfToDraw2dCommandLabel); - SetConnectionAnchorsCommand setConnectionAnchorsCommand = new SetConnectionAnchorsCommand(transactionalEditingDomain, "Map GMF anchor to Draw2D anchor"); + SetConnectionAnchorsCommand setConnectionAnchorsCommand = new SetConnectionAnchorsCommand(transactionalEditingDomain, + Messages.ChangeBendpointsOfEdgesCommand_mapGmfAnchorToDraw2dAnchorCommandLabel); setConnectionAnchorsCommand.setEdgeAdaptor(connectionEditPart); setConnectionAnchorsCommand.setNewSourceTerminal(((INodeEditPart) connectionEditPart.getSource()).mapConnectionAnchorToTerminal(connectionFigure.getSourceAnchor())); setConnectionAnchorsCommand.setNewTargetTerminal(((INodeEditPart) connectionEditPart.getTarget()).mapConnectionAnchorToTerminal(connectionFigure.getTargetAnchor())); command.add(setConnectionAnchorsCommand); SetConnectionBendpointsAccordingToDraw2DCommand setConnectionBendpointsCommand = new SetConnectionBendpointsAccordingToDraw2DCommand(transactionalEditingDomain); - setConnectionBendpointsCommand.setLabel("Map GMF points to Draw2D points"); + setConnectionBendpointsCommand.setLabel(Messages.ChangeBendpointsOfEdgesCommand_mapGmfPointsToDraw2dPoints); setConnectionBendpointsCommand.setSourceMove(sourceMove); setConnectionBendpointsCommand.setMoveDelta(new PrecisionPoint(moveDelta)); setConnectionBendpointsCommand.setEdgeAdapter(connectionEditPart); @@ -251,7 +253,7 @@ public class ChangeBendpointsOfEdgesCommand extends AbstractTransactionalCommand } else if (connectionEditPartQuery.isEdgeWithObliqueRoutingStyle() || connectionEditPartQuery.isEdgeWithRectilinearRoutingStyle()) { if (!allMovedEditParts.isEmpty()) { if ((sourceMove && !allMovedEditParts.contains(connectionEditPart.getTarget())) || (!sourceMove && !allMovedEditParts.contains(connectionEditPart.getSource()))) { - CompositeTransactionalCommand command = new CompositeTransactionalCommand(transactionalEditingDomain, "Map GMF to Draw2D"); + CompositeTransactionalCommand command = new CompositeTransactionalCommand(transactionalEditingDomain, Messages.ChangeBendpointsOfEdgesCommand_mapGmfToDraw2dCommandLabel); // Reset the connection anchor source and target // considering // it can be wrongly modified by the arrange selection @@ -279,7 +281,7 @@ public class ChangeBendpointsOfEdgesCommand extends AbstractTransactionalCommand if (!allMovedEditParts.isEmpty()) { if ((sourceMove && !allMovedEditParts.contains(connectionEditPart.getTarget())) || (!sourceMove && !allMovedEditParts.contains(connectionEditPart.getSource()))) { // Just update the label offset - CompositeTransactionalCommand command = new CompositeTransactionalCommand(transactionalEditingDomain, "Update offset of labels"); + CompositeTransactionalCommand command = new CompositeTransactionalCommand(transactionalEditingDomain, Messages.ChangeBendpointsOfEdgesCommand_updateLabelsOffsetCmdLabel); PointList currentPointList = connectionEditPart.getConnectionFigure().getPoints(); PointList futurePointList = new BracketConnectionQuery(connectionEditPart.getConnectionFigure()).getPointListFromConstraintAndMove(moveDelta, sourceMove); SetLabelsOffsetCommmand setLabelsOffsetCommand = new SetLabelsOffsetCommmand(transactionalEditingDomain); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChildrenAdjustmentCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChildrenAdjustmentCommand.java index bac3d614ee..3faf12eae9 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChildrenAdjustmentCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/ChildrenAdjustmentCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.query.RequestQuery; import org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusResizeTracker; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeContainerCompartmentEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerViewNodeContainerCompartmentEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.edit.command.CommandFactory; import org.eclipse.sirius.diagram.ui.tools.internal.util.EditPartQuery; import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper; @@ -49,7 +50,7 @@ import com.google.common.collect.Lists; /** * This command avoids time consumption as long as it does not executed. The * "real" command is created during the execution. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { @@ -65,7 +66,7 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { /** * Default constructor. - * + * * @param host * the <i>host</i> EditPart on which this policy is installed. * @param request @@ -77,7 +78,7 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { /** * Default constructor. - * + * * @param host * the <i>host</i> EditPart on which this policy is installed. * @param request @@ -89,7 +90,7 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { * the content pane) */ public ChildrenAdjustmentCommand(IGraphicalEditPart host, ChangeBoundsRequest request, boolean borderNodes, boolean subNodes) { - super(host.getEditingDomain(), "Adapt children location", null); + super(host.getEditingDomain(), Messages.ChildrenAdjustmentCommand_label, null); this.host = host; this.request = request; this.adjustBorderNodes = borderNodes; @@ -130,7 +131,7 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { } } else { // Not expected to be there - result = CommandResult.newWarningCommandResult("The adaptation of children location to shape move can not be done.", null); + result = CommandResult.newWarningCommandResult(Messages.ChildrenAdjustmentCommand_errorMsg, null); } } return result; @@ -162,7 +163,7 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { /** * Add the needed commands, to move the children nodes, to the original * command. - * + * * @param resizedPart * The part that will be resized * @param cc @@ -188,7 +189,7 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { /** * Add the needed commands, to "move" only the last segment of edges * pointing to the children nodes, to the original command. - * + * * @param resizedPart * The part that will be resized * @param cc @@ -200,8 +201,8 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { private void addChildrenEdgesAdjustmentCommands(IGraphicalEditPart resizedPart, CompositeTransactionalCommand cc, ChangeBoundsRequest cbr) { PrecisionPoint delta = new PrecisionPoint(cbr.getMoveDelta()); GraphicalHelper.applyInverseZoomOnPoint(resizedPart, delta); - DNodeContainerViewNodeContainerCompartmentEditPart compartment = Iterables - .getFirst(Iterables.filter(resizedPart.getChildren(), DNodeContainerViewNodeContainerCompartmentEditPart.class), null); + DNodeContainerViewNodeContainerCompartmentEditPart compartment = Iterables.getFirst(Iterables.filter(resizedPart.getChildren(), DNodeContainerViewNodeContainerCompartmentEditPart.class), + null); if (compartment != null) { Iterable<EditPart> childrenExceptBorderItemPart = Iterables.filter(compartment.getChildren(), EditPart.class); for (EditPart editPart : childrenExceptBorderItemPart) { @@ -216,7 +217,7 @@ public class ChildrenAdjustmentCommand extends AbstractTransactionalCommand { /** * Add the needed commands, to move the border nodes, to the original * command. - * + * * @param resizedPart * The part that will be resized (parent of the border nodes to * move) diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DEdgeCreateCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DEdgeCreateCommand.java index f46d6a9189..57f79895ab 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DEdgeCreateCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DEdgeCreateCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * 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 @@ -25,6 +25,7 @@ import org.eclipse.sirius.diagram.DiagramFactory; import org.eclipse.sirius.diagram.DiagramPackage; import org.eclipse.sirius.diagram.EdgeTarget; import org.eclipse.sirius.diagram.ui.internal.edit.policies.SiriusBaseItemSemanticEditPolicy; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * @was-generated @@ -72,6 +73,7 @@ public class DEdgeCreateCommand extends CreateElementCommand { /** * @was-generated */ + @Override public boolean canExecute() { if (source == null && target == null) { return false; @@ -96,6 +98,7 @@ public class DEdgeCreateCommand extends CreateElementCommand { /** * @was-generated */ + @Override protected EObject doDefaultElementCreation() { // org.eclipse.sirius.DEdge newElement = (org.eclipse.sirius.DEdge) // super.doDefaultElementCreation(); @@ -109,6 +112,7 @@ public class DEdgeCreateCommand extends CreateElementCommand { /** * @was-generated */ + @Override protected EClass getEClassToEdit() { return DiagramPackage.eINSTANCE.getDDiagram(); } @@ -116,9 +120,10 @@ public class DEdgeCreateCommand extends CreateElementCommand { /** * @was-generated */ + @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (!canExecute()) { - throw new ExecutionException("Invalid arguments in create link command"); //$NON-NLS-1$ + throw new ExecutionException(Messages.DEdgeCreateCommand_executionErrorMsg); } return super.doExecuteWithResult(monitor, info); } @@ -126,6 +131,7 @@ public class DEdgeCreateCommand extends CreateElementCommand { /** * @was-generated */ + @Override protected ConfigureRequest createConfigureRequest() { ConfigureRequest request = super.createConfigureRequest(); request.setParameter(CreateRelationshipRequest.SOURCE, getSource()); @@ -136,6 +142,7 @@ public class DEdgeCreateCommand extends CreateElementCommand { /** * @was-generated */ + @Override protected void setElementToEdit(EObject element) { throw new UnsupportedOperationException(); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DistributeCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DistributeCommand.java index 39bd8be708..c116cc2a78 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DistributeCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/DistributeCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -35,6 +35,7 @@ import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalC import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.sirius.diagram.ui.business.internal.operation.ShiftDirectBorderedNodesOperation; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.locator.DBorderItemLocator; import org.eclipse.sirius.diagram.ui.tools.internal.actions.distribute.DistributeAction; import org.eclipse.sirius.diagram.ui.tools.internal.edit.command.CommandFactory; @@ -49,7 +50,7 @@ import com.google.common.collect.Maps; * Performance information: This command is only time consumming on execution, * not creation. The "real" command, <code>wrappedCommand</code>, is created * during the execution. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class DistributeCommand extends AbstractTransactionalCommand { @@ -72,7 +73,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Default constructor. - * + * * @param domain * my editing domain * @param host @@ -121,7 +122,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { } } else { // Not expected to be there - result = CommandResult.newWarningCommandResult("The distribution of selected elements can not be done.", null); + result = CommandResult.newWarningCommandResult(Messages.DistributeCommand_errorMsg, null); } } return result; @@ -130,7 +131,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * A {@link Comparator} that sorts the {@link IGraphicalEditPart parts} by * the x coordinate of the center of the bounds of the part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class PartByCenter implements Comparator<IGraphicalEditPart> { @@ -155,7 +156,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * A {@link Comparator} that sorts the {@link IGraphicalEditPart parts} by * the y coordinate of the center of the bounds of the part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class PartByMiddle implements Comparator<IGraphicalEditPart> { @@ -182,9 +183,9 @@ public class DistributeCommand extends AbstractTransactionalCommand { * edit part and the gap. The {@link #apply(Object, Rectangle, int)} must be * called instead of {@link #apply(Object)} for this function. This function * does not modify the original bounds. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> - * + * * @param <IGraphicalEditPart> * The edit part from which getting the new bounds * @param <Rectangle> @@ -205,9 +206,9 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * A function with {@link HashMap<IGraphicalEditPart, Rectangle>} as * parameter. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> - * + * */ public abstract class FunctionWithBounds implements Function<IGraphicalEditPart, Integer> { HashMap<IGraphicalEditPart, Rectangle> partsToBounds; @@ -227,7 +228,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get the x coordinate of the left side of the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetLeftFunction extends FunctionWithBounds { @@ -235,6 +236,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.x); }; @@ -242,7 +244,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get the x coordinate of the center of the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetCenterFunction extends FunctionWithBounds { @@ -250,6 +252,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.getCenter().x); }; @@ -257,7 +260,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get the x coordinate of the right side of the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetRightFunction extends FunctionWithBounds { @@ -265,6 +268,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.getRight().x); }; @@ -272,7 +276,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get the y coordinate of the top side of the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetTopFunction extends FunctionWithBounds { @@ -280,6 +284,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.y); }; @@ -287,7 +292,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get the y coordinate of the center the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetMiddleFunction extends FunctionWithBounds { @@ -295,6 +300,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.getCenter().y); }; @@ -302,7 +308,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get the y coordinate of the bottom side of the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetBottomFunction extends FunctionWithBounds { @@ -310,6 +316,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.getBottom().y); }; @@ -317,7 +324,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get width of the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetWidthFunction extends FunctionWithBounds { @@ -325,6 +332,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.width); }; @@ -332,7 +340,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Get height of the edit part. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class GetHeightFunction extends FunctionWithBounds { @@ -340,6 +348,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { super(partsToBounds); } + @Override protected Integer apply(Rectangle rectangle) { return new Integer(rectangle.height); }; @@ -347,7 +356,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Function to compute the gap for the parts to distribute. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public abstract class GetGapFunction { @@ -372,35 +381,37 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Must be called only when <code>wrappedCommand</code> is initialized. - * + * * @param partsToBounds * List of parts to distribute associated with their bounds (the * bounds of their figure). */ private void distributeHorizontallyWithUniformGaps(final HashMap<IGraphicalEditPart, Rectangle> partsToBounds) { GetNewBoundsFunction setXFunction = new GetNewBoundsFunction() { + @Override public Rectangle apply(IGraphicalEditPart input) { return partsToBounds.get(input).getCopy().setX(previousPartBounds.getRight().x + gap); }; }; - distributeWithUniformGaps(partsToBounds.keySet(), new GetLeftFunction(partsToBounds), new GetTopFunction(partsToBounds), new GetRightFunction(partsToBounds), new GetBottomFunction( - partsToBounds), new GetWidthFunction(partsToBounds), new PartByCenter(partsToBounds), setXFunction, Functions.forMap(partsToBounds)); + distributeWithUniformGaps(partsToBounds.keySet(), new GetLeftFunction(partsToBounds), new GetTopFunction(partsToBounds), new GetRightFunction(partsToBounds), + new GetBottomFunction(partsToBounds), new GetWidthFunction(partsToBounds), new PartByCenter(partsToBounds), setXFunction, Functions.forMap(partsToBounds)); } /** * Must be called only when <code>wrappedCommand</code> is initialized. - * + * * @param partsToBounds * List of parts to distribute associated with their bounds. */ private void distributeVerticallyWithUniformGaps(final HashMap<IGraphicalEditPart, Rectangle> partsToBounds) { GetNewBoundsFunction setYFunction = new GetNewBoundsFunction() { + @Override public Rectangle apply(IGraphicalEditPart input) { return partsToBounds.get(input).getCopy().setY(previousPartBounds.getBottom().y + gap); }; }; - distributeWithUniformGaps(partsToBounds.keySet(), new GetTopFunction(partsToBounds), new GetLeftFunction(partsToBounds), new GetBottomFunction(partsToBounds), new GetRightFunction( - partsToBounds), new GetHeightFunction(partsToBounds), new PartByMiddle(partsToBounds), setYFunction, Functions.forMap(partsToBounds)); + distributeWithUniformGaps(partsToBounds.keySet(), new GetTopFunction(partsToBounds), new GetLeftFunction(partsToBounds), new GetBottomFunction(partsToBounds), + new GetRightFunction(partsToBounds), new GetHeightFunction(partsToBounds), new PartByMiddle(partsToBounds), setYFunction, Functions.forMap(partsToBounds)); } private void distributeWithUniformGaps(Set<IGraphicalEditPart> partsToDistribute, Function<IGraphicalEditPart, Integer> getFirstPartMainAxisFunction, @@ -431,12 +442,13 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Must be called only when <code>wrappedCommand</code> is initialized. - * + * * @param partsToBounds * List of parts to distribute associated with their bounds. */ private void distributeCentersHorizontally(final HashMap<IGraphicalEditPart, Rectangle> partsToBounds) { GetNewBoundsFunction setCenterFunction = new GetNewBoundsFunction() { + @Override public Rectangle apply(IGraphicalEditPart input) { Rectangle r = partsToBounds.get(input).getCopy(); return r.setX(previousPartBounds.getCenter().x + gap - (r.width / 2)); @@ -449,12 +461,13 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Must be called only when <code>wrappedCommand</code> is initialized. - * + * * @param partsToBounds * List of parts to distribute associated with their bounds. */ private void distributeCentersVertically(final HashMap<IGraphicalEditPart, Rectangle> partsToBounds) { GetNewBoundsFunction setMiddleFunction = new GetNewBoundsFunction() { + @Override public Rectangle apply(IGraphicalEditPart input) { Rectangle r = partsToBounds.get(input).getCopy(); return r.setY(previousPartBounds.getCenter().y + gap - (r.height / 2)); @@ -483,7 +496,7 @@ public class DistributeCommand extends AbstractTransactionalCommand { /** * Generic distribute method that distributes shapes according to parameters * to customize the distribution. - * + * * @param partsToDistribute * List of {@link IGraphicalEditPart parts} to distribute * (including the first and the last that don't move). @@ -586,11 +599,11 @@ public class DistributeCommand extends AbstractTransactionalCommand { } Dimension delta = newBounds.getLocation().getDifference(getBoundsFunction.apply(editPart).getLocation()); if (delta.width != 0) { - wrappedCommand.compose(CommandFactory.createICommand(wrappedCommand.getEditingDomain(), new ShiftDirectBorderedNodesOperation(Lists.newArrayList((Node) editPart.getModel()), - new Dimension(delta.width, 0)))); + wrappedCommand.compose(CommandFactory.createICommand(wrappedCommand.getEditingDomain(), + new ShiftDirectBorderedNodesOperation(Lists.newArrayList((Node) editPart.getModel()), new Dimension(delta.width, 0)))); } else { - wrappedCommand.compose(CommandFactory.createICommand(wrappedCommand.getEditingDomain(), new ShiftDirectBorderedNodesOperation(Lists.newArrayList((Node) editPart.getModel()), - new Dimension(0, delta.height)))); + wrappedCommand.compose(CommandFactory.createICommand(wrappedCommand.getEditingDomain(), + new ShiftDirectBorderedNodesOperation(Lists.newArrayList((Node) editPart.getModel()), new Dimension(0, delta.height)))); } previousPartBounds = expectedNewBounds; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SetLabelsOffsetCommmand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SetLabelsOffsetCommmand.java index 5a298f2ae8..ac2aee8268 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SetLabelsOffsetCommmand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SetLabelsOffsetCommmand.java @@ -18,6 +18,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart; import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This class allows to update edge label Node position. @@ -36,7 +37,7 @@ public class SetLabelsOffsetCommmand extends AbstractTransactionalCommand { * the editing domain through which model changes are made */ public SetLabelsOffsetCommmand(TransactionalEditingDomain editingDomain) { - super(editingDomain, "Update labels offset", null); + super(editingDomain, Messages.SetLabelsOffsetCommmand_label, null); setLabelsOperation = new SetLabelsOffsetOperation(); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SiriusReorientConnectionViewCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SiriusReorientConnectionViewCommand.java index 9d8138eccd..aed1f5fb9f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SiriusReorientConnectionViewCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/commands/SiriusReorientConnectionViewCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * 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 @@ -19,6 +19,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * @was-generated @@ -40,6 +41,7 @@ public class SiriusReorientConnectionViewCommand extends AbstractTransactionalCo /** * @was-generated */ + @Override public List getAffectedFiles() { View view = (View) edgeAdaptor.getAdapter(View.class); if (view != null) { @@ -65,10 +67,11 @@ public class SiriusReorientConnectionViewCommand extends AbstractTransactionalCo /** * @was-generated */ + @Override protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) { - assert null != edgeAdaptor : "Null child in SiriusReorientConnectionViewCommand"; //$NON-NLS-1$ + assert null != edgeAdaptor : Messages.SiriusReorientConnectionViewCommand_nullChild; Edge edge = (Edge) getEdgeAdaptor().getAdapter(Edge.class); - assert null != edge : "Null edge in SiriusReorientConnectionViewCommand"; //$NON-NLS-1$ + assert null != edge : Messages.SiriusReorientConnectionViewCommand_nullEdge; View tempView = edge.getSource(); edge.setSource(edge.getTarget()); edge.setTarget(tempView); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/BundledImageEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/BundledImageEditPart.java index bb72b8b5da..1238eeb4b0 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/BundledImageEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/BundledImageEditPart.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 @@ -35,6 +35,7 @@ import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramBorderNodeEditPar import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramElementEditPartOperation; import org.eclipse.sirius.diagram.ui.edit.internal.part.DiagramNodeEditPartOperation; import org.eclipse.sirius.diagram.ui.internal.edit.policies.FixedLayoutEditPolicy; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.AirStyleDefaultSizeNodeFigure; import org.eclipse.sirius.diagram.ui.tools.api.figure.BundledImageFigure; import org.eclipse.sirius.ui.tools.api.color.VisualBindingManager; @@ -116,7 +117,7 @@ public class BundledImageEditPart extends AbstractNotSelectableShapeNodeEditPart if (this.getMetamodelType().isInstance(this.resolveSemanticElement())) { bif = (BundledImageFigure) BundledImageFigure.createImageFigure((BundledImage) resolveSemanticElement()); } else { - DiagramPlugin.getDefault().logWarning("The element is not a BundledImage"); + DiagramPlugin.getDefault().logWarning(Messages.BundledImageEditPart_notBundleImageMsg); final BundledImage bundle = DiagramFactory.eINSTANCE.createBundledImage(); bundle.setShape(BundledImageShape.SQUARE_LITERAL); bundle.getLabelFormat().clear(); @@ -162,10 +163,10 @@ public class BundledImageEditPart extends AbstractNotSelectableShapeNodeEditPart /** * Creates figure for this edit part. - * + * * Body of this method does not depend on settings in generation model so * you may safely remove <i>generated</i> tag and modify it. - * + * * @not-generated */ @Override @@ -181,7 +182,7 @@ public class BundledImageEditPart extends AbstractNotSelectableShapeNodeEditPart /** * Default implementation treats passed figure as content pane. Respects * layout one may have set for generated figure. - * + * * @param nodeShape * instance of generated figure class * @was-generated diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java index 09adc975cf..9938ee0f98 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/parts/DDiagramEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. + * 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.diagram.ui.graphical.edit.policies.RevealSelectedEleme import org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusContainerDropPolicy; import org.eclipse.sirius.diagram.ui.graphical.edit.policies.SiriusPropertyHandlerEditPolicy; import org.eclipse.sirius.diagram.ui.internal.edit.policies.DDiagramItemSemanticEditPolicy; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.policy.CompoundEditPolicy; import org.eclipse.sirius.diagram.ui.tools.api.requests.RequestConstants; import org.eclipse.sirius.diagram.ui.tools.internal.ruler.SiriusSnapToHelperUtil; @@ -120,9 +121,9 @@ public class DDiagramEditPart extends AbstractDDiagramEditPart { /** * A command that changes the LayoutingMode of the given {@link DDiagram}. - * + * * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> - * + * */ public static class SetLayoutingModeCommand extends SiriusCommand { @@ -138,7 +139,7 @@ public class DDiagramEditPart extends AbstractDDiagramEditPart { /** * Constructor. - * + * * @param editingDomain * the editing domain * @param diagram @@ -149,18 +150,18 @@ public class DDiagramEditPart extends AbstractDDiagramEditPart { * disabled */ public SetLayoutingModeCommand(TransactionalEditingDomain editingDomain, DDiagram diagram, boolean layoutingModeShouldBeEnabled) { - super(editingDomain, "Deactivating Layouting mode"); + super(editingDomain, Messages.SetLayoutingModeCommand_deactivateLabel); this.diagram = diagram; this.layoutingModeShouldBeEnabled = layoutingModeShouldBeEnabled; if (layoutingModeShouldBeEnabled) { - setLabel("Activating Layouting mode"); + setLabel(Messages.SetLayoutingModeCommand_activateLabel); } } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.sirius.tools.api.command.SiriusCommand#doExecute() */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/InitialPointsOfRequestDataManager.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/InitialPointsOfRequestDataManager.java index e0c752aa47..aefc6628ea 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/InitialPointsOfRequestDataManager.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/InitialPointsOfRequestDataManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 THALES GLOBAL SERVICES. + * Copyright (c) 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 @@ -42,7 +42,7 @@ public class InitialPointsOfRequestDataManager { * The key used to store the initial points of the edge (before the feedback * drawing). */ - private static final String INITIAL_POINTS_KEY = "InitialPointsManagerForEdgePolicy.initialPointsKey"; // $NON-NLS-1 + private static final String INITIAL_POINTS_KEY = "InitialPointsManagerForEdgePolicy.initialPointsKey"; //$NON-NLS-1$ /** The list of points before feedback drawing. */ private PointList initialPoints; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/OpenDiagramEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/OpenDiagramEditPolicy.java index cac17f35d8..89b9014257 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/OpenDiagramEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/OpenDiagramEditPolicy.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 @@ -12,6 +12,7 @@ package org.eclipse.sirius.diagram.ui.internal.edit.policies; import java.io.IOException; import java.lang.reflect.InvocationTargetException; +import java.text.MessageFormat; import java.util.Iterator; import org.eclipse.core.commands.ExecutionException; @@ -58,6 +59,7 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy { /** * @was-generated */ + @Override protected Command getOpenCommand(Request request) { EditPart targetEditPart = getTargetEditPart(request); if (false == targetEditPart.getModel() instanceof View) { @@ -97,6 +99,7 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy { /** * @not-generated */ + @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { try { Diagram diagram = getDiagramToOpen(); @@ -112,10 +115,10 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy { page.openEditor(editorInput, getEditorID()); return CommandResult.newOKCommandResult(); } - return CommandResult.newErrorCommandResult("Can't open diagram -- getElement() is not an instance of Sirius"); + return CommandResult.newErrorCommandResult(org.eclipse.sirius.diagram.ui.provider.Messages.OpenDiagramCommand_notDiagramElementErrorMsg); } catch (Exception ex) { - throw new ExecutionException("Can't open diagram", ex); + throw new ExecutionException(org.eclipse.sirius.diagram.ui.provider.Messages.OpenDiagramCommand_exceptionMsg, ex); } } @@ -132,7 +135,7 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy { protected Diagram intializeNewDiagram() throws ExecutionException { Diagram d = ViewService.createDiagram(getDiagramDomainElement(), getDiagramKind(), getPreferencesHint()); if (d == null) { - throw new ExecutionException("Can't create diagram of '" + getDiagramKind() + "' kind"); + throw new ExecutionException(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.OpenDiagramCommand_creationErrorMsg, getDiagramKind())); } diagramFacet.setDiagramLink(d); final Resource diagramFacetResource = diagramFacet.eResource(); @@ -140,6 +143,7 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy { diagramFacetResource.getContents().add(d); try { new WorkspaceModifyOperation() { + @Override protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException { try { for (Iterator<Resource> it = diagramFacetResource.getResourceSet().getResources().iterator(); it.hasNext();) { @@ -149,14 +153,14 @@ public class OpenDiagramEditPolicy extends OpenEditPolicy { } } } catch (IOException ex) { - throw new InvocationTargetException(ex, "Save operation failed"); + throw new InvocationTargetException(ex, org.eclipse.sirius.diagram.ui.provider.Messages.OpenDiagramCommand_saveFailedMsg); } } }.run(null); } catch (InvocationTargetException e) { - throw new ExecutionException("Can't create diagram of '" + getDiagramKind() + "' kind", e); + throw new ExecutionException(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.OpenDiagramCommand_creationErrorMsg, getDiagramKind()), e); } catch (InterruptedException e) { - throw new ExecutionException("Can't create diagram of '" + getDiagramKind() + "' kind", e); + throw new ExecutionException(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.OpenDiagramCommand_creationErrorMsg, getDiagramKind()), e); } return d; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/SiriusBaseItemSemanticEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/SiriusBaseItemSemanticEditPolicy.java index 00e31142dd..4af9e634d1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/SiriusBaseItemSemanticEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/edit/policies/SiriusBaseItemSemanticEditPolicy.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 @@ -59,6 +59,7 @@ import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactoryProvid import org.eclipse.sirius.diagram.ui.graphical.edit.policies.AirDestroyElementRequest; import org.eclipse.sirius.diagram.ui.part.SiriusVisualIDRegistry; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.graphical.edit.policies.DeleteHelper; @@ -164,7 +165,7 @@ public class SiriusBaseItemSemanticEditPolicy extends SemanticEditPolicy { DDiagramElement viewPointElement = (DDiagramElement) view.getElement(); DDiagramEditor diagramEditor = (DDiagramEditor) this.getHost().getViewer().getProperty(DDiagramEditor.EDITOR_ID); Object adapter = diagramEditor.getAdapter(IDiagramCommandFactoryProvider.class); - CompositeCommand compositeCommand = new CompositeCommand("Delete element from diagram"); + CompositeCommand compositeCommand = new CompositeCommand(Messages.SiriusBaseItemSemanticEditPolicy_deleteFromDiagramCmdLabel); IDiagramCommandFactoryProvider cmdFactoryProvider = (IDiagramCommandFactoryProvider) (adapter); org.eclipse.emf.common.command.Command cmd = cmdFactoryProvider.getCommandFactory(editingDomain).buildDeleteFromDiagramCommand(viewPointElement); if (shouldImpactLinkedNotesOnHideOrRemove()) { @@ -193,7 +194,7 @@ public class SiriusBaseItemSemanticEditPolicy extends SemanticEditPolicy { IDiagramCommandFactoryProvider cmdFactoryProvider = (IDiagramCommandFactoryProvider) (adapter); org.eclipse.emf.common.command.Command cmd = cmdFactoryProvider.getCommandFactory(editingDomain).buildDeleteDiagramElement(viewPointElement); if (cmd.canExecute()) { - CompositeCommand compositeCommand = new CompositeCommand("Delete element"); + CompositeCommand compositeCommand = new CompositeCommand(Messages.SiriusBaseItemSemanticEditPolicy_deleteCmdLabel); if (shouldImpactLinkedNotesOnHideOrRemove()) { DeleteHelper.addDeleteLinkedNotesTask(cmd, view); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/RegionContainerUpdateLayoutOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/RegionContainerUpdateLayoutOperation.java index c95547ec82..f14ac67659 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/RegionContainerUpdateLayoutOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/RegionContainerUpdateLayoutOperation.java @@ -28,6 +28,7 @@ import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerViewNodeC import org.eclipse.sirius.diagram.ui.internal.edit.parts.DNodeContainerViewNodeContainerCompartmentEditPart; import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper; import org.eclipse.sirius.diagram.ui.part.SiriusVisualIDRegistry; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.description.RepresentationElementMapping; @@ -52,7 +53,7 @@ public class RegionContainerUpdateLayoutOperation extends AbstractModelChangeOpe * The Region Container view to layout. */ public RegionContainerUpdateLayoutOperation(Node regionContainer) { - super("Layout Regions Operations"); + super(Messages.RegionContainerUpdateLayoutOperation_name); this.regionContainer = extractRealRegionContainer(regionContainer); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/ResetOriginChangeModelOperation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/ResetOriginChangeModelOperation.java index 01d6bb44da..a656ca5fd2 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/ResetOriginChangeModelOperation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/operation/ResetOriginChangeModelOperation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -38,6 +38,7 @@ import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.diagram.ui.business.internal.operation.AbstractModelChangeOperation; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramContainerEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeContainerCompartmentEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -81,11 +82,11 @@ public class ResetOriginChangeModelOperation extends AbstractModelChangeOperatio @Override public String getName() { - String name = "Reset Origin"; + String name = Messages.ResetOriginChangeModelOperation_name; if (containerEditPart instanceof DiagramEditPart) { - name = "Reset Diagram Origin"; + name = Messages.ResetOriginChangeModelOperation_nameOnDiagram; } else if (containerEditPart instanceof AbstractDiagramContainerEditPart) { - name = "Reset Container Origin"; + name = Messages.ResetOriginChangeModelOperation_nameOnContainer; } return name; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/parsers/AbstractParser.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/parsers/AbstractParser.java index 0d9310acc3..743815c997 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/parsers/AbstractParser.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/parsers/AbstractParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * 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 @@ -115,6 +115,7 @@ public abstract class AbstractParser implements IParser { /** * @was-generated */ + @Override public boolean isAffectingEvent(Object event, int flags) { if (event instanceof Notification) { return isAffectingFeature(((Notification) event).getFeature()); @@ -137,6 +138,7 @@ public abstract class AbstractParser implements IParser { /** * @was-generated */ + @Override public IContentAssistProcessor getCompletionProcessor(IAdaptable element) { return null; } @@ -178,7 +180,7 @@ public abstract class AbstractParser implements IParser { if (editingDomain == null) { return UnexecutableCommand.INSTANCE; } - CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, "Set Values"); //$NON-NLS-1$ + CompositeTransactionalCommand command = new CompositeTransactionalCommand(editingDomain, org.eclipse.sirius.diagram.ui.provider.Messages.AbstractParser_setValuesCmdLabel); for (int i = 0; i < values.length; i++) { command.compose(getModificationCommand(element, features[i], values[i])); } @@ -391,6 +393,7 @@ public abstract class AbstractParser implements IParser { /** * @was-generated */ + @Override public String toString() { return description; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramAppearancePreferencePage.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramAppearancePreferencePage.java index 1c982f5d3f..b473544e4d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramAppearancePreferencePage.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramAppearancePreferencePage.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 @@ -17,6 +17,7 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.tools.api.preferences.SiriusDiagramPreferencesKeys; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.preferences.SiriusDiagramUiPreferencesKeys; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; @@ -30,42 +31,6 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore; */ public class DiagramAppearancePreferencePage extends AppearancePreferencePage { - /** - * Title of the popup opened when toggling ui style. - */ - public static final String USER_INTERFACE = "User interface"; - - /** - * Message explaining user the action of toggling ui style. - */ - public static final String OLD_STYLE_NO_TAB_BAR_LAYERS_AND_FILTERS_MANAGEMENT_IN_OUTLINE = "old style : no tab bar, layers and filters management in outline"; - - /** - * Message explaining user the action of hiding label icons for all - * connectors. - */ - public static final String HIDE_LABEL_ICONS_ON_CONNECTORS_MESSAGE = " Hide label icons on connectors"; //$NON-NLS-1$ - - /** - * Message explaining user the action of hiding label icons for all shapes. - */ - public static final String HIDE_LABEL_ICONS_ON_SHAPES_MESSAGE = " Hide label icons on shapes"; //$NON-NLS-1$ - - /** - * Title of the group containing all options related to label icons hiding. - */ - public static final String LABEL_ICONS_GROUP_TITLE = "Label icons (does not affect existing elements of opened diagrams)"; //$NON-NLS-1$ - - /** - * Title of the group containing display header option. - */ - public static final String LABEL_DISPLAY_HEADER_TITLE = "Display header"; //$NON-NLS-1$ /** - - /** - * Message explaining user the action of display header. - */ - public static final String DISPLAY_HEADER_MESSAGE = "Display header"; //$NON-NLS-1$ - private BooleanFieldEditor hideLabelIconsOfShapes; private BooleanFieldEditor hideLabelIconsOfConnectors; @@ -106,7 +71,7 @@ public class DiagramAppearancePreferencePage extends AppearancePreferencePage { gridData.grabExcessHorizontalSpace = true; gridData.horizontalSpan = 3; composite.setLayoutData(gridData); - group.setText(LABEL_ICONS_GROUP_TITLE); + group.setText(Messages.DiagramAppearancePreferencePage_labelIconsGroupText); addLabelIconsFields(composite); @@ -133,7 +98,7 @@ public class DiagramAppearancePreferencePage extends AppearancePreferencePage { gridData.grabExcessHorizontalSpace = true; gridData.horizontalSpan = 3; composite.setLayoutData(gridData); - group.setText(LABEL_DISPLAY_HEADER_TITLE); + group.setText(Messages.DiagramAppearancePreferencePage_displayHeaderGroupText); addDisplayHeaderField(composite); @@ -153,7 +118,7 @@ public class DiagramAppearancePreferencePage extends AppearancePreferencePage { * the group on which create the fields */ protected void addDisplayHeaderField(Composite composite) { - displayHeader = new BooleanFieldEditor(SiriusDiagramPreferencesKeys.PREF_DISPLAY_HEADER_SECTION.name(), DISPLAY_HEADER_MESSAGE, composite); + displayHeader = new BooleanFieldEditor(SiriusDiagramPreferencesKeys.PREF_DISPLAY_HEADER_SECTION.name(), Messages.DiagramAppearancePreferencePage_displayHeaderLabel, composite); addField(displayHeader); } @@ -165,10 +130,10 @@ public class DiagramAppearancePreferencePage extends AppearancePreferencePage { * the group on which create the fields */ protected void addLabelIconsFields(Composite composite) { - hideLabelIconsOfShapes = new BooleanFieldEditor(SiriusDiagramUiPreferencesKeys.PREF_HIDE_LABEL_ICONS_ON_SHAPES.name(), HIDE_LABEL_ICONS_ON_SHAPES_MESSAGE, composite); + hideLabelIconsOfShapes = new BooleanFieldEditor(SiriusDiagramUiPreferencesKeys.PREF_HIDE_LABEL_ICONS_ON_SHAPES.name(), Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, composite); addField(hideLabelIconsOfShapes); - hideLabelIconsOfConnectors = new BooleanFieldEditor(SiriusDiagramUiPreferencesKeys.PREF_HIDE_LABEL_ICONS_ON_CONNECTORS.name(), HIDE_LABEL_ICONS_ON_CONNECTORS_MESSAGE, composite); + hideLabelIconsOfConnectors = new BooleanFieldEditor(SiriusDiagramUiPreferencesKeys.PREF_HIDE_LABEL_ICONS_ON_CONNECTORS.name(), Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, composite); addField(hideLabelIconsOfConnectors); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramConnectionsPreferencePage.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramConnectionsPreferencePage.java index bff0ff70a3..6fbd56fc2d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramConnectionsPreferencePage.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramConnectionsPreferencePage.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 @@ -23,6 +23,7 @@ import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.tools.api.preferences.SiriusDiagramCorePreferences; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Combo; @@ -50,11 +51,6 @@ public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage private static final String LINE_STYLE_LABEL = DiagramUIMessages.ConnectionsPreferencePage_lineStyle_label; /** - * Label of the enableOverride field. - */ - private static final String ENABLE_OVERRIDE_LABEL = "Enable user specifc default values. These setting apply to all diagrams (does not affect existing elements)."; //$NON-NLS-1$ - - /** * LineStyle field. */ protected ComboFieldEditor lineStyleFieldEditor = null; @@ -90,7 +86,7 @@ public class DiagramConnectionsPreferencePage extends ConnectionsPreferencePage protected void addFieldEditors(Composite composite) { fieldsParent = composite; // Create the check box to enable or not the override. - enableOverrideFieldEditor = new CheckBoxFieldEditor(SiriusDiagramCorePreferences.PREF_ENABLE_OVERRIDE, ENABLE_OVERRIDE_LABEL, fieldsParent); + enableOverrideFieldEditor = new CheckBoxFieldEditor(SiriusDiagramCorePreferences.PREF_ENABLE_OVERRIDE, Messages.DiagramConnectionsPreferencePage_enableOverrideLabel, fieldsParent); addField(enableOverrideFieldEditor); // The original field of the GMF Connections preference page, is not diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramGeneralPreferencePage.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramGeneralPreferencePage.java index 56ad2c1979..3eba2929e6 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramGeneralPreferencePage.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/preferences/DiagramGeneralPreferencePage.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 @@ -18,6 +18,7 @@ import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.tools.api.preferences.SiriusDiagramPreferencesKeys; import org.eclipse.sirius.diagram.tools.internal.preferences.SiriusDiagramInternalPreferencesKeys; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.preferences.SiriusDiagramUiInternalPreferencesKeys; import org.eclipse.ui.preferences.ScopedPreferenceStore; @@ -52,22 +53,22 @@ public class DiagramGeneralPreferencePage extends DiagramsPreferencePage { protected void createFieldEditors() { super.createFieldEditors(); - autosizeOnArrangeAll = new BooleanFieldEditor(SiriusDiagramUiInternalPreferencesKeys.PREF_AUTOSIZE_ON_ARRANGE.name(), "Auto-size containers during arrange-all action.", + autosizeOnArrangeAll = new BooleanFieldEditor(SiriusDiagramUiInternalPreferencesKeys.PREF_AUTOSIZE_ON_ARRANGE.name(), Messages.DiagramGeneralPreferencePage_arrangeAndAutoSizeContainersLabel, getFieldEditorParent()); addField(autosizeOnArrangeAll); - moveUnlinkedNotesDuringLayout = new BooleanFieldEditor(SiriusDiagramPreferencesKeys.PREF_MOVE_NOTES_DURING_LATOUT.name(), "Move unlinked notes during layout", getFieldEditorParent()); + moveUnlinkedNotesDuringLayout = new BooleanFieldEditor(SiriusDiagramPreferencesKeys.PREF_MOVE_NOTES_DURING_LATOUT.name(), Messages.DiagramGeneralPreferencePage_moveUnlinkedNodeLabel, getFieldEditorParent()); addField(moveUnlinkedNotesDuringLayout); - autoPinOnMove = new BooleanFieldEditor(SiriusDiagramUiInternalPreferencesKeys.PREF_AUTO_PIN_ON_MOVE.name(), "Automatically mark moved elements as pinned", getFieldEditorParent()); + autoPinOnMove = new BooleanFieldEditor(SiriusDiagramUiInternalPreferencesKeys.PREF_AUTO_PIN_ON_MOVE.name(), Messages.DiagramGeneralPreferencePage_pinMovedElementsLabel, getFieldEditorParent()); addField(autoPinOnMove); - synchronizeOnDiagramCreation = new BooleanFieldEditor(SiriusDiagramInternalPreferencesKeys.PREF_SYNCHRONIZE_DIAGRAM_ON_CREATION.name(), "Synchronized mode for new diagrams", + synchronizeOnDiagramCreation = new BooleanFieldEditor(SiriusDiagramInternalPreferencesKeys.PREF_SYNCHRONIZE_DIAGRAM_ON_CREATION.name(), Messages.DiagramGeneralPreferencePage_synchronizedModeLabel, getFieldEditorParent()); addField(synchronizeOnDiagramCreation); removeHideNoteWhenAnnotatedElementRemovedHidden = new BooleanFieldEditor(SiriusDiagramUiInternalPreferencesKeys.PREF_REMOVE_HIDE_NOTE_WHEN_ANNOTED_ELEMENT_HIDDEN_OR_REMOVE.name(), - "Remove/hide note when the annotated element is removed/hidden", getFieldEditorParent()); + Messages.DiagramGeneralPreferencePage_removeHideNoteLabel, getFieldEditorParent()); addField(removeHideNoteWhenAnnotatedElementRemovedHidden); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusMarkerNavigationProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusMarkerNavigationProvider.java index 18f130919d..b58d73a0c4 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusMarkerNavigationProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusMarkerNavigationProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,6 +26,7 @@ import org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNaviga import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorUtil; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.validation.ValidationRule; /** @@ -41,6 +42,7 @@ public class SiriusMarkerNavigationProvider extends AbstractModelMarkerNavigatio /** * @was-generated */ + @Override protected void doGotoMarker(IMarker marker) { String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null); if (elementId == null || !(getEditor() instanceof DiagramEditor)) { @@ -87,7 +89,7 @@ public class SiriusMarkerNavigationProvider extends AbstractModelMarkerNavigatio } marker.setAttribute(IMarker.SEVERITY, markerSeverity); } catch (CoreException e) { - DiagramPlugin.getDefault().logError("Failed to create validation marker", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.SiriusMarkerNavigationProvider_validationMarkerCreationError, e); } return marker; } @@ -111,7 +113,7 @@ public class SiriusMarkerNavigationProvider extends AbstractModelMarkerNavigatio } marker.setAttribute(IMarker.SEVERITY, markerSeverity); } catch (CoreException e) { - DiagramPlugin.getDefault().logError("Failed to create validation marker", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.SiriusMarkerNavigationProvider_validationMarkerCreationError, e); } return marker; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationDecoratorProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationDecoratorProvider.java index 77d9a50595..3f3846ce4c 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationDecoratorProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationDecoratorProvider.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 @@ -52,6 +52,7 @@ import org.eclipse.sirius.diagram.ui.internal.edit.parts.DDiagramEditPart; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; import org.eclipse.sirius.diagram.ui.part.SiriusVisualIDRegistry; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; @@ -79,7 +80,7 @@ public class SiriusValidationDecoratorProvider extends AbstractProvider implemen /** * @was-generated */ - private static Map/* <String, List<IDecorator>> */allDecorators = new HashMap(); + private static Map/* <String, List<IDecorator>> */ allDecorators = new HashMap(); /** * @was-generated @@ -150,7 +151,7 @@ public class SiriusValidationDecoratorProvider extends AbstractProvider implemen } }); } catch (Exception e) { - DiagramPlugin.getDefault().logError("Decorator refresh failure", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.SiriusValidationDecoratorProvider_refreshFailureMsg, e); } } }); @@ -181,7 +182,7 @@ public class SiriusValidationDecoratorProvider extends AbstractProvider implemen } }); } catch (Exception e) { - DiagramPlugin.getDefault().logError("ViewID access failure", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.StatusDecorator_viewIdAccessFailureMsg, e); } } @@ -219,7 +220,7 @@ public class SiriusValidationDecoratorProvider extends AbstractProvider implemen try { markers = resource.findMarkers(MARKER_TYPE, true, IResource.DEPTH_INFINITE); } catch (CoreException e) { - DiagramPlugin.getDefault().logError("Validation markers refresh failure", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.StatusDecorator_validationMarkersFailureMsg, e); } if (markers == null || markers.length == 0) { return; @@ -439,7 +440,7 @@ public class SiriusValidationDecoratorProvider extends AbstractProvider implemen try { return marker.getType(); } catch (CoreException e) { - DiagramPlugin.getDefault().logError("Validation marker refresh failure", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.MarkerObserver_validationMarkerFailureMsg, e); return ""; //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationProvider.java index 702874085d..a191b7948e 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/providers/SiriusValidationProvider.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.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DDiagramEditPart; import org.eclipse.sirius.diagram.ui.part.SiriusVisualIDRegistry; import org.eclipse.sirius.diagram.ui.part.ValidateAction; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * @was-generated @@ -50,6 +51,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { /** * @was-generated */ + @Override protected IAction createAction(String actionId, IWorkbenchPartDescriptor partDescriptor) { if (ValidateAction.VALIDATE_ACTION_KEY.equals(actionId)) { return new ValidateAction(partDescriptor); @@ -64,6 +66,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { final Runnable fop = op; Runnable task = new Runnable() { + @Override public void run() { try { constraintsActive = true; @@ -78,7 +81,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { try { txDomain.runExclusive(task); } catch (Exception e) { - DiagramPlugin.getDefault().logError("Validation action failed", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.SiriusValidationProvider_validationFailed, e); } } else { task.run(); @@ -150,6 +153,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { /** * @was-generated */ + @Override public void elementValidated(EObject element, IStatus status) { defaultStrategy.elementValidated(element, status); } @@ -157,6 +161,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { /** * @was-generated */ + @Override public boolean hasNext() { return defaultStrategy.hasNext(); } @@ -164,6 +169,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { /** * @was-generated */ + @Override public boolean isClientContextChanged() { if (preFetchedNextTarget == null) { preFetchedNextTarget = next(); @@ -175,6 +181,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { /** * @was-generated */ + @Override public EObject next() { EObject nextTarget = preFetchedNextTarget; if (nextTarget == null) { @@ -187,6 +194,7 @@ public class SiriusValidationProvider extends AbstractContributionItemProvider { /** * @was-generated */ + @Override public void startTraversal(Collection traversalRoots, IProgressMonitor monitor) { defaultStrategy.startTraversal(traversalRoots, monitor); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java index b0be38452d..5621195d6d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/quickfix/ValidationFixResolution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 THALES GLOBAL SERVICES. + * 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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.internal.quickfix; +import java.text.MessageFormat; + import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; @@ -25,6 +27,7 @@ import org.eclipse.sirius.business.api.session.SessionManager; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactory; import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactoryProvider; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ui.business.api.dialect.DialectEditor; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -58,17 +61,19 @@ public class ValidationFixResolution implements IMarkerResolution { this.fix = fix; } + @Override public String getLabel() { return fix.getName(); } + @Override public void run(IMarker marker) { IResource airdFile = marker.getResource(); if (airdFile instanceof IFile) { try { tryToOpenEditor(airdFile, marker); } catch (PartInitException e) { - SiriusPlugin.getDefault().error("Can't open editor for " + airdFile, e); + SiriusPlugin.getDefault().error(MessageFormat.format(Messages.ValidationFixResolution_editorOpeningError, airdFile), e); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java index b5e6b0f4c3..2baad97e8f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/GMFHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -51,6 +51,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.query.DNodeQuery; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramElementContainerEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.AbstractDNodeContainerCompartmentEditPart; import org.eclipse.sirius.diagram.ui.internal.refresh.borderednode.CanonicalDBorderItemLocator; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IContainerLabelOffsets; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils; import org.eclipse.sirius.diagram.ui.tools.internal.figure.LabelBorderStyleIds; @@ -643,8 +644,7 @@ public final class GMFHelper { } return result; } - throw new IllegalArgumentException( - "The model of the edgeEditPart should be a org.eclipse.gmf.runtime.notation.Edge and the figure of this edgeEditPart should be a org.eclipse.draw2d.Connection."); + throw new IllegalArgumentException(Messages.GMFHelper_invalidEdgeModelAndFigure); } /** @@ -673,7 +673,6 @@ public final class GMFHelper { } return result; } - throw new IllegalArgumentException( - "The model of the edgeEditPart should be a org.eclipse.gmf.runtime.notation.Edge and the figure of this edgeEditPart should be a org.eclipse.draw2d.Connection."); + throw new IllegalArgumentException(Messages.GMFHelper_invalidEdgeModelAndFigure); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/SynchronizeGMFModelCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/SynchronizeGMFModelCommand.java index f54223dd44..18492e5530 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/SynchronizeGMFModelCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/SynchronizeGMFModelCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.ui.internal.refresh; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.business.api.refresh.CanonicalSynchronizer; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * EMF Command to execute the {@link CanonicalSynchronizer}. @@ -34,7 +35,7 @@ public class SynchronizeGMFModelCommand extends RecordingCommand { * the {@link CanonicalSynchronizer} to execute */ public SynchronizeGMFModelCommand(TransactionalEditingDomain domain, CanonicalSynchronizer canonicalSynchronizer) { - super(domain, "Synchronize GMF Notation Model"); + super(domain, Messages.SynchronizeGMFModelCommand_label); this.canonicalSynchronizer = canonicalSynchronizer; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/ConnectionsFactory.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/ConnectionsFactory.java index 5e8cdeadeb..b5b25e0b74 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/ConnectionsFactory.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/ConnectionsFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.internal.refresh.diagram; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -49,13 +50,14 @@ import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper; import org.eclipse.sirius.diagram.ui.internal.refresh.edge.SlidableAnchor; import org.eclipse.sirius.diagram.ui.part.SiriusLinkDescriptor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.util.GMFNotationUtilities; import org.eclipse.sirius.ext.base.Option; /** * Specific factory for {@link Edge} used by the * {@link DDiagramCanonicalSynchronizer}. - * + * * @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a> */ public class ConnectionsFactory { @@ -87,7 +89,7 @@ public class ConnectionsFactory { /** * Default constructor. - * + * * @param gmfDiagram * the {@link Diagram} on which create {@link Edge}. * @param viewpointViewProvider @@ -101,13 +103,13 @@ public class ConnectionsFactory { /** * Create a {@link Edge} according to information provided in * <code>viewDescriptor</code> and <code>domain2NotationMap</code>. - * + * * @param viewDescriptor * {@link SiriusLinkDescriptor} describing the Edge to create. - * + * * @param domain2NotationMap * map from DDiagramElement to gmf notation view. - * + * * @return the created {@link Edge} */ public Edge createEdge(SiriusLinkDescriptor viewDescriptor, Map<EObject, View> domain2NotationMap) { @@ -168,7 +170,7 @@ public class ConnectionsFactory { createdEdge = edge; } else { - DiagramPlugin.getDefault().logError("GMF Edge not created between source element : " + sourceEdgeTarget + ", and target element : " + targetEdgeTarget); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ConnectionsFactory_edgeNotCreatedMsg, sourceEdgeTarget, targetEdgeTarget)); } } } @@ -178,7 +180,7 @@ public class ConnectionsFactory { /** * As FontStyle.fontHeight default value is 9 and BasicLabelStyle.labelSize * default value is 8 we must synchronize this property. - * + * * @param edge */ // FIXME : as we have begin/center/endLabelStyle we should have a FontStyle @@ -263,7 +265,7 @@ public class ConnectionsFactory { * Only source or target of edge has been moved (or dragged and dropped). * Use the data as is, except for border node that potentially needs * adaptation. - * + * * @param egdeLayoutData * Edge layout data from source (or from target) * @param edge @@ -296,7 +298,7 @@ public class ConnectionsFactory { * We must use a "mix" of the edge layout data from source that contains the * impacted points for the source move and the edge layout data from target * that contains the impacted points for the target move. - * + * * @param egdeLayoutData * Edge layout data from source (or from target) * @param oppositeEgdeLayoutData @@ -393,9 +395,9 @@ public class ConnectionsFactory { } } if (sourceTerminal != null) { - if (sourceTerminal.length() == 0) + if (sourceTerminal.length() == 0) { edge.setSourceAnchor(null); - else { + } else { IdentityAnchor a = (IdentityAnchor) edge.getSourceAnchor(); if (a == null) { a = NotationFactory.eINSTANCE.createIdentityAnchor(); @@ -417,9 +419,9 @@ public class ConnectionsFactory { targetTerminal = "(0.5,0.5)"; //$NON-NLS-1$ } if (targetTerminal != null) { - if (targetTerminal.length() == 0) + if (targetTerminal.length() == 0) { edge.setTargetAnchor(null); - else { + } else { IdentityAnchor a = (IdentityAnchor) edge.getTargetAnchor(); if (a == null) { a = NotationFactory.eINSTANCE.createIdentityAnchor(); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/DDiagramCanonicalSynchronizer.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/DDiagramCanonicalSynchronizer.java index 8238cbe012..b090990bdf 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/DDiagramCanonicalSynchronizer.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/diagram/DDiagramCanonicalSynchronizer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -65,9 +65,9 @@ import com.google.common.collect.Sets; /** * Synchronizer allowing to synchronize a DSemanticDiagram with its * corresponding GMFDiagram. - * + * * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> - * + * * @since 0.9.0 */ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer { @@ -84,7 +84,7 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer /** * Default constructor. - * + * * @param gmfDiagram * the {@link Diagram} to update according to "semantic" * DSemanticDiagram. @@ -96,9 +96,9 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.business.api.refresh.view.refresh.CanonicalSynchronizer#synchronize() */ @Override @@ -187,7 +187,7 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer * createdViewsWithCenterLayout : only the container(s) of all the new * created views must have a center layout. the filtered views must have a * "normal" layout. - * + * * @param createdViewsWithSpecialLayout * @param createdViewsToLayout */ @@ -213,7 +213,7 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer /** * AnnotationEntries contains the GMF diagrams. - * + * * @param view * @param aView * @return if view is contained by aView @@ -228,7 +228,7 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer /** * Remove the adapter marker that reveal an already arranged view. - * + * * @param view * The view to check */ @@ -263,7 +263,8 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer final EObject nextDiagramLinkEContainer = nextDiagramLink.eContainer(); if (diagramLinkObject != null) { final EObject diagramLinkEContainer = diagramLinkObject.eContainer(); - if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null && nextDiagramLink.getSource().eContainer() != null && nextDiagramLink.getTarget().eContainer() != null) { + if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null && nextDiagramLink.getSource().eContainer() != null + && nextDiagramLink.getTarget().eContainer() != null) { final EObject diagramLinkSrc = nextDiagramLink.getSource().getElement(); final EObject diagramLinkDst = nextDiagramLink.getTarget().getElement(); final int diagramLinkVisualID = SiriusVisualIDRegistry.getVisualID(nextDiagramLink); @@ -349,12 +350,12 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer }; while (it.hasNext()) { View child = it.next(); - if (!domain2NotationMap.containsKey(child.getElement())) { //$NON-NLS-1$ + if (!domain2NotationMap.containsKey(child.getElement())) { domain2NotationMap.put(child.getElement(), child); } } for (Edge edge : Iterables.filter(((Diagram) view).getEdges(), Edge.class)) { - if (!domain2NotationMap.containsKey(edge.getElement())) { //$NON-NLS-1$ + if (!domain2NotationMap.containsKey(edge.getElement())) { domain2NotationMap.put(edge.getElement(), edge); } } @@ -387,7 +388,7 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer /** * Collect all Note Attachments. - * + * * @param diagram * the diagram. * @return all note attachments. @@ -407,7 +408,7 @@ public class DDiagramCanonicalSynchronizer extends AbstractCanonicalSynchronizer /** * Collect all Line (GMF figure). - * + * * @param diagram * the diagram. * @return all lines. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/layout/SiriusCanonicalLayoutCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/layout/SiriusCanonicalLayoutCommand.java index 5133f3b59a..54093fc033 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/layout/SiriusCanonicalLayoutCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/layout/SiriusCanonicalLayoutCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -19,6 +19,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.swt.widgets.Display; /** @@ -32,8 +33,6 @@ import org.eclipse.swt.widgets.Display; */ public class SiriusCanonicalLayoutCommand extends RecordingCommand implements NonDirtying { - private static final String ARRANGE_CREATED_VIEWS_CMD_LABEL = "Arrange Created views"; - private IGraphicalEditPart diagramEditPart; private List<IAdaptable> childViewsAdapters; @@ -70,7 +69,7 @@ public class SiriusCanonicalLayoutCommand extends RecordingCommand implements No * list of {@link IAdaptable} for created Views to center layout */ public SiriusCanonicalLayoutCommand(TransactionalEditingDomain domain, IGraphicalEditPart parentEditPart, List<IAdaptable> childViewsAdapters, List<IAdaptable> childViewsAdaptersForCenterLayout) { - super(domain, ARRANGE_CREATED_VIEWS_CMD_LABEL); + super(domain, Messages.SiriusCanonicalLayoutCommand_label); this.diagramEditPart = parentEditPart; this.childViewsAdapters = childViewsAdapters; this.childViewsAdaptersForCenterLayout = childViewsAdaptersForCenterLayout; @@ -83,6 +82,7 @@ public class SiriusCanonicalLayoutCommand extends RecordingCommand implements No protected void doExecute() { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (childViewsAdapters == null && childViewsAdaptersForCenterLayout == null) { executeLayoutOnDiagramOpening(); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/GMFBoundsUpdater.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/GMFBoundsUpdater.java index e0b4872cee..aa8624a12a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/GMFBoundsUpdater.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/GMFBoundsUpdater.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 THALES GLOBAL SERVICES. + * 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 @@ -37,6 +37,7 @@ import org.eclipse.sirius.diagram.description.style.NodeStyleDescription; import org.eclipse.sirius.diagram.description.style.WorkspaceImageDescription; import org.eclipse.sirius.diagram.ui.business.api.view.SiriusGMFHelper; import org.eclipse.sirius.diagram.ui.business.internal.query.WorkspaceImageQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils; /** @@ -150,7 +151,7 @@ public class GMFBoundsUpdater extends ResourceSetListenerImpl { * elements which visibility needs to be refreshed */ public ResizeImageCommand(TransactionalEditingDomain domain, DDiagram diagram, Collection<DDiagramElement> elementsToResize) { - super(domain, "Update visibility"); + super(domain, Messages.ResizeImageCommand_label); this.diagram = diagram; this.elementsToResize = elementsToResize; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/NotationVisibilityUpdater.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/NotationVisibilityUpdater.java index 65f4fa5752..6649cc86b1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/NotationVisibilityUpdater.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/NotationVisibilityUpdater.java @@ -43,6 +43,7 @@ import org.eclipse.sirius.diagram.HideLabelFilter; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.business.api.query.ViewQuery; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.util.GMFNotationHelper; import org.eclipse.sirius.diagram.ui.tools.internal.preferences.SiriusDiagramUiInternalPreferencesKeys; @@ -278,7 +279,7 @@ public class NotationVisibilityUpdater extends ResourceSetListenerImpl { private final Map<View, Boolean> viewsToUpdate; public VisibilityUpdateCommand(TransactionalEditingDomain domain, Map<View, Boolean> viewsToUpdate) { - super(domain, "Update view visibility"); + super(domain, Messages.VisibilityUpdateCommand_label); this.viewsToUpdate = viewsToUpdate; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/VisibilityUpdater.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/VisibilityUpdater.java index 8e08334da4..4460cd7b6b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/VisibilityUpdater.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/listeners/VisibilityUpdater.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 @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.GraphicalFilter; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManager; import org.eclipse.sirius.diagram.business.api.componentization.DiagramMappingsManagerRegistry; import org.eclipse.sirius.diagram.business.api.helper.display.DisplayServiceManager; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.properties.PropertiesService; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; import org.eclipse.sirius.tools.api.ui.property.IPropertiesProvider; @@ -168,7 +169,7 @@ public class VisibilityUpdater extends ResourceSetListenerImpl { * elements which visibility needs to be refreshed */ public UpdateVisibilityCommand(TransactionalEditingDomain domain, DDiagram diagram, Collection<DDiagramElement> elementsToRefresh) { - super(domain, "Update visibility"); + super(domain, Messages.UpdateVisibilityCommand_label); this.diagram = diagram; this.elementsToRefresh = elementsToRefresh; } @@ -199,6 +200,7 @@ public class VisibilityUpdater extends ResourceSetListenerImpl { /** * {@inheritDoc} */ + @Override public void receive(int kind, int notification) { switch (notification) { case org.eclipse.sirius.common.tools.api.listener.Notification.VISIBILITY_UPDATE: @@ -222,6 +224,7 @@ public class VisibilityUpdater extends ResourceSetListenerImpl { } } + @Override public Notifier getTarget() { return target; } @@ -229,6 +232,7 @@ public class VisibilityUpdater extends ResourceSetListenerImpl { /** * {@inheritDoc} */ + @Override public boolean isAdapterForType(Object type) { return type instanceof DDiagram; } @@ -236,11 +240,13 @@ public class VisibilityUpdater extends ResourceSetListenerImpl { /** * {@inheritDoc} */ + @Override public void notifyChanged(Notification notification) { // do nothing } + @Override public void setTarget(Notifier newTarget) { target = newTarget; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramActionBarContributor.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramActionBarContributor.java index dc91f3b7c0..233807f970 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramActionBarContributor.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramActionBarContributor.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 @@ -22,6 +22,7 @@ import org.eclipse.jface.action.IContributionItem; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.Separator; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.action.ConcernComboContributionItem; import org.eclipse.sirius.diagram.ui.tools.api.action.SiriusActionBarActionContributionItem; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; @@ -55,6 +56,7 @@ public class SiriusDiagramActionBarContributor extends DiagramActionBarContribut /** * @was-generated */ + @Override protected Class<?> getEditorClass() { return SiriusDiagramEditor.class; } @@ -62,41 +64,42 @@ public class SiriusDiagramActionBarContributor extends DiagramActionBarContribut /** * Action id for the "Launch behavior" */ - public static final String LAUNCH_BEHAVIOR = "Launch behavior"; + public static final String LAUNCH_BEHAVIOR = Messages.SiriusDiagramActionBarContributor_launchBehavior; /** * Action id for the "Refresh DDiagram" */ - public static final String REFRESH_DIAGRAM = "Refresh diagram"; + public static final String REFRESH_DIAGRAM = Messages.SiriusDiagramActionBarContributor_refreshDiagram; /** * Action id for the "Hide element" */ - public static final String HIDE_ELEMENT = "Hide element"; + public static final String HIDE_ELEMENT = Messages.SiriusDiagramActionBarContributor_hideElement; /** * Action id for the "Hide label" */ - public static final String HIDE_LABEL = "Hide label"; + public static final String HIDE_LABEL = Messages.SiriusDiagramActionBarContributor_hideLabel; /** * Action id for the "Reveal elements" */ - public static final String REVEAL_ELEMENTS = "Reveal elements"; + public static final String REVEAL_ELEMENTS = Messages.SiriusDiagramActionBarContributor_revealElement; /** * Action tooltip text for the "Delete from Diagram" */ - public static final String DELETE_FROM_DIAGRAM = "Delete from Diagram"; + public static final String DELETE_FROM_DIAGRAM = Messages.SiriusDiagramActionBarContributor_deleteFromDiagram; /** * Action tooltip text for the "Delete from Diagram" */ - public static final String DELETE_FROM_MODEL = "Delete from Model"; + public static final String DELETE_FROM_MODEL = Messages.SiriusDiagramActionBarContributor_deleteFromModel; /** * @was-generated */ + @Override protected String getEditorId() { return DDiagramEditor.EDITOR_ID; } @@ -107,6 +110,7 @@ public class SiriusDiagramActionBarContributor extends DiagramActionBarContribut * @was-generated NOT * @see org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor#buildActions() */ + @Override protected void buildActions() { super.buildActions(); final RetargetAction action = new LaunchBehaviorToolAction(LAUNCH_BEHAVIOR, DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.GO_IMG)); @@ -153,6 +157,7 @@ public class SiriusDiagramActionBarContributor extends DiagramActionBarContribut * * @was-generated NOT */ + @Override public void contributeToToolBar(final IToolBarManager toolBarManager) { super.contributeToToolBar(toolBarManager); if (isOldUIEnabled()) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditorUtil.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditorUtil.java index ba82e920fb..003e7e43ee 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditorUtil.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusDiagramEditorUtil.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 @@ -11,6 +11,7 @@ package org.eclipse.sirius.diagram.ui.part; import java.io.IOException; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -101,7 +102,7 @@ public class SiriusDiagramEditorUtil { try { file.setCharset("UTF-8", new NullProgressMonitor()); //$NON-NLS-1$ } catch (CoreException e) { - DiagramPlugin.getDefault().logError("Unable to set charset for file " + file.getFullPath(), e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusDiagramEditorUtil_charsetError, file.getFullPath()), e); } } @@ -113,7 +114,7 @@ public class SiriusDiagramEditorUtil { containerFullPath = new Path(""); //$NON-NLS-1$ } if (fileName == null || fileName.trim().length() == 0) { - fileName = "default"; //$NON-NLS-1$ + fileName = org.eclipse.sirius.diagram.ui.provider.Messages.SiriusDiagramEditorUtil_defaultFileName; } IPath filePath = containerFullPath.append(fileName); if (extension != null && !extension.equals(filePath.getFileExtension())) { @@ -181,7 +182,7 @@ public class SiriusDiagramEditorUtil { diagramResource.save(org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorUtil.getSaveOptions()); } catch (IOException e) { - DiagramPlugin.getDefault().logError("Unable to store model and diagram resources", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusDiagramEditorUtil_modelAndDiagramResourceSaveError, e); } return CommandResult.newOKCommandResult(); } @@ -189,7 +190,7 @@ public class SiriusDiagramEditorUtil { try { OperationHistoryFactory.getOperationHistory().execute(command, new SubProgressMonitor(progressMonitor, 1), null); } catch (ExecutionException e) { - DiagramPlugin.getDefault().logError("Unable to create model and diagram", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusDiagramEditorUtil_modelAndDiagramCreationError, e); } setCharset(WorkspaceSynchronizer.getFile(modelResource)); setCharset(WorkspaceSynchronizer.getFile(diagramResource)); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusInitDiagramFileAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusInitDiagramFileAction.java index de5e128808..c8906e32ef 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusInitDiagramFileAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusInitDiagramFileAction.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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.part; +import java.text.MessageFormat; + import org.eclipse.core.resources.IFile; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.common.util.WrappedException; @@ -49,6 +51,7 @@ public class SiriusInitDiagramFileAction implements IObjectActionDelegate { /** * @was-generated */ + @Override public void setActivePart(IAction action, IWorkbenchPart targetPart) { this.targetPart = targetPart; } @@ -56,6 +59,7 @@ public class SiriusInitDiagramFileAction implements IObjectActionDelegate { /** * @was-generated */ + @Override public void selectionChanged(IAction action, ISelection selection) { domainModelURI = null; action.setEnabled(false); @@ -77,6 +81,7 @@ public class SiriusInitDiagramFileAction implements IObjectActionDelegate { /** * @was-generated */ + @Override public void run(IAction action) { final ResourceSet set = ResourceSetFactory.createFactory().createResourceSet(domainModelURI); TransactionalEditingDomain editingDomain = GMFEditingDomainFactory.INSTANCE.createEditingDomain(set); @@ -85,7 +90,7 @@ public class SiriusInitDiagramFileAction implements IObjectActionDelegate { Resource resource = set.getResource(domainModelURI, true); diagramRoot = resource.getContents().get(0); } catch (WrappedException ex) { - DiagramPlugin.getDefault().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusInitDiagramFileAction_loadResourceError, domainModelURI), ex); } if (diagramRoot == null) { MessageDialog.openError(getShell(), Messages.SiriusInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle, diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusNewDiagramFileWizard.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusNewDiagramFileWizard.java index d3e040afc8..e77a231ea6 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusNewDiagramFileWizard.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusNewDiagramFileWizard.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 @@ -11,6 +11,7 @@ package org.eclipse.sirius.diagram.ui.part; import java.io.IOException; +import java.text.MessageFormat; import java.util.LinkedList; import java.util.List; @@ -66,9 +67,9 @@ public class SiriusNewDiagramFileWizard extends Wizard { * @was-generated */ public SiriusNewDiagramFileWizard(URI domainModelURI, EObject diagramRoot, TransactionalEditingDomain editingDomain) { - assert domainModelURI != null : "Domain model uri must be specified"; //$NON-NLS-1$ - assert diagramRoot != null : "Doagram root element must be specified"; //$NON-NLS-1$ - assert editingDomain != null : "Editing domain must be specified"; //$NON-NLS-1$ + assert domainModelURI != null : org.eclipse.sirius.diagram.ui.provider.Messages.SiriusNewDiagramFileWizard_invalidDomainModelURI; + assert diagramRoot != null : org.eclipse.sirius.diagram.ui.provider.Messages.SiriusNewDiagramFileWizard_invalidDiagramRootElement; + assert editingDomain != null : org.eclipse.sirius.diagram.ui.provider.Messages.SiriusNewDiagramFileWizard_invalidEditingDomain; myFileCreationPage = new WizardNewFileCreationPage(Messages.SiriusNewDiagramFileWizard_CreationPageName, StructuredSelection.EMPTY); myFileCreationPage.setTitle(Messages.SiriusNewDiagramFileWizard_CreationPageTitle); @@ -81,7 +82,7 @@ public class SiriusNewDiagramFileWizard extends Wizard { filePath = new Path(domainModelURI.trimSegments(1).toFileString()); } else { // TODO : use some default path - throw new IllegalArgumentException("Unsupported URI: " + domainModelURI); //$NON-NLS-1$ + throw new IllegalArgumentException(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusNewDiagramFileWizard_unsupportedURI, domainModelURI)); } myFileCreationPage.setContainerFullPath(filePath); myFileCreationPage.setFileName(SiriusDiagramEditorUtil.getUniqueFileName(filePath, fileName, "airview")); //$NON-NLS-1$ @@ -97,6 +98,7 @@ public class SiriusNewDiagramFileWizard extends Wizard { /** * @was-generated */ + @Override public void addPages() { addPage(myFileCreationPage); addPage(diagramRootElementSelectionPage); @@ -105,6 +107,7 @@ public class SiriusNewDiagramFileWizard extends Wizard { /** * @was-generated */ + @Override public boolean performFinish() { List affectedFiles = new LinkedList(); IFile diagramFile = myFileCreationPage.createNewFile(); @@ -115,6 +118,7 @@ public class SiriusNewDiagramFileWizard extends Wizard { final Resource diagramResource = resourceSet.createResource(diagramModelURI); AbstractTransactionalCommand command = new AbstractTransactionalCommand(myEditingDomain, Messages.SiriusNewDiagramFileWizard_InitDiagramCommand, affectedFiles) { + @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { int diagramVID = SiriusVisualIDRegistry.getDiagramVisualID(diagramRootElementSelectionPage.getModelElement()); if (diagramVID != DDiagramEditPart.VISUAL_ID) { @@ -130,11 +134,11 @@ public class SiriusNewDiagramFileWizard extends Wizard { diagramResource.save(SiriusDiagramEditorUtil.getSaveOptions()); SiriusDiagramEditorUtil.openDiagram(diagramResource); } catch (ExecutionException e) { - DiagramPlugin.getDefault().logError("Unable to create model and diagram", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusNewDiagramFileWizard_errorDuringCreation, e); } catch (IOException ex) { - DiagramPlugin.getDefault().logError("Save operation failed for: " + diagramModelURI, ex); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusNewDiagramFileWizard_saveFailed, diagramModelURI), ex); } catch (PartInitException ex) { - DiagramPlugin.getDefault().logError("Unable to open editor", ex); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(org.eclipse.sirius.diagram.ui.provider.Messages.SiriusNewDiagramFileWizard_errorDuringOpening, ex); } return true; } @@ -154,6 +158,7 @@ public class SiriusNewDiagramFileWizard extends Wizard { /** * @was-generated */ + @Override protected String getSelectionTitle() { return Messages.SiriusNewDiagramFileWizard_RootSelectionPageSelectionTitle; } @@ -161,13 +166,14 @@ public class SiriusNewDiagramFileWizard extends Wizard { /** * @was-generated */ + @Override protected boolean validatePage() { if (selectedModelElement == null) { setErrorMessage(Messages.SiriusNewDiagramFileWizard_RootSelectionPageNoSelectionMessage); return false; } - boolean result = ViewService.getInstance().provides( - new CreateDiagramViewOperation(new EObjectAdapter(selectedModelElement), DDiagramEditPart.MODEL_ID, DiagramUIPlugin.DIAGRAM_PREFERENCES_HINT)); + boolean result = ViewService.getInstance() + .provides(new CreateDiagramViewOperation(new EObjectAdapter(selectedModelElement), DDiagramEditPart.MODEL_ID, DiagramUIPlugin.DIAGRAM_PREFERENCES_HINT)); setErrorMessage(result ? null : Messages.SiriusNewDiagramFileWizard_RootSelectionPageInvalidSelectionMessage); return result; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusVisualIDRegistry.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusVisualIDRegistry.java index fbbb4539a3..cf25105e96 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusVisualIDRegistry.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/SiriusVisualIDRegistry.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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.part; +import java.text.MessageFormat; + import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EAnnotation; import org.eclipse.emf.ecore.EObject; @@ -54,6 +56,7 @@ import org.eclipse.sirius.diagram.ui.internal.edit.parts.NoteEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.SquareEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.WorkspaceImageEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.Style; /** @@ -107,7 +110,7 @@ public class SiriusVisualIDRegistry { return Integer.parseInt(type); } catch (NumberFormatException e) { if (Boolean.TRUE.toString().equalsIgnoreCase(Platform.getDebugOption(DEBUG_KEY))) { - DiagramPlugin.getDefault().logError("Unable to parse view type as a visualID number: " + type); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.SiriusVisualIDRegistry_parseError, type)); } } return -1; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/ValidateAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/ValidateAction.java index 7101b451fc..a421bbe505 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/ValidateAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/part/ValidateAction.java @@ -109,7 +109,7 @@ public class ValidateAction extends Action { } }).run(new NullProgressMonitor()); } catch (Exception e) { - DiagramPlugin.getDefault().logError("Validation action failed", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(org.eclipse.sirius.diagram.ui.provider.Messages.ValidateAction_failureMessage, e); } } } @@ -128,7 +128,7 @@ public class ValidateAction extends Action { } } } catch (Exception e) { - DiagramPlugin.getDefault().logError("Validation action failed", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(org.eclipse.sirius.diagram.ui.provider.Messages.ValidateAction_failureMessage, e); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/ConcernComboContributionItem.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/ConcernComboContributionItem.java index e1b0c74d1a..4c4546cc13 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/ConcernComboContributionItem.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/ConcernComboContributionItem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 THALES GLOBAL SERVICES. + * 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 @@ -24,6 +24,7 @@ import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.description.concern.ConcernDescription; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.commands.SetCurrentConcernCommand; import org.eclipse.sirius.diagram.ui.tools.internal.commands.SetDefaultConcernCommand; @@ -47,7 +48,7 @@ import org.eclipse.ui.IWorkbenchPart; /** * A ControlContribution that uses a {@link org.eclipse.swt.widgets.Combo} as * its control. - * + * * @author ymortier */ public class ConcernComboContributionItem extends ContributionItem { @@ -77,7 +78,7 @@ public class ConcernComboContributionItem extends ContributionItem { /** * Constructor for ComboToolItem. - * + * * @param partService * used to add a PartListener * @param initString @@ -89,7 +90,7 @@ public class ConcernComboContributionItem extends ContributionItem { /** * Constructor for ComboToolItem. - * + * * @param partService * used to add a PartListener * @param initStrings @@ -100,6 +101,7 @@ public class ConcernComboContributionItem extends ContributionItem { this.initStrings = initStrings; service = partService; partListener = new IPartListener() { + @Override public void partActivated(final IWorkbenchPart part) { if (part instanceof DDiagramEditor) { @@ -110,15 +112,19 @@ public class ConcernComboContributionItem extends ContributionItem { } } + @Override public void partBroughtToTop(final IWorkbenchPart p) { } + @Override public void partClosed(final IWorkbenchPart p) { } + @Override public void partDeactivated(final IWorkbenchPart p) { } + @Override public void partOpened(final IWorkbenchPart p) { } }; @@ -127,7 +133,7 @@ public class ConcernComboContributionItem extends ContributionItem { /** * Get the current diagram. - * + * * @return current diagram */ public DDiagram getDiagram() { @@ -137,6 +143,7 @@ public class ConcernComboContributionItem extends ContributionItem { private void diagramChanged() { if (Display.getCurrent() == null) { EclipseUIUtil.displayAsyncExec(new Runnable() { + @Override public void run() { refresh(false); } @@ -195,7 +202,7 @@ public class ConcernComboContributionItem extends ContributionItem { /** * Computes the width required by control. - * + * * @param control * The control to compute width * @return int The width required @@ -207,7 +214,7 @@ public class ConcernComboContributionItem extends ContributionItem { /** * Creates and returns the control for this contribution item under the * given parent composite. - * + * * @param parent * the parent composite * @return the new control @@ -215,19 +222,23 @@ public class ConcernComboContributionItem extends ContributionItem { protected Control createControl(final Composite parent) { combo = new Combo(parent, SWT.DROP_DOWN); combo.addSelectionListener(new SelectionListener() { + @Override public void widgetSelected(final SelectionEvent e) { handleWidgetSelected(e); } + @Override public void widgetDefaultSelected(final SelectionEvent e) { handleWidgetDefaultSelected(e); } }); combo.addFocusListener(new FocusListener() { + @Override public void focusGained(final FocusEvent e) { // do nothing } + @Override public void focusLost(final FocusEvent e) { refresh(false); } @@ -236,14 +247,14 @@ public class ConcernComboContributionItem extends ContributionItem { // Initialize width of combo combo.setItems(initStrings); toolitem.setWidth(computeWidth(combo)); - combo.setToolTipText("Current concern"); + combo.setToolTipText(Messages.ConcernComboContributionItem_tooltip); refresh(true); return combo; } /** * {@inheritDoc} - * + * * @see org.eclipse.jface.action.ContributionItem#dispose() */ @Override @@ -264,7 +275,7 @@ public class ConcernComboContributionItem extends ContributionItem { * method calls the <code>createControl</code> framework method. Subclasses * must implement <code>createControl</code> rather than overriding this * method. - * + * * @param parent * The parent of the control to fill */ @@ -276,7 +287,7 @@ public class ConcernComboContributionItem extends ContributionItem { /** * The control item implementation of this <code>IContributionItem</code> * method throws an exception since controls cannot be added to menus. - * + * * @param parent * The menu * @param index @@ -292,7 +303,7 @@ public class ConcernComboContributionItem extends ContributionItem { * control under the given parent, and then creates a new tool item to hold * it. Subclasses must implement <code>createControl</code> rather than * overriding this method. - * + * * @param parent * The ToolBar to add the new control to * @param index @@ -307,7 +318,7 @@ public class ConcernComboContributionItem extends ContributionItem { /** * Sets the DDiagram. - * + * * @param dia * The diagram */ diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/LaunchBehaviorContributionItem.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/LaunchBehaviorContributionItem.java index b4b50ed7a2..6a2ba1ce53 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/LaunchBehaviorContributionItem.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/action/LaunchBehaviorContributionItem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 THALES GLOBAL SERVICES. + * 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 @@ -20,6 +20,7 @@ import org.eclipse.gmf.runtime.diagram.ui.render.editparts.RenderedDiagramRootEd import org.eclipse.jface.action.ContributionItem; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.requests.RequestConstants; import org.eclipse.swt.SWT; @@ -38,7 +39,7 @@ import org.eclipse.ui.IWorkbenchPart; /** * Add a button to launch all behaviors. - * + * * @author ymortier */ public class LaunchBehaviorContributionItem extends ContributionItem { @@ -60,7 +61,7 @@ public class LaunchBehaviorContributionItem extends ContributionItem { /** * Constructor for ComboToolItem. - * + * * @param partService * used to add a PartListener */ @@ -69,6 +70,7 @@ public class LaunchBehaviorContributionItem extends ContributionItem { service = partService; Assert.isNotNull(partService); partListener = new IPartListener() { + @Override public void partActivated(final IWorkbenchPart part) { final EditPart editPArt = (EditPart) part.getAdapter(EditPart.class); if (editPArt instanceof RenderedDiagramRootEditPart) { @@ -84,15 +86,19 @@ public class LaunchBehaviorContributionItem extends ContributionItem { } + @Override public void partBroughtToTop(final IWorkbenchPart p) { } + @Override public void partClosed(final IWorkbenchPart p) { } + @Override public void partDeactivated(final IWorkbenchPart p) { } + @Override public void partOpened(final IWorkbenchPart p) { } }; @@ -102,14 +108,14 @@ public class LaunchBehaviorContributionItem extends ContributionItem { /** * Creates and returns the control for this contribution item under the * given parent composite. - * + * * @param parent * the parent composite * @return the new control */ protected Control createControl(final Composite parent) { button = new Button(parent, SWT.PUSH); - button.setText("Launch Behavior"); + button.setText(Messages.LaunchBehaviorContributionItem_launchBehaviorButtonLabel); button.setSize(30, 20); button.addSelectionListener(new SelectionAdapter() { @Override @@ -126,7 +132,7 @@ public class LaunchBehaviorContributionItem extends ContributionItem { /** * {@inheritDoc} - * + * * @see org.eclipse.jface.action.ContributionItem#dispose() */ @Override @@ -149,7 +155,7 @@ public class LaunchBehaviorContributionItem extends ContributionItem { * method calls the <code>createControl</code> framework method. Subclasses * must implement <code>createControl</code> rather than overriding this * method. - * + * * @param parent * The parent of the control to fill */ @@ -161,7 +167,7 @@ public class LaunchBehaviorContributionItem extends ContributionItem { /** * The control item implementation of this <code>IContributionItem</code> * method throws an exception since controls cannot be added to menus. - * + * * @param parent * The menu * @param index @@ -178,7 +184,7 @@ public class LaunchBehaviorContributionItem extends ContributionItem { * control under the given parent, and then creates a new tool item to hold * it. Subclasses must implement <code>createControl</code> rather than * overriding this method. - * + * * @param parent * The ToolBar to add the new control to * @param index diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/command/GMFCommandWrapper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/command/GMFCommandWrapper.java index b1ffe23e3e..66bd9cbcd2 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/command/GMFCommandWrapper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/command/GMFCommandWrapper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -17,6 +17,7 @@ import org.eclipse.emf.common.command.Command; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Wrap an EMF command into a GMF command. @@ -44,12 +45,12 @@ public class GMFCommandWrapper extends AbstractTransactionalCommand { * the EMF command. */ public GMFCommandWrapper(final TransactionalEditingDomain domain, final Command emfCommand) { - super(domain, "GMF Command Wrapper", null); + super(domain, Messages.GMFCommandWrapper_label, null); if (emfCommand == null) { - throw new IllegalArgumentException("the command is null"); + throw new IllegalArgumentException(Messages.GMFCommandWrapper_nullCommand); } if (domain == null) { - throw new IllegalArgumentException("the domain is null"); + throw new IllegalArgumentException(Messages.GMFCommandWrapper_nullDomain); } /* Set the right label */ diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/SVGFigure.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/SVGFigure.java index 43a61cf689..be255b9891 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/SVGFigure.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/SVGFigure.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2008 Borland Software Corporation + * Copyright (c) 2008, 2015 Borland Software 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 @@ -31,6 +31,7 @@ import org.eclipse.draw2d.Figure; import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.sirius.diagram.DiagramPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.figure.svg.InferringNamespaceContext; import org.eclipse.sirius.diagram.ui.tools.internal.figure.svg.SVGUtils; import org.eclipse.sirius.diagram.ui.tools.internal.figure.svg.SimpleImageTranscoder; @@ -110,11 +111,11 @@ public class SVGFigure extends Figure { try { return factory.createDocument(uri); } catch (IOException e) { - boolean saxParserNotFound = e.getMessage() != null && e.getMessage().contains("SAX2 driver class org.apache.xerces.parsers.SAXParser not found"); + boolean saxParserNotFound = e.getMessage() != null && e.getMessage().contains("SAX2 driver class org.apache.xerces.parsers.SAXParser not found"); //$NON-NLS-1$ if (!forceClassLoader && saxParserNotFound && Thread.currentThread().getContextClassLoader() == null) { return createDocument(factory, true); } else { - DiagramPlugin.getDefault().logError("Error loading SVG file", e); + DiagramPlugin.getDefault().logError(Messages.SVGFigure_loadError, e); } } finally { if (forceClassLoader) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/IBorderItemLocatorWrapper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/IBorderItemLocatorWrapper.java index b1e74d9f5e..de5e6a6c5d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/IBorderItemLocatorWrapper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/IBorderItemLocatorWrapper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES. + * 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gmf.runtime.diagram.ui.figures.IBorderItemLocator; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This class wraps an @@ -39,7 +40,7 @@ public class IBorderItemLocatorWrapper implements IBorderItemLocator { */ public IBorderItemLocatorWrapper(final org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator locator) throws IllegalArgumentException { if (locator == null) { - throw new IllegalArgumentException("The locator is null"); + throw new IllegalArgumentException(Messages.IBorderItemLocatorWrapper_nullLocator); } this.wrappedLocator = locator; } @@ -49,6 +50,7 @@ public class IBorderItemLocatorWrapper implements IBorderItemLocator { * * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getCurrentSideOfParent() */ + @Override public int getCurrentSideOfParent() { return this.wrappedLocator.getCurrentSideOfParent(); } @@ -59,6 +61,7 @@ public class IBorderItemLocatorWrapper implements IBorderItemLocator { * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#getValidLocation(org.eclipse.draw2d.geometry.Rectangle, * org.eclipse.draw2d.IFigure) */ + @Override public Rectangle getValidLocation(final Rectangle proposedLocation, final IFigure borderItem) { return this.wrappedLocator.getValidLocation(proposedLocation, borderItem); } @@ -68,6 +71,7 @@ public class IBorderItemLocatorWrapper implements IBorderItemLocator { * * @see org.eclipse.gmf.runtime.draw2d.ui.figures.IBorderItemLocator#setConstraint(org.eclipse.draw2d.geometry.Rectangle) */ + @Override public void setConstraint(final Rectangle constraint) { this.wrappedLocator.setConstraint(constraint); } @@ -77,6 +81,7 @@ public class IBorderItemLocatorWrapper implements IBorderItemLocator { * * @see org.eclipse.draw2d.Locator#relocate(org.eclipse.draw2d.IFigure) */ + @Override public void relocate(final IFigure target) { this.wrappedLocator.relocate(target); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SafeStyleConfiguration.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SafeStyleConfiguration.java index dcba344dd4..9bf8030ccf 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SafeStyleConfiguration.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SafeStyleConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles; +import java.text.MessageFormat; + import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; @@ -19,13 +21,14 @@ import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DNode; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.ui.business.internal.query.StyleConfigurationQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; import org.eclipse.sirius.diagram.ui.tools.api.figure.anchor.AnchorProvider; import org.eclipse.swt.graphics.Image; /** * A safe style configuration to preserve the integrity of designer. - * + * * @author ymortier */ public class SafeStyleConfiguration implements StyleConfiguration { @@ -38,7 +41,7 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * Creates a new {@link SafeStyleConfiguration}. - * + * * @param delegated * the delegated configuration. */ @@ -50,10 +53,11 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#adaptNodeLabel(org.eclipse.sirius.viewpoint.DNode, * org.eclipse.sirius.common.ui.tools.api.draw2d.ui.figures.SiriusWrapLabel) */ + @Override public void adaptNodeLabel(final DNode node, final SiriusWrapLabel nodeLabel) { try { this.delegated.adaptNodeLabel(node, nodeLabel); @@ -65,11 +69,12 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#adaptViewNodeSizeWithLabel(org.eclipse.sirius.viewpoint.DNode, * org.eclipse.sirius.common.ui.tools.api.draw2d.ui.figures.SiriusWrapLabel, * int) */ + @Override public int adaptViewNodeSizeWithLabel(final DNode viewNode, final SiriusWrapLabel nodeLabel, final int nodeWidth) { try { return this.delegated.adaptViewNodeSizeWithLabel(viewNode, nodeLabel, nodeWidth); @@ -81,11 +86,12 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#fitToText(org.eclipse.sirius.viewpoint.DNode, * org.eclipse.sirius.common.ui.tools.api.draw2d.ui.figures.SiriusWrapLabel, * org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure) */ + @Override public Dimension fitToText(DNode node, SiriusWrapLabel nodeLabel, DefaultSizeNodeFigure defaultSizeNodeFigure) { try { return this.delegated.fitToText(node, nodeLabel, defaultSizeNodeFigure); @@ -97,9 +103,10 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getAnchorProvider() */ + @Override public AnchorProvider getAnchorProvider() { try { return this.delegated.getAnchorProvider(); @@ -111,9 +118,10 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getBorderItemLocatorProvider() */ + @Override public BorderItemLocatorProvider getBorderItemLocatorProvider() { try { return this.delegated.getBorderItemLocatorProvider(); @@ -125,10 +133,11 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getLabelIcon(DDiagramElement, * IGraphicalEditPart) */ + @Override public Image getLabelIcon(DDiagramElement vpElement, IGraphicalEditPart editPart) { try { return new StyleConfigurationQuery(this.delegated).getLabelIcon(vpElement, editPart); @@ -140,10 +149,11 @@ public class SafeStyleConfiguration implements StyleConfiguration { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getNameBorderItemLocator(DNode, * IFigure) */ + @Override public IBorderItemLocator getNameBorderItemLocator(DNode node, IFigure mainFigure) { try { return this.delegated.getNameBorderItemLocator(node, mainFigure); @@ -157,7 +167,7 @@ public class SafeStyleConfiguration implements StyleConfiguration { // CHECKSTYLE:ON private void log(final Exception e) { - DiagramPlugin.getDefault().logError("Error while invoking custom style configuration : " + this.delegated.getClass().getName(), e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.SafeStyleConfiguration_customStyleInvocationError, this.delegated.getClass().getName()), e); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SimpleStyleConfiguration.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SimpleStyleConfiguration.java index 229ff3785d..a315813a07 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SimpleStyleConfiguration.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/graphical/edit/styles/SimpleStyleConfiguration.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -12,6 +12,7 @@ package org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles; import java.io.File; import java.net.MalformedURLException; +import java.text.MessageFormat; import org.eclipse.core.runtime.Path; import org.eclipse.draw2d.FigureUtilities; @@ -40,6 +41,7 @@ import org.eclipse.sirius.diagram.ui.internal.edit.parts.DEdgeBeginNameEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DEdgeEndNameEditPart; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DEdgeNameEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.GaugeCompositeFigure; import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; import org.eclipse.sirius.diagram.ui.tools.api.figure.anchor.AnchorProvider; @@ -62,6 +64,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#adaptNodeLabel(org.eclipse.sirius.viewpoint.DNode, * org.eclipse.sirius.common.ui.tools.api.draw2d.ui.figures.SiriusWrapLabel) */ + @Override public void adaptNodeLabel(final DNode node, final SiriusWrapLabel nodeLabel) { if (nodeLabel.getParent() != null) { final Rectangle constraint = new Rectangle(nodeLabel.getParent().getBounds()); @@ -87,6 +90,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { * org.eclipse.sirius.common.ui.tools.api.draw2d.ui.figures.SiriusWrapLabel, * int) */ + @Override public int adaptViewNodeSizeWithLabel(final DNode viewNode, final SiriusWrapLabel nodeLabel, final int nodeWidth) { if (viewNode.getResizeKind() != ResizeKind.NONE_LITERAL) { // empty @@ -99,6 +103,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getAnchorProvider() */ + @Override public AnchorProvider getAnchorProvider() { return null; } @@ -108,6 +113,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getBorderItemLocatorProvider() */ + @Override public BorderItemLocatorProvider getBorderItemLocatorProvider() { return DefaultBorderItemLocatorProvider.getInstance(); } @@ -118,6 +124,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getNameBorderItemLocator(org.eclipse.sirius.viewpoint.DNode, * org.eclipse.draw2d.IFigure) */ + @Override public IBorderItemLocator getNameBorderItemLocator(final DNode node, final IFigure mainFigure) { final BorderItemLocator locator = new DBorderItemLocator(mainFigure, PositionConstants.NSEW); locator.setBorderItemOffset(IBorderItemOffsets.NO_OFFSET); @@ -130,6 +137,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.styles.StyleConfiguration#getLabelIcon(DDiagramElement, * IGraphicalEditPart) */ + @Override public Image getLabelIcon(final DDiagramElement vpElement, IGraphicalEditPart editPart) { Image icon = null; @@ -176,7 +184,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { } private void logIconNotFoundWarning(String iconPath, MalformedURLException e) { - SiriusPlugin.getDefault().warning("Icon file \"" + iconPath + "\" not found", e); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.SimpleStyleConfiguration_iconFileNotFound, iconPath), e); } /** @@ -233,6 +241,7 @@ public class SimpleStyleConfiguration implements StyleConfiguration { * org.eclipse.sirius.common.ui.tools.api.draw2d.ui.figures.SiriusWrapLabel, * org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure) */ + @Override public Dimension fitToText(final DNode node, final SiriusWrapLabel nodeLabel, final DefaultSizeNodeFigure defaultSizeNodeFigure) { if (nodeLabel.getFont() != null) { final String text = node.getName(); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/AbstractSiriusLayoutDataManager.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/AbstractSiriusLayoutDataManager.java index 9b3bace7b0..5cb1389b74 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/AbstractSiriusLayoutDataManager.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/AbstractSiriusLayoutDataManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.api.layout; +import java.text.MessageFormat; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -69,6 +70,7 @@ import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEdit import org.eclipse.sirius.diagram.ui.internal.operation.CenterEdgeEndModelChangeOperation; import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper; import org.eclipse.sirius.diagram.ui.internal.refresh.borderednode.CanonicalDBorderItemLocator; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IBorderItemOffsets; import org.eclipse.sirius.ext.draw2d.figure.FigureUtilities; import org.eclipse.sirius.viewpoint.DSemanticDecorator; @@ -82,9 +84,9 @@ import com.google.common.collect.Sets; * An abstract implementation for {@link SiriusLayoutDataManager}. <BR> * Provide a method to store a layout from a graphicalEditPart and iterates on * it's children. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> - * + * */ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDataManager { @@ -92,9 +94,10 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManager#storeLayoutData(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) */ + @Override public void storeLayoutData(final IGraphicalEditPart rootEditPart) { final Collection<LayoutDataKey> discoveredKeys = Sets.newHashSet(); final EObject semanticElement = rootEditPart.resolveSemanticElement(); @@ -113,10 +116,11 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManager#applyLayout(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart, * org.eclipse.gef.EditPartViewer) */ + @Override public void applyLayout(final IGraphicalEditPart rootEditPart) { final EObject semanticElement = rootEditPart.resolveSemanticElement(); final View toStoreView = (View) rootEditPart.getModel(); @@ -277,7 +281,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Search a layout corresponding to the semantic decorator and applies it to * the node. Then it applies to it's children and outgoing edges. - * + * * @param semanticDecorator * The semantic decorator to search the corresponding layout * @param toRestoreView @@ -386,13 +390,13 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat } if (logWarn) { - DiagramPlugin.getDefault().logWarning("This kind of diagram element (" + semanticDecorator.getClass().getName() + ") is not yet managed by the LayoutDataManager."); + DiagramPlugin.getDefault().logWarning(MessageFormat.format(Messages.AbstractSiriusLayoutDataManager_unhandledDiagramElementKind, semanticDecorator.getClass().getName())); } } /** * Try to apply a layout to the children of the {@link DNode}. - * + * * @param parentNode * The parent containing children to apply layout on. * @param editPartViewer @@ -408,7 +412,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Try to apply a layout to the children of the {@link DNodeContainer}. - * + * * @param container * The parent containing children to apply layout on. * @param editPartViewer @@ -434,7 +438,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Try to apply the layout to the bordered nodes. - * + * * @param borderedNodes * The list of bordered nodes to deals with * @param editPartViewer @@ -487,7 +491,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Try to apply the layout to a bordered node. - * + * * @param semanticDecorator * The semantic decorator associated with this Node * @param toRestoreView @@ -600,7 +604,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Try to apply a layout to the children of the {@link DNodeList}. - * + * * @param nodeList * The parent containing children to apply layout on. * @param editPartViewer @@ -617,7 +621,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add the layout for the children of a node. - * + * * @param parentNode * The parent of the children * @param parentLayoutData @@ -630,7 +634,8 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat * The {@link LayoutDataKey} discovered during the current store * action. */ - protected void addNodeChildren(final DNode parentNode, final NodeLayoutData parentLayoutData, final IGraphicalEditPart parentEditPart, final View gmfView, Collection<LayoutDataKey> discoveredKeys) { + protected void addNodeChildren(final DNode parentNode, final NodeLayoutData parentLayoutData, final IGraphicalEditPart parentEditPart, final View gmfView, + Collection<LayoutDataKey> discoveredKeys) { for (final DNode child : parentNode.getOwnedBorderedNodes()) { checkDataAndAddChildLayout(parentLayoutData, child, parentEditPart, discoveredKeys); } @@ -640,7 +645,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add a layout (if we have enough information : GMF view and editPart). - * + * * @param parentLayoutData * The parent layout data * @param child @@ -651,7 +656,8 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat * The {@link LayoutDataKey} discovered during the current store * action. */ - protected void checkDataAndAddChildLayout(final NodeLayoutData parentLayoutData, final AbstractDNode child, final IGraphicalEditPart parentSavedEditPart, Collection<LayoutDataKey> discoveredKeys) { + protected void checkDataAndAddChildLayout(final NodeLayoutData parentLayoutData, final AbstractDNode child, final IGraphicalEditPart parentSavedEditPart, + Collection<LayoutDataKey> discoveredKeys) { // Search the GMF node corresponding to the child final Node gmfNode = SiriusGMFHelper.getGmfNode(child); if (gmfNode != null) { @@ -664,7 +670,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add children of the node. - * + * * @param container * The parent of the children * @param parentLayoutData @@ -688,7 +694,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add children of the node. - * + * * @param nodeList * The parent of the children * @param parentLayoutData @@ -707,7 +713,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add the child layout of the diagram. - * + * * @param diagram * the diagram * @param editPart @@ -729,7 +735,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add a layout. - * + * * @param parentLayoutData * The parent layout data * @param child @@ -778,7 +784,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add outgoing edge of the edgeTarget. - * + * * @param parentLayoutData * The parent layout data * @param sourceOfEdge @@ -794,7 +800,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat /** * Add edge layout data. - * + * * @param parentLayoutData * The parent layout data * @param edge @@ -825,7 +831,7 @@ public abstract class AbstractSiriusLayoutDataManager implements SiriusLayoutDat * Add the layout data of the label of the edge. This layout data sets the * <code>edgeLabelLayoutData</code> of the {@link EdgeLayoutData}. It's not * added to the layout data with a key in the manager. - * + * * @param parentLayoutData * The edge layout data * @param element diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/ordering/GridView.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/ordering/GridView.java index 990ad8a226..ad4203da74 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/ordering/GridView.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/ordering/GridView.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES. + * 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 @@ -17,6 +17,7 @@ import java.util.Iterator; import java.util.List; import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Represents a grid of views. @@ -168,7 +169,7 @@ public final class GridView { */ public View getLeftSibling(final View view) throws IllegalArgumentException { if (!this.views.contains(view)) { - throw new IllegalArgumentException("The view is not in the column"); + throw new IllegalArgumentException(Messages.Column_wrongColumnViewError); } if (this.index == 0) { return null; @@ -188,7 +189,7 @@ public final class GridView { */ public View getRightSibling(final View view) throws IllegalArgumentException { if (!this.views.contains(view)) { - throw new IllegalArgumentException("The view is not in the column"); + throw new IllegalArgumentException(Messages.Column_wrongColumnViewError); } if (this.index + 1 == GridView.this.getColumnsCount()) { return null; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/AbstractLayoutProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/AbstractLayoutProvider.java index 538755e64a..bc859e99d7 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/AbstractLayoutProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/AbstractLayoutProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 THALES GLOBAL SERVICES. + * 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 @@ -42,13 +42,14 @@ import org.eclipse.sirius.common.tools.api.profiler.ProfilerTask; import org.eclipse.sirius.common.ui.SiriusTransPlugin; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.tools.api.layout.PinHelper; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.layout.provider.LayoutService; import com.google.common.collect.Iterables; /** * An abstract layout provider. - * + * * @author ymortier */ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvider { @@ -56,19 +57,19 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Modeler Category. */ - public static final String GENERIC_MODELER_CAT = "Generic Modeler"; + public static final String GENERIC_MODELER_CAT = Messages.AbstractLayoutProvider_arrangeAllProfilerTaskCategory; /** * Arrange all. */ - public static final ProfilerTask ARRANGE_ALL = new ProfilerTask(GENERIC_MODELER_CAT, "Arrange All"); + public static final ProfilerTask ARRANGE_ALL = new ProfilerTask(GENERIC_MODELER_CAT, Messages.AbstractLayoutProvider_arrangeAllProfilerTaskName); /** Map all views with a its associated {@link ChangeBoundsRequest}. */ protected Map<View, List<Request>> viewsToChangeBoundsRequest; /** * Create a new {@link AbstractLayoutProvider}. - * + * */ public AbstractLayoutProvider() { this.viewsToChangeBoundsRequest = new HashMap<View, List<Request>>(); @@ -77,7 +78,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Set the map that maps all views with a its associated * {@link ChangeBoundsRequest}. - * + * * @param viewsToChangeBoundsRequest * Map all views with a its associated * {@link ChangeBoundsRequest}. @@ -89,7 +90,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Return the map that maps all views with a its associated * {@link ChangeBoundsRequest}. - * + * * @return the map that maps all views with a its associated * {@link ChangeBoundsRequest}. */ @@ -99,7 +100,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.services.layout.AbstractLayoutEditPartProvider#layoutEditParts(org.eclipse.gef.GraphicalEditPart, * org.eclipse.core.runtime.IAdaptable) */ @@ -112,22 +113,22 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /* * If we are asked to layout a whole diagram, check if a specific * provider has been registered for it (through the - * org.eclipse.sirius.common.ui.airLayoutProvider extension point), and use - * that provider if there is. + * org.eclipse.sirius.common.ui.airLayoutProvider extension point), and + * use that provider if there is. */ if (containerEditPart instanceof DiagramEditPart) { final DiagramEditPart diagramEditPart = (DiagramEditPart) containerEditPart; final LayoutProvider diagramLayoutProvider = getDiagramLayoutProvider(diagramEditPart, layoutHint); if (diagramLayoutProvider != null) { final Command command = getCommandFromDiagramLayoutProvider(diagramLayoutProvider, diagramEditPart, layoutHint); - command.setLabel("Arrange all"); + command.setLabel(Messages.AbstractLayoutProvider_arrangeAllCommandLabel); DslCommonPlugin.PROFILER.stopWork(ARRANGE_ALL); return command; } } final Command command = buildCommand(containerEditPart, layoutHint); - command.setLabel("Arrange all"); + command.setLabel(Messages.AbstractLayoutProvider_arrangeAllCommandLabel); this.getViewsToChangeBoundsRequest().clear(); AbstractLayoutProvider.resetWrappedCommand(command); DslCommonPlugin.PROFILER.stopWork(ARRANGE_ALL); @@ -136,7 +137,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Get the the diagram layout provider if there is one. - * + * * @param diagramEditPart * the diagram edit part * @param layoutHint @@ -164,9 +165,9 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi command = layoutProvider.layoutEditParts(diagramEditPart, layoutHint); } } catch (final SecurityException e) { - SiriusTransPlugin.getPlugin().error("Layout Error", e); + SiriusTransPlugin.getPlugin().error(Messages.AbstractLayoutProvider_layoutError, e); } catch (final NoSuchMethodException e) { - SiriusTransPlugin.getPlugin().error("Layout Error", e); + SiriusTransPlugin.getPlugin().error(Messages.AbstractLayoutProvider_layoutError, e); } if (command == null) { final List<?> children = diagramEditPart.getChildren(); @@ -182,7 +183,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi * The resulting command is a compound command built recursively by calling * {@link #layoutEditParts(List, IAdaptable)} on all the descendants of the * specified container and then on the container itself. - * + * * @param containerEditPart * the container to layout. * @param layoutHint @@ -209,16 +210,17 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation) */ + @Override public boolean provides(final IOperation operation) { return false; } /** * Search a request for the specified edit part and of the specified type. - * + * * @param editPart * the edit part. * @param requestType @@ -234,7 +236,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Search a request for the specified view and of the specified type. - * + * * @param notationView * the view. * @param requestType @@ -258,7 +260,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Create a command with the specified request. - * + * * @param request * the request. * @param editPart @@ -280,7 +282,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Tests whether an edit part should be considered as pinned (fixed size and * location) during the layout. - * + * * @param part * the edit part. * @return <code>true</code> if the edit part should be considered as @@ -297,7 +299,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Wraps a GMF Command. - * + * * @author ymortier */ protected static class CommandWrapper extends Command { @@ -313,7 +315,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Create a new Command wrapper. - * + * * @param request * the request. * @param editPart @@ -326,7 +328,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * {@inheritDoc} - * + * * @see org.eclipse.gef.commands.Command#execute() */ @Override @@ -338,7 +340,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * {@inheritDoc} - * + * * @see org.eclipse.gef.commands.Command#canExecute() */ @Override @@ -348,7 +350,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * {@inheritDoc} - * + * * @see org.eclipse.gef.commands.Command#canUndo() */ @Override @@ -358,7 +360,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * {@inheritDoc} - * + * * @see org.eclipse.gef.commands.Command#undo() */ @Override @@ -368,7 +370,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * {@inheritDoc} - * + * * @see org.eclipse.gef.commands.Command#redo() */ @Override @@ -401,7 +403,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Returns the request that is causing the command. - * + * * @return the request */ public Request getRequest() { @@ -410,7 +412,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Return the associated edit part. - * + * * @return the editPart */ public EditPart getEditPart() { @@ -420,7 +422,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Return the relative bounds of the specified edit part. - * + * * @param graphicalEditPart * the edit part. * @return the bounds of the specified edit part. @@ -486,7 +488,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Return the first figure of type <code>type</code> that is the figure * <code>searchRoot</code> or a child of <code>searchRoot</code>. - * + * * @param searchRoot * the root figure to start the search. * @param type @@ -510,7 +512,7 @@ public abstract class AbstractLayoutProvider extends AbstractLayoutEditPartProvi /** * Return all edit parts contained in root + root. - * + * * @param root * the root edit part * @return all edit parts contained in root + root. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/GridLayoutProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/GridLayoutProvider.java index 39df59b7ee..fd251c573f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/GridLayoutProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/layout/provider/GridLayoutProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008, 2009 THALES GLOBAL SERVICES. + * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.api.layout.provider; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; @@ -33,6 +34,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart; import org.eclipse.gmf.runtime.notation.View; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutExtender; import org.eclipse.sirius.diagram.ui.tools.api.layout.ordering.GridView; import org.eclipse.sirius.diagram.ui.tools.api.layout.ordering.GridView.Column; @@ -127,7 +129,7 @@ public class GridLayoutProvider extends DefaultLayoutProvider implements Extenda */ public void setColumnSizeMode(final int columnSizeMode) { if (columnSizeMode < GridLayoutProvider.SAME_DIMENSION || columnSizeMode > GridLayoutProvider.FREE_DIMENSION) { - throw new IllegalArgumentException("Unknown mode : " + columnSizeMode); + throw new IllegalArgumentException(MessageFormat.format(Messages.GridLayoutProvider_unknownMode, columnSizeMode)); } this.columnSizeMode = columnSizeMode; } @@ -159,7 +161,7 @@ public class GridLayoutProvider extends DefaultLayoutProvider implements Extenda */ public void setLineSizeMode(final int lineSizeMode) { if (lineSizeMode < GridLayoutProvider.SAME_DIMENSION || lineSizeMode > GridLayoutProvider.FREE_DIMENSION) { - throw new IllegalArgumentException("Unknown mode : " + lineSizeMode); + throw new IllegalArgumentException(MessageFormat.format(Messages.GridLayoutProvider_unknownMode, lineSizeMode)); } this.lineSizeMode = lineSizeMode; } @@ -518,6 +520,7 @@ public class GridLayoutProvider extends DefaultLayoutProvider implements Extenda * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.provider.ExtendableLayoutProvider#getExtender() */ + @Override public LayoutExtender getExtender() { return extender; } @@ -527,6 +530,7 @@ public class GridLayoutProvider extends DefaultLayoutProvider implements Extenda * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.provider.ExtendableLayoutProvider#handleConnectableListItems() */ + @Override public boolean handleConnectableListItems() { return false; } @@ -536,6 +540,7 @@ public class GridLayoutProvider extends DefaultLayoutProvider implements Extenda * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.provider.ExtendableLayoutProvider#provideNodeMetrics(org.eclipse.draw2d.graph.Node) */ + @Override public Rectangle provideNodeMetrics(Node node) { return null; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java index db5ec86203..ab66c663fe 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/part/DiagramEditPartService.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 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 @@ -16,6 +16,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; +import java.text.MessageFormat; import java.util.List; import org.eclipse.core.resources.IFile; @@ -37,6 +38,7 @@ import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.ui.internal.refresh.layout.SiriusCanonicalLayoutHandler; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.part.OffscreenEditPartFactory; import org.eclipse.sirius.ui.tools.api.actions.export.SizeTooLargeException; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -147,11 +149,11 @@ public class DiagramEditPartService extends org.eclipse.gmf.runtime.diagram.ui.r CopyToImageUtil copyToHmlUtil = (CopyToImageUtil) exportToHtmlClass.newInstance(); return copyToHmlUtil.copyToImage(diagramEP, destination, format, monitor); } catch (InstantiationException e) { - throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, -1, " Cannot export image (InstanciationException)", e)); + throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, -1, MessageFormat.format(Messages.DiagramEditPartService_imageExportException, "InstanciationException"), e)); //$NON-NLS-1$ } catch (IllegalAccessException e) { - throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, -1, " Cannot export image (IllegalAccessException)", e)); + throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, -1, MessageFormat.format(Messages.DiagramEditPartService_imageExportException, "IllegalAccessException"), e)); //$NON-NLS-1$ } catch (OutOfMemoryError e) { - throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, -1, " Cannot export image (OutofMemoryError)", e)); + throw new CoreException(new Status(IStatus.ERROR, SiriusPlugin.ID, -1, MessageFormat.format(Messages.DiagramEditPartService_imageExportException, "OutofMemoryError"), e)); //$NON-NLS-1$ } } // Retrieve swt image for knows size. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/policy/CompoundEditPolicy.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/policy/CompoundEditPolicy.java index 015029bdd5..1425cf69fc 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/policy/CompoundEditPolicy.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/policy/CompoundEditPolicy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES. + * 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 @@ -19,10 +19,11 @@ import org.eclipse.gef.EditPolicy; import org.eclipse.gef.Request; import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.CompoundCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This edit policy is composed of many edit policies. - * + * * @author ymortier */ public class CompoundEditPolicy implements EditPolicy { @@ -41,7 +42,7 @@ public class CompoundEditPolicy implements EditPolicy { /** * <code>true</code> if the resulted command can contain null value. - * + * * @param allowNullCommand * <code>true</code> if the resulted command can contain null * value. @@ -52,7 +53,7 @@ public class CompoundEditPolicy implements EditPolicy { /** * Returns <code>true</code> if the resulted command can contain null value. - * + * * @return <code>true</code> if the resulted command can contain null value. */ public boolean isAllowNullCommand() { @@ -61,9 +62,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#activate() */ + @Override public void activate() { final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); while (iterEditPolicies.hasNext()) { @@ -73,9 +75,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#deactivate() */ + @Override public void deactivate() { final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); while (iterEditPolicies.hasNext()) { @@ -85,9 +88,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#eraseSourceFeedback(org.eclipse.gef.Request) */ + @Override public void eraseSourceFeedback(final Request request) { final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); while (iterEditPolicies.hasNext()) { @@ -97,9 +101,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#eraseTargetFeedback(org.eclipse.gef.Request) */ + @Override public void eraseTargetFeedback(final Request request) { final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); while (iterEditPolicies.hasNext()) { @@ -109,9 +114,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#getCommand(org.eclipse.gef.Request) */ + @Override public Command getCommand(final Request request) { CompoundCommand ret = null; final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.listIterator(); @@ -142,18 +148,20 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#getHost() */ + @Override public EditPart getHost() { return this.host; } /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#getTargetEditPart(org.eclipse.gef.Request) */ + @Override public EditPart getTargetEditPart(final Request request) { EditPart res = null; final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); @@ -166,9 +174,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#setHost(org.eclipse.gef.EditPart) */ + @Override public void setHost(final EditPart editpart) { this.host = editpart; final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); @@ -179,9 +188,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#showSourceFeedback(org.eclipse.gef.Request) */ + @Override public void showSourceFeedback(final Request request) { final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); while (iterEditPolicies.hasNext()) { @@ -191,9 +201,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#showTargetFeedback(org.eclipse.gef.Request) */ + @Override public void showTargetFeedback(final Request request) { final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); while (iterEditPolicies.hasNext()) { @@ -203,9 +214,10 @@ public class CompoundEditPolicy implements EditPolicy { /** * {@inheritDoc} - * + * * @see org.eclipse.gef.EditPolicy#understandsRequest(org.eclipse.gef.Request) */ + @Override public boolean understandsRequest(final Request request) { boolean res = false; final Iterator<EditPolicy> iterEditPolicies = this.delegatedEditPolicies.iterator(); @@ -217,20 +229,20 @@ public class CompoundEditPolicy implements EditPolicy { /** * Adds an edit policy. - * + * * @param editPolicy * the edit policy to add. */ public void addEditPolicy(final EditPolicy editPolicy) { if (editPolicy == null) { - throw new IllegalArgumentException("the edit policy is null"); + throw new IllegalArgumentException(Messages.CompoundEditPolicy_nullEditPolicyMsg); } this.delegatedEditPolicies.add(editPolicy); } /** * Removes an edit policy. - * + * * @param policy * the policy to remove. */ @@ -240,7 +252,7 @@ public class CompoundEditPolicy implements EditPolicy { /** * Return all edit policies. - * + * * @return all edit policies. */ public List<EditPolicy> getEditPolicies() { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySection.java index f9b94ddffd..1418cb3317 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES. + * 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 @@ -19,6 +19,7 @@ import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AdvancedPropertySe import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.sirius.common.tools.api.util.StringUtil; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.properties.DefaultPropertySource; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.views.properties.IPropertyDescriptor; @@ -40,6 +41,7 @@ public class MiscPropertySection extends AdvancedPropertySection implements IPro * the object. * @return the property source of the specified object. */ + @Override public IPropertySource getPropertySource(final Object object) { IPropertySource propSrc = null; @@ -66,7 +68,7 @@ public class MiscPropertySection extends AdvancedPropertySection implements IPro for (int i = 0; i < collection.length; i++) { Object next = collection[i]; if (next == null) { - next = "null object"; + next = Messages.MiscPropertySection_nullObject; } propertyDescriptors[i] = new PropertyDescriptor(next, i + ""); //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySource.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySource.java index 69a18167b6..0fda63326f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySource.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/properties/MiscPropertySource.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES. + * 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 @@ -18,6 +18,7 @@ import java.util.LinkedList; import java.util.List; import org.eclipse.sirius.common.ui.SiriusTransPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.ui.views.properties.IPropertyDescriptor; import org.eclipse.ui.views.properties.IPropertySource; import org.eclipse.ui.views.properties.PropertyDescriptor; @@ -48,6 +49,7 @@ public class MiscPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() */ + @Override public Object getEditableValue() { return this.selectedObject; } @@ -57,6 +59,7 @@ public class MiscPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() */ + @Override public IPropertyDescriptor[] getPropertyDescriptors() { final List<Field> allFields = new LinkedList<Field>(); Field[] fields = this.selectedObject.getClass().getDeclaredFields(); @@ -89,6 +92,7 @@ public class MiscPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) */ + @Override public Object getPropertyValue(final Object id) { Object value = null; @@ -100,9 +104,9 @@ public class MiscPropertySource implements IPropertySource { try { value = field.get(this.selectedObject); } catch (final IllegalArgumentException e) { - SiriusTransPlugin.getPlugin().error("Error while getting property value", e); + SiriusTransPlugin.getPlugin().error(Messages.MiscPropertySource_errorGettingValueMsg, e); } catch (final IllegalAccessException e) { - SiriusTransPlugin.getPlugin().error("Error while getting property value", e); + SiriusTransPlugin.getPlugin().error(Messages.MiscPropertySource_errorGettingValueMsg, e); } } finally { field.setAccessible(oldAccessible); @@ -116,6 +120,7 @@ public class MiscPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object) */ + @Override public boolean isPropertySet(final Object id) { // does nothing return true; @@ -126,6 +131,7 @@ public class MiscPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) */ + @Override public void resetPropertyValue(final Object id) { // does nothing. } @@ -136,6 +142,7 @@ public class MiscPropertySource implements IPropertySource { * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, * java.lang.Object) */ + @Override public void setPropertyValue(final Object id, final Object value) { // does nothing. } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java index f431939580..f16ea118cb 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/ui/actions/ActionIds.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -50,8 +50,7 @@ public interface ActionIds { * @deprecated use {@link ActionIds#ARRANGE_BORDER_NODES} instead */ @Deprecated - String ARRANGE_BORDERED_NODES = "arrangeBorderNodesAction"; - // $NON-NLS-1$ + String ARRANGE_BORDERED_NODES = "arrangeBorderNodesAction"; //$NON-NLS-1$ /** * Action id for arrange bordered nodes action. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/util/EditPartTools.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/util/EditPartTools.java index a606f9bc01..1a7424da7d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/util/EditPartTools.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/util/EditPartTools.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.ui.tools.api.util; import java.util.Iterator; import org.eclipse.gef.EditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Tools for edit part. @@ -40,7 +41,7 @@ public final class EditPartTools { */ public static EditPart getEditPartOfType(final EditPart root, final Class<?> editPartType) { if (root == null || editPartType == null) { - throw new IllegalArgumentException("root or editPartType is null"); + throw new IllegalArgumentException(Messages.EditPartTools_nullParameterMsg); } EditPart result = null; if (editPartType.isInstance(root)) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java index e93f035eea..40f6d22415 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.api.wizards.page; +import java.text.MessageFormat; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -33,6 +34,7 @@ import org.eclipse.sirius.business.api.query.IdentifiedElementQuery; import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DSemanticDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; @@ -57,11 +59,6 @@ import org.eclipse.ui.navigator.ICommonContentProvider; */ public class DiagramSelectionWizardPage extends WizardPage { - private static final String SELECT_DIAGRAMS_TO_EXPORT = "Select Diagrams to export"; - - /** The title of the page. */ - private static final String PAGE_TITLE = "Select diagrams to export"; - /** The page is completed. */ private static final int CODE_OK = 0; @@ -90,7 +87,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * the root object */ public DiagramSelectionWizardPage(final DView root) { - super(PAGE_TITLE); + super(Messages.DiagramSelectionWizardPage_title); initialize(root, new DiagramSelectionFilter()); } @@ -105,7 +102,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * @since 0.9.0 */ public DiagramSelectionWizardPage(final DView root, final ViewerFilter diagramSelectionFilter) { - super(PAGE_TITLE); + super(Messages.DiagramSelectionWizardPage_title); initialize(root, diagramSelectionFilter); } @@ -114,15 +111,13 @@ public class DiagramSelectionWizardPage extends WizardPage { this.setPageComplete(false); this.diagramSelectionFilter = aDiagramSelectionFilter; - setMessage(SELECT_DIAGRAMS_TO_EXPORT, IMessageProvider.INFORMATION); + setMessage(Messages.DiagramSelectionWizardPage_message, IMessageProvider.INFORMATION); - final StringBuilder title = new StringBuilder(); - title.append(PAGE_TITLE); if (root.getViewpoint() != null && !StringUtil.isEmpty(new IdentifiedElementQuery(root.getViewpoint()).getLabel())) { - title.append(" for "); - title.append(new IdentifiedElementQuery(root.getViewpoint()).getLabel()); + this.setTitle(MessageFormat.format(Messages.DiagramSelectionWizardPage_titleFor, new IdentifiedElementQuery(root.getViewpoint()).getLabel())); + } else { + this.setTitle(Messages.DiagramSelectionWizardPage_title); } - this.setTitle(title.toString()); } /** @@ -130,6 +125,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ + @Override public void createControl(final Composite parent) { initializeDialogUnits(parent); @@ -215,23 +211,24 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent) */ + @Override public void checkStateChanged(final CheckStateChangedEvent event) { final int result = checkSelection(getSelectedElements()); switch (result) { case CODE_OK: - setMessage(SELECT_DIAGRAMS_TO_EXPORT, IMessageProvider.INFORMATION); + setMessage(Messages.DiagramSelectionWizardPage_message, IMessageProvider.INFORMATION); setPageComplete(true); break; case CODE_NO_SEL: - setMessage(SELECT_DIAGRAMS_TO_EXPORT, IMessageProvider.INFORMATION); + setMessage(Messages.DiagramSelectionWizardPage_message, IMessageProvider.INFORMATION); setPageComplete(false); break; case CODE_ERROR: - setMessage("You must select Diagrams", IMessageProvider.ERROR); + setMessage(Messages.SiriusDiagramSelectionCheckStateListener_errorMsg, IMessageProvider.ERROR); setPageComplete(false); break; default: - setMessage("Unknown code result", IMessageProvider.ERROR); + setMessage(Messages.SiriusDiagramSelectionCheckStateListener_unknwonCodeResult, IMessageProvider.ERROR); setPageComplete(false); break; } @@ -419,6 +416,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.ui.navigator.ICommonContentProvider#init(org.eclipse.ui.navigator.ICommonContentExtensionSite) */ + @Override public void init(final ICommonContentExtensionSite config) { // empty. } @@ -428,6 +426,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) */ + @Override public Object[] getChildren(final Object parentElement) { if (parentElement instanceof EObject && !(parentElement instanceof DDiagram)) { final EObject parent = (EObject) parentElement; @@ -450,6 +449,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) */ + @Override public Object getParent(final Object element) { if (element instanceof EObject) { final EObject current = (EObject) element; @@ -464,6 +464,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) */ + @Override public boolean hasChildren(final Object element) { return getChildren(element).length > 0; } @@ -473,6 +474,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) */ + @Override public Object[] getElements(final Object inputElement) { return getChildren(inputElement); } @@ -482,6 +484,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.jface.viewers.IContentProvider#dispose() */ + @Override public void dispose() { this.semanticProvider.dispose(); } @@ -492,6 +495,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, * java.lang.Object, java.lang.Object) */ + @Override public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) { // empty } @@ -501,6 +505,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.ui.navigator.IMementoAware#restoreState(org.eclipse.ui.IMemento) */ + @Override public void restoreState(final IMemento memento) { // empty. } @@ -510,6 +515,7 @@ public class DiagramSelectionWizardPage extends WizardPage { * * @see org.eclipse.ui.navigator.IMementoAware#saveState(org.eclipse.ui.IMemento) */ + @Override public void saveState(final IMemento memento) { // empty. } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/CreateRepresentationFromRepresentationCreationDescription.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/CreateRepresentationFromRepresentationCreationDescription.java index 8f2baf3ecd..20bcce1778 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/CreateRepresentationFromRepresentationCreationDescription.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/CreateRepresentationFromRepresentationCreationDescription.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -18,6 +18,7 @@ import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalC import org.eclipse.sirius.business.api.dialect.command.CreateRepresentationCommand; import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactory; import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactoryProvider; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.commands.InitializeLayoutCommand; @@ -30,9 +31,9 @@ import org.eclipse.sirius.viewpoint.description.tool.RepresentationCreationDescr /** * Create a new Representation from a {@link RepresentationCreationDescription}. - * + * * @author cbrun - * + * */ public class CreateRepresentationFromRepresentationCreationDescription extends AbstractCreateRepresentationFromRepresentationCreationDescription { @@ -40,7 +41,7 @@ public class CreateRepresentationFromRepresentationCreationDescription extends A /** * Build the action. - * + * * @param desc * {@link RepresentationCreationDescription} to use. * @param target @@ -61,7 +62,7 @@ public class CreateRepresentationFromRepresentationCreationDescription extends A @Override protected Option<DRepresentation> executeCreationCommand(Option<Command> initialOperationCommand, CreateRepresentationCommand createRepresentationCommand) { - final CompositeTransactionalCommand compositeCommand = new CompositeTransactionalCommand(getEditingDomain(), "Create and open representation"); + final CompositeTransactionalCommand compositeCommand = new CompositeTransactionalCommand(getEditingDomain(), Messages.CreateRepresentationFromRepresentationCreationDescription_cmdLabel); if (initialOperationCommand.some()) { compositeCommand.compose(new GMFCommandWrapper(getEditingDomain(), initialOperationCommand.get())); } @@ -84,9 +85,9 @@ public class CreateRepresentationFromRepresentationCreationDescription extends A /** * Returns the emf command factory. - * + * * @param curPart - * + * * @return the emf command factory. */ private static IDiagramCommandFactory getDiagramCommandFactory(IGraphicalEditPart curPart, TransactionalEditingDomain editingDomain) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/DeselectAllAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/DeselectAllAction.java index 465a63aa68..69d9ee76b7 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/DeselectAllAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/DeselectAllAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -17,6 +17,7 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.swt.SWT; @@ -28,7 +29,7 @@ import org.eclipse.ui.PlatformUI; * Select the {@link org.eclipse.sirius.diagram.DDiagram diagram} (equivalent to * unselect all selected {@link org.eclipse.sirius.diagram.DDiagramElement * diagram elements}). - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> */ public class DeselectAllAction extends Action implements IObjectActionDelegate { @@ -43,14 +44,14 @@ public class DeselectAllAction extends Action implements IObjectActionDelegate { setId(ActionIds.DESELECT_ALL); setActionDefinitionId("org.eclipse.sirius.diagram.ui.command.deselectAll"); //$NON-NLS-1$ setAccelerator(SWT.ESC); - setText("Deselect All"); - setToolTipText("Deselect all selected diagram elements."); + setText(Messages.DeselectAllAction_label); + setToolTipText(Messages.DeselectAllAction_tooltip); setImageDescriptor(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.DESELECT_ALL_ICON)); } /** * Deselect all from the selection. - * + * * @param selection * ISelection */ @@ -68,17 +69,18 @@ public class DeselectAllAction extends Action implements IObjectActionDelegate { /** * Empty. {@inheritDoc} - * + * * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, * org.eclipse.ui.IWorkbenchPart) */ + @Override public void setActivePart(final IAction action, final IWorkbenchPart targetPart) { // empty. } /** * {@inheritDoc} - * + * * @see org.eclipse.jface.action.Action#run() */ @Override @@ -90,19 +92,21 @@ public class DeselectAllAction extends Action implements IObjectActionDelegate { /** * Execute the action. Refresh all selected view point element. * {@inheritDoc} - * + * * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ + @Override public void run(final IAction action) { DeselectAllAction.deselectAll(selection); } /** * Set the selection. {@inheritDoc} - * + * * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, * org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(final IAction action, final ISelection s) { this.selection = s; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/LaunchBehaviorToolAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/LaunchBehaviorToolAction.java index 4f33ece3f8..2dab82ec70 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/LaunchBehaviorToolAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/LaunchBehaviorToolAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES. + * 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 @@ -24,6 +24,7 @@ import org.eclipse.jface.action.IAction; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.requests.RequestConstants; import org.eclipse.swt.widgets.Event; import org.eclipse.ui.PlatformUI; @@ -31,7 +32,7 @@ import org.eclipse.ui.actions.RetargetAction; /** * This action launch all {@link RuleTool} to update the model. - * + * * @author ymortier */ public class LaunchBehaviorToolAction extends RetargetAction { @@ -41,21 +42,21 @@ public class LaunchBehaviorToolAction extends RetargetAction { /** * Create a new {@link LaunchBehaviorToolAction}. - * + * * @param actionID * the action id * @param imageDescriptor * an image descriptor for the UI */ public LaunchBehaviorToolAction(final String actionID, final ImageDescriptor imageDescriptor) { - super(actionID, "Launch behavior rules", IAction.AS_PUSH_BUTTON); + super(actionID, Messages.LaunchBehaviorToolAction_label, IAction.AS_PUSH_BUTTON); this.setImageDescriptor(imageDescriptor); } /** * {@inheritDoc} - * + * * @see org.eclipse.ui.actions.RetargetAction#run() */ @Override @@ -77,7 +78,7 @@ public class LaunchBehaviorToolAction extends RetargetAction { /** * {@inheritDoc} - * + * * @see org.eclipse.ui.actions.RetargetAction#runWithEvent(org.eclipse.swt.widgets.Event) */ @Override @@ -134,7 +135,7 @@ public class LaunchBehaviorToolAction extends RetargetAction { /** * {@inheritDoc} - * + * * @see org.eclipse.jface.action.Action#isEnabled() */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SaveAsImageFileAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SaveAsImageFileAction.java index 7d0768b0cd..1652fdd0bc 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SaveAsImageFileAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SaveAsImageFileAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2013 THALES GLOBAL SERVICES. + * 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 @@ -22,6 +22,7 @@ import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ui.tools.internal.actions.export.AbstractExportRepresentationsAction; @@ -30,7 +31,7 @@ import org.eclipse.ui.PlatformUI; /** * Action to save current diagram as an image file. - * + * * @author dlecan */ public class SaveAsImageFileAction extends AbstractExportRepresentationsAction { @@ -39,7 +40,7 @@ public class SaveAsImageFileAction extends AbstractExportRepresentationsAction { * Default constructor. */ public SaveAsImageFileAction() { - super("Export diagram as image", DiagramUIPlugin.Implementation.getBundledImageDescriptor("icons/screenshot.gif")); //$NON-NLS-2$ + super(Messages.SaveAsImageFileAction_label, DiagramUIPlugin.Implementation.getBundledImageDescriptor("icons/screenshot.gif")); //$NON-NLS-1$ /* set the id */ setId(ActionIds.COPY_TO_IMAGE); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectHiddenElementsAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectHiddenElementsAction.java index f27738173b..780e81f379 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectHiddenElementsAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectHiddenElementsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2013 THALES GLOBAL SERVICES. + * 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 @@ -32,6 +32,7 @@ import org.eclipse.sirius.diagram.business.api.query.DDiagramElementQuery; import org.eclipse.sirius.diagram.ui.business.api.provider.AbstractDDiagramElementLabelItemProvider; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.sirius.diagram.ui.tools.internal.actions.visibility.HideDDiagramElementAction; import org.eclipse.sirius.diagram.ui.tools.internal.dialogs.DiagramElementsSelectionDialog; @@ -47,7 +48,7 @@ import com.google.common.base.Predicates; /** * Action to open a dialog box where the user can select/deselect the diagram * elements which should be hidden. - * + * * @author pcdavid */ public class SelectHiddenElementsAction extends AbstractDiagramAction { @@ -62,7 +63,7 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - DiagramElementsSelectionDialog dlg = new DiagramElementsSelectionDialog(TITLE, MESSAGE); + DiagramElementsSelectionDialog dlg = new DiagramElementsSelectionDialog(Messages.HiddenElementsSelectionCommand_dialogTitle, Messages.HiddenElementsSelectionCommand_dialogMessage); dlg.setSelectionPredicate(isVisible); dlg.setSelectedAction(revealElement); dlg.setDeselectedAction(hideElement); @@ -82,6 +83,7 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { } return new Predicate<Object>() { + @Override public boolean apply(Object input) { if (input instanceof DDiagramElement) { return !allowsHideReveal.apply((DDiagramElement) input); @@ -92,18 +94,13 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { } } - private static final String TITLE = "Diagram elements visibility"; - - private static final String MESSAGE = "Visible diagram elements are checked."; - - private static final String TOOLTIP = "Show/Hide"; - private static final String ICON_PATH = "icons/categoryWizard.gif"; //$NON-NLS-1$ /** The hide icon descriptor. */ private static final ImageDescriptor DESC_HIDE = DiagramUIPlugin.Implementation.getBundledImageDescriptor(ICON_PATH); private final Predicate<Object> isVisible = new Predicate<Object>() { + @Override public boolean apply(Object input) { boolean result = false; if (input instanceof DDiagramElement) { @@ -119,6 +116,7 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { }; private final Function<Object, Void> hideElement = new Function<Object, Void>() { + @Override public Void apply(Object from) { if (from instanceof DDiagramElement) { HideFilterHelper.INSTANCE.hide((DDiagramElement) from); @@ -133,6 +131,7 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { }; private final Function<Object, Void> revealElement = new Function<Object, Void>() { + @Override public Void apply(Object from) { if (from instanceof DDiagramElement) { HideFilterHelper.INSTANCE.reveal((DDiagramElement) from); @@ -145,21 +144,21 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { /** * Constructor. - * + * * @param workbenchPage * the workbench page. */ public SelectHiddenElementsAction(IWorkbenchPage workbenchPage) { super(workbenchPage); - setText(TOOLTIP); + setText(Messages.SelectHiddenElementsAction_tooltip); setId(ActionIds.SELECT_HIDDEN_ELEMENTS); - setToolTipText(TOOLTIP); + setToolTipText(Messages.SelectHiddenElementsAction_tooltip); setImageDescriptor(DESC_HIDE); } /** * Constructor. - * + * * @param workbenchPage * the workbench page. * @param part @@ -168,9 +167,9 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { public SelectHiddenElementsAction(IWorkbenchPage workbenchPage, IDiagramWorkbenchPart part) { super(workbenchPage); setWorkbenchPart(part); - setText(TOOLTIP); + setText(Messages.SelectHiddenElementsAction_tooltip); setId(ActionIds.SELECT_HIDDEN_ELEMENTS); - setToolTipText(TOOLTIP); + setToolTipText(Messages.SelectHiddenElementsAction_tooltip); setImageDescriptor(getImage()); } @@ -238,7 +237,7 @@ public class SelectHiddenElementsAction extends AbstractDiagramAction { EObject semanticElement = diagramEditPart.resolveSemanticElement(); if (semanticElement instanceof DDiagram) { DDiagram diagram = (DDiagram) semanticElement; - elementsSelectionCommand = new ICommandProxy(new HiddenElementsSelectionCommand(diagramEditPart.getEditingDomain(), TOOLTIP, diagram)); + elementsSelectionCommand = new ICommandProxy(new HiddenElementsSelectionCommand(diagramEditPart.getEditingDomain(), Messages.SelectHiddenElementsAction_tooltip, diagram)); } } return elementsSelectionCommand; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectPinnedElementsAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectPinnedElementsAction.java index 84bec07258..0f6d015f01 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectPinnedElementsAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/SelectPinnedElementsAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2013 THALES GLOBAL SERVICES. + * 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 @@ -31,6 +31,7 @@ import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.tools.api.layout.PinHelper; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.dialogs.DiagramElementsSelectionDialog; import org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl; import org.eclipse.swt.widgets.Shell; @@ -43,7 +44,7 @@ import com.google.common.base.Predicate; /** * Action to open a dialog box where the user can select/deselect the diagram * elements which should be pinned. - * + * * @author pcdavid */ public class SelectPinnedElementsAction extends AbstractDiagramAction { @@ -57,7 +58,7 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { - DiagramElementsSelectionDialog dlg = new DiagramElementsSelectionDialog(TITLE, MESSAGE); + DiagramElementsSelectionDialog dlg = new DiagramElementsSelectionDialog(Messages.SelectPinnedElementsAction_label, Messages.PinnedElementsSelectionCommand_dialogMessage); dlg.setSelectionPredicate(isPinned); dlg.setSelectedAction(pinElement); dlg.setDeselectedAction(unpinElement); @@ -72,6 +73,7 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { private Predicate<Object> getNonSelectablePredicate() { return new Predicate<Object>() { + @Override public boolean apply(Object input) { if (input instanceof DDiagramElement) { return !PinHelper.allowsPinUnpin((DDiagramElement) input); @@ -84,18 +86,13 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { private static final String ACTION_ID = "selectPinnedElementsAction"; //$NON-NLS-1$ - private static final String TITLE = "Diagram elements pinning"; - - private static final String MESSAGE = "Pinned diagram elements are checked."; - - private static final String TOOLTIP = "Pin/Unpin"; - private static final String ICON_PATH = "icons/pinWizard.gif"; //$NON-NLS-1$ /** The pin icon descriptor. */ private static final ImageDescriptor DESC_PIN = DiagramUIPlugin.Implementation.getBundledImageDescriptor(ICON_PATH); private final Predicate<Object> isPinned = new Predicate<Object>() { + @Override public boolean apply(Object input) { if (input instanceof DDiagramElement) { return new PinHelper().isPinned((DDiagramElement) input); @@ -105,6 +102,7 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { }; private final Function<Object, Void> pinElement = new Function<Object, Void>() { + @Override public Void apply(Object from) { if (from instanceof DDiagramElement) { new PinHelper().markAsPinned((DDiagramElement) from); @@ -114,6 +112,7 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { }; private final Function<Object, Void> unpinElement = new Function<Object, Void>() { + @Override public Void apply(Object from) { if (from instanceof DDiagramElement) { new PinHelper().markAsUnpinned((DDiagramElement) from); @@ -124,21 +123,21 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { /** * Constructor. - * + * * @param workbenchPage * the workbench page. */ public SelectPinnedElementsAction(IWorkbenchPage workbenchPage) { super(workbenchPage); - setText(TITLE); - setToolTipText(TOOLTIP); + setText(Messages.SelectPinnedElementsAction_label); + setToolTipText(Messages.SelectPinnedElementsAction_tooltip); setId(ACTION_ID); setImageDescriptor(DiagramUIPlugin.Implementation.getDecoratedCheckedImageDescriptor(DESC_PIN)); } /** * Constructor. - * + * * @param workbenchPage * the workbench page. * @param part @@ -147,8 +146,8 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { public SelectPinnedElementsAction(IWorkbenchPage workbenchPage, IWorkbenchPart part) { super(workbenchPage); setWorkbenchPart(part); - setText(TITLE); - setToolTipText(TOOLTIP); + setText(Messages.SelectPinnedElementsAction_label); + setToolTipText(Messages.SelectPinnedElementsAction_tooltip); setId(ACTION_ID); setImageDescriptor(getImage()); } @@ -229,7 +228,7 @@ public class SelectPinnedElementsAction extends AbstractDiagramAction { EObject semanticElement = diagramEditPart.resolveSemanticElement(); if (semanticElement instanceof DDiagram) { DDiagram diagram = (DDiagram) semanticElement; - elementsSelectionCommand = new ICommandProxy(new PinnedElementsSelectionCommand(diagramEditPart.getEditingDomain(), TITLE, diagram)); + elementsSelectionCommand = new ICommandProxy(new PinnedElementsSelectionCommand(diagramEditPart.getEditingDomain(), Messages.SelectPinnedElementsAction_label, diagram)); } } return elementsSelectionCommand; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/distribute/DistributeAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/distribute/DistributeAction.java index b8d5bbb79c..95125a5665 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/distribute/DistributeAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/distribute/DistributeAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -25,6 +25,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IBorderItemEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.requests.DistributeRequest; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; @@ -57,33 +58,6 @@ public class DistributeAction extends DiagramAction { /** Constant indicating distribution of centers vertically. */ public static final int CENTERS_VERTICALLY = 3; - /** Prefix used for label when the action is displayed in the tab bar. */ - private static final String DISTRIBUTE_PREFIX = "Distribute "; - - /** Label for horizontal distribution with uniform gaps. */ - private static final String GAPS_HORIZONTALLY_LABEL = "Gaps Horizontally"; - - /** Label for distribution of centers horizontally. */ - private static final String CENTERS_HORIZONTALLY_LABEL = "Centers Horizontally"; - - /** Label for vertical distribution with uniform gaps. */ - private static final String GAPS_VERTICALLY_LABEL = "Gaps Vertically"; - - /** Label for distribution of centers vertically. */ - private static final String CENTERS_VERTICALLY_LABEL = "Centers Vertically"; - - /** Label for horizontal distribution with uniform gaps. */ - private static final String GAPS_HORIZONTALLY_TOOLTIP = DISTRIBUTE_PREFIX + "With Uniform Gaps Horizontally"; - - /** Label for distribution of centers horizontally. */ - private static final String CENTERS_HORIZONTALLY_TOOLTIP = DISTRIBUTE_PREFIX + "Centers Evenly Horizontally"; - - /** Label for vertical distribution with uniform gaps. */ - private static final String GAPS_VERTICALLY_TOOLTIP = DISTRIBUTE_PREFIX + "With Uniform Gaps Vertically"; - - /** Label for distribution of centers vertically. */ - private static final String CENTERS_VERTICALLY_TOOLTIP = DISTRIBUTE_PREFIX + "Centers Evenly Vertically"; - /** * The distribution type must by one of: * <UL> @@ -136,23 +110,38 @@ public class DistributeAction extends DiagramAction { String label = StringStatics.BLANK; switch (distributeType) { case DistributeAction.GAPS_HORIZONTALLY: - label = DistributeAction.GAPS_HORIZONTALLY_LABEL; + label = Messages.DistributeAction_gapsHorizontallyLabel; break; case DistributeAction.CENTERS_HORIZONTALLY: - label = DistributeAction.CENTERS_HORIZONTALLY_LABEL; + label = Messages.DistributeAction_centersHorizontallyLabel; break; case DistributeAction.GAPS_VERTICALLY: - label = DistributeAction.GAPS_VERTICALLY_LABEL; + label = Messages.DistributeAction_gapsVerticallyLabel; break; case DistributeAction.CENTERS_VERTICALLY: - label = DistributeAction.CENTERS_VERTICALLY_LABEL; + label = Messages.DistributeAction_centersVerticallyLabel; break; default: break; } if (isToolbarItem && !StringStatics.BLANK.equals(label)) { - // Add distribute prefix - label = DistributeAction.DISTRIBUTE_PREFIX + label; + // Use same label but with distribute prefix + switch (distributeType) { + case DistributeAction.GAPS_HORIZONTALLY: + label = Messages.DistributeAction_distributeGapsHorizontallyLabel; + break; + case DistributeAction.CENTERS_HORIZONTALLY: + label = Messages.DistributeAction_distributeCentersHorizontallyLabel; + break; + case DistributeAction.GAPS_VERTICALLY: + label = Messages.DistributeAction_distributeGapsVerticallyLabel; + break; + case DistributeAction.CENTERS_VERTICALLY: + label = Messages.DistributeAction_distributeCentersVerticallyLabel; + break; + default: + break; + } } return label; } @@ -168,16 +157,16 @@ public class DistributeAction extends DiagramAction { String tooltip = StringStatics.BLANK; switch (distributeType) { case DistributeAction.GAPS_HORIZONTALLY: - tooltip = DistributeAction.GAPS_HORIZONTALLY_TOOLTIP; + tooltip = Messages.DistributeAction_distributeGapsHorizontallyTooltip; break; case DistributeAction.CENTERS_HORIZONTALLY: - tooltip = DistributeAction.CENTERS_HORIZONTALLY_TOOLTIP; + tooltip = Messages.DistributeAction_distributeCentersHorizontallyTooltip; break; case DistributeAction.GAPS_VERTICALLY: - tooltip = DistributeAction.GAPS_VERTICALLY_TOOLTIP; + tooltip = Messages.DistributeAction_distributeGapsVerticallyTooltip; break; case DistributeAction.CENTERS_VERTICALLY: - tooltip = DistributeAction.CENTERS_VERTICALLY_TOOLTIP; + tooltip = Messages.DistributeAction_distributeCentersVerticallyTooltip; break; default: break; @@ -390,8 +379,9 @@ public class DistributeAction extends DiagramAction { EditPart part = (EditPart) editparts.get(i); // if there is no common parent, then Distribute isn't // supported. - if (part.getParent() != parent) + if (part.getParent() != parent) { return null; + } } } return parent; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/ArrangeBorderNodesAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/ArrangeBorderNodesAction.java index 0ac21c89fe..20347485c1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/ArrangeBorderNodesAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/ArrangeBorderNodesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2010 THALES GLOBAL SERVICES. + * 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 @@ -23,6 +23,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; import org.eclipse.gmf.runtime.diagram.ui.services.layout.LayoutType; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.sirius.diagram.ui.tools.internal.actions.AbstractDiagramAction; @@ -72,7 +73,7 @@ public class ArrangeBorderNodesAction extends AbstractDiagramAction { protected void initAction(final String id, final String text) { setId(id); setText(text); - setToolTipText("Arrange all the linked border nodes of the diagram."); + setToolTipText(Messages.ArrangeBorderNodesAction_toolTipText); setImageDescriptor(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.ARRANGE_BORDERED_NODES_ICON)); } @@ -123,7 +124,7 @@ public class ArrangeBorderNodesAction extends AbstractDiagramAction { @Override protected String getCommandLabel() { - return "Arrange Linked Border Nodes "; + return Messages.ArrangeBorderNodesAction_commandLabel; } /** @@ -135,7 +136,7 @@ public class ArrangeBorderNodesAction extends AbstractDiagramAction { */ public static ArrangeBorderNodesAction createArrangeBorderNodesAction(final IWorkbenchPage workbenchPage) { final ArrangeBorderNodesAction action = new ArrangeBorderNodesAction(workbenchPage); - action.initAction(ActionIds.ARRANGE_BORDER_NODES, "Linked Border Nodes"); + action.initAction(ActionIds.ARRANGE_BORDER_NODES, Messages.ArrangeBorderNodesAction_actionText); return action; } @@ -148,7 +149,7 @@ public class ArrangeBorderNodesAction extends AbstractDiagramAction { */ public static ArrangeBorderNodesAction createToolBarArrangeBorderNodesAction(final IWorkbenchPage workbenchPage) { final ArrangeBorderNodesAction action = new ArrangeBorderNodesAction(workbenchPage); - action.initAction(ActionIds.ARRANGE_BORDER_NODES_TOOLBAR, "Arrange Linked Border Nodes"); + action.initAction(ActionIds.ARRANGE_BORDER_NODES_TOOLBAR, Messages.ArrangeBorderNodesAction_toolbarActionText); return action; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/CopyLayoutAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/CopyLayoutAction.java index 2746e5bca0..78d4fc9e34 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/CopyLayoutAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/CopyLayoutAction.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2002, 2014 IBM Corporation and others. + * Copyright (c) 2002, 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 @@ -19,6 +19,7 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; +import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.CompoundCommand; import org.eclipse.gmf.runtime.common.core.command.CommandResult; @@ -30,6 +31,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramNameEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManager; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; @@ -59,10 +61,10 @@ public class CopyLayoutAction extends AbstractCopyPasteLayoutAction { public CopyLayoutAction(final IWorkbenchPage workbenchPage, IWorkbenchPart actionWorkbenchPart) { super(workbenchPage, actionWorkbenchPart); - setText("Copy layout"); + setText(Messages.CopyLayoutAction_text); setAccelerator(SWT.CTRL | SWT.SHIFT | SWT.ALT | 'C'); setId(ActionIds.COPY_LAYOUT); - setToolTipText("Copy the layout of the selected diagram elements"); + setToolTipText(Messages.CopyLayoutAction_toolTipText); setImageDescriptor(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.COPY_LAYOUT_ICON)); setDisabledImageDescriptor(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.COPY_LAYOUT_DISABLED_ICON)); @@ -86,7 +88,7 @@ public class CopyLayoutAction extends AbstractCopyPasteLayoutAction { */ @Override protected String getCommandLabel() { - return "Copy Layout"; + return Messages.CopyLayoutAction_commandLabel; } /** @@ -97,8 +99,8 @@ public class CopyLayoutAction extends AbstractCopyPasteLayoutAction { @Override protected Command getCommand() { // Create a compound command to hold the store layout commands - final CompoundCommand doStoreLayoutsCmd = new CompoundCommand("Store layouts"); - doStoreLayoutsCmd.add(new Command("Clear previous layout data") { + final CompoundCommand doStoreLayoutsCmd = new CompoundCommand(Messages.CopyLayoutAction_storeLayoutCommandLabel); + doStoreLayoutsCmd.add(new Command(Messages.CopyLayoutAction_clrearPreviousLayoutDateCommandLabel) { /** * {@inheritDoc} * @@ -142,35 +144,10 @@ public class CopyLayoutAction extends AbstractCopyPasteLayoutAction { List<IGraphicalEditPart> selectedEditParts = cleanSelectedObjects(getSelectedObjects()); // For each selected edit part, store its layout. for (final IGraphicalEditPart toStore : selectedEditParts) { - - doStoreLayoutsCmd.add(new ICommandProxy(new AbstractTransactionalCommand(toStore.getEditingDomain(), "Copy layout data", null) { - - @Override - protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { - for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(diagram.get())) { - layoutDataManager.storeLayoutData(toStore); - } - return CommandResult.newOKCommandResult(); - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doUndo(org.eclipse.core.runtime.IProgressMonitor, - * org.eclipse.core.runtime.IAdaptable) - */ - @Override - protected IStatus doUndo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { - for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(diagram.get())) { - layoutDataManager.clearLayoutData(); - } - return super.doUndo(monitor, info); - } - })); + doStoreLayoutsCmd.add(new ICommandProxy(new CopyLayoutDataCommand(toStore.getEditingDomain(), diagram.get(), toStore))); } } } - return doStoreLayoutsCmd.unwrap(); } @@ -194,4 +171,52 @@ public class CopyLayoutAction extends AbstractCopyPasteLayoutAction { } return result; } + + /** + * A command allowing to copy layout data. + */ + private final class CopyLayoutDataCommand extends AbstractTransactionalCommand { + + private IGraphicalEditPart toStore; + + private DDiagram dDiagram; + + /** + * Default constructor. + * + * @param domain + * the editing domain on which this command will be executed + * @param dDiagram + * the {@link DDiagram} on which layout will be pasted + * @param editPartToStore + * the edit part to store + */ + public CopyLayoutDataCommand(TransactionalEditingDomain domain, DDiagram dDiagram, IGraphicalEditPart editPartToStore) { + super(domain, Messages.CopyLayoutDataCommand_label, null); + this.dDiagram = dDiagram; + this.toStore = editPartToStore; + } + + @Override + protected CommandResult doExecuteWithResult(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { + for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(dDiagram)) { + layoutDataManager.storeLayoutData(toStore); + } + return CommandResult.newOKCommandResult(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doUndo(org.eclipse.core.runtime.IProgressMonitor, + * org.eclipse.core.runtime.IAdaptable) + */ + @Override + protected IStatus doUndo(final IProgressMonitor monitor, final IAdaptable info) throws ExecutionException { + for (SiriusLayoutDataManager layoutDataManager : LayoutDataManagerRegistry.getSiriusLayoutDataManagers(dDiagram)) { + layoutDataManager.clearLayoutData(); + } + return super.doUndo(monitor, info); + } + } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/PasteLayoutAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/PasteLayoutAction.java index 6274ed46f7..776f8aa6a4 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/PasteLayoutAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/layout/PasteLayoutAction.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2002, 2014 IBM Corporation and others. + * Copyright (c) 2002, 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 @@ -29,6 +29,7 @@ import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCo import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManager; import org.eclipse.sirius.diagram.ui.tools.api.layout.SiriusLayoutDataManagerForSemanticElementsFactory; @@ -58,10 +59,10 @@ public class PasteLayoutAction extends AbstractCopyPasteLayoutAction { public PasteLayoutAction(final IWorkbenchPage workbenchPage, IWorkbenchPart actionWorkbenchPart) { super(workbenchPage, actionWorkbenchPart); - setText("Paste layout"); + setText(Messages.PasteLayoutAction_text); setAccelerator(SWT.CTRL | SWT.SHIFT | SWT.ALT | 'V'); setId(ActionIds.PASTE_LAYOUT); - setToolTipText("Paste the current recorded layout to the selected diagram"); + setToolTipText(Messages.PasteLayoutAction_toolTipText); setImageDescriptor(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.PASTE_LAYOUT_ICON)); setDisabledImageDescriptor(DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.PASTE_LAYOUT_DISABLED_ICON)); @@ -85,7 +86,7 @@ public class PasteLayoutAction extends AbstractCopyPasteLayoutAction { */ @Override protected String getCommandLabel() { - return "Paste Layout"; + return Messages.PasteLayoutAction_commandLabel; } /** @@ -99,7 +100,7 @@ public class PasteLayoutAction extends AbstractCopyPasteLayoutAction { if (SiriusLayoutDataManagerForSemanticElementsFactory.getInstance().getSiriusLayoutDataManager().containsData()) { // Create a compound command to hold the resize commands - CompoundCommand doStoreLayoutsCmd = new CompoundCommand("Restore layouts"); + CompoundCommand doStoreLayoutsCmd = new CompoundCommand(Messages.PasteLayoutAction_restoreLayoutCommandLabel); // Create an iterator for the selection final Iterator<?> iter = getSelectedObjects().iterator(); @@ -147,7 +148,7 @@ public class PasteLayoutAction extends AbstractCopyPasteLayoutAction { * the edit part to restore */ public PasteLayoutDataCommand(TransactionalEditingDomain domain, DDiagram dDiagram, IGraphicalEditPart editPartToRestore) { - super(domain, "Paste layout data", null); + super(domain, Messages.PasteLayoutDataCommand_label, null); this.dDiagram = dDiagram; this.editPartToRestore = editPartToRestore; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/PinElementsEclipseAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/PinElementsEclipseAction.java index 89dd327e9d..53c9441da2 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/PinElementsEclipseAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/PinElementsEclipseAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009-2012 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.tools.api.layout.PinHelper; import org.eclipse.sirius.diagram.tools.internal.commands.PinElementsCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; @@ -28,13 +29,11 @@ import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAutho */ public class PinElementsEclipseAction extends AbstractPinUnpinElementsEclipseAction { - private static final String PIN_SELECTED_ELEMENTS = "Pin selected elements"; - /** * Constructor. */ public PinElementsEclipseAction() { - super(PIN_SELECTED_ELEMENTS, ActionIds.PIN_ELEMENTS, PIN_SELECTED_ELEMENTS, DiagramImagesPath.PIN_ELEMENTS_ICON); + super(Messages.PinElementsEclipseAction_text, ActionIds.PIN_ELEMENTS, Messages.PinElementsEclipseAction_text, DiagramImagesPath.PIN_ELEMENTS_ICON); } /** diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/UnpinElementsEclipseAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/UnpinElementsEclipseAction.java index 3f1fc985aa..cfadb0ad56 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/UnpinElementsEclipseAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/pinning/UnpinElementsEclipseAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.tools.api.layout.PinHelper; import org.eclipse.sirius.diagram.tools.internal.commands.UnpinElementsCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; @@ -28,13 +29,11 @@ import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAutho */ public class UnpinElementsEclipseAction extends AbstractPinUnpinElementsEclipseAction { - private static final String UNPIN_SELECTED_ELEMENTS = "Unpin selected elements"; - /** * Constructor. */ public UnpinElementsEclipseAction() { - super(UNPIN_SELECTED_ELEMENTS, ActionIds.UNPIN_ELEMENTS, UNPIN_SELECTED_ELEMENTS, DiagramImagesPath.UNPIN_ELEMENTS_ICON); + super(Messages.UnpinElementsEclipseAction_text, ActionIds.UNPIN_ELEMENTS, Messages.UnpinElementsEclipseAction_text, DiagramImagesPath.UNPIN_ELEMENTS_ICON); } /** diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshDiagramAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshDiagramAction.java index cef0086805..95249ed4e1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshDiagramAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshDiagramAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,6 +27,7 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectUIServices; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.graphical.edit.part.DDiagramHelper; import org.eclipse.sirius.ui.business.api.action.RefreshActionListenerRegistry; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -95,10 +96,10 @@ public class RefreshDiagramAction extends RetargetAction { try { monitorDialog.run(true, false, new RefreshRunnableWithProgress(minimizedSelection)); } catch (final InvocationTargetException e) { - MessageDialog.openError(activeShell, "Error", e.getTargetException().getMessage()); - SiriusPlugin.getDefault().error("Error while refreshing diagram", e); + MessageDialog.openError(activeShell, Messages.RefreshDiagramAction_error, e.getTargetException().getMessage()); + SiriusPlugin.getDefault().error(Messages.RefreshDiagramAction_refreshDiagramError, e); } catch (final InterruptedException e) { - MessageDialog.openInformation(activeShell, "Cancelled", e.getMessage()); + MessageDialog.openInformation(activeShell, Messages.RefreshDiagramAction_cancelled, e.getMessage()); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshRunnableWithProgress.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshRunnableWithProgress.java index 3f04e86dfb..e9b81aa503 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshRunnableWithProgress.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/refresh/RefreshRunnableWithProgress.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2013 THALES GLOBAL SERVICES - * All rights reserved. + * Copyright (c) 2013, 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 + * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Obeo - Initial API and implementation + * Obeo - initial API and implementation *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.actions.refresh; @@ -29,6 +32,7 @@ import org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCom import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.requests.RequestConstants; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; @@ -60,9 +64,10 @@ public class RefreshRunnableWithProgress implements IRunnableWithProgress { * * @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor) */ + @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { - monitor.beginTask("Refresh", editPartsToRefresh.size()); + monitor.beginTask(Messages.RefreshRunnableWithProgress_taskName, editPartsToRefresh.size()); Collection<Command> commandsToExecute = new ArrayList<Command>(); for (final EditPart editPartToRefresh : editPartsToRefresh) { if (editPartToRefresh instanceof IDDiagramEditPart) { @@ -94,7 +99,7 @@ public class RefreshRunnableWithProgress implements IRunnableWithProgress { private void executeInCompoundCommand(Collection<Command> commandsToExecute, IProgressMonitor monitor) { if (!commandsToExecute.isEmpty()) { IDiagramEditDomain domain = getFirstEditingDomain(); - CompoundCommand compoundCommand = new CompoundCommand("Refresh"); + CompoundCommand compoundCommand = new CompoundCommand(Messages.RefreshRunnableWithProgress_commandLabel); for (Command command : commandsToExecute) { compoundCommand.add(command); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/DiagramRepairParticipant.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/DiagramRepairParticipant.java index 0041525fc2..3c7efa5b40 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/DiagramRepairParticipant.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/DiagramRepairParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * 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 @@ -54,6 +54,7 @@ import org.eclipse.sirius.diagram.description.DiagramDescription; import org.eclipse.sirius.diagram.description.filter.FilterDescription; import org.eclipse.sirius.diagram.description.tool.BehaviorTool; import org.eclipse.sirius.diagram.ui.internal.refresh.listeners.GMFDiagramUpdater; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.migration.DiagramCrossReferencer; import org.eclipse.sirius.diagram.ui.tools.internal.actions.repair.commands.RemoveInvalidViewsCommand; import org.eclipse.sirius.viewpoint.DAnalysis; @@ -93,6 +94,7 @@ public class DiagramRepairParticipant implements IRepairParticipant { /** * {@inheritDoc} */ + @Override public void repairStarted() { diagramElementStateFactory = DiagramElementStateFactory.newInstance(); lostNodesByDelete = ArrayListMultimap.create(); @@ -102,6 +104,7 @@ public class DiagramRepairParticipant implements IRepairParticipant { /** * {@inheritDoc} */ + @Override public void repairCompeleted() { Collection<IDiagramElementState<DDiagramElement>> values = elementStatesMap.values(); @@ -117,8 +120,9 @@ public class DiagramRepairParticipant implements IRepairParticipant { /** * {@inheritDoc} */ + @Override public void restoreModelElementState(DView view, IProgressMonitor monitor) { - monitor.subTask("Restoring model state"); + monitor.subTask(Messages.DiagramRepairParticipant_restoreModelStateTaskName); // Creates a new CrossReferencer before restoring the model state (This // cross referencer will return all the references named "element" on // GMF Nodes) @@ -190,6 +194,7 @@ public class DiagramRepairParticipant implements IRepairParticipant { /** * {@inheritDoc} */ + @Override public void postRefreshOperations(TransactionalEditingDomain domain, Resource resource) { this.editingDomain = domain; @@ -201,8 +206,9 @@ public class DiagramRepairParticipant implements IRepairParticipant { /** * {@inheritDoc} */ + @Override public void saveModelElementState(DView view, IProgressMonitor monitor) { - monitor.subTask("Saving model state"); + monitor.subTask(Messages.DiagramRepairParticipant_saveModelStateTaskName); // Creates a new CrossReferencer before saving the model state (This // cross referencer will return all the references named "element" on @@ -286,6 +292,7 @@ public class DiagramRepairParticipant implements IRepairParticipant { /** * {@inheritDoc} */ + @Override public void startRepairOnView(Session session, DView view) { for (DRepresentation representation : view.getOwnedRepresentations()) { @@ -300,6 +307,7 @@ public class DiagramRepairParticipant implements IRepairParticipant { /** * {@inheritDoc} */ + @Override public void endRepairOnView() { for (GMFDiagramUpdater gmfDiagramUpdater : gmfDiagramUpdaters) { gmfDiagramUpdater.dispose(); @@ -364,7 +372,7 @@ public class DiagramRepairParticipant implements IRepairParticipant { } private void removeDiagramElements(final IProgressMonitor monitor, TransactionalEditingDomain transactionalEditingDomain, final List<EObject> toBeRemoved) { - monitor.beginTask("remove Diagram Elements", 1); + monitor.beginTask(Messages.DiagramRepairParticipant_removeDiagramElementTaskName, 1); Command removeDiagramElementsCommand = new RemoveDiagramElementsCommand(new NullProgressMonitor(), toBeRemoved); new MigrationCommandExecutor().execute(transactionalEditingDomain, removeDiagramElementsCommand); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/Identifier.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/Identifier.java index 0ecf2eab44..e004879454 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/Identifier.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/Identifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.actions.repair; +import java.text.MessageFormat; import java.util.List; import org.eclipse.emf.ecore.EObject; @@ -20,6 +21,7 @@ import org.eclipse.sirius.diagram.AbstractDNode; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.migration.IDiagramIdentifierProvider; import org.eclipse.sirius.viewpoint.Customizable; @@ -232,7 +234,7 @@ public final class Identifier { private static void checkNotNull(Object obj, String propertyName) { if (obj == null) { - throw new IllegalArgumentException(propertyName + " cannot be null"); + throw new IllegalArgumentException(MessageFormat.format(Messages.Identifier_invalidNullObject, propertyName)); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/commands/RemoveInvalidViewsCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/commands/RemoveInvalidViewsCommand.java index 01c43fd3f2..d47f692c58 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/commands/RemoveInvalidViewsCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/repair/commands/RemoveInvalidViewsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 THALES GLOBAL SERVICES. + * 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 @@ -22,6 +22,7 @@ import org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.business.api.helper.SiriusUtil; import org.eclipse.sirius.common.tools.DslCommonPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ui.tools.api.profiler.SiriusTasks; /** @@ -41,7 +42,7 @@ public class RemoveInvalidViewsCommand extends IdentityCommand { * Aird {@link Resource} */ public RemoveInvalidViewsCommand(Resource airdResource) { - super("Remove invalid views"); + super(Messages.RemoveInvalidViewsCommand_label); this.airdResource = airdResource; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/ResetStylePropertiesToDefaultValuesAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/ResetStylePropertiesToDefaultValuesAction.java index 71e2bdfad3..6f518f3e25 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/ResetStylePropertiesToDefaultValuesAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/ResetStylePropertiesToDefaultValuesAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -28,6 +28,7 @@ import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.business.api.query.DDiagramElementQuery; import org.eclipse.sirius.diagram.ui.business.api.query.ViewQuery; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.internal.commands.ResetStylePropertiesToDefaultValuesCommand; @@ -48,7 +49,7 @@ import com.google.common.collect.Iterables; public class ResetStylePropertiesToDefaultValuesAction extends Action implements Disposable { /** The action name. */ - public static final String ACTION_NAME = "Reset style properties to default values"; + public static final String ACTION_NAME = Messages.ResetStylePropertiesToDefaultValuesAction_text; /** The action id. */ public static final String ID = "RESET_STYLE_PROPERTIES_TO_DEFAULT_VALUES_ACTION_ID"; //$NON-NLS-1$ @@ -167,6 +168,7 @@ public class ResetStylePropertiesToDefaultValuesAction extends Action implements /** * {@inheritDoc} */ + @Override public void dispose() { this.selection = null; this.page = null; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/SetStyleToWorkspaceImageAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/SetStyleToWorkspaceImageAction.java index 528fbc5677..568db53425 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/SetStyleToWorkspaceImageAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/style/SetStyleToWorkspaceImageAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -27,6 +27,7 @@ import org.eclipse.sirius.diagram.ui.business.api.image.ImageSelectorService; import org.eclipse.sirius.diagram.ui.edit.api.part.IAbstractDiagramNodeEditPart; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuthority; import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; @@ -45,10 +46,10 @@ import org.eclipse.ui.PlatformUI; public class SetStyleToWorkspaceImageAction extends Action { /** Action id for the "Set style to workspace image". */ - public static final String SET_STYLE_TO_WORKSPACE_IMAGE_ACTION_ID = "org.eclipse.sirius.diagram.tools.internal.actions.style"; + public static final String SET_STYLE_TO_WORKSPACE_IMAGE_ACTION_ID = "org.eclipse.sirius.diagram.tools.internal.actions.style"; //$NON-NLS-1$ /** Action name for the "Set style to workspace image". */ - public static final String SET_STYLE_TO_WORKSPACE_IMAGE_ACTION_NAME = "Set style to workspace image"; + public static final String SET_STYLE_TO_WORKSPACE_IMAGE_ACTION_NAME = Messages.SetStyleToWorkspaceImageAction_text; /** * Create an new {@link SetStyleToWorkspaceImageAction}. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineElementsAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineElementsAction.java index 57378f2b78..7687986e60 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineElementsAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineElementsAction.java @@ -18,6 +18,7 @@ import org.eclipse.gef.RootEditPart; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactory; import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactoryProvider; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.editor.DiagramOutlinePage; @@ -27,17 +28,11 @@ import org.eclipse.sirius.diagram.ui.tools.internal.editor.DiagramOutlinePage; * @author dlecan */ public class RevealOutlineElementsAction extends AbstractRevealElementsAction<DDiagramElement> { - - /** - * Action label. - */ - public static final String REVEAL_ELEMENT_LABEL = "Show element"; - /** * Constructor. */ public RevealOutlineElementsAction() { - super(REVEAL_ELEMENT_LABEL); + super(Messages.RevealOutlineElementsAction_label); } /** diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineLabelsAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineLabelsAction.java index a9f1810224..2d6793dc90 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineLabelsAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/actions/visibility/RevealOutlineLabelsAction.java @@ -22,6 +22,7 @@ import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactoryProvid import org.eclipse.sirius.diagram.ui.business.api.provider.AbstractDDiagramElementLabelItemProvider; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.internal.editor.DiagramOutlinePage; @@ -33,17 +34,11 @@ import org.eclipse.sirius.ext.base.Option; * @author lredor */ public class RevealOutlineLabelsAction extends AbstractRevealElementsAction<Object> { - - /** - * Action label. - */ - public static final String REVEAL_LABEL_LABEL = "Show label"; - /** * Constructor. */ public RevealOutlineLabelsAction() { - this(REVEAL_LABEL_LABEL); + this(Messages.RevealOutlineLabelsAction_label); } /** diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/clipboard/SiriusClipboardGlobalActionHandler.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/clipboard/SiriusClipboardGlobalActionHandler.java index fb3d65ccc8..ef4a48ac38 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/clipboard/SiriusClipboardGlobalActionHandler.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/clipboard/SiriusClipboardGlobalActionHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -12,6 +12,7 @@ package org.eclipse.sirius.diagram.ui.tools.internal.clipboard; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.text.MessageFormat; import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashSet; @@ -60,6 +61,7 @@ import org.eclipse.sirius.diagram.tools.internal.command.builders.PasteCommandBu import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager; import org.eclipse.sirius.diagram.ui.business.internal.view.RootLayoutData; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.api.util.GMFNotationHelper; @@ -89,11 +91,6 @@ import com.google.common.collect.Sets; public class SiriusClipboardGlobalActionHandler extends ImageSupportGlobalActionHandler { /** - * Start of the error message when more than one valid paste description. - */ - private static final String MORE_THAN_ONE_PASTE_DESCRIPTION_ERROR_MSG = "There are more than one paste description that match the target container"; - - /** * Keep trace of the paste command computed for canPaste : avoid duplicated * command buildong operation and mouse location change between. */ @@ -104,6 +101,7 @@ public class SiriusClipboardGlobalActionHandler extends ImageSupportGlobalAction * * @see org.eclipse.gmf.runtime.common.ui.action.AbstractGlobalActionHandler#canHandle(IGlobalActionContext) */ + @Override public boolean canHandle(IGlobalActionContext cntxt) { /* @@ -302,7 +300,7 @@ public class SiriusClipboardGlobalActionHandler extends ImageSupportGlobalAction if (session != null && diag != null && !dSelection.isEmpty()) { boolean valid = true; TransactionalEditingDomain domain = session.getTransactionalEditingDomain(); - CompositeTransactionalCommand cc = new CompositeTransactionalCommand(domain, "Paste ..."); + CompositeTransactionalCommand cc = new CompositeTransactionalCommand(domain, Messages.SiriusClipboardGlobalActionHandler_pasteCommandLabel); valid = fillCompositePasteCommand(cc, domain, dSelection, cntxt, activePart); // Append GMF Not paste command @@ -486,8 +484,7 @@ public class SiriusClipboardGlobalActionHandler extends ImageSupportGlobalAction if (bestTool == null) { bestTool = pasteTool; } else { - SiriusPlugin.getDefault().warning(MORE_THAN_ONE_PASTE_DESCRIPTION_ERROR_MSG + " : " + pasteTarget.getTarget() + " (" + bestTool.getName() + " and " + pasteTool.getName() + ").", - new RuntimeException()); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.SiriusClipboardGlobalActionHandler_severalFoundPasteToolError, pasteTarget.getTarget(), bestTool.getName(), pasteTool.getName()), new RuntimeException()); } } @@ -558,7 +555,7 @@ public class SiriusClipboardGlobalActionHandler extends ImageSupportGlobalAction final Set<DSemanticDecorator> dSelection = extractDSelection(cntxt); if (dSelection.size() == 1 && cntxt.getSelection() instanceof IStructuredSelection) { final Point cursorLocation = getCursorLocation(activePart, ((IStructuredSelection) cntxt.getSelection()).iterator().next()); - cc.compose(new AbstractCommand("Add layout data") { + cc.compose(new AbstractCommand(Messages.SiriusClipboardGlobalActionHandler_addLayoutDataCommandLabel) { @Override protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateBehaviorToolsCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateBehaviorToolsCommand.java index faed6b1f1c..c325a77e57 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateBehaviorToolsCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateBehaviorToolsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -17,10 +17,11 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.business.api.helper.concern.ConcernService; import org.eclipse.sirius.diagram.description.tool.BehaviorTool; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to update activated behaviors. - * + * * @author mporhel */ public final class ActivateBehaviorToolsCommand extends RecordingCommand { @@ -31,7 +32,7 @@ public final class ActivateBehaviorToolsCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param newElements @@ -40,7 +41,7 @@ public final class ActivateBehaviorToolsCommand extends RecordingCommand { * the current diagram. */ public ActivateBehaviorToolsCommand(TransactionalEditingDomain domain, DDiagram dDiagram, Collection<BehaviorTool> newElements) { - super(domain, "Activate behavior tools"); + super(domain, Messages.ActivateBehaviorToolsCommand_label); this.diagram = dDiagram; this.newElements = newElements; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateFiltersCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateFiltersCommand.java index 6f4e442b17..e34ba0dd1a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateFiltersCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateFiltersCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -29,11 +29,12 @@ import org.eclipse.sirius.diagram.description.filter.CompositeFilterDescription; import org.eclipse.sirius.diagram.description.filter.Filter; import org.eclipse.sirius.diagram.description.filter.FilterDescription; import org.eclipse.sirius.diagram.description.filter.VariableFilter; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.filter.FilterTools; /** * Specific command to update activated filters. - * + * * @author mporhel */ public final class ActivateFiltersCommand extends RecordingCommand { @@ -44,7 +45,7 @@ public final class ActivateFiltersCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param diagram @@ -53,7 +54,7 @@ public final class ActivateFiltersCommand extends RecordingCommand { * elements to activate */ public ActivateFiltersCommand(TransactionalEditingDomain domain, DDiagram diagram, Collection<FilterDescription> newElements) { - super(domain, "Activate filters"); + super(domain, Messages.ActivateFiltersCommand_label); this.newElements = newElements; this.diagram = diagram; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateRulesCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateRulesCommand.java index fdf744c105..4b02a15493 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateRulesCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ActivateRulesCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -15,11 +15,12 @@ import java.util.Collection; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.validation.ValidationRule; /** * Specific command to update activated rules. - * + * * @author mporhel */ public final class ActivateRulesCommand extends RecordingCommand { @@ -30,7 +31,7 @@ public final class ActivateRulesCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param diagram @@ -39,7 +40,7 @@ public final class ActivateRulesCommand extends RecordingCommand { * elements to activate */ public ActivateRulesCommand(TransactionalEditingDomain domain, DDiagram diagram, Collection<ValidationRule> newElements) { - super(domain, "Activate validation rules"); + super(domain, Messages.ActivateRulesCommand_label); this.newElements = newElements; this.diagram = diagram; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ChangeSynchronizedDagramStatusCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ChangeSynchronizedDagramStatusCommand.java index c468a152ea..84654cbf90 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ChangeSynchronizedDagramStatusCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ChangeSynchronizedDagramStatusCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -13,10 +13,11 @@ package org.eclipse.sirius.diagram.ui.tools.internal.commands; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to change synchronized diagram status. - * + * * @author mporhel */ public class ChangeSynchronizedDagramStatusCommand extends RecordingCommand { @@ -25,14 +26,14 @@ public class ChangeSynchronizedDagramStatusCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param diagram * the diagram to update. */ public ChangeSynchronizedDagramStatusCommand(TransactionalEditingDomain domain, DDiagram diagram) { - super(domain, "Change Synchronized status"); + super(domain, Messages.ChangeSynchronizedDagramStatusCommand_label); this.diagram = diagram; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateBehaviorToolsCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateBehaviorToolsCommand.java index a6234860da..a013662ae1 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateBehaviorToolsCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateBehaviorToolsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -17,10 +17,11 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.business.api.helper.concern.ConcernService; import org.eclipse.sirius.diagram.description.tool.BehaviorTool; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to update activated behaviors. - * + * * @author mporhel */ public final class DeactivateBehaviorToolsCommand extends RecordingCommand { @@ -31,7 +32,7 @@ public final class DeactivateBehaviorToolsCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param oldElements @@ -40,7 +41,7 @@ public final class DeactivateBehaviorToolsCommand extends RecordingCommand { * the current diagram. */ public DeactivateBehaviorToolsCommand(TransactionalEditingDomain domain, DDiagram dDiagram, Collection<BehaviorTool> oldElements) { - super(domain, "Deactivate behavior tools"); + super(domain, Messages.DeactivateBehaviorToolsCommand_label); this.diagram = dDiagram; this.oldElements = oldElements; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateFiltersCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateFiltersCommand.java index 6c45a6b360..a5e312dd41 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateFiltersCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateFiltersCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -18,10 +18,11 @@ import org.eclipse.sirius.common.tools.api.listener.NotificationUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.business.api.helper.concern.ConcernService; import org.eclipse.sirius.diagram.description.filter.FilterDescription; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to update activated filters. - * + * * @author mporhel */ public final class DeactivateFiltersCommand extends RecordingCommand { @@ -32,7 +33,7 @@ public final class DeactivateFiltersCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param diagram @@ -41,7 +42,7 @@ public final class DeactivateFiltersCommand extends RecordingCommand { * elements to deactivate */ public DeactivateFiltersCommand(TransactionalEditingDomain domain, DDiagram diagram, Collection<FilterDescription> oldElements) { - super(domain, "Deactivate filters"); + super(domain, Messages.DeactivateFiltersCommand_label); this.oldElements = oldElements; this.diagram = diagram; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateRulesCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateRulesCommand.java index 6efb9414bb..a7d566090e 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateRulesCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/DeactivateRulesCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -15,11 +15,12 @@ import java.util.Collection; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.validation.ValidationRule; /** * Specific command to update activated rules. - * + * * @author mporhel */ public final class DeactivateRulesCommand extends RecordingCommand { @@ -30,7 +31,7 @@ public final class DeactivateRulesCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param diagram @@ -39,7 +40,7 @@ public final class DeactivateRulesCommand extends RecordingCommand { * elements to deactivate */ public DeactivateRulesCommand(TransactionalEditingDomain domain, DDiagram diagram, Collection<ValidationRule> oldElements) { - super(domain, "Dectivate validation rules"); + super(domain, Messages.DeactivateRulesCommand_label); this.oldElements = oldElements; this.diagram = diagram; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/EdgeRoutingStyleChangedCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/EdgeRoutingStyleChangedCommand.java index ba00a9fad5..b2b641691f 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/EdgeRoutingStyleChangedCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/EdgeRoutingStyleChangedCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -14,10 +14,11 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramEdgeEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to update the routing style of an edge edit part. - * + * * @author mporhel */ public final class EdgeRoutingStyleChangedCommand extends RecordingCommand { @@ -28,7 +29,7 @@ public final class EdgeRoutingStyleChangedCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param msg @@ -37,7 +38,7 @@ public final class EdgeRoutingStyleChangedCommand extends RecordingCommand { * the edge edit part to update. */ public EdgeRoutingStyleChangedCommand(TransactionalEditingDomain domain, IDiagramEdgeEditPart editpart, Notification msg) { - super(domain, "Change routing style"); + super(domain, Messages.EdgeRoutingStyleChangedCommand_label); this.editpart = editpart; this.msg = msg; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeHiddenElementsCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeHiddenElementsCommand.java index fd9f5aaa89..b62c27ceda 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeHiddenElementsCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeHiddenElementsCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -16,11 +16,12 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DDiagramElement; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to add hidden elements to transient reference * hiddenElements. - * + * * @author mporhel */ public final class InitializeHiddenElementsCommand extends RecordingCommand { @@ -31,7 +32,7 @@ public final class InitializeHiddenElementsCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param hiddenElements @@ -40,7 +41,7 @@ public final class InitializeHiddenElementsCommand extends RecordingCommand { * the DDiagram to update. */ public InitializeHiddenElementsCommand(TransactionalEditingDomain domain, DDiagram dDiagram, List<DDiagramElement> hiddenElements) { - super(domain, "Initialize hidden elements"); + super(domain, Messages.InitializeHiddenElementsCommand_label); this.dDiagram = dDiagram; this.hiddenElements = hiddenElements; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeLayoutCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeLayoutCommand.java index bfced71a19..bce6819695 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeLayoutCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/InitializeLayoutCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -16,6 +16,7 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.sirius.business.api.dialect.command.CreateRepresentationCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutUtils; import org.eclipse.sirius.viewpoint.DRepresentation; @@ -24,7 +25,7 @@ import com.google.common.collect.Lists; /** * Specific command to initialize layout after diagram creation from diagram * creation tool description. - * + * * @author mporhel */ public class InitializeLayoutCommand extends RecordingCommand { @@ -37,7 +38,7 @@ public class InitializeLayoutCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param editPart @@ -46,7 +47,7 @@ public class InitializeLayoutCommand extends RecordingCommand { * the creation command. */ public InitializeLayoutCommand(final TransactionalEditingDomain domain, CreateRepresentationCommand command, IGraphicalEditPart editPart) { - super(domain, "Initialize layout"); + super(domain, Messages.InitializeLayoutCommand_label); this.command = command; this.editPart = editPart; } @@ -72,7 +73,7 @@ public class InitializeLayoutCommand extends RecordingCommand { /** * Get the layouted representation. - * + * * @return the layouted representation */ public DRepresentation getLayoutedRepresentation() { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetCurrentConcernCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetCurrentConcernCommand.java index 57bc5e543d..778a42d254 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetCurrentConcernCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetCurrentConcernCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -25,11 +25,12 @@ import org.eclipse.sirius.diagram.description.concern.ConcernDescription; import org.eclipse.sirius.diagram.description.filter.CompositeFilterDescription; import org.eclipse.sirius.diagram.description.filter.FilterDescription; import org.eclipse.sirius.diagram.description.filter.VariableFilter; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.filter.FilterTools; /** * Specific command to set the current concern. - * + * * @author mporhel */ public class SetCurrentConcernCommand extends RecordingCommand { @@ -40,7 +41,7 @@ public class SetCurrentConcernCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain * @param diagram @@ -49,7 +50,7 @@ public class SetCurrentConcernCommand extends RecordingCommand { * the requested concern description */ public SetCurrentConcernCommand(final TransactionalEditingDomain domain, DDiagram diagram, final ConcernDescription desc) { - super(domain, "Set current concern"); + super(domain, Messages.SetCurrentConcernCommand_label); this.diagram = diagram; this.desc = desc; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetDefaultConcernCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetDefaultConcernCommand.java index 43e31937cc..68e521ec19 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetDefaultConcernCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SetDefaultConcernCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -15,10 +15,11 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.sirius.common.tools.api.listener.NotificationUtil; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.business.api.helper.concern.ConcernService; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to set current concern to default. - * + * * @author mporhel */ public final class SetDefaultConcernCommand extends RecordingCommand { @@ -27,14 +28,14 @@ public final class SetDefaultConcernCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param diagram * the current diagram. */ public SetDefaultConcernCommand(TransactionalEditingDomain domain, DDiagram diagram) { - super(domain, "Set current concern to default"); + super(domain, Messages.SetDefaultConcernCommand_label); this.diag = diagram; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SynchronizedDiagramCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SynchronizedDiagramCommand.java index e7aac35763..43068eff83 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SynchronizedDiagramCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/SynchronizedDiagramCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.ui.tools.internal.commands; import java.util.Map; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.actions.SynchronizedDiagramAction; import org.eclipse.sirius.ui.tools.internal.commands.AbstractActionWrapperHandler; @@ -24,7 +25,7 @@ import org.eclipse.ui.menus.UIElement; /** * Toggle between synchronized and unsynchronized diagram modes. - * + * * @author smonnier */ public class SynchronizedDiagramCommand extends AbstractActionWrapperHandler implements IElementUpdater { @@ -38,10 +39,11 @@ public class SynchronizedDiagramCommand extends AbstractActionWrapperHandler imp /** * Update the synchronization contribution menu. {@inheritDoc} - * + * * @see org.eclipse.ui.commands.IElementUpdater#updateElement(org.eclipse.ui.menus.UIElement, * java.util.Map) */ + @Override public void updateElement(final UIElement element, @SuppressWarnings("rawtypes") final Map parameters) { final IWorkbenchWindow window = (IWorkbenchWindow) element.getServiceLocator().getService(IWorkbenchWindow.class); if (window == null) { @@ -55,7 +57,7 @@ public class SynchronizedDiagramCommand extends AbstractActionWrapperHandler imp if (ddiagramEditor.getRepresentation() instanceof DDiagram) { final DDiagram diagram = (DDiagram) ddiagramEditor.getRepresentation(); element.setChecked(!diagram.isSynchronized()); - element.setText("Unsynchronized"); + element.setText(Messages.SynchronizedDiagramCommand_unsynchronizedLabel); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ToggleFoldingStateCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ToggleFoldingStateCommand.java index 6474230d6f..abda93d9ee 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ToggleFoldingStateCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/ToggleFoldingStateCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -25,6 +25,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.query.DEdgeQuery; import org.eclipse.sirius.diagram.ui.business.internal.query.EdgeTargetQuery; import org.eclipse.sirius.diagram.ui.business.internal.query.EdgeTargetQuery.FoldingState; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import com.google.common.base.Predicates; import com.google.common.collect.Iterables; @@ -33,15 +34,10 @@ import com.google.common.collect.Sets; /** * A command to fold all the edges (which support it) which have a given element * as folding point. - * + * * @author pcdavid */ public class ToggleFoldingStateCommand extends RecordingCommand { - /** - * The command's label. - */ - public static final String LABEL = "Toggle edges folding state"; - private final IDiagramElementEditPart part; /** @@ -52,14 +48,14 @@ public class ToggleFoldingStateCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain. * @param part * the folding point from which to start the folding. */ public ToggleFoldingStateCommand(TransactionalEditingDomain domain, IDiagramElementEditPart part) { - super(domain, LABEL); + super(domain, Messages.ToggleFoldingStateCommand_label); this.part = part; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/UpdateGMFEdgeStyleCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/UpdateGMFEdgeStyleCommand.java index 8faf324bb1..fa2ea1f02c 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/UpdateGMFEdgeStyleCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/UpdateGMFEdgeStyleCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * 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 @@ -17,10 +17,11 @@ import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.Routing; import org.eclipse.sirius.diagram.EdgeRouting; import org.eclipse.sirius.diagram.EdgeStyle; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Specific command to update GMF style. - * + * * @author <a href="mailto:steve.monnier@obeo.fr">Steve Monnier</a> */ public class UpdateGMFEdgeStyleCommand extends RecordingCommand { @@ -31,7 +32,7 @@ public class UpdateGMFEdgeStyleCommand extends RecordingCommand { /** * Constructor. - * + * * @param domain * the editing domain * @param edge @@ -40,7 +41,7 @@ public class UpdateGMFEdgeStyleCommand extends RecordingCommand { * style to put at edge */ public UpdateGMFEdgeStyleCommand(final TransactionalEditingDomain domain, final Edge edge, EdgeStyle style) { - super(domain, "Update GMF Edge Style"); + super(domain, Messages.UpdateGMFEdgeStyleCommand_label); this.edge = edge; this.style = style; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/CopyToSiriusClipboardCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/CopyToSiriusClipboardCommand.java index 49ec160fbd..1a124ca2c0 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/CopyToSiriusClipboardCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/CopyToSiriusClipboardCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.edit.command.CopyToClipboardCommand; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.clipboard.SiriusClipboardManager; import org.eclipse.sirius.viewpoint.DSemanticDecorator; @@ -28,7 +29,7 @@ import com.google.common.collect.Sets; /** * A copy command which is a proxy to {@link CopyToClipboardCommand} but set the * copy result to a viewpoint clipboard. - * + * * @author mporhel */ public class CopyToSiriusClipboardCommand extends RecordingCommand implements AbstractCommand.NonDirtying { @@ -48,10 +49,10 @@ public class CopyToSiriusClipboardCommand extends RecordingCommand implements Ab /** * Creates a new {@link CopyToSiriusClipboardCommand}. - * + * * The links between elements and semanticElements will be copied. Others * references will target original objects. - * + * * @param domain * the editing domain. * @param dElements @@ -60,7 +61,7 @@ public class CopyToSiriusClipboardCommand extends RecordingCommand implements Ab * the semantic elements to copy. */ public CopyToSiriusClipboardCommand(final TransactionalEditingDomain domain, final Collection<DSemanticDecorator> dElements, Collection<EObject> semanticElements) { - super(domain, "Copy to clipboard"); + super(domain, Messages.CopyToSiriusClipboardCommand_label); this.domain = domain; this.dElementsToCopy.addAll(dElements); this.elementsToCopy.addAll(semanticElements); @@ -68,7 +69,7 @@ public class CopyToSiriusClipboardCommand extends RecordingCommand implements Ab /** * This returns the collection of objects to be copied to the clipboard. - * + * * @return the object to copy. */ public Collection<?> getSourceObjects() { @@ -89,6 +90,7 @@ public class CopyToSiriusClipboardCommand extends RecordingCommand implements Ab /** * {@inheritDoc} */ + @Override public void doExecute() { if (copyCommand != null) { copyCommand.execute(); @@ -104,7 +106,7 @@ public class CopyToSiriusClipboardCommand extends RecordingCommand implements Ab * This gives an abbreviated name using this object's own class' name, * without package qualification, followed by a space separated list of * <tt>field:value</tt> pairs. - * + * * {@inheritDoc} */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/PasteFromSiriusClipboardCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/PasteFromSiriusClipboardCommand.java index 15eac5fee7..c4bd101abb 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/PasteFromSiriusClipboardCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/PasteFromSiriusClipboardCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.edit.command.PasteFromClipboardCommand; import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.clipboard.SiriusClipboardManager; import org.eclipse.sirius.viewpoint.DSemanticDecorator; @@ -26,7 +27,7 @@ import com.google.common.collect.Lists; /** * A command to paste from viewpoint clipboard into a new container. - * + * * @author mporhel */ public class PasteFromSiriusClipboardCommand extends RecordingCommand { @@ -43,15 +44,15 @@ public class PasteFromSiriusClipboardCommand extends RecordingCommand { /** * Creates a new {@link PasteFromSiriusClipboardCommand}. - * + * * @param domain * the current editing domain. - * + * * @param semanticContainer * the element which triggered the paste. */ public PasteFromSiriusClipboardCommand(TransactionalEditingDomain domain, final EObject semanticContainer) { - super(domain, "Generic Paste from clipboard"); + super(domain, Messages.PasteFromSiriusClipboardCommand_label); this.domain = domain; this.container = semanticContainer; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/SelectionWizardCommand.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/SelectionWizardCommand.java index f16ae934e9..5296883598 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/SelectionWizardCommand.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/commands/emf/SelectionWizardCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -30,6 +30,7 @@ import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.tools.api.command.IDiagramCommandFactory; import org.eclipse.sirius.diagram.ui.business.api.view.SiriusLayoutDataManager; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -39,7 +40,7 @@ import org.eclipse.ui.PlatformUI; /** * A command to display a selection wizard. - * + * * @author mchauvin */ public class SelectionWizardCommand extends AbstractSelectionWizardCommand { @@ -54,7 +55,7 @@ public class SelectionWizardCommand extends AbstractSelectionWizardCommand { /** * Default constructor. - * + * * @param factory * the command factory. * @param tool @@ -74,7 +75,7 @@ public class SelectionWizardCommand extends AbstractSelectionWizardCommand { /** * {@inheritDoc} - * + * * @see org.eclipse.emf.transaction.RecordingCommand#doExecute() */ @Override @@ -89,8 +90,8 @@ public class SelectionWizardCommand extends AbstractSelectionWizardCommand { shell = new Shell(); createdShell = true; } - final EObjectSelectionWizard wizard = new EObjectSelectionWizard(this.tool.getWindowTitle(), this.tool.getMessage(), getImage(), input, DiagramUIPlugin.getPlugin() - .getItemProvidersAdapterFactory()); + final EObjectSelectionWizard wizard = new EObjectSelectionWizard(this.tool.getWindowTitle(), this.tool.getMessage(), getImage(), input, + DiagramUIPlugin.getPlugin().getItemProvidersAdapterFactory()); wizard.setMany(tool.isMultiple()); final WizardDialog dlg = new WizardDialog(shell, wizard); final int result = dlg.open(); @@ -108,7 +109,7 @@ public class SelectionWizardCommand extends AbstractSelectionWizardCommand { if (createdShell) { shell.dispose(); } - throw new OperationCanceledException("User cancel operation"); + throw new OperationCanceledException(Messages.SelectionWizardCommand_cancelExceptionMsg); } } @@ -149,7 +150,7 @@ public class SelectionWizardCommand extends AbstractSelectionWizardCommand { /** * {@inheritDoc} - * + * * @see org.eclipse.emf.common.command.AbstractCommand#getLabel() */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/DiagramElementsSelectionDialog.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/DiagramElementsSelectionDialog.java index 817148b027..3815fd4701 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/DiagramElementsSelectionDialog.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/DiagramElementsSelectionDialog.java @@ -43,6 +43,7 @@ import org.eclipse.sirius.diagram.provider.DiagramItemProviderAdapterFactory; import org.eclipse.sirius.diagram.ui.business.api.provider.AbstractDDiagramElementLabelItemProvider; import org.eclipse.sirius.diagram.ui.business.api.provider.DDiagramElementContainerLabelItemProvider; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.internal.providers.FilteredTreeContentProvider; import org.eclipse.sirius.diagram.ui.tools.internal.views.providers.outline.OutlineLabelProvider; @@ -105,6 +106,7 @@ import com.google.common.collect.Sets; public class DiagramElementsSelectionDialog { private static final Function<Object, Void> DO_NOTHING = new Function<Object, Void>() { + @Override public Void apply(Object from) { return null; }; @@ -155,23 +157,6 @@ public class DiagramElementsSelectionDialog { protected final class CustomTreeSelectionDialog extends CheckedTreeSelectionDialog { /** - * A String used to identify the Text allowing user to type regular - * expression (can be used for testing). - */ - public static final String REGEXP_TOOL_TIP = "Expression that will be used to filer elements by name (for example 'abc', 'a?c', '*c'...)"; - - /** - * The title of the Group allowing user to type Regular Expressions and - * filter the selection. - */ - private static final String REGEXP_TITLE = "Filter elements by name"; - - /** - * The String explaining to user how to use regular expressions. - */ - private static final String REGEXP_EXPLANATIONS = "? = any character, * = any String"; - - /** * A matcher used to determine if a given DDiagramElement is matching * the regular expression typed by user. It's updated each time the user * modify the regular expression. @@ -219,15 +204,18 @@ public class DiagramElementsSelectionDialog { Control result = super.createContents(parent); getTreeViewer().setCheckStateProvider(new ICheckStateProvider() { + @Override public boolean isGrayed(Object element) { return isGrayed.apply(element); } + @Override public boolean isChecked(Object element) { return checkedElements.contains(element); } }); getTreeViewer().addCheckStateListener(new ICheckStateListener() { + @Override public void checkStateChanged(CheckStateChangedEvent event) { if (!isGrayed.apply(event.getElement())) { if (event.getChecked()) { @@ -304,7 +292,7 @@ public class DiagramElementsSelectionDialog { data.grabExcessHorizontalSpace = true; composite.setData(data); - new Label(buttonComposite, SWT.LEAD).setText("Show"); + new Label(buttonComposite, SWT.LEAD).setText(Messages.CustomTreeSelectionDialog_showLabelText); final Combo choices = new Combo(buttonComposite, SWT.READ_ONLY); choices.add(FilteringMode.SHOW_ALL.getName()); choices.add(FilteringMode.SHOW_ONLY_CHECKED_ELEMENTS.getName()); @@ -335,7 +323,7 @@ public class DiagramElementsSelectionDialog { data = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); data.grabExcessHorizontalSpace = true; - addButton(buttonComposite, "Check All", DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.CHECK_ALL_ICON), new SelectionAdapter() { + addButton(buttonComposite, Messages.CustomTreeSelectionDialog_checkAllButtonTooltip, DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.CHECK_ALL_ICON), new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { checkAll(); @@ -347,7 +335,7 @@ public class DiagramElementsSelectionDialog { } }).setLayoutData(data); - addButton(buttonComposite, "Uncheck All", DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.UNCHECK_ALL_ICON), new SelectionAdapter() { + addButton(buttonComposite, Messages.CustomTreeSelectionDialog_uncheckAllButtonTooltip, DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.UNCHECK_ALL_ICON), new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { uncheckAll(); @@ -359,14 +347,14 @@ public class DiagramElementsSelectionDialog { } }).setLayoutData(data); - addButton(buttonComposite, "Expand All", DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.EXPAND_ALL_ICON), new SelectionAdapter() { + addButton(buttonComposite, Messages.CustomTreeSelectionDialog_expandAllButtonTooltip, DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.EXPAND_ALL_ICON), new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { expandAll(); } }).setLayoutData(data); - addButton(buttonComposite, "Collapse All", DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.COLLAPSE_ALL_ICON), new SelectionAdapter() { + addButton(buttonComposite, Messages.CustomTreeSelectionDialog_collapaseAllTooltip, DiagramUIPlugin.getPlugin().getBundledImage(DiagramImagesPath.COLLAPSE_ALL_ICON), new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { collapseAll(); @@ -386,7 +374,7 @@ public class DiagramElementsSelectionDialog { private void createRegexpTypeZone(Composite composite) { // Step 1 : create Group Group expregGroup = new Group(composite, SWT.NONE); - expregGroup.setText(REGEXP_TITLE); + expregGroup.setText(Messages.CustomTreeSelectionDialog_regexpTitle); GridLayout expregLayout = new GridLayout(); expregGroup.setLayout(expregLayout); expregGroup.setFont(composite.getFont()); @@ -394,16 +382,17 @@ public class DiagramElementsSelectionDialog { // Step 2 : create explanations zone final Label explanationsLabel = new Label(expregGroup, SWT.NONE); - explanationsLabel.setText(REGEXP_EXPLANATIONS); + explanationsLabel.setText(Messages.CustomTreeSelectionDialog_regexpExplanations); // Step 3 : create the text zone in which user will type the expreg final Text regularExpressionText = new Text(expregGroup, SWT.BORDER); - regularExpressionText.setToolTipText(REGEXP_TOOL_TIP); + regularExpressionText.setToolTipText(Messages.CustomTreeSelectionDialog_regexpTooltip); regularExpressionText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); // Step 4 : add modify listener to this textZone regularExpressionText.addModifyListener(new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { String typedRegex = ((Text) e.getSource()).getText(); // Each time the regular expression is modified, the @@ -544,6 +533,7 @@ public class DiagramElementsSelectionDialog { return true; } else { return Iterables.any(Arrays.asList(contentProvider.getChildren(element)), new Predicate<Object>() { + @Override public boolean apply(Object input) { return isOrHasDescendant(input, pred); } @@ -579,15 +569,15 @@ public class DiagramElementsSelectionDialog { /** * Filtering mode in which all elements are considered. */ - SHOW_ALL("all elements"), + SHOW_ALL(Messages.FilteringMode_allElements), /** * Filtering mode in which only checked elements are considered. */ - SHOW_ONLY_CHECKED_ELEMENTS("only checked elements"), + SHOW_ONLY_CHECKED_ELEMENTS(Messages.FilteringMode_onlyCheckedElements), /** * Filtering mode in which only unchecked elements are considered. */ - SHOW_ONLY_UNCHECKED_ELEMENTS("only unchecked elements"); + SHOW_ONLY_UNCHECKED_ELEMENTS(Messages.FilteringMode_onlyUncheckedElements); private final String name; @@ -775,7 +765,7 @@ public class DiagramElementsSelectionDialog { if (!Predicates.alwaysFalse().equals(isGrayed)) { StringBuilder sb = new StringBuilder(message); sb.append("\n"); //$NON-NLS-1$ - sb.append("The wizard will have no effect on grayed elements."); + sb.append(Messages.DiagramElementsSelectionDialog_grayedElementDialogMessage); msg = sb.toString(); } dialog.setMessage(msg); @@ -950,6 +940,7 @@ public class DiagramElementsSelectionDialog { /** * {@inheritDoc} */ + @Override public Color getForeground(final Object element) { Color foreground = null; @@ -962,6 +953,7 @@ public class DiagramElementsSelectionDialog { /** * {@inheritDoc} */ + @Override public Color getBackground(Object element) { return null; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/SelectDiagramElementBackgroundImageDialog.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/SelectDiagramElementBackgroundImageDialog.java index 43c1b4a340..2cb7cb0275 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/SelectDiagramElementBackgroundImageDialog.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/SelectDiagramElementBackgroundImageDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -23,6 +23,7 @@ import org.eclipse.jface.fieldassist.FieldDecorationRegistry; import org.eclipse.sirius.diagram.DiagramFactory; import org.eclipse.sirius.diagram.DiagramPackage; import org.eclipse.sirius.diagram.WorkspaceImage; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.BasicLabelStyle; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; @@ -41,8 +42,6 @@ import org.eclipse.swt.widgets.Text; */ public class SelectDiagramElementBackgroundImageDialog extends Dialog { - private static final String DIALOG_TITLE = "Select background image from workspace"; - private WorkspaceImage workspaceImageForWorkspace; private Label workspacePathLabel; @@ -100,7 +99,7 @@ public class SelectDiagramElementBackgroundImageDialog extends Dialog { fromWorkspaceComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true)); workspacePathLabel = new Label(fromWorkspaceComposite, SWT.NONE); - workspacePathLabel.setText("Path:"); + workspacePathLabel.setText(Messages.SelectDiagramElementBackgroundImageDialog_pathLabelText); workspacePathText = new Text(fromWorkspaceComposite, SWT.FLAT | SWT.BORDER); workspacePathText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); @@ -115,7 +114,7 @@ public class SelectDiagramElementBackgroundImageDialog extends Dialog { ctx.bindValue(workspacePathTextObservable, workspaceImageObservable, new UpdateValueStrategy().setAfterConvertValidator(workspacePathValidator), null); browseButton = new Button(fromWorkspaceComposite, SWT.NONE); - browseButton.setText("Browse"); + browseButton.setText(Messages.SelectDiagramElementBackgroundImageDialog_browseButtonText); browseButton.addSelectionListener(new WorkspaceImagePathSelector(workspacePathText)); } @@ -128,7 +127,7 @@ public class SelectDiagramElementBackgroundImageDialog extends Dialog { @Override protected void configureShell(final Shell shell) { super.configureShell(shell); - shell.setText(DIALOG_TITLE); + shell.setText(Messages.SelectDiagramElementBackgroundImageDialog_title); shell.setMinimumSize(500, 100); setShellStyle(getShellStyle() | SWT.RESIZE | SWT.MAX); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java index 2ce63bb4b3..d294ada1c8 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspaceImagePathSelector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * 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 @@ -21,6 +21,7 @@ import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.sirius.common.ui.tools.api.resource.WorkspaceResourceDialogWithFilter; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.widgets.Text; @@ -59,12 +60,13 @@ public class WorkspaceImagePathSelector extends SelectionAdapter { /** * {@inheritDoc} */ + @Override public void widgetSelected(SelectionEvent e) { List<ViewerFilter> filters = Lists.newArrayList(); if (IMAGE_FILE_EXTENSIONS != null) { filters.add(new FileExtensionFilter(IMAGE_FILE_EXTENSIONS)); } - IFile[] selectedResources = WorkspaceResourceDialogWithFilter.openFileSelection(PlatformUI.getWorkbench().getDisplay().getActiveShell(), "Background image", "Select the image file:", false, + IFile[] selectedResources = WorkspaceResourceDialogWithFilter.openFileSelection(PlatformUI.getWorkbench().getDisplay().getActiveShell(), Messages.WorkspaceImagePathSelector_dialogTitle, Messages.WorkspaceImagePathSelector_dialogMessage, false, null, filters); if (selectedResources != null && selectedResources.length == 1) { workspacePathText.setText(selectedResources[0].getFullPath().makeRelative().toString()); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspacePathValidator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspacePathValidator.java index ff7af50154..68ec4e57ff 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspacePathValidator.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/dialogs/WorkspacePathValidator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * 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 @@ -20,6 +20,7 @@ import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.jface.fieldassist.ControlDecoration; import org.eclipse.sirius.common.tools.api.resource.FileProvider; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * A {@link IValidator} to validate the workspace path entered in the text @@ -44,6 +45,7 @@ public class WorkspacePathValidator implements IValidator { /** * {@inheritDoc} */ + @Override public IStatus validate(Object value) { IStatus status = Status.OK_STATUS; if (value instanceof String && controlDecoration.getControl().isEnabled()) { @@ -53,8 +55,8 @@ public class WorkspacePathValidator implements IValidator { File file = FileProvider.getDefault().getFile(path); if (file == null || !file.exists()) { controlDecoration.show(); - controlDecoration.setDescriptionText("The specified path does not correspond to an image in the workspace or in the runtime"); - status = ValidationStatus.error("NonExistingImageResource"); + controlDecoration.setDescriptionText(Messages.WorkspacePathValidator_invalidPathDecorationDescriptionText); + status = ValidationStatus.error(Messages.WorkspacePathValidator_invalidPahtStatusMessage); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/edit/command/CommandFactory.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/edit/command/CommandFactory.java index 6e9b2f9048..4140a8c911 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/edit/command/CommandFactory.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/edit/command/CommandFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -25,12 +25,13 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult; import org.eclipse.gmf.runtime.common.core.command.ICommand; import org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand; import org.eclipse.sirius.diagram.ui.business.internal.operation.AbstractModelChangeOperation; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * Helper class to convert an {@link AbstractModelChangeOperation}s into either * a plain EMF Transaction {@link RecordingCommand} or a GMF-compatible * {@link ICommand}. - * + * * @author pcdavid */ public final class CommandFactory { @@ -40,29 +41,29 @@ public final class CommandFactory { /** * Converts these operations into an EMF Transaction recording command. - * + * * @param ted * the editing domain in which to command will execute. * @param operations * the array of operation to convert. - * + * * @param <T> * the return type of the operation. * @return a recording command which will execute this operation. */ public static <T> RecordingCommand createRecordingCommand(TransactionalEditingDomain ted, final Collection<AbstractModelChangeOperation<T>> operations) { - String name = operations.isEmpty() ? "Do nothing" : operations.iterator().next().getName(); + String name = operations.isEmpty() ? Messages.CommandFactory_doNothingLabel : operations.iterator().next().getName(); return new RecordingCommandsExecutor<T>(ted, name, operations); } /** * Converts this operation into an EMF Transaction recording command. - * + * * @param ted * the editing domain in which to command will execute. * @param operation * the operation to convert. - * + * * @param <T> * the return type of the operation. * @return a recording command which will execute this operation. @@ -73,12 +74,12 @@ public final class CommandFactory { /** * Converts these operations into an EMF Transaction recording command. - * + * * @param ted * the editing domain in which to command will execute. * @param operations * the array of operation to convert. - * + * * @param <T> * the return type of the operation. * @return a recording command which will execute this operation. @@ -89,18 +90,18 @@ public final class CommandFactory { /** * Converts these operations into a GMF-compatible ICommand. - * + * * @param ted * the editing domain in which to command will execute. * @param operations * the operations to convert. - * + * * @param <T> * the return types of the operations. * @return a GMF-compatible command which will execute this operation. */ public static <T> ICommand createICommand(TransactionalEditingDomain ted, final Collection<AbstractModelChangeOperation<T>> operations) { - String name = operations.isEmpty() ? "Do nothing" : operations.iterator().next().getName(); + String name = operations.isEmpty() ? Messages.CommandFactory_doNothingLabel : operations.iterator().next().getName(); return new AbstractTransactionalCommand(ted, name, null) { @Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { @@ -118,12 +119,12 @@ public final class CommandFactory { /** * Converts this operation into a GMF-compatible ICommand. - * + * * @param ted * the editing domain in which to command will execute. * @param operation * the operation to convert. - * + * * @param <T> * the return type of the operation. * @return a GMF-compatible command which will execute this operation. @@ -134,12 +135,12 @@ public final class CommandFactory { /** * Converts these operations into a GMF-compatible ICommand. - * + * * @param ted * the editing domain in which to command will execute. * @param operations * the operations to convert. - * + * * @param <T> * the return types of the operations. * @return a GMF-compatible command which will execute this operation. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/AbstractExtendedContentOutlinePage.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/AbstractExtendedContentOutlinePage.java index 317b35135e..75d19122dd 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/AbstractExtendedContentOutlinePage.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/AbstractExtendedContentOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2006, 2007, 2008 IBM Corporation and others. + * Copyright (c) 2000, 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 @@ -33,6 +33,7 @@ import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.sirius.common.ui.tools.api.util.SWTUtil; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -75,12 +76,6 @@ import org.eclipse.ui.views.contentoutline.IContentOutlinePage; public abstract class AbstractExtendedContentOutlinePage extends Page implements IContentOutlinePage, ISelectionChangedListener, ISelectionListener { /** - * The name to associate to the job in charge of setting this outline's - * selection. - */ - private static final String SET_SELECTION_JOB_NAME = "Refreshing outline"; - - /** * The delay to use for scheduling the setSelectionJob. */ private static final int SET_SELECTION_JOB_SCHEDULE_DELAY = 300; @@ -132,6 +127,7 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements * * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) */ + @Override public void addSelectionChangedListener(final ISelectionChangedListener listener) { selectionChangedListeners.add(listener); } @@ -221,6 +217,7 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements for (int i = 0; i < listeners.length; ++i) { final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i]; SafeRunner.run(new SafeRunnable() { + @Override public void run() { l.selectionChanged(event); } @@ -264,6 +261,7 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements * * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection() */ + @Override public ISelection getSelection() { if (treeViewer == null) { return StructuredSelection.EMPTY; @@ -276,6 +274,7 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements * * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) */ + @Override public void removeSelectionChangedListener(final ISelectionChangedListener listener) { selectionChangedListeners.remove(listener); } @@ -285,6 +284,7 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements * * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) */ + @Override public void selectionChanged(final SelectionChangedEvent event) { fireSelectionChanged(event.getSelection()); } @@ -302,6 +302,7 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements * * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection) */ + @Override public void setSelection(final ISelection selection) { // Setting the selection on the treeViewer can be rather long, as @@ -310,10 +311,11 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements if (setSelectionJob != null) { setSelectionJob.cancel(); } - setSelectionJob = new Job(SET_SELECTION_JOB_NAME) { + setSelectionJob = new Job(Messages.AbstractExtendedContentOutlinePage_setSelectionJobName) { @Override protected IStatus run(IProgressMonitor monitor) { Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { if (treeViewer != null) { treeViewer.setSelection(selection); @@ -362,6 +364,7 @@ public abstract class AbstractExtendedContentOutlinePage extends Page implements * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, * org.eclipse.jface.viewers.ISelection) */ + @Override public void selectionChanged(final IWorkbenchPart part, final ISelection selection) { if (!(part instanceof ContentOutline)) { if (selection instanceof IStructuredSelection) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java index 56764961b4..0a182eb645 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java @@ -128,6 +128,7 @@ import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorUtil; import org.eclipse.sirius.diagram.ui.part.ValidateAction; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.palette.PaletteManager; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.palette.ToolFilter; @@ -216,7 +217,7 @@ import com.google.common.collect.Sets; /** * The diagram editor. - * + * * @author mchauvin * @since 0.9.0 */ @@ -228,7 +229,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE * Constructs a new AbstractTransferDropTargetListener and sets the * EditPartViewer and Transfer. The Viewer's Control should be the Drop * target. - * + * * @param viewer * the EditPartViewer * @param xfer @@ -390,7 +391,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE try { refreshJob.join(); } catch (InterruptedException e) { - DiagramPlugin.getDefault().getLog().log(new Status(IStatus.INFO, DiagramPlugin.ID, "Refresh job got interrupted", e)); + DiagramPlugin.getDefault().getLog().log(new Status(IStatus.INFO, DiagramPlugin.ID, Messages.DDiagramEditorImpl_refreshJobInterruptedMsg, e)); } } disposeGraphicalListeners(); @@ -400,7 +401,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * We have to take care of the case when Eclipse starts up with a session. * and diagram already open. {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.part.SiriusDiagramEditor#init(org.eclipse.ui.IEditorSite, * org.eclipse.ui.IEditorInput) */ @@ -450,7 +451,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE initPermissionAuthority(); } catch (NullPointerException e) { - DiagramPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, DiagramPlugin.ID, "Error while getting the session.", e)); + DiagramPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, DiagramPlugin.ID, Messages.DDiagramEditorImpl_noSessionMsg, e)); } } @@ -513,7 +514,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Overridden to instantiate a {@link SiriusPaletteViewer} instead of the * standard one, to support creation from the palette with drag'n drop. - * + * * {@inheritDoc} */ @Override @@ -535,7 +536,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Overridden to change the visibility of the inherited method. - * + * * {@inheritDoc} */ @Override @@ -590,7 +591,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId())); keyHandler.put(/* CTRL + D */ - KeyStroke.getPressed((char) 0x4, 100, SWT.CTRL), getActionRegistry().getAction(ActionIds.ACTION_DELETE_FROM_MODEL)); + KeyStroke.getPressed((char) 0x4, 100, SWT.CTRL), getActionRegistry().getAction(ActionIds.ACTION_DELETE_FROM_MODEL)); } return keyHandler; } @@ -606,7 +607,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE // Run refresh in a job to avoid taking lock on the Workspace on // representation change, while the lock is already taken on odesign // change - refreshJob = new Job("Refresh ") { + refreshJob = new Job(Messages.DDiagramEditorImpl_refreshJobLabel) { @Override protected IStatus run(IProgressMonitor monitor) { @@ -636,7 +637,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Overridden to not create a new {@link TransactionalEditingDomain} but * return the {@link Session#getTransactionalEditingDomain()}. - * + * * @return the {@link Session#getTransactionalEditingDomain()} */ @Override @@ -646,7 +647,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Called when the diagram is displayed. Updates the Palette. - * + * * {@inheritDoc} */ @Override @@ -835,7 +836,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE } return result; } - }, new IObjectActionDelegateWrapper(new RevealOutlineElementsAction(), RevealOutlineElementsAction.REVEAL_ELEMENT_LABEL) { + }, new IObjectActionDelegateWrapper(new RevealOutlineElementsAction(), Messages.RevealOutlineElementsAction_label) { @Override public ImageDescriptor getImageDescriptor() { @@ -852,7 +853,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE } return false; } - }, new IObjectActionDelegateWrapper(new RevealOutlineLabelsAction(), RevealOutlineLabelsAction.REVEAL_LABEL_LABEL) { + }, new IObjectActionDelegateWrapper(new RevealOutlineLabelsAction(), Messages.RevealOutlineLabelsAction_label) { @Override public ImageDescriptor getImageDescriptor() { @@ -983,7 +984,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE // An issue has been encountered while connecting to // remote CDO server if (DiagramUIPlugin.getPlugin().isDebugging()) { - DiagramUIPlugin.getPlugin().getLog().log(new Status(IStatus.WARNING, DiagramUIPlugin.ID, "Error while connecting to remote CDO server")); + DiagramUIPlugin.getPlugin().getLog().log(new Status(IStatus.WARNING, DiagramUIPlugin.ID, Messages.DDiagramEditorImpl_cdoServerConnectionPbMsg)); } } } else { @@ -1098,9 +1099,9 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Overridden to delegate {@link SessionListener} events to * {@link DDiagramEditorSessionListenerDelegate}. - * + * * {@inheritDoc} - * + * * @since 0.9.0 */ @Override @@ -1123,7 +1124,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Method to update some ui parts according to events. - * + * * @param notificationKind * the event to update ui parts. */ @@ -1284,7 +1285,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Return true if the header must be enabled, false otherwise. - * + * * @return true if the header must be enabled, false otherwise. */ public boolean isHeaderSectionEnabled() { @@ -1304,7 +1305,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Get the tab bar. - * + * * @return Returns the tab bar */ public Tabbar getTabbar() { @@ -1313,7 +1314,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Set the tab bar. - * + * * @param tabbar * the tab bar to set . */ @@ -1323,7 +1324,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Create classic diagram graphical viewer. - * + * * @param parent * the parent composite */ @@ -1345,7 +1346,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * {@inheritDoc} - * + * * @not-generated : we're making sure the property is set as soon as * possible. */ @@ -1437,7 +1438,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Sets my undo context. - * + * * @param context * the undo context */ @@ -1474,14 +1475,14 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * This will create the quick outline presenter and install it on this * editor. - * + * * @return The quick outline presenter. */ public SiriusInformationPresenter getQuickOutlinePresenter() { SiriusInformationPresenter informationPresenter = new SiriusInformationPresenter(new IInformationControlCreator() { /** * {@inheritDoc} - * + * * @see org.eclipse.jface.text.IInformationControlCreator#createInformationControl(org.eclipse.swt.widgets.Shell) */ @Override @@ -1581,7 +1582,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE * weakHashMap used bu DiagramEventBroker is not clean.<BR> * But if there is no more GMF editor, using this transactional editing * domain, opened when can remove the diagram event broker to be more clear. - * + * * @param ted * The transactional editing domain used by the current editor. */ @@ -1618,7 +1619,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * {@inheritDoc} - * + * * Overridden for two reason: <br/> * - to update the given input in case the URI is a DDiagram instead of a * GMF Diagram <br/> @@ -1639,7 +1640,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE DDiagram dDiagram = (DDiagram) eObject; final DiagramCreationUtil util = new DiagramCreationUtil(dDiagram); if (!util.findAssociatedGMFDiagram()) { - DiagramPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, DiagramPlugin.ID, "The gmf diagram is expected to be created before calling setInput() on the editor")); + DiagramPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, DiagramPlugin.ID, Messages.DDiagramEditorImpl_noAssociatedGMFDiagramMsg)); } final Diagram gmfDiag = util.getAssociatedGMFDiagram(); updatedEditorInput = new SessionEditorInput(EcoreUtil.getURI(gmfDiag), dDiagram.getName(), session); @@ -1717,7 +1718,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /** * Return the diagram header composite. - * + * * @return the diagram header composite */ public DiagramHeaderComposite getDiagramHeader() { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DiagramDialectEditorDialogFactory.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DiagramDialectEditorDialogFactory.java index 9f217d8d64..ec72d1911c 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DiagramDialectEditorDialogFactory.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DiagramDialectEditorDialogFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 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 @@ -14,6 +14,7 @@ import org.eclipse.gef.RootEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.preferences.SiriusDiagramUiPreferencesKeys; import org.eclipse.sirius.diagram.ui.tools.internal.figure.NotificationFigure; import org.eclipse.sirius.ui.business.api.dialect.DefaultDialectEditorDialogFactory; @@ -71,7 +72,7 @@ public class DiagramDialectEditorDialogFactory extends DefaultDialectEditorDialo // We open a message dialog displaying the given message IWorkbenchPartSite site = editor.getSite(); if (site != null && site.getShell() != null) { - MessageDialog.openInformation(site.getShell(), "Forbidden operation", message); + MessageDialog.openInformation(site.getShell(), Messages.DiagramDialectEditorDialogFactory_forbiddenOperation, message); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/IDiagramOutlinePage.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/IDiagramOutlinePage.java index d221479272..f44ef1d9e0 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/IDiagramOutlinePage.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/IDiagramOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 THALES GLOBAL SERVICES. + * 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 @@ -12,6 +12,7 @@ package org.eclipse.sirius.diagram.ui.tools.internal.editor; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This interface store Resources handle for {@link DiagramOutlinePage}. @@ -21,10 +22,10 @@ import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; public interface IDiagramOutlinePage { /** The outline tip text. */ - String OUTLINE_VIEW_OUTLINE_TIP_TEXT = "Outline"; //$NON-NLS-1$ + String OUTLINE_VIEW_OUTLINE_TIP_TEXT = Messages.IDiagramOutlinePage_outlineTooltip; /** The overview tip text. */ - String OUTLINE_VIEW_OVERVIEW_TIP_TEXT = "Overview"; //$NON-NLS-1$ + String OUTLINE_VIEW_OVERVIEW_TIP_TEXT = Messages.IDiagramOutlinePage_overviewTooltip; /** The outline icon descriptor. */ ImageDescriptor DESC_OUTLINE = DiagramUIPlugin.Implementation.getBundledImageDescriptor("icons/outline.gif"); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/FiltersContributionItem.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/FiltersContributionItem.java index 58fe6dc726..2bcb48e776 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/FiltersContributionItem.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/FiltersContributionItem.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -24,6 +24,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.description.DiagramDescription; import org.eclipse.sirius.diagram.description.filter.FilterDescription; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.handler.ChangeFilterActivation; import org.eclipse.swt.graphics.Image; @@ -69,7 +70,7 @@ public class FiltersContributionItem extends AbstractMenuContributionItem { */ @Override protected String getLabel() { - return "Filters"; + return Messages.FiltersContributionItem_label; } /** diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayersContribution.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayersContribution.java index 79790aeed5..2509a199f7 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayersContribution.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayersContribution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -28,6 +28,7 @@ import org.eclipse.sirius.diagram.description.AdditionalLayer; import org.eclipse.sirius.diagram.description.DiagramDescription; import org.eclipse.sirius.diagram.description.Layer; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.actions.LayersActivationAction; import org.eclipse.sirius.diagram.ui.tools.internal.views.providers.layers.LayersActivationAdapter; @@ -73,7 +74,7 @@ public class LayersContribution extends AbstractMenuContributionItem { */ @Override protected String getLabel() { - return "Layers"; + return Messages.LayersContribution_label; } /** @@ -111,6 +112,7 @@ public class LayersContribution extends AbstractMenuContributionItem { allLayers.remove(diagramDesc.getDefaultLayer()); Iterables.removeIf(allLayers, new Predicate<Layer>() { + @Override public boolean apply(Layer layer) { if (layer instanceof AdditionalLayer) { return !((AdditionalLayer) layer).isOptional(); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java index 0562d8b14d..96adc9fee0 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/LayoutingModeSwitchingAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 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 @@ -33,6 +33,7 @@ import org.eclipse.sirius.diagram.business.api.diagramtype.DiagramTypeDescriptor import org.eclipse.sirius.diagram.business.api.diagramtype.IDiagramTypeDescriptor; import org.eclipse.sirius.diagram.ui.edit.api.part.IDDiagramEditPart; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; import org.eclipse.ui.IEditorPart; @@ -42,28 +43,12 @@ import org.eclipse.ui.part.EditorActionBarContributor; /** * An action that switches the LayoutingMode of the given {@link DDiagram}. - * + * * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> - * + * */ public class LayoutingModeSwitchingAction extends DiagramAction { - private static final String MESSAGE_ACTIVATE_LAYOUTING_MODE = "Activate Layouting Mode"; //$NON-NLS-1$ - - private static final String MESSAGE_DEACTIVATE_LAYOUTING_MODE = "Deactivate Layouting Mode"; //$NON-NLS-1$ - - /** - * Message used in the editor's status line to show that layouting mode is - * activated. - */ - private static final String MESSAGE_STATUS_LINE_LAYOUTING_MODE_IS_ON = "Layouting Mode"; //$NON-NLS-1$ - - /** - * Message used in the editor's status line to show that layouting mode is - * disabled. - */ - private static final String MESSAGE_STATUS_LINE_LAYOUTING_MODE_IS_OFF = ""; //$NON-NLS-1$ - /** * Icon used in the tabbar to allow end-user to activate layouting mode. It * is also used in the editor's status line to indicate that LayoutingMode @@ -78,7 +63,7 @@ public class LayoutingModeSwitchingAction extends DiagramAction { /** * Default constructor. - * + * * @param workbenchPage * The workbench page associated with this action * @param editorDiagram @@ -101,10 +86,10 @@ public class LayoutingModeSwitchingAction extends DiagramAction { private void setTextAndStatusAccordingToLayoutingMode() { // Step 1 : updating action's text and image if (this.ddiagram != null && this.ddiagram.isIsInLayoutingMode()) { - setText(MESSAGE_DEACTIVATE_LAYOUTING_MODE); + setText(Messages.LayoutingModeSwitchingAction_deactivate); setChecked(true); } else { - setText(MESSAGE_ACTIVATE_LAYOUTING_MODE); + setText(Messages.LayoutingModeSwitchingAction_activate); setChecked(false); } @@ -126,19 +111,19 @@ public class LayoutingModeSwitchingAction extends DiagramAction { if (statusLineManager != null) { // we update it according to the DDiagram layouting mode status if (this.ddiagram != null && this.ddiagram.isIsInLayoutingMode()) { - String statusMessage = MESSAGE_STATUS_LINE_LAYOUTING_MODE_IS_ON; + String statusMessage = Messages.LayoutingModeSwitchingAction_statusOn; statusLineManager.setMessage(DiagramUIPlugin.getPlugin().getImage(ACTIVATE_LAYOUTING_MODE_IMAGE_DESCRIPTOR), statusMessage); } else { - statusLineManager.setMessage(MESSAGE_STATUS_LINE_LAYOUTING_MODE_IS_OFF); + statusLineManager.setMessage(""); //$NON-NLS-1$ } } } } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.jface.action.Action#getStyle() */ @Override @@ -147,9 +132,9 @@ public class LayoutingModeSwitchingAction extends DiagramAction { } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#isSelectionListener() */ @Override @@ -158,9 +143,9 @@ public class LayoutingModeSwitchingAction extends DiagramAction { } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#getCommand() */ @Override @@ -185,7 +170,7 @@ public class LayoutingModeSwitchingAction extends DiagramAction { /** * Returns a command that switches the LayoutingMode of the given * {@link DDiagram}. - * + * * @param diagram * the {@link DDiagram} on witch the layouting mode should be * switched @@ -202,9 +187,9 @@ public class LayoutingModeSwitchingAction extends DiagramAction { } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#dispose() */ @Override @@ -215,7 +200,7 @@ public class LayoutingModeSwitchingAction extends DiagramAction { /** * Indicates if the given ddiagram is allowing layouting mode. - * + * * @param diagram * the diagram to inspect * @return true if the given ddiagram is allowing layouting mode, false @@ -246,9 +231,9 @@ public class LayoutingModeSwitchingAction extends DiagramAction { /** * A command that changes the LayoutingMode of the given {@link DDiagram} * and updates the image assocatied to the Action. - * + * * @author <a href="mailto:alex.lagarde@obeo.fr">Alex Lagarde</a> - * + * */ public class SetLayoutingModeCommandAndUpdateActionImage extends AbstractTransactionalCommand { @@ -264,7 +249,7 @@ public class LayoutingModeSwitchingAction extends DiagramAction { /** * Constructor. - * + * * @param editingDomain * the editing domain * @param diagram @@ -275,18 +260,18 @@ public class LayoutingModeSwitchingAction extends DiagramAction { * disabled */ public SetLayoutingModeCommandAndUpdateActionImage(TransactionalEditingDomain editingDomain, DDiagram diagram, boolean layoutingModeShouldBeEnabled) { - super(editingDomain, "Activating Layouting mode", null); + super(editingDomain, Messages.SetLayoutingModeCommandAndUpdateActionImage_activateLabel, null); this.diagram = diagram; this.layoutingModeShouldBeEnabled = layoutingModeShouldBeEnabled; if (this.diagram.isIsInLayoutingMode()) { - setText("Deactivating Layouting mode"); + setText(Messages.SetLayoutingModeCommandAndUpdateActionImage_deactivateLabel); } } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.emf.commands.core.command.AbstractTransactionalCommand#doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor, * org.eclipse.core.runtime.IAdaptable) */ @@ -302,9 +287,9 @@ public class LayoutingModeSwitchingAction extends DiagramAction { } /** - * + * * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction#createTargetRequest() */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/actions/DistributeMenuManager.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/actions/DistributeMenuManager.java index 53c7f72937..73f98bcc85 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/actions/DistributeMenuManager.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/tabbar/actions/DistributeMenuManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -14,6 +14,7 @@ import org.eclipse.gmf.runtime.common.ui.action.ActionMenuManager; import org.eclipse.jface.action.Action; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.api.ui.actions.ActionIds; @@ -30,8 +31,8 @@ public class DistributeMenuManager extends ActionMenuManager { */ private static class DistributeMenuAction extends Action { public DistributeMenuAction() { - setText("&Distribute"); - setToolTipText("Distribute selected shapes"); + setText(Messages.DistributeMenuAction_text); + setToolTipText(Messages.DistributeMenuAction_tooltip); ImageDescriptor imageDesc = DiagramUIPlugin.Implementation.getBundledImageDescriptor(DiagramImagesPath.DISTRIBUTE_WITH_UNIFORM_GAPS_HORIZONTALLY); setImageDescriptor(imageDesc); setHoverImageDescriptor(imageDesc); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/svg/SimpleImageTranscoder.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/svg/SimpleImageTranscoder.java index 84ddc3e07c..3f7c182738 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/svg/SimpleImageTranscoder.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/figure/svg/SimpleImageTranscoder.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2008 Borland Software Corporation + * Copyright (c) 2008, 2015 Borland Software 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 @@ -27,6 +27,7 @@ import org.apache.batik.transcoder.TranscoderInput; import org.apache.batik.transcoder.TranscoderOutput; import org.apache.batik.transcoder.image.ImageTranscoder; import org.eclipse.sirius.diagram.DiagramPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.w3c.dom.Document; //CHECKSTYLE:OFF @@ -148,10 +149,11 @@ public class SimpleImageTranscoder extends SVGAbstractTranscoder { } transcode(new TranscoderInput(document), new TranscoderOutput()); } catch (TranscoderException e) { - DiagramPlugin.getDefault().logError("Error transcoding SVG image", e); + DiagramPlugin.getDefault().logError(Messages.SimpleImageTranscoder_svgImageTranscodingError, e); } } + @Override protected void transcode(Document document, String uri, TranscoderOutput output) throws TranscoderException { super.transcode(document, uri, output); int w = (int) (width + 0.5); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/policies/DeleteHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/policies/DeleteHelper.java index ccce296ef7..d231af6be6 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/policies/DeleteHelper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/policies/DeleteHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. + * 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 @@ -24,6 +24,7 @@ import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.View; import org.eclipse.sirius.business.api.helper.task.AbstractCommandTask; import org.eclipse.sirius.diagram.DSemanticDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.util.GMFNotationHelper; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaClassNotFoundException; @@ -37,7 +38,7 @@ import com.google.common.collect.Sets; /** * Delete helper to execute specific operations on delete request. - * + * * @author mchauvin */ public final class DeleteHelper { @@ -49,7 +50,7 @@ public final class DeleteHelper { /** * Delete all notes attached to view. If a note is attached to an other * view, the note is not destroyed. - * + * * @param command * the command * @param deletedView @@ -70,7 +71,7 @@ public final class DeleteHelper { /** * Delete all note attachments attached to view. - * + * * @param command * the command * @param deletedView @@ -112,9 +113,9 @@ public final class DeleteHelper { * Delete note if this is associated to node deleted. If a note is * associated at two node, the note is not deleted if the two node are not * deleted. - * + * * @author <a href="mailto:julien.dupont@obeo.fr">Julien DUPONT</a> - * + * */ private static final class DeleteRelatedNotesTask extends AbstractCommandTask { @@ -150,7 +151,7 @@ public final class DeleteHelper { @Override public String getLabel() { - return "Delete Related GMF notes"; + return Messages.DeleteRelatedNotesTask_label; } private Set<View> getAllRelatedNotesToDelete(View viewToDelete) { @@ -189,7 +190,7 @@ public final class DeleteHelper { /** * Remove all contains set if the set contains an element that is not a * note. It the element is hide, hide notes associated. - * + * * @param linked * set of notes to delete. * @return a collection of notes @@ -251,9 +252,9 @@ public final class DeleteHelper { /** * Delete note attachment if this is associated to node deleted. - * + * * @author <a href="mailto:mickael.lanoe@obeo.fr">Mickael LANOE</a> - * + * */ private static final class DeleteRelatedNoteAttachmentsTask extends AbstractCommandTask { @@ -286,7 +287,7 @@ public final class DeleteHelper { @Override public String getLabel() { - return "Delete Related GMF note attachments"; + return Messages.DeleteRelatedNoteAttachmentsTask_label; } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/styles/StyleConfigurationRegistry.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/styles/StyleConfigurationRegistry.java index 96930d01de..6194c70141 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/styles/StyleConfigurationRegistry.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/graphical/edit/styles/StyleConfigurationRegistry.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 @@ -11,6 +11,7 @@ package org.eclipse.sirius.diagram.ui.tools.internal.graphical.edit.styles; import java.lang.ref.WeakReference; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; @@ -36,6 +37,7 @@ import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.Square; import org.eclipse.sirius.diagram.WorkspaceImage; import org.eclipse.sirius.diagram.description.DiagramElementMapping; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IStyleConfigurationProvider; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IStyleConfigurationRegistry; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.SafeStyleConfiguration; @@ -54,12 +56,14 @@ public final class StyleConfigurationRegistry extends SessionManagerListener.Stu private static final SimpleStyleConfiguration DEFAULT_CONFIGURATION = new SimpleStyleConfiguration(); - private static final ProfilerTask GET_CONFIG = new ProfilerTask("Sirius", "get style configuration"); + private static final ProfilerTask GET_CONFIG = new ProfilerTask("Sirius", Messages.StyleConfigurationRegistry_profilerTaskName); //$NON-NLS-1$ /** All providers. */ private static List<IStyleConfigurationProvider> styleConfigurationProviders = new ArrayList<IStyleConfigurationProvider>(); - /** Name of the extension point to parse for style configuration providers. */ + /** + * Name of the extension point to parse for style configuration providers. + */ private static final String STYLE_CONFIGURATION_PROVIDER_EXTENSION_POINT = "org.eclipse.sirius.diagram.ui.styleConfigurationProvider"; //$NON-NLS-1$ /** Externalized here to avoid too many distinct usages. */ @@ -100,7 +104,7 @@ public final class StyleConfigurationRegistry extends SessionManagerListener.Stu final IStyleConfigurationProvider styleConfigurationProvider = (IStyleConfigurationProvider) configElement.createExecutableExtension("providerClass"); //$NON-NLS-1$ StyleConfigurationRegistry.styleConfigurationProviders.add(styleConfigurationProvider); } catch (final CoreException e) { - DiagramPlugin.getDefault().logError("Impossible to load the style configuration provider : " + configElement.getName(), e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.StyleConfigurationRegistry_styleConfigurationProviderLoadError, configElement.getName()), e); } } } @@ -220,8 +224,7 @@ public final class StyleConfigurationRegistry extends SessionManagerListener.Stu // CHECKSTYLE:OFF } catch (final Exception e) { // CHECKSTYLE:ON - DiagramPlugin.getDefault().logError( - "The style configuration provider " + styleConfigurationProvider.getClass().getName() + " has threw an exception in its provides method and has been deactivated.", e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.StyleConfigurationRegistry_disableStyleConfigurationProviderInError, styleConfigurationProvider.getClass().getName()), e); currentIterator.remove(); } return result; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/ChangeFilterActivation.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/ChangeFilterActivation.java index 9f90c52053..6452e4663b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/ChangeFilterActivation.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/ChangeFilterActivation.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.handler; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -29,13 +30,14 @@ import org.eclipse.sirius.diagram.description.filter.CompositeFilterDescription; import org.eclipse.sirius.diagram.description.filter.Filter; import org.eclipse.sirius.diagram.description.filter.FilterDescription; import org.eclipse.sirius.diagram.description.filter.VariableFilter; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.filter.FilterTools; import org.eclipse.sirius.tools.api.command.DCommand; import org.eclipse.sirius.tools.api.command.SiriusCommand; /** * Change filter activation. - * + * * @author mchauvin */ public class ChangeFilterActivation extends AbstractChangeActivation { @@ -44,9 +46,9 @@ public class ChangeFilterActivation extends AbstractChangeActivation { /** * Constructor. - * + * * @see AbstractChangeActivation constructor - * + * * @param part * the diagram workbench part * @param diagram @@ -63,9 +65,10 @@ public class ChangeFilterActivation extends AbstractChangeActivation { /** * {@inheritDoc} - * + * * @see java.lang.Runnable#run() */ + @Override public void run() { final TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(diagram); @@ -73,9 +76,10 @@ public class ChangeFilterActivation extends AbstractChangeActivation { command.getTasks().add(new AbstractCommandTask() { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#execute() */ + @Override public void execute() { NotificationUtil.sendNotification(diagram, org.eclipse.sirius.common.tools.api.listener.Notification.Kind.START, org.eclipse.sirius.common.tools.api.listener.Notification.VISIBILITY_UPDATE); @@ -90,11 +94,12 @@ public class ChangeFilterActivation extends AbstractChangeActivation { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.business.api.helper.task.ICommandTask#getLabel() */ + @Override public String getLabel() { - return "hide or show filter"; + return Messages.ChangeFilterActivation_label; } }); @@ -102,7 +107,8 @@ public class ChangeFilterActivation extends AbstractChangeActivation { // This DDiagramSynchronizer.refesh is useless // command.getTasks().add(new RefreshDElementTask((DDiagram) // designerElement)); - command.setLabel(activate ? "Activate " : "Deactivate " + filter.getName() + " filter"); + command.setLabel(activate ? MessageFormat.format(Messages.ChangeFilterActivation_activateFilter, filter.getName()) + : MessageFormat.format(Messages.ChangeFilterActivation_deactivateFilter, filter.getName())); domain.getCommandStack().execute(command); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/RemoveBendpointsHandler.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/RemoveBendpointsHandler.java index b513ccddd8..66d848a122 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/RemoveBendpointsHandler.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/handler/RemoveBendpointsHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2014, 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 @@ -25,12 +25,13 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.sirius.diagram.ui.internal.operation.RemoveBendpointsOperation; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.edit.command.CommandFactory; import org.eclipse.ui.handlers.HandlerUtil; /** * Handle the remove bendpoints command. - * + * * @author Florian Barbin * */ @@ -44,7 +45,7 @@ public class RemoveBendpointsHandler extends AbstractHandler { List<RecordingCommand> commands = new ArrayList<RecordingCommand>(); TransactionalEditingDomain ted = computeCommandsToExecute(selection, commands); if (commands.size() > 0 && ted != null) { - CompoundCommand cc = new CompoundCommand("Remove Bend-points"); + CompoundCommand cc = new CompoundCommand(Messages.RemoveBendpointsHandler_cmdLabel); for (RecordingCommand command : commands) { cc.append(command); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/LayoutDataHelperImpl.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/LayoutDataHelperImpl.java index 58954598d7..129ea046bc 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/LayoutDataHelperImpl.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/LayoutDataHelperImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.layout; +import java.text.MessageFormat; import java.util.Map; import org.eclipse.draw2d.geometry.Dimension; @@ -36,6 +37,7 @@ import org.eclipse.sirius.diagram.layoutdata.LayoutdataFactory; import org.eclipse.sirius.diagram.layoutdata.NodeLayoutData; import org.eclipse.sirius.diagram.layoutdata.Point; import org.eclipse.sirius.diagram.ui.business.api.query.NodeQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataHelper; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataKey; import org.eclipse.sirius.diagram.ui.tools.internal.layout.semantic.SemanticEdgeLayoutDataKey; @@ -58,6 +60,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { /** * {@inheritDoc} */ + @Override public boolean apply(final EObject input) { return input.eContainer() == null; } @@ -76,6 +79,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { * org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart, * org.eclipse.sirius.diagram.layoutdata.NodeLayoutData) */ + @Override public NodeLayoutData createNodeLayoutData(final Node node, final IGraphicalEditPart editPart, final NodeLayoutData parentLayoutData) { final NodeLayoutData result = LayoutdataFactory.eINSTANCE.createNodeLayoutData(); @@ -135,6 +139,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataHelper#createEdgeLayoutData(org.eclipse.gmf.runtime.notation.Edge) */ + @Override public EdgeLayoutData createEdgeLayoutData(final Edge gmfEdge, final ConnectionEditPart connectionEditPart) { final EdgeLayoutData result = LayoutdataFactory.eINSTANCE.createEdgeLayoutData(); final ConnectorStyle connectorStyle = (ConnectorStyle) gmfEdge.getStyle(NotationPackage.eINSTANCE.getConnectorStyle()); @@ -173,6 +178,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataHelper#createLabelLayoutData(org.eclipse.gmf.runtime.notation.Node) */ + @Override public NodeLayoutData createLabelLayoutData(final Node labelNode) { final NodeLayoutData result = LayoutdataFactory.eINSTANCE.createNodeLayoutData(); @@ -201,6 +207,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataHelper#getAbsoluteLocation(org.eclipse.sirius.diagram.layoutdata.NodeLayoutData) */ + @Override public Point getAbsoluteLocation(final NodeLayoutData nodeLayoutData) { Point result = getCopy(nodeLayoutData.getLocation()); if (nodeLayoutData.eContainer() instanceof NodeLayoutData) { @@ -215,6 +222,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { * @see org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataHelper#getRelativeLocation(org.eclipse.sirius.diagram.layoutdata.NodeLayoutData, * org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) */ + @Override public Point getRelativeLocation(final NodeLayoutData layoutData, final IGraphicalEditPart editPart) { final Point result = getAbsoluteLocation(layoutData); final org.eclipse.draw2d.geometry.Point p = new org.eclipse.draw2d.geometry.Point(result.getX(), result.getY()); @@ -295,6 +303,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { * Point which provides the translation amounts. * @return A new Point */ + @Override public Point getTranslated(final Point originalPoint, final org.eclipse.draw2d.geometry.Point pt) { final Point translatedPoint = LayoutdataFactory.eINSTANCE.createPoint(); translatedPoint.setX(originalPoint.getX() + pt.x); @@ -313,6 +322,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { /** * {@inheritDoc} */ + @Override public LayoutDataKey createKey(final AbstractLayoutData layoutData) { LayoutDataKey result; if (layoutData instanceof NodeLayoutData) { @@ -320,7 +330,7 @@ public class LayoutDataHelperImpl implements LayoutDataHelper { } else if (layoutData instanceof EdgeLayoutData) { result = new SemanticEdgeLayoutDataKey(layoutData.getId()); } else { - throw new IllegalArgumentException("Layoutdata of type " + layoutData.getClass() + " is unknown"); + throw new IllegalArgumentException(MessageFormat.format(Messages.LayoutDataHelperImpl_unkownLayoutData, layoutData.getClass())); } return result; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/PinnedElementsHandler.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/PinnedElementsHandler.java index 15885e2eed..bef1b51cb6 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/PinnedElementsHandler.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/PinnedElementsHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -37,6 +37,7 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; @@ -97,6 +98,7 @@ public class PinnedElementsHandler { * Compares points in left-to-right, top-to-bottom ("reading") order. */ private final Comparator<Point> pointComparator = new Comparator<Point>() { + @Override public int compare(final Point p1, final Point p2) { if (p1.y != p2.y) { return p1.y - p2.y; @@ -111,6 +113,7 @@ public class PinnedElementsHandler { * to produce a more regular and predictable result. */ private final Comparator<IGraphicalEditPart> positionComparator = new Comparator<IGraphicalEditPart>() { + @Override public int compare(final IGraphicalEditPart igep1, final IGraphicalEditPart igep2) { return pointComparator.compare(getCurrentPosition(igep1), getCurrentPosition(igep2)); } @@ -121,6 +124,7 @@ public class PinnedElementsHandler { * point as reference). */ private final Comparator<IGraphicalEditPart> leftToRightComparator = new Comparator<IGraphicalEditPart>() { + @Override public int compare(final IGraphicalEditPart p1, final IGraphicalEditPart p2) { return getCurrentPosition(p1).x - getCurrentPosition(p2).x; } @@ -131,6 +135,7 @@ public class PinnedElementsHandler { * point as reference). */ private final Comparator<IGraphicalEditPart> topToBottomComparator = new Comparator<IGraphicalEditPart>() { + @Override public int compare(final IGraphicalEditPart p1, final IGraphicalEditPart p2) { return getCurrentPosition(p1).y - getCurrentPosition(p2).y; } @@ -479,7 +484,7 @@ public class PinnedElementsHandler { for (IGraphicalEditPart part : fixedEditParts) { resolveOverlaps(part); } - assert !hasRemainingSolvableOverlaps() : "solvable but unsolved overlaps remain"; + assert !hasRemainingSolvableOverlaps() : Messages.PinnedElementsHandler_remainOverlapsMsg; } /** @@ -506,7 +511,7 @@ public class PinnedElementsHandler { assert !overlaps(fixedPart, part); } } - assert Collections2.filter(findOverlappingParts(fixedPart), Predicates.not(isPinned)).isEmpty() : "solvable but unsolved overlaps remain"; + assert Collections2.filter(findOverlappingParts(fixedPart), Predicates.not(isPinned)).isEmpty() : Messages.PinnedElementsHandler_remainOverlapsMsg; } /** @@ -655,7 +660,7 @@ public class PinnedElementsHandler { move = computeMoveVector(movable, movablePadding, fixed, fixedPadding, SOUTH).expand(computeMoveVector(movable, movablePadding, fixed, fixedPadding, WEST)); } else { move = null; - assert false : "Unknown direction"; + assert false : Messages.PinnedElementsHandler_unknownDirection; } return move; } @@ -847,7 +852,7 @@ public class PinnedElementsHandler { } private void setCurrentPosition(final IGraphicalEditPart part, final Point position) { - Preconditions.checkArgument(!isPinned.apply(part), "Pinned elements can not move"); + Preconditions.checkArgument(!isPinned.apply(part), Messages.PinnedElementsHandler_notMovableMsg); if (position.equals(getInitialPosition(part))) { currentBounds.remove(part); } else { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/diagram/DNodeLayoutDataKey.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/diagram/DNodeLayoutDataKey.java index 3c18cc0a98..a145da7a92 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/diagram/DNodeLayoutDataKey.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/diagram/DNodeLayoutDataKey.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -14,14 +14,15 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.sirius.diagram.AbstractDNode; import org.eclipse.sirius.diagram.DDiagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.layout.NodeLayoutDataKey; /** * Kind of key use to store the layout data corresponding to an * {@link AbstractDNode} or a {@link DDiagram}. - * + * * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a> - * + * */ public class DNodeLayoutDataKey implements NodeLayoutDataKey { /** @@ -32,20 +33,20 @@ public class DNodeLayoutDataKey implements NodeLayoutDataKey { /** * Default constructor. - * + * * @param target * The target of the */ public DNodeLayoutDataKey(final EObject target) { if (!(target instanceof AbstractDNode || target instanceof DDiagram)) { - throw new IllegalArgumentException("The key uses to store this layout data can only be an AbstractDNode or a DDiagram."); + throw new IllegalArgumentException(Messages.DNodeLayoutDataKey_wrongKeyMsg); } this.target = target; } /** * {@inheritDoc} - * + * * @see java.lang.Object#equals(java.lang.Object) */ @Override @@ -59,7 +60,7 @@ public class DNodeLayoutDataKey implements NodeLayoutDataKey { /** * {@inheritDoc} - * + * * @see java.lang.Object#hashCode() */ @Override @@ -77,9 +78,10 @@ public class DNodeLayoutDataKey implements NodeLayoutDataKey { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutDataKey#getId() */ + @Override public String getId() { return EcoreUtil.getURI(getTarget()).fragment(); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/ordering/ViewOrderingProviderRegistry.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/ordering/ViewOrderingProviderRegistry.java index 4ad95802d6..62d28b6d4b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/ordering/ViewOrderingProviderRegistry.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/ordering/ViewOrderingProviderRegistry.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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.layout.ordering; +import java.text.MessageFormat; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; @@ -21,6 +22,7 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.EMFPlugin; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.description.DiagramElementMapping; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.ordering.ViewOrderingProvider; /** @@ -33,7 +35,9 @@ public final class ViewOrderingProviderRegistry { /** The shared instance. */ private static ViewOrderingProviderRegistry instance = new ViewOrderingProviderRegistry(); - /** Name of the extension point to parse for style configuration providers. */ + /** + * Name of the extension point to parse for style configuration providers. + */ private static final String VIEW_ORDERING_PROVIDER_EXTENSION_POINT = "org.eclipse.sirius.diagram.ui.viewOrderingProvider"; //$NON-NLS-1$ /** Externalized here to avoid too many distinct usages. */ @@ -65,7 +69,7 @@ public final class ViewOrderingProviderRegistry { final ViewOrderingProvider viewOrderingProvider = (ViewOrderingProvider) configElement.createExecutableExtension("providerClass"); //$NON-NLS-1$ this.viewOrderingProviders.add(viewOrderingProvider); } catch (final CoreException e) { - DiagramPlugin.getDefault().logError("Impossible to load the view ordering provider : " + configElement.getName(), e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ViewOrderingProviderRegistry_viewOrderingProvider_loadingProblem, configElement.getName()), e); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/AbstractProviderDescriptor.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/AbstractProviderDescriptor.java index 8645500788..34456f3c5e 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/AbstractProviderDescriptor.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/AbstractProviderDescriptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008, 2009 THALES GLOBAL SERVICES. + * 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 @@ -10,12 +10,15 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.layout.provider; +import java.text.MessageFormat; + import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.LayoutConstants; /** * A basic descriptor. - * + * * @author ymortier */ public abstract class AbstractProviderDescriptor implements Comparable<AbstractProviderDescriptor> { @@ -31,7 +34,7 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP /** * Create a new {@link AbstractProviderDescriptor}. - * + * * @param element * the configuration element. */ @@ -43,7 +46,7 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP /** * Return the provider class name. - * + * * @return the provider class name. */ public String getProviderClassName() { @@ -54,7 +57,7 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP * Returns the value of the attribute <code>name</code> of this descriptor's * configuration element. if the attribute hasn't been set, we'll return * <code>defaultValue</code> instead. - * + * * @param name * Name of the attribute we seek the value of. * @param defaultValue @@ -70,12 +73,12 @@ 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_missingAttributeMsg, name)); } /** * Return the priority of this provider. - * + * * @return the priority of this provider. */ public int getPriority() { @@ -83,7 +86,8 @@ 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" => @@ -102,7 +106,7 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP * {@value org.eclipse.sirius.ecore.extender.business.api.accessor.ExtenderConstants#PRIORITY_NORMAL} * </li> * </ul> - * + * * @param priorityString * {@link String} value of the priority we seek. * @return <code>int</code> corresponding to the given priority @@ -125,6 +129,7 @@ public abstract class AbstractProviderDescriptor implements Comparable<AbstractP /** * {@inheritDoc} */ + @Override public int compareTo(final AbstractProviderDescriptor other) { final int nombre1 = other.getPriority(); final int nombre2 = priority; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/BorderItemAwareLayoutProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/BorderItemAwareLayoutProvider.java index 6b23e84c2d..9813f5fac7 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/BorderItemAwareLayoutProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/BorderItemAwareLayoutProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. + * 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.layout.provider; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -83,6 +84,7 @@ import org.eclipse.sirius.diagram.ui.internal.edit.parts.DEdgeEditPart; import org.eclipse.sirius.diagram.ui.internal.operation.RegionContainerUpdateLayoutOperation; import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper; import org.eclipse.sirius.diagram.ui.internal.refresh.borderednode.CanonicalDBorderItemLocator; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.locator.DBorderItemLocator; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IBorderItemOffsets; import org.eclipse.sirius.diagram.ui.tools.api.layout.provider.AbstractLayoutProvider; @@ -170,14 +172,12 @@ public class BorderItemAwareLayoutProvider extends AbstractLayoutProvider { */ @Override public String toString() { - String result = ""; + StringBuilder result = new StringBuilder(); if (isMoved) { - result += "Border item has been moved since previous layout."; + return MessageFormat.format(Messages.BorderItemLayoutData_movedBorderItemSincePreviousLayout, getPreviousCenterLocation()); } else { - result += "Border item has not been moved since previous layout."; + return MessageFormat.format(Messages.BorderItemLayoutData_unmovedBorderItemSincePreviousLayout, getPreviousCenterLocation()); } - result += " " + getPreviousCenterLocation(); - return result; } } @@ -591,7 +591,6 @@ public class BorderItemAwareLayoutProvider extends AbstractLayoutProvider { * to stay fixed */ private void resetBoundsOfPinnedElements(final List selectedObjects, final CompoundCommand compoundCommand, ArrayList<IDiagramElementEditPart> elementsToKeepFixed) { - final String commandName = "Set Bounds"; for (IGraphicalEditPart graphicalEditPart : Iterables.filter(selectedObjects, IGraphicalEditPart.class)) { EObject semanticElement = graphicalEditPart.resolveSemanticElement(); if (semanticElement instanceof DDiagramElement) { @@ -601,7 +600,7 @@ public class BorderItemAwareLayoutProvider extends AbstractLayoutProvider { View notationView = graphicalEditPart.getNotationView(); if (notationView instanceof Node) { final Node node = (Node) notationView; - resetBounds(compoundCommand, commandName, node, editingDomain); + resetBounds(compoundCommand, node, editingDomain); } // Keep the GMF model consistent for pinned RegionContainer @@ -611,7 +610,7 @@ public class BorderItemAwareLayoutProvider extends AbstractLayoutProvider { AbstractDNodeContainerCompartmentEditPart comp = Iterables.getFirst(Iterables.filter(graphicalEditPart.getChildren(), AbstractDNodeContainerCompartmentEditPart.class), null); if (comp != null && comp.getNotationView() != null) { for (Node region : Iterables.filter(comp.getChildren(), Node.class)) { - resetBounds(compoundCommand, commandName, region, editingDomain); + resetBounds(compoundCommand, region, editingDomain); } } compoundCommand.add( @@ -622,22 +621,22 @@ public class BorderItemAwareLayoutProvider extends AbstractLayoutProvider { } } - private void resetBounds(final CompoundCommand compoundCommand, final String commandName, Node node, TransactionalEditingDomain editingDomain) { + private void resetBounds(final CompoundCommand compoundCommand, Node node, TransactionalEditingDomain editingDomain) { final EObjectAdapter objectAdapter = new EObjectAdapter(node); final LayoutConstraint layoutConstraint = node.getLayoutConstraint(); if (layoutConstraint instanceof Bounds) { final Bounds bounds = (Bounds) layoutConstraint; - final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(editingDomain, commandName, objectAdapter, + final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(editingDomain, Messages.BorderItemAwareLayoutProvider_setBoundsCommandLabel, objectAdapter, new Rectangle(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight())); compoundCommand.add(new ICommandProxy(setBoundsCommand)); } else if (layoutConstraint instanceof Location) { final Location location = (Location) layoutConstraint; - final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(editingDomain, commandName, objectAdapter, new Point(location.getX(), location.getY())); + final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(editingDomain, Messages.BorderItemAwareLayoutProvider_setBoundsCommandLabel, objectAdapter, new Point(location.getX(), location.getY())); compoundCommand.add(new ICommandProxy(setBoundsCommand)); } else if (layoutConstraint instanceof Size) { final Size size = (Size) layoutConstraint; - final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(editingDomain, commandName, objectAdapter, new Dimension(size.getWidth(), size.getHeight())); + final SetBoundsCommand setBoundsCommand = new SetBoundsCommand(editingDomain, Messages.BorderItemAwareLayoutProvider_setBoundsCommandLabel, objectAdapter, new Dimension(size.getWidth(), size.getHeight())); compoundCommand.add(new ICommandProxy(setBoundsCommand)); } } @@ -1046,7 +1045,7 @@ public class BorderItemAwareLayoutProvider extends AbstractLayoutProvider { newLocation = new Point(0, current); break; default: - throw new IllegalArgumentException("Invalid items position."); + throw new IllegalArgumentException(Messages.BorderItemAwareLayoutProvider_invalidItemsPosition); } newLocation = newLocation.getTranslated(containerBounds.getTopLeft()); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/LayoutProviderDescriptor.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/LayoutProviderDescriptor.java index 19fa3bc372..e4895979df 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/LayoutProviderDescriptor.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/layout/provider/LayoutProviderDescriptor.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 @@ -10,14 +10,17 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.tools.internal.layout.provider; +import java.text.MessageFormat; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.sirius.diagram.DiagramPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.layout.provider.LayoutProvider; /** * The descriptor of a {@link LayoutProvider}. - * + * * @author ymortier */ public class LayoutProviderDescriptor extends AbstractProviderDescriptor { @@ -27,7 +30,7 @@ public class LayoutProviderDescriptor extends AbstractProviderDescriptor { /** * Create a new descriptor with the specified configuration element. - * + * * @param element * the configuration element. */ @@ -37,7 +40,7 @@ public class LayoutProviderDescriptor extends AbstractProviderDescriptor { /** * Return the layout provider. - * + * * @return the layout provider. */ public LayoutProvider getProviderInstance() { @@ -45,7 +48,7 @@ public class LayoutProviderDescriptor extends AbstractProviderDescriptor { try { provider = (LayoutProvider) element.createExecutableExtension("providerClass"); //$NON-NLS-1$ } catch (final CoreException e) { - DiagramPlugin.getDefault().logError("CoreException during the initialization of the AIR Layout Provider " + this.getProviderClassName(), e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.LayoutProviderDescriptor_initializationErrorMsg, this.getProviderClassName()), e); } } return provider; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java index 820ad00467..60869377ab 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/marker/SiriusMarkerNavigationProviderSpec.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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 @@ -31,6 +31,7 @@ import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.internal.providers.SiriusMarkerNavigationProvider; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorUtil; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.sirius.diagram.ui.tools.internal.resource.NavigationMarkerConstants; import org.eclipse.sirius.ui.business.api.dialect.DialectEditor; @@ -200,7 +201,7 @@ public class SiriusMarkerNavigationProviderSpec extends SiriusMarkerNavigationPr marker.setAttribute(NavigationMarkerConstants.SEMANTIC_URI, semanticURI); marker.setAttribute(IDE.EDITOR_ID_ATTR, DDiagramEditor.EDITOR_ID); } catch (final CoreException e) { - DiagramPlugin.getDefault().logError("Failed to create validation marker", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.SiriusMarkerNavigationProvider_validationMarkerCreationError, e); } return marker; } @@ -238,7 +239,7 @@ public class SiriusMarkerNavigationProviderSpec extends SiriusMarkerNavigationPr marker.setAttribute(NavigationMarkerConstants.SEMANTIC_URI, semanticURI); marker.setAttribute(IDE.EDITOR_ID_ATTR, DDiagramEditor.EDITOR_ID); } catch (final CoreException e) { - DiagramPlugin.getDefault().logError("Failed to create validation marker", e); //$NON-NLS-1$ + DiagramPlugin.getDefault().logError(Messages.SiriusMarkerNavigationProvider_validationMarkerCreationError, e); } return marker; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/DiagramEditorContextMenuProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/DiagramEditorContextMenuProvider.java index b62715c8fa..e9b6216dbe 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/DiagramEditorContextMenuProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/DiagramEditorContextMenuProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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 @@ -34,6 +34,7 @@ import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DiagramPlugin; import org.eclipse.sirius.diagram.tools.api.preferences.SiriusDiagramPreferencesKeys; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.actions.delete.DeleteFromModelWithHookAction; import org.eclipse.sirius.diagram.ui.tools.internal.editor.tabbar.actions.ColorPropertyContributionItem; import org.eclipse.sirius.diagram.ui.tools.internal.layout.provider.ArrangeAllOnlyLayoutProvider; @@ -54,8 +55,6 @@ public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider private static final String FILTER_FORMAT_GROUP = "filterFormatGroup"; //$NON-NLS-1$ - private static final String ARRANGE_MENU_ERROR = "Arrange menu is not renamed in Layout"; - /** the workbench part */ private IWorkbenchPart part; @@ -319,17 +318,17 @@ public class DiagramEditorContextMenuProvider extends DiagramContextMenuProvider field.setAccessible(true); Object realMenuManager = field.get(arrangeMenu); if (realMenuManager instanceof ActionMenuManager) { - ((ActionMenuManager) realMenuManager).getDefaultAction().setText("Layout"); + ((ActionMenuManager) realMenuManager).getDefaultAction().setText(Messages.DiagramEditorContextMenuProvider_arrangeMenuText); } } catch (SecurityException e) { - SiriusPlugin.getDefault().error(ARRANGE_MENU_ERROR, e); + SiriusPlugin.getDefault().error(Messages.DiagramEditorContextMenuProvider_arrangeMenuRenameError, e); } catch (NoSuchFieldException e) { - SiriusPlugin.getDefault().error(ARRANGE_MENU_ERROR, e); + SiriusPlugin.getDefault().error(Messages.DiagramEditorContextMenuProvider_arrangeMenuRenameError, e); } catch (IllegalArgumentException e) { - SiriusPlugin.getDefault().error(ARRANGE_MENU_ERROR, e); + SiriusPlugin.getDefault().error(Messages.DiagramEditorContextMenuProvider_arrangeMenuRenameError, e); } catch (IllegalAccessException e) { - SiriusPlugin.getDefault().error(ARRANGE_MENU_ERROR, e); + SiriusPlugin.getDefault().error(Messages.DiagramEditorContextMenuProvider_arrangeMenuRenameError, e); } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/OpenMenuContribution.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/OpenMenuContribution.java index 98ea1a2e4b..6208575a00 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/OpenMenuContribution.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/OpenMenuContribution.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 @@ -42,6 +42,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.commands.emf.EMFCommandFactoryUI; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; @@ -81,6 +82,7 @@ public class OpenMenuContribution implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void contributeToPopupMenu(final IMenuManager menu, final IWorkbenchPart part) { if (part instanceof SiriusDiagramEditor) { final SiriusDiagramEditor diagrampart = (SiriusDiagramEditor) part; @@ -114,7 +116,7 @@ public class OpenMenuContribution implements IContributionItemProvider { navigateManager.remove("open"); //$NON-NLS-1$ } // Add menus to open existing representations - final MenuManager openMenuManager = new MenuManager("Open", MENU_OPEN_REPRESENTATION_ID); + final MenuManager openMenuManager = new MenuManager(Messages.OpenMenuContribution_menuLabel, MENU_OPEN_REPRESENTATION_ID); if (!menu.isEmpty()) { menu.insertBefore(menu.getItems()[0].getId(), openMenuManager); } else { @@ -167,7 +169,8 @@ public class OpenMenuContribution implements IContributionItemProvider { return isFromActiveViewpoint(session, description); } - private void buildOpenableRepresentationsMenu(final IMenuManager openMenu, final EObject designerObj, final Session session, final EditPart editpart, final TransactionalEditingDomain transDomain) { + private void buildOpenableRepresentationsMenu(final IMenuManager openMenu, final EObject designerObj, final Session session, final EditPart editpart, + final TransactionalEditingDomain transDomain) { final DRepresentationElement element = (DRepresentationElement) designerObj; final Separator createGroup = new Separator(MenuHelper.OPEN_REPRESENTATION_GROUP_SEPARATOR); openMenu.add(createGroup); @@ -214,6 +217,7 @@ public class OpenMenuContribution implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void contributeToActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute } @@ -221,6 +225,7 @@ public class OpenMenuContribution implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void disposeContributions(final IWorkbenchPartDescriptor arg0) { // Nothing to contribute } @@ -228,6 +233,7 @@ public class OpenMenuContribution implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void updateActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute } @@ -235,6 +241,7 @@ public class OpenMenuContribution implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void addProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute } @@ -242,6 +249,7 @@ public class OpenMenuContribution implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public boolean provides(final IOperation arg0) { // Always provide return true; @@ -250,6 +258,7 @@ public class OpenMenuContribution implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void removeProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/PopupMenuContribution.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/PopupMenuContribution.java index 1df9237955..76686a7ee8 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/PopupMenuContribution.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/PopupMenuContribution.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2008, 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 @@ -60,6 +60,7 @@ import org.eclipse.sirius.diagram.ui.business.internal.view.RootLayoutData; import org.eclipse.sirius.diagram.ui.edit.api.part.ISiriusEditPart; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.command.GMFCommandWrapper; import org.eclipse.sirius.diagram.ui.tools.api.draw2d.ui.figures.FigureUtilities; import org.eclipse.sirius.ext.base.Option; @@ -98,6 +99,7 @@ public class PopupMenuContribution implements IContributionItemProvider { * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#contributeToActionBars(org.eclipse.ui.IActionBars, * org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) */ + @Override public void contributeToActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute @@ -109,6 +111,7 @@ public class PopupMenuContribution implements IContributionItemProvider { * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#contributeToPopupMenu(org.eclipse.jface.action.IMenuManager, * org.eclipse.ui.IWorkbenchPart) */ + @Override public void contributeToPopupMenu(final IMenuManager menu, final IWorkbenchPart part) { if (part instanceof SiriusDiagramEditor) { @@ -449,7 +452,7 @@ public class PopupMenuContribution implements IContributionItemProvider { final TransactionalEditingDomain transactionalEditingDomain = TransactionUtil.getEditingDomain(selectedViews.iterator().next()); final Command command = emfCommandFactory.buildOperationActionFromTool(operationAction, selectedViews); final CompoundCommand cc = new CompoundCommand(command.getLabel()); - cc.add(new org.eclipse.gef.commands.Command("Store mouse location") { + cc.add(new org.eclipse.gef.commands.Command(Messages.PopupMenuContribution_storeMouseLocationCmdLabel) { @Override public void execute() { SiriusLayoutDataManager.INSTANCE.addData(new RootLayoutData(primarySelection, currentMouseLocation.getCopy(), new Dimension(-1, -1))); @@ -457,9 +460,11 @@ public class PopupMenuContribution implements IContributionItemProvider { }); cc.add(new ICommandProxy(new GMFCommandWrapper(transactionalEditingDomain, command))); ImageDescriptor imageDescriptor = null; - if (operationAction.getIcon() != null && !"".equals(operationAction.getIcon())) //$NON-NLS-1$ + if (operationAction.getIcon() != null && !"".equals(operationAction.getIcon())) { //$NON-NLS-1$ imageDescriptor = DiagramUIPlugin.Implementation.findImageDescriptor(operationAction.getIcon()); + } return new Action(new IdentifiedElementQuery(operationAction).getLabel(), imageDescriptor) { + @Override public void run() { super.run(); domain.getCommandStack().execute(cc); @@ -473,6 +478,7 @@ public class PopupMenuContribution implements IContributionItemProvider { * * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#disposeContributions(org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) */ + @Override public void disposeContributions(final IWorkbenchPartDescriptor arg0) { } @@ -483,6 +489,7 @@ public class PopupMenuContribution implements IContributionItemProvider { * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#updateActionBars(org.eclipse.ui.IActionBars, * org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) */ + @Override public void updateActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute @@ -493,6 +500,7 @@ public class PopupMenuContribution implements IContributionItemProvider { * * @see org.eclipse.gmf.runtime.common.core.service.IProvider#addProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener) */ + @Override public void addProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute @@ -503,6 +511,7 @@ public class PopupMenuContribution implements IContributionItemProvider { * * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation) */ + @Override public boolean provides(final IOperation arg0) { // Always provide return true; @@ -513,6 +522,7 @@ public class PopupMenuContribution implements IContributionItemProvider { * * @see org.eclipse.gmf.runtime.common.core.service.IProvider#removeProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener) */ + @Override public void removeProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SpecificationMenuContribution.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SpecificationMenuContribution.java index a3445785e3..f01e23cdb4 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SpecificationMenuContribution.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SpecificationMenuContribution.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 @@ -34,6 +34,7 @@ import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.ui.business.internal.navigation.MappingDefinitionFinder; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ui.tools.api.image.ImagesPath; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorPart; @@ -61,6 +62,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#contributeToActionBars(org.eclipse.ui.IActionBars, * org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) */ + @Override public void contributeToActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute @@ -72,6 +74,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#contributeToPopupMenu(org.eclipse.jface.action.IMenuManager, * org.eclipse.ui.IWorkbenchPart) */ + @Override public void contributeToPopupMenu(final IMenuManager menu, final IWorkbenchPart part) { if (part instanceof SiriusDiagramEditor) { @@ -118,7 +121,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider } if (modelFile != null) { - final Action openAction = new Action("Open Definition", imageDescriptor) { + final Action openAction = new Action(Messages.SpecificationMenuContribution_openDefinitionMenuLabel, imageDescriptor) { @Override public void run() { @@ -138,7 +141,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider } }; - openAction.setId("Open Definition"); + openAction.setId(Messages.SpecificationMenuContribution_openDefinitionMenuLabel); menu.insertAfter(IWorkbenchActionConstants.MB_ADDITIONS, openAction); } } @@ -154,6 +157,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider * * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#disposeContributions(org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) */ + @Override public void disposeContributions(final IWorkbenchPartDescriptor arg0) { // Nothing to contribute @@ -165,6 +169,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider * @see org.eclipse.gmf.runtime.common.ui.services.action.internal.contributionitem.IContributionItemProvider#updateActionBars(org.eclipse.ui.IActionBars, * org.eclipse.gmf.runtime.common.ui.util.IWorkbenchPartDescriptor) */ + @Override public void updateActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute @@ -175,6 +180,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider * * @see org.eclipse.gmf.runtime.common.core.service.IProvider#addProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener) */ + @Override public void addProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute @@ -185,6 +191,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider * * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation) */ + @Override public boolean provides(final IOperation arg0) { // Always provide return true; @@ -195,6 +202,7 @@ public class SpecificationMenuContribution implements IContributionItemProvider * * @see org.eclipse.gmf.runtime.common.core.service.IProvider#removeProviderChangeListener(org.eclipse.gmf.runtime.common.core.service.IProviderChangeListener) */ + @Override public void removeProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.java index 0f3d7a8fbb..4ec83818ae 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/menu/SubDiagramMenu.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 @@ -32,6 +32,7 @@ import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.ui.edit.api.part.ISiriusEditPart; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.actions.CreateRepresentationFromRepresentationCreationDescription; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -56,6 +57,7 @@ public class SubDiagramMenu implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void contributeToActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute @@ -64,6 +66,7 @@ public class SubDiagramMenu implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void contributeToPopupMenu(final IMenuManager menu, final IWorkbenchPart part) { if (part instanceof SiriusDiagramEditor) { @@ -86,7 +89,7 @@ public class SubDiagramMenu implements IContributionItemProvider { } if (editpart instanceof ISiriusEditPart) { // Create a new sub-menu manager - final MenuManager newMenuManager = new MenuManager("New", SubDiagramMenu.MENU_NEW_REPRESENTATION_ID); + final MenuManager newMenuManager = new MenuManager(Messages.SubDiagramMenu_newLabel, SubDiagramMenu.MENU_NEW_REPRESENTATION_ID); // Create the item to add to the top of main manager, just // before the open menu if (!menu.isEmpty()) { @@ -149,6 +152,7 @@ public class SubDiagramMenu implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void disposeContributions(final IWorkbenchPartDescriptor arg0) { // Nothing to contribute @@ -157,6 +161,7 @@ public class SubDiagramMenu implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void updateActionBars(final IActionBars arg0, final IWorkbenchPartDescriptor arg1) { // Nothing to contribute @@ -165,6 +170,7 @@ public class SubDiagramMenu implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void addProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute @@ -173,6 +179,7 @@ public class SubDiagramMenu implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public boolean provides(final IOperation arg0) { // Always provide return true; @@ -181,6 +188,7 @@ public class SubDiagramMenu implements IContributionItemProvider { /** * {@inheritDoc} */ + @Override public void removeProviderChangeListener(final IProviderChangeListener arg0) { // Nothing to contribute diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteImageProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteImageProvider.java index 97e55af515..61d0014e95 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteImageProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteImageProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 THALES GLOBAL SERVICES. + * 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 @@ -12,6 +12,7 @@ package org.eclipse.sirius.diagram.ui.tools.internal.palette; import java.io.File; import java.net.MalformedURLException; +import java.text.MessageFormat; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -29,6 +30,7 @@ import org.eclipse.sirius.diagram.description.tool.ContainerCreationDescription; import org.eclipse.sirius.diagram.description.tool.EdgeCreationDescription; import org.eclipse.sirius.diagram.description.tool.NodeCreationDescription; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.ecore.extender.business.api.accessor.exception.MetaClassNotFoundException; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -68,7 +70,7 @@ public class PaletteImageProvider { final EObject anInstance = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(abstractToolDescription).createInstance(domainClassToUse); return DiagramUIPlugin.getPlugin().getItemImageDescriptor(anInstance); } catch (final MetaClassNotFoundException e) { - SiriusPlugin.getDefault().warning("No icon is available for the tool " + abstractToolDescription.getName() + ". A default icon has been set instead.", null); + SiriusPlugin.getDefault().warning(MessageFormat.format(Messages.PaletteImageProvider_noIconFor, abstractToolDescription.getName()), null); } } if (abstractToolDescription instanceof EdgeCreationDescription) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteManagerImpl.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteManagerImpl.java index c79a67a3d6..3c1d172a30 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteManagerImpl.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/palette/PaletteManagerImpl.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 @@ -64,6 +64,7 @@ import org.eclipse.sirius.diagram.description.tool.RequestDescription; import org.eclipse.sirius.diagram.description.tool.ToolGroup; import org.eclipse.sirius.diagram.description.tool.ToolGroupExtension; import org.eclipse.sirius.diagram.description.tool.ToolSection; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.palette.PaletteManager; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.palette.ToolFilter; import org.eclipse.sirius.ext.base.Option; @@ -90,8 +91,6 @@ import com.google.common.collect.UnmodifiableIterator; * @author mchauvin */ public class PaletteManagerImpl implements PaletteManager { - private static final String SEVERAL_CANDIDATES_IN_PALETTE_FOUND = "Several {0}s with identical id '{1}' have been found in the palette. Please fix your VSM by whether set a different ID for these Palette entries or ensuring that they cannot be available in the same time."; - /** The image provider. */ private static PaletteImageProvider paletteImageProvider = new PaletteImageProvider(); @@ -121,6 +120,7 @@ public class PaletteManagerImpl implements PaletteManager { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.PaletteManager#dispose() */ + @Override public void dispose() { listenersManager.dispose(); listenersManager = null; @@ -133,6 +133,7 @@ public class PaletteManagerImpl implements PaletteManager { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.PaletteManager#addToolFilter(org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.ToolFilter) */ + @Override public void addToolFilter(ToolFilter toolFilter) { filters.add(toolFilter); } @@ -142,6 +143,7 @@ public class PaletteManagerImpl implements PaletteManager { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.PaletteManager#removeToolFilter(org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.ToolFilter) */ + @Override public void removeToolFilter(ToolFilter toolFilter) { filters.remove(toolFilter); } @@ -160,6 +162,7 @@ public class PaletteManagerImpl implements PaletteManager { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.PaletteManager#update() */ + @Override public void update(final Diagram diagram) { update(diagram, false); } @@ -169,6 +172,7 @@ public class PaletteManagerImpl implements PaletteManager { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.PaletteManager#update() */ + @Override public void update(final Diagram diagram, final boolean clean) { if (diagram != null) { initPaletteRoot(); @@ -178,6 +182,7 @@ public class PaletteManagerImpl implements PaletteManager { // If test is not launched in UI Thread make the changes in UI // thread Display.getDefault().asyncExec(new Runnable() { + @Override public void run() { updatePalette(diagram, clean); } @@ -371,6 +376,7 @@ public class PaletteManagerImpl implements PaletteManager { private <T extends PaletteEntry> Option<T> getPaletteEntry(PaletteContainer container, final String id, Class<T> type) { Option<T> matchingPaletteEntry = Options.newNone(); UnmodifiableIterator<T> matchingPaletteEntries = Iterators.filter(Iterators.filter(container.getChildren().iterator(), type), new Predicate<T>() { + @Override public boolean apply(T paletteEntry) { return id.equals(paletteEntry.getId()); } @@ -381,7 +387,7 @@ public class PaletteManagerImpl implements PaletteManager { // Here no matching candidate has been found, we will return // Options.newNone } catch (IllegalArgumentException e) { - DiagramPlugin.getDefault().logWarning(MessageFormat.format(SEVERAL_CANDIDATES_IN_PALETTE_FOUND, type.getName(), id)); + DiagramPlugin.getDefault().logWarning(MessageFormat.format(Messages.PaletteManagerImpl_severalCandidatesInPalette, type.getName(), id)); // Here no matching candidate has been found, we will return // Options.newNone } @@ -463,6 +469,7 @@ public class PaletteManagerImpl implements PaletteManager { * @param layer * the layer */ + @Override public void hideLayer(final Layer layer) { // final PaletteViewer viewer = editDomain.getPaletteViewer(); // if (viewer != null) { @@ -480,6 +487,7 @@ public class PaletteManagerImpl implements PaletteManager { * @param layer * the layer */ + @Override public void showLayer(final Layer layer) { final PaletteViewer viewer = editDomain.getPaletteViewer(); if (viewer != null) { @@ -783,7 +791,7 @@ public class PaletteManagerImpl implements PaletteManager { } else if (existingPaletteEntry.get() instanceof PaletteStack) { paletteStack = (PaletteStack) existingPaletteEntry.get(); } else { - throw new IllegalArgumentException("An existing palette entry with name " + newName + " already exists but it is another kind of entry."); + throw new IllegalArgumentException(MessageFormat.format(Messages.PaletteManagerImpl_alreadyExistingEntry, newName)); } for (final AbstractToolDescription tool : ((ToolGroup) toolEntry).getTools()) { Option<PaletteEntry> paletteEntry = getPaletteEntry(paletteStack, new IdentifiedElementQuery(tool).getLabel(), PaletteEntry.class); @@ -847,6 +855,7 @@ public class PaletteManagerImpl implements PaletteManager { * * @see org.eclipse.sirius.diagram.tools.api.graphical.edit.palette.PaletteManager#isDisposed() */ + @Override public boolean isDisposed() { return isDisposed; } @@ -886,10 +895,12 @@ public class PaletteManagerImpl implements PaletteManager { this.toolDescription = toolDescription; } + @Override public Object getObjectType() { return toolDescription.getClass(); } + @Override public Object getNewObject() { return toolDescription; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/part/SiriusDiagramGraphicalViewer.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/part/SiriusDiagramGraphicalViewer.java index 6a6142d525..cc1406eeee 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/part/SiriusDiagramGraphicalViewer.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/part/SiriusDiagramGraphicalViewer.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2002, 2014 IBM Corporation and others. + * Copyright (c) 2002, 2015 IBM Corporation and others 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.diagram.ui.tools.internal.part; import java.lang.reflect.Field; +import java.text.MessageFormat; import java.util.List; import org.eclipse.draw2d.DeferredUpdateManager; @@ -27,6 +28,7 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil; import org.eclipse.sirius.diagram.DiagramPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.part.IDiagramDialectGraphicalViewer; import org.eclipse.sirius.diagram.ui.tools.internal.editor.SiriusPaletteToolDropTargetListener; import org.eclipse.sirius.diagram.ui.tools.internal.graphical.edit.policies.ChangeBoundRequestRecorder; @@ -63,6 +65,7 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme * @see org.eclipse.sirius.diagram.ui.tools.api.part.IDiagramDialectGraphicalViewer#registerEditPartForSemanticElement(org.eclipse.emf.ecore.EObject, * org.eclipse.gef.EditPart) */ + @Override public void registerEditPartForSemanticElement(final EObject element, final EditPart ep) { elementToEditPartsMap.registerEditPartForElement(element, ep); } @@ -73,6 +76,7 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme * @see org.eclipse.sirius.diagram.ui.tools.api.part.IDiagramDialectGraphicalViewer#unregisterEditPartForSemanticElement(org.eclipse.emf.ecore.EObject, * org.eclipse.gef.EditPart) */ + @Override public void unregisterEditPartForSemanticElement(final EObject element, final EditPart ep) { elementToEditPartsMap.unregisterEditPartForElement(element, ep); } @@ -82,6 +86,7 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme * * @see org.eclipse.sirius.diagram.ui.tools.api.part.IDiagramDialectGraphicalViewer#unregisterEditPart(org.eclipse.gef.EditPart) */ + @Override public void unregisterEditPart(final EditPart ep) { elementToEditPartsMap.unregisterEditPart(ep); } @@ -92,6 +97,7 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme * @see org.eclipse.sirius.diagram.ui.tools.api.part.IDiagramDialectGraphicalViewer#findEditPartsForElement(String, * Class) */ + @Override public <T extends EditPart> List<T> findEditPartsForElement(final EObject element, final Class<T> editPartClass) { return elementToEditPartsMap.findEditPartsForElement(element, editPartClass); } @@ -133,10 +139,6 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme */ private static class ToggleUpdateManager extends DeferredUpdateManager { - private static final String ERROR_INVALID_FIGURES_FIELD = "Error while getting the invalidFigures field."; - - private static final String ERROR_VALIDATING_FIELD = "Error while getting the validating field."; - private boolean disableUpdates; private final Field invalidFiguresField; @@ -154,9 +156,9 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme field.setAccessible(true); return field; } catch (final SecurityException e) { - DiagramPlugin.getDefault().logError("Error while getting the " + name + " field.", e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, name), e); } catch (final NoSuchFieldException e) { - DiagramPlugin.getDefault().logError("Error while getting the " + name + " field.", e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, name), e); } return null; } @@ -232,9 +234,9 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme try { return (List) invalidFiguresField.get(this); } catch (final IllegalArgumentException e) { - DiagramPlugin.getDefault().logError(ERROR_INVALID_FIGURES_FIELD, e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, invalidFiguresField.getName()), e); } catch (final IllegalAccessException e) { - DiagramPlugin.getDefault().logError(ERROR_INVALID_FIGURES_FIELD, e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, invalidFiguresField.getName()), e); } } return null; @@ -250,9 +252,9 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme try { return validatingField.getBoolean(this); } catch (final IllegalArgumentException e) { - DiagramPlugin.getDefault().logError(ERROR_VALIDATING_FIELD, e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, validatingField.getName()), e); } catch (final IllegalAccessException e) { - DiagramPlugin.getDefault().logError(ERROR_VALIDATING_FIELD, e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, validatingField.getName()), e); } } return false; @@ -269,9 +271,9 @@ public class SiriusDiagramGraphicalViewer extends DiagramGraphicalViewer impleme try { validatingField.setBoolean(this, validating); } catch (final IllegalArgumentException e) { - DiagramPlugin.getDefault().logError(ERROR_VALIDATING_FIELD, e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, validatingField.getName()), e); } catch (final IllegalAccessException e) { - DiagramPlugin.getDefault().logError(ERROR_VALIDATING_FIELD, e); + DiagramPlugin.getDefault().logError(MessageFormat.format(Messages.ToggleUpdateManager_fieldAccessError, validatingField.getName()), e); } } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusEnhancedPrintActionHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusEnhancedPrintActionHelper.java index 621de50b8c..dfd4cc7ae6 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusEnhancedPrintActionHelper.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusEnhancedPrintActionHelper.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2005, 2006 IBM Corporation and others. + * Copyright (c) 2005, 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 @@ -40,6 +40,7 @@ import org.eclipse.gmf.runtime.diagram.ui.printing.util.DiagramPrinterUtil; import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; import org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil; import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.ui.IWorkbenchPart; /** @@ -49,10 +50,10 @@ import org.eclipse.ui.IWorkbenchPart; * applicable diagrams will be displayed to the user, when prompting the user to * select a diagram for printing. If the diagram does not correspond to an * IFile, its part name will be used as the next choice. - * + * * This class implements the IPrintActionHelper interface that can be passed * into Print Preview, enabling the print action from there. - * + * * @author Wayne Diu, wdiu */ @SuppressWarnings("restriction") @@ -61,14 +62,15 @@ public class SiriusEnhancedPrintActionHelper implements IPrintActionHelper { /** * {@inheritDoc} */ + @Override public void doPrint(final IWorkbenchPart workbenchPart) { DiagramEditor diagramEditor = null; if (workbenchPart instanceof DiagramEditor) { diagramEditor = (DiagramEditor) workbenchPart; } else { - Log.error(DiagramUIPrintingRenderPlugin.getInstance(), IStatus.ERROR, "Invalid IWorkbenchPart"); //$NON-NLS-1$ - final IllegalArgumentException e = new IllegalArgumentException("Invalid IWorkbenchPart."); //$NON-NLS-1$ + Log.error(DiagramUIPrintingRenderPlugin.getInstance(), IStatus.ERROR, Messages.SiriusEnhancedPrintActionHelper_invalidIworkbenchPart); + final IllegalArgumentException e = new IllegalArgumentException(Messages.SiriusEnhancedPrintActionHelper_invalidIworkbenchPart); Trace.throwing(DiagramUIPrintingRenderPlugin.getInstance(), DiagramUIPrintingRenderDebugOptions.EXCEPTIONS_THROWING, EnhancedPrintActionHelper.class, "doPrint()", e); //$NON-NLS-1$ throw e; } @@ -96,7 +98,7 @@ public class SiriusEnhancedPrintActionHelper implements IPrintActionHelper { /** * Return a Map with diagram name String as key and Diagram as value All * entries in the map correspond to open editors. - * + * * @return Map with diagram name String as key and Diagram as value All * entries in the map correspond to open editors with the * diagramEditor's id. @@ -135,7 +137,7 @@ public class SiriusEnhancedPrintActionHelper implements IPrintActionHelper { * Make the <code>name</code> unique. If this name exists in the * <code>existingNames</code> list, a digit is added at the end to make it * unique. - * + * * @param name * The name to make unique * @param existingNames @@ -154,7 +156,7 @@ public class SiriusEnhancedPrintActionHelper implements IPrintActionHelper { * Make the <code>name</code> unique. If this name exists in the * <code>existingNames</code> list, a digit is added at the end to make it * unique. - * + * * @param name * The name to make unique * @param existingNames diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusSWTRenderedDiagramPrinter.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusSWTRenderedDiagramPrinter.java index 1182ef6f2a..9711044cb4 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusSWTRenderedDiagramPrinter.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/print/SiriusSWTRenderedDiagramPrinter.java @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 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 @@ -28,13 +28,14 @@ import org.eclipse.gmf.runtime.diagram.ui.printing.render.util.RenderedDiagramPr import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.swt.printing.PrinterData; import org.eclipse.swt.widgets.Shell; /** * A specialized <code>RenderedDiagramPrinter</code> that manage also diagram * print for diagram stored in any resource not only XMLResource. - * + * * @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a> */ @SuppressWarnings("restriction") @@ -42,7 +43,7 @@ public class SiriusSWTRenderedDiagramPrinter extends RenderedDiagramPrinter { /** * Creates a new instance. - * + * * @param preferencesHint * the preferences hint to use for initializing the preferences * @param mm @@ -60,8 +61,8 @@ public class SiriusSWTRenderedDiagramPrinter extends RenderedDiagramPrinter { */ @Override public void run() { - assert null != printer : "printer must be set"; //$NON-NLS-1$ - if (!(printer.startJob("Printing"))) { //$NON-NLS-1$ + assert null != printer : Messages.SiriusSWTRenderedDiagramPrinter_printerNotSetMsg; + if (!(printer.startJob(Messages.SiriusSWTRenderedDiagramPrinter_jobLabel))) { return; } @@ -81,8 +82,9 @@ public class SiriusSWTRenderedDiagramPrinter extends RenderedDiagramPrinter { boolean loadedPreferences = PrintHelperUtil.initializePreferences(dgrmEP, preferencesHint); RootEditPart rep = dgrmEP.getRoot(); - if (rep instanceof DiagramRootEditPart) + if (rep instanceof DiagramRootEditPart) { this.mapMode = ((DiagramRootEditPart) rep).getMapMode(); + } initialize(); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/BehaviorsPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/BehaviorsPropertySection.java index e20609ff16..c2861ca400 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/BehaviorsPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/BehaviorsPropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * 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 @@ -20,6 +20,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.business.api.componentization.DiagramComponentizationManager; import org.eclipse.sirius.diagram.description.tool.BehaviorTool; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.commands.ActivateBehaviorToolsCommand; import org.eclipse.sirius.diagram.ui.tools.internal.commands.DeactivateBehaviorToolsCommand; import org.eclipse.swt.SWT; @@ -33,14 +34,14 @@ import com.google.common.collect.Lists; /** * Sections that allows the user to choose activated filters. - * + * * @author ymortier */ public class BehaviorsPropertySection extends FiltersPropertySection { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.internal.properties.FiltersPropertySection#getAppliedElements() */ @Override @@ -54,7 +55,7 @@ public class BehaviorsPropertySection extends FiltersPropertySection { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.internal.properties.FiltersPropertySection#getAvailableElements() */ @Override @@ -80,7 +81,7 @@ public class BehaviorsPropertySection extends FiltersPropertySection { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.internal.properties.FiltersPropertySection#createFeatureComposite(org.eclipse.swt.widgets.Composite) */ @Override @@ -89,14 +90,14 @@ public class BehaviorsPropertySection extends FiltersPropertySection { featureComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); featureComposite.setLayout(new GridLayout()); - final Label featureLabel = getWidgetFactory().createLabel(featureComposite, "Activated Behaviors", SWT.NONE); + final Label featureLabel = getWidgetFactory().createLabel(featureComposite, Messages.BehaviorsPropertySection_activatedBehaviorsLabel, SWT.NONE); featureLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); return featureComposite; } /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.internal.properties.FiltersPropertySection#createChoiceComposite(org.eclipse.swt.widgets.Composite) */ @Override @@ -105,14 +106,14 @@ public class BehaviorsPropertySection extends FiltersPropertySection { choiceComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); choiceComposite.setLayout(new GridLayout()); - final Label choiceLabel = getWidgetFactory().createLabel(choiceComposite, "Available Behaviors", SWT.NONE); + final Label choiceLabel = getWidgetFactory().createLabel(choiceComposite, Messages.BehaviorsPropertySection_availableBehaviorsLabel, SWT.NONE); choiceLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); return choiceComposite; } /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.internal.properties.FiltersPropertySection#newElementsSelected(java.util.Collection) */ @Override @@ -122,7 +123,7 @@ public class BehaviorsPropertySection extends FiltersPropertySection { /** * {@inheritDoc} - * + * * @see org.eclipse.sirius.diagram.ui.tools.internal.properties.FiltersPropertySection#oldElementsRemoved(java.util.Collection) */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramColorAndFontPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramColorAndFontPropertySection.java index ba99794517..ef49cdeb9d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramColorAndFontPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramColorAndFontPropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -46,6 +46,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.internal.refresh.diagram.ViewPropertiesSynchronizer; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.internal.actions.style.ResetStylePropertiesToDefaultValuesAction; import org.eclipse.sirius.diagram.ui.tools.internal.actions.style.SetStyleToWorkspaceImageAction; @@ -68,9 +69,9 @@ import org.eclipse.swt.widgets.Label; /** * Class necessary to remove default color option. - * + * * @author jdupont - * + * */ @SuppressWarnings("restriction") public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPropertySection { @@ -98,9 +99,9 @@ public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPro /** * {@inheritDoc} - * + * * @overrides - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection#changeColor(org.eclipse.swt.events.SelectionEvent, * org.eclipse.swt.widgets.Button, java.lang.String, java.lang.String, * org.eclipse.jface.resource.ImageDescriptor) @@ -163,7 +164,7 @@ public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPro final View view = (View) ep.getModel(); // change the color. final UserFixedColor newColor = DescriptionFactory.eINSTANCE.createUserFixedColor(); - newColor.setName("<anonymous>"); + newColor.setName(Messages.AnonymousUserFixedColorName); newColor.setBlue(finalColor.blue); newColor.setGreen(finalColor.green); newColor.setRed(finalColor.red); @@ -187,13 +188,14 @@ public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPro /** * This method has been overridden to add the undo context to the command. - * + * * {@inheritDoc} */ @Override protected CommandResult executeAsCompositeCommand(String actionName, List commands) { - if (bIsCommandInProgress) + if (bIsCommandInProgress) { return null; + } bIsCommandInProgress = true; @@ -221,7 +223,7 @@ public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPro /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection#createFontsGroup(org.eclipse.swt.widgets.Composite) */ @Override @@ -241,7 +243,7 @@ public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPro fontUnderlineButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "Underline"; + e.result = Messages.FontPropertySection_underline; } }); @@ -251,7 +253,7 @@ public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPro fontStrikeThroughButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "StrikeThrough"; + e.result = Messages.FontPropertySection_strikeThrough; } }); @@ -328,7 +330,7 @@ public class DiagramColorAndFontPropertySection extends DiagramColorsAndFontsPro /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection#refresh() */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramConnectionAppearancePropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramConnectionAppearancePropertySection.java index 53ce0d0589..7a2f6419c9 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramConnectionAppearancePropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramConnectionAppearancePropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.EdgeStyle; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.internal.refresh.diagram.ViewPropertiesSynchronizer; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.internal.actions.style.ResetStylePropertiesToDefaultValuesAction; import org.eclipse.sirius.diagram.ui.tools.internal.actions.style.SetStyleToWorkspaceImageAction; @@ -63,9 +64,9 @@ import org.eclipse.ui.IWorkbenchPart; /** * allow color customization of diagram edges. - * + * * @author fmorel - * + * */ @SuppressWarnings("restriction") public class DiagramConnectionAppearancePropertySection extends ConnectionAppearancePropertySection { @@ -93,7 +94,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection#changeColor(org.eclipse.swt.events.SelectionEvent, * org.eclipse.swt.widgets.Button, java.lang.String, java.lang.String, * org.eclipse.jface.resource.ImageDescriptor) @@ -146,6 +147,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear final RGB finalColor = color; // need a final variable commands.add(createCommand(commandName, ((View) ep.getModel()).eResource(), new Runnable() { + @Override public void run() { final ENamedElement element = PackageUtil.getElement(propertyId); if (element instanceof EStructuralFeature) { @@ -157,7 +159,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear // change the color. final UserFixedColor newColor = DescriptionFactory.eINSTANCE.createUserFixedColor(); - newColor.setName("<anonymous>"); + newColor.setName(Messages.AnonymousUserFixedColorName); newColor.setBlue(finalColor.blue); newColor.setGreen(finalColor.green); newColor.setRed(finalColor.red); @@ -180,7 +182,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection#createFontsGroup(org.eclipse.swt.widgets.Composite) */ @Override @@ -200,7 +202,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear fontUnderlineButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "Underline"; + e.result = Messages.FontPropertySection_underline; } }); @@ -210,7 +212,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear fontStrikeThroughButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "StrikeThrough"; + e.result = Messages.FontPropertySection_strikeThrough; } }); @@ -288,7 +290,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * Overridden to access to the routing group. - * + * * {@inheritDoc} */ @Override @@ -300,7 +302,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * Overridden to display property of selection only if semantic element of * selection exists. - * + * * {@inheritDoc} */ @Override @@ -325,7 +327,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * Transform selection to have {@link DSemanticDecorator} instead of * {@link EditPart} or null if the semantic element (target) not exists. - * + * * @param selection * the currently selected object * @return the unwrapped object @@ -355,7 +357,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection#dispose() */ @Override @@ -367,7 +369,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection#refresh() */ @Override @@ -376,6 +378,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear super.refresh(); executeAsReadAction(new Runnable() { + @Override public void run() { boolean hasBracketStyle = false; final IGraphicalEditPart ep = getSingleInput(); @@ -409,7 +412,7 @@ public class DiagramConnectionAppearancePropertySection extends ConnectionAppear /** * Disable the routing group and all its children for Bracket edge. - * + * * @param hasBracketStyle * true if we must disable, false otherwise */ diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramShapeColorAndFontPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramShapeColorAndFontPropertySection.java index e712ed4801..3da1bd1dc7 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramShapeColorAndFontPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DiagramShapeColorAndFontPropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. + * 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 @@ -57,6 +57,7 @@ import org.eclipse.sirius.diagram.ui.business.api.image.ImageSelectorService; import org.eclipse.sirius.diagram.ui.edit.api.part.IDiagramElementEditPart; import org.eclipse.sirius.diagram.ui.internal.refresh.diagram.ViewPropertiesSynchronizer; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.internal.actions.style.ResetStylePropertiesToDefaultValuesAction; import org.eclipse.sirius.diagram.ui.tools.internal.actions.style.SetStyleToWorkspaceImageAction; @@ -84,7 +85,7 @@ import org.eclipse.ui.IWorkbenchPart; /** * allow color customization of diagram nodes. - * + * * @author fmorel */ @SuppressWarnings("restriction") @@ -113,9 +114,9 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * {@inheritDoc} - * + * * @overrides - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection#changeColor(org.eclipse.swt.events.SelectionEvent, * org.eclipse.swt.widgets.Button, java.lang.String, java.lang.String, * org.eclipse.jface.resource.ImageDescriptor) @@ -178,7 +179,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts final View view = (View) ep.getModel(); // change the color. final UserFixedColor newColor = DescriptionFactory.eINSTANCE.createUserFixedColor(); - newColor.setName("<anonymous>"); + newColor.setName(Messages.AnonymousUserFixedColorName); newColor.setBlue(finalColor.blue); newColor.setGreen(finalColor.green); newColor.setRed(finalColor.red); @@ -202,13 +203,14 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * This method has been overridden to add the undo context to the command. - * + * * {@inheritDoc} */ @Override protected CommandResult executeAsCompositeCommand(String actionName, List commands) { - if (bIsCommandInProgress) + if (bIsCommandInProgress) { return null; + } bIsCommandInProgress = true; @@ -236,7 +238,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection#createFontsAndColorsGroups(org.eclipse.swt.widgets.Composite) */ @Override @@ -246,7 +248,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection#createFontsGroup(org.eclipse.swt.widgets.Composite) */ @Override @@ -266,7 +268,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts fontUnderlineButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "Underline"; + e.result = Messages.FontPropertySection_underline; } }); @@ -276,7 +278,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts fontStrikeThroughButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "StrikeThrough"; + e.result = Messages.FontPropertySection_strikeThrough; } }); @@ -323,7 +325,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * Overridden to display property of selection only if semantic element of * selection exists. - * + * * {@inheritDoc} */ @Override @@ -348,7 +350,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * Transform selection to have {@link DSemanticDecorator} instead of * {@link EditPart} or null if the semantic element (target) not exists. - * + * * @param selection * the currently selected object * @return the unwrapped object @@ -378,7 +380,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * Change fill color to default color. - * + * * @param event * event from the button push. */ @@ -412,7 +414,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ColorsAndFontsPropertySection#dispose() */ @Override @@ -422,7 +424,7 @@ public class DiagramShapeColorAndFontPropertySection extends ShapeColorsAndFonts /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.properties.sections.appearance.ShapeColorsAndFontsPropertySection#refresh() */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DocumentationPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DocumentationPropertySection.java index 68e95d8cd8..0796949630 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DocumentationPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/DocumentationPropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 THALES GLOBAL SERVICES. + * 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.jface.viewers.StructuredSelection; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DDiagramEditPart; import org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditor; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; @@ -81,6 +82,7 @@ public class DocumentationPropertySection extends AbstractPropertySection { */ class TextListener implements ITextListener { + @Override public void textChanged(TextEvent event) { handleTextModified(); } @@ -204,7 +206,7 @@ public class DocumentationPropertySection extends AbstractPropertySection { * @see org.eclipse.sirius.editor.properties.sections.AbstractMultilinePropertySection#getPropertyDescription() */ protected String getPropertyDescription() { - return "Use this field to save notes about this representation."; + return Messages.DocumentationPropertySection_description; } protected String getToolTipText() { @@ -258,7 +260,7 @@ public class DocumentationPropertySection extends AbstractPropertySection { * @return The default label for the text field. */ protected String getDefaultLabelText() { - return "Documentation:"; //$NON-NLS-1$ + return Messages.DocumentationPropertySection_defaultLabel; } /** diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ExtendedPropertySource.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ExtendedPropertySource.java index f17e0ffce1..77df7c1318 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ExtendedPropertySource.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ExtendedPropertySource.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * 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 @@ -32,6 +32,7 @@ import org.eclipse.jface.viewers.CellEditor; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.TextCellEditor; import org.eclipse.sirius.common.tools.api.util.StringUtil; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.dialogs.ExtendedFeatureEditorDialog; import org.eclipse.sirius.ecore.extender.business.api.accessor.ExtensionFeatureDescription; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; @@ -95,6 +96,7 @@ public class ExtendedPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#getEditableValue() */ + @Override public Object getEditableValue() { return target.getTarget(); } @@ -104,6 +106,7 @@ public class ExtendedPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyDescriptors() */ + @Override public IPropertyDescriptor[] getPropertyDescriptors() { if (this.target == null || this.target.getTarget() == null || this.getModelAccessor() == null) { return EMPTY; @@ -139,6 +142,7 @@ public class ExtendedPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#getPropertyValue(java.lang.Object) */ + @Override public Object getPropertyValue(final Object id) { Object object = null; if (id instanceof ExtensionFeatureDescription) { @@ -166,6 +170,7 @@ public class ExtendedPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#isPropertySet(java.lang.Object) */ + @Override public boolean isPropertySet(final Object id) { return this.getPropertyValue(id) != null; } @@ -175,6 +180,7 @@ public class ExtendedPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertySource#resetPropertyValue(java.lang.Object) */ + @Override public void resetPropertyValue(final Object id) { // TODOYMO Auto-generated method stub } @@ -185,6 +191,7 @@ public class ExtendedPropertySource implements IPropertySource { * @see org.eclipse.ui.views.properties.IPropertySource#setPropertyValue(java.lang.Object, * java.lang.Object) */ + @Override public void setPropertyValue(final Object id, final Object value) { if (id instanceof ExtensionFeatureDescription) { final ExtensionFeatureDescription desc = (ExtensionFeatureDescription) id; @@ -192,7 +199,7 @@ public class ExtendedPropertySource implements IPropertySource { try { this.getModelAccessor().eSet(target.getTarget(), ExtendedPropertySource.getFeatureName((ExtensionFeatureDescription) id), value); } catch (final FeatureNotFoundException e) { - SiriusPlugin.getDefault().error("Error while setting the property value", e); + SiriusPlugin.getDefault().error(Messages.ExtendedPropertySource_errorSettingValueMsg, e); } } else if (desc.isReference()) { this.getModelAccessor().eClear(target.getTarget(), ExtendedPropertySource.getFeatureName((ExtensionFeatureDescription) id)); @@ -241,6 +248,7 @@ public class ExtendedPropertySource implements IPropertySource { * * @see org.eclipse.ui.views.properties.IPropertyDescriptor#createPropertyEditor(org.eclipse.swt.widgets.Composite) */ + @Override public CellEditor createPropertyEditor(final Composite parent) { final EObject editableValue = (EObject) getEditableValue(); CellEditor editor = null; @@ -254,7 +262,7 @@ public class ExtendedPropertySource implements IPropertySource { try { referenceValues = (List<EObject>) getModelAccessor().eGet(editableValue, ExtendedPropertySource.getFeatureName(extensionDescription)); } catch (final FeatureNotFoundException e) { - SiriusPlugin.getDefault().error("Error while retrieving reference values", e); + SiriusPlugin.getDefault().error(Messages.ExtendedPropertyDescriptor_errorRetrievingValueMsg, e); } final List<EObject> ref = referenceValues == null ? Collections.EMPTY_LIST : referenceValues; @@ -268,7 +276,7 @@ public class ExtendedPropertySource implements IPropertySource { } }; } else { - throw new UnsupportedOperationException("unknown extension"); + throw new UnsupportedOperationException(Messages.ExtendedPropertyDescriptor_unknownExtensionMsg); } return editor; } @@ -297,20 +305,23 @@ public class ExtendedPropertySource implements IPropertySource { /** * @see IPropertyDescriptor#getCategory() */ + @Override public String getCategory() { - return "Extended"; + return Messages.ExtendedPropertyDescriptor_categoryName; } /** * @see IPropertyDescriptor#getDescription() */ + @Override public String getDescription() { - return "Property source for the extension framework"; + return Messages.ExtendedPropertyDescriptor_description; } /** * @see IPropertyDescriptor#getDisplayName() */ + @Override public String getDisplayName() { return ExtendedPropertySource.getFeatureName(this.extensionDescription); } @@ -318,6 +329,7 @@ public class ExtendedPropertySource implements IPropertySource { /** * @see IPropertyDescriptor#getFilterFlags() */ + @Override public String[] getFilterFlags() { return EMPTY_STRING_ARRAY; } @@ -325,6 +337,7 @@ public class ExtendedPropertySource implements IPropertySource { /** * @see IPropertyDescriptor#getHelpContextIds() */ + @Override public Object getHelpContextIds() { return null; } @@ -332,6 +345,7 @@ public class ExtendedPropertySource implements IPropertySource { /** * @see IPropertyDescriptor#getId() */ + @Override public Object getId() { return this.extensionDescription; } @@ -339,6 +353,7 @@ public class ExtendedPropertySource implements IPropertySource { /** * @see IPropertyDescriptor#getLabelProvider() */ + @Override public ILabelProvider getLabelProvider() { return this; } @@ -346,6 +361,7 @@ public class ExtendedPropertySource implements IPropertySource { /** * @see IPropertyDescriptor#isCompatibleWith(IPropertyDescriptor) */ + @Override public boolean isCompatibleWith(final IPropertyDescriptor anotherProperty) { if (anotherProperty instanceof ExtendedPropertyDescriptor) { return this.extensionDescription.equals(((ExtendedPropertyDescriptor) anotherProperty).extensionDescription); @@ -356,6 +372,7 @@ public class ExtendedPropertySource implements IPropertySource { /** * @see ILabelProvider#getImage(Object) */ + @Override public Image getImage(final Object element) { // No specific image by default return null; @@ -366,6 +383,7 @@ public class ExtendedPropertySource implements IPropertySource { * * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) */ + @Override public String getText(final Object element) { String text = null; @@ -374,7 +392,7 @@ public class ExtendedPropertySource implements IPropertySource { try { text = String.valueOf(getModelAccessor().eGet((EObject) element, ExtendedPropertySource.getFeatureName(extensionDescription))); } catch (final FeatureNotFoundException e) { - SiriusPlugin.getDefault().error("Error while getting the property value", e); + SiriusPlugin.getDefault().error(Messages.ExtendedPropertyDescriptor_errorGettingValueMsg, e); text = e.getMessage(); } } else if (element instanceof Collection) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/FiltersPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/FiltersPropertySection.java index 27fab9b267..2655adf04a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/FiltersPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/FiltersPropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 THALES GLOBAL SERVICES. + * 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 @@ -43,6 +43,7 @@ import org.eclipse.sirius.diagram.description.filter.FilterDescription; import org.eclipse.sirius.diagram.description.filter.provider.FilterItemProviderAdapterFactory; import org.eclipse.sirius.diagram.provider.DiagramItemProviderAdapterFactory; import org.eclipse.sirius.diagram.ui.internal.edit.parts.DDiagramEditPart; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.commands.ActivateFiltersCommand; import org.eclipse.sirius.diagram.ui.tools.internal.commands.DeactivateFiltersCommand; import org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor; @@ -102,6 +103,7 @@ public class FiltersPropertySection extends AbstractPropertySection { private Button removeButton; private final IDoubleClickListener availableElementsTableDoubleClickListener = new IDoubleClickListener() { + @Override public void doubleClick(final DoubleClickEvent event) { if (addButton.isEnabled()) { addButton.notifyListeners(SWT.Selection, null); @@ -110,6 +112,7 @@ public class FiltersPropertySection extends AbstractPropertySection { }; private final IDoubleClickListener selectedElementsTableDoubleClickListener = new IDoubleClickListener() { + @Override public void doubleClick(final DoubleClickEvent event) { if (removeButton.isEnabled()) { removeButton.notifyListeners(SWT.Selection, null); @@ -164,10 +167,12 @@ public class FiltersPropertySection extends AbstractPropertySection { addButton.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(final SelectionEvent e) { } + @Override public void widgetSelected(final SelectionEvent e) { final List<Object> newElements = new ArrayList<Object>(); final IStructuredSelection selection = (IStructuredSelection) availableElementsTableViewer.getSelection(); @@ -185,10 +190,12 @@ public class FiltersPropertySection extends AbstractPropertySection { }); removeButton.addSelectionListener(new SelectionListener() { + @Override public void widgetDefaultSelected(final SelectionEvent e) { } + @Override public void widgetSelected(final SelectionEvent e) { final List<Object> oldElements = new ArrayList<Object>(); final IStructuredSelection selection = (IStructuredSelection) selectedElementsTableViewer.getSelection(); @@ -254,10 +261,10 @@ public class FiltersPropertySection extends AbstractPropertySection { new Label(controlButtons, SWT.NONE); - addButton = getWidgetFactory().createButton(controlButtons, "Add >", SWT.PUSH); + addButton = getWidgetFactory().createButton(controlButtons, Messages.FiltersPropertySection_addButtonLabel, SWT.PUSH); addButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); - removeButton = getWidgetFactory().createButton(controlButtons, "< Remove", SWT.PUSH); + removeButton = getWidgetFactory().createButton(controlButtons, Messages.FiltersPropertySection_removeButtonLabel, SWT.PUSH); removeButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); final Label spaceLabel = new Label(controlButtons, SWT.NONE); @@ -291,7 +298,7 @@ public class FiltersPropertySection extends AbstractPropertySection { featureComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); featureComposite.setLayout(new GridLayout()); - final Label featureLabel = getWidgetFactory().createLabel(featureComposite, "Applied filters", SWT.NONE); + final Label featureLabel = getWidgetFactory().createLabel(featureComposite, Messages.FiltersPropertySection_appliedFiltersLabel, SWT.NONE); featureLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); return featureComposite; } @@ -308,7 +315,7 @@ public class FiltersPropertySection extends AbstractPropertySection { choiceComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); choiceComposite.setLayout(new GridLayout()); - final Label choiceLabel = getWidgetFactory().createLabel(choiceComposite, "Available filters", SWT.NONE); + final Label choiceLabel = getWidgetFactory().createLabel(choiceComposite, Messages.FiltersPropertySection_availableFiltersLabel, SWT.NONE); choiceLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); return choiceComposite; } @@ -406,6 +413,7 @@ public class FiltersPropertySection extends AbstractPropertySection { public void refresh() { Display.getDefault().syncExec(new Runnable() { + @Override public void run() { /* * Set content/label provider diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/LabelColorAndFontPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/LabelColorAndFontPropertySection.java index 7ee88af01d..685f9eec55 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/LabelColorAndFontPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/LabelColorAndFontPropertySection.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 THALES GLOBAL SERVICES. + * Copyright (c) 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 @@ -35,6 +35,7 @@ import org.eclipse.sirius.common.tools.api.interpreter.IInterpreter; import org.eclipse.sirius.diagram.business.api.query.EObjectQuery; import org.eclipse.sirius.diagram.ui.internal.refresh.diagram.ViewPropertiesSynchronizer; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.sirius.diagram.ui.tools.internal.actions.style.ResetStylePropertiesToDefaultValuesAction; import org.eclipse.sirius.diagram.ui.tools.internal.dialogs.ColorPalettePopup; @@ -57,7 +58,7 @@ import org.eclipse.ui.IWorkbenchPart; /** * Allow color customization of labels. - * + * * @author <a href="mailto:mickael.lanoe@obeo.fr">Mickael LANOE</a> */ @SuppressWarnings("restriction") @@ -136,7 +137,7 @@ public class LabelColorAndFontPropertySection extends ColorsAndFontsPropertySect final View view = (View) ep.getModel(); // change the color. final UserFixedColor newColor = DescriptionFactory.eINSTANCE.createUserFixedColor(); - newColor.setName("<anonymous>"); + newColor.setName(Messages.AnonymousUserFixedColorName); newColor.setBlue(finalColor.blue); newColor.setGreen(finalColor.green); newColor.setRed(finalColor.red); @@ -177,7 +178,7 @@ public class LabelColorAndFontPropertySection extends ColorsAndFontsPropertySect fontUnderlineButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "Underline"; + e.result = Messages.FontPropertySection_underline; } }); @@ -187,7 +188,7 @@ public class LabelColorAndFontPropertySection extends ColorsAndFontsPropertySect fontStrikeThroughButton.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(final AccessibleEvent e) { - e.result = "StrikeThrough"; + e.result = Messages.FontPropertySection_strikeThrough; } }); @@ -223,7 +224,7 @@ public class LabelColorAndFontPropertySection extends ColorsAndFontsPropertySect /** * Overridden to display property of selection only if semantic element of * selection exists. - * + * * {@inheritDoc} */ @Override @@ -248,7 +249,7 @@ public class LabelColorAndFontPropertySection extends ColorsAndFontsPropertySect /** * Transform selection to have {@link DSemanticDecorator} instead of * {@link EditPart} or null if the semantic element (target) not exists. - * + * * @param selection * the currently selected object * @return the unwrapped object diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ValidationPropertySection.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ValidationPropertySection.java index 00a7e2ef90..c7a4122796 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ValidationPropertySection.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/properties/ValidationPropertySection.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 @@ -13,6 +13,7 @@ package org.eclipse.sirius.diagram.ui.tools.internal.properties; import java.util.Collection; import java.util.HashSet; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.commands.ActivateRulesCommand; import org.eclipse.sirius.diagram.ui.tools.internal.commands.DeactivateRulesCommand; import org.eclipse.sirius.viewpoint.description.validation.ValidationRule; @@ -76,7 +77,7 @@ public class ValidationPropertySection extends FiltersPropertySection { featureComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); featureComposite.setLayout(new GridLayout()); - final Label featureLabel = getWidgetFactory().createLabel(featureComposite, "Activated rules", SWT.NONE); + final Label featureLabel = getWidgetFactory().createLabel(featureComposite, Messages.ValidationPropertySection_activatedRulesLabel, SWT.NONE); featureLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); return featureComposite; } @@ -92,7 +93,7 @@ public class ValidationPropertySection extends FiltersPropertySection { choiceComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); choiceComposite.setLayout(new GridLayout()); - final Label choiceLabel = getWidgetFactory().createLabel(choiceComposite, "Available rules", SWT.NONE); + final Label choiceLabel = getWidgetFactory().createLabel(choiceComposite, Messages.ValidationPropertySection_availableRulesLabel, SWT.NONE); choiceLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); return choiceComposite; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java index c46b863f42..7732d09a2e 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/providers/decorators/SubDiagramDecorator.java @@ -35,6 +35,7 @@ import org.eclipse.sirius.common.tools.api.profiler.ProfilerTask; import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.WorkspaceImageFigure; import org.eclipse.sirius.diagram.ui.tools.api.graphical.edit.styles.IBorderItemOffsets; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; @@ -60,7 +61,7 @@ import com.google.common.collect.Iterables; */ public class SubDiagramDecorator extends AbstractDecorator { - private static final ProfilerTask DECORATOR_REFRESH = new ProfilerTask(SiriusTasksKey.DIAGRAM_CAT, "SubDiagramDecorator refresh", SiriusTasks.IMAGES_VIEWPOINT); + private static final ProfilerTask DECORATOR_REFRESH = new ProfilerTask(SiriusTasksKey.DIAGRAM_CAT, Messages.SubDiagramDecorator_taskName, SiriusTasks.IMAGES_VIEWPOINT); private Session session; @@ -80,6 +81,7 @@ public class SubDiagramDecorator extends AbstractDecorator { /** * {@inheritDoc} */ + @Override public void activate() { // Nothing to do. } @@ -95,6 +97,7 @@ public class SubDiagramDecorator extends AbstractDecorator { * * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#refresh() */ + @Override public void refresh() { DslCommonPlugin.PROFILER.startWork(DECORATOR_REFRESH); removeDecoration(); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/CustomSiriusDocumentProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/CustomSiriusDocumentProvider.java index b0705ba0e0..0c5175c13d 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/CustomSiriusDocumentProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/CustomSiriusDocumentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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.diagram.ui.tools.internal.resource; import java.io.IOException; +import java.text.MessageFormat; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -58,7 +59,7 @@ import org.eclipse.ui.part.FileEditorInput; /** * . - * + * * @author cbrun */ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider implements IDiagramDocumentProvider { @@ -74,7 +75,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * Default constructor. - * + * * @param transactionalEditingDomain * the {@link TransactionalEditingDomain} */ @@ -85,14 +86,14 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider#createDocument(java.lang.Object) */ @Override protected IDocument createDocument(final Object element) throws CoreException { if (!(element instanceof FileEditorInput) && !(element instanceof URIEditorInput)) { - throw new CoreException(new Status(IStatus.ERROR, DiagramPlugin.ID, 0, NLS.bind(Messages.SiriusDocumentProvider_IncorrectInputError, new Object[] { element, - "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput", }), //$NON-NLS-1$ //$NON-NLS-2$ + throw new CoreException(new Status(IStatus.ERROR, DiagramPlugin.ID, 0, + NLS.bind(Messages.SiriusDocumentProvider_IncorrectInputError, new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput", }), //$NON-NLS-1$ //$NON-NLS-2$ null)); } final IDocument document = createEmptyDocument(); @@ -103,12 +104,13 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * . - * + * * @param document * . * @param element * . - * @throws CoreException . + * @throws CoreException + * . */ protected void setDocumentContent(final IDocument document, final IEditorInput element) throws CoreException { final IDiagramDocument diagramDocument = (IDiagramDocument) document; @@ -141,8 +143,8 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple } else if (element instanceof URIEditorInput) { caseURIEditorInput(document, (URIEditorInput) element, domain); } else { - throw new CoreException(new Status(IStatus.ERROR, DiagramPlugin.ID, 0, NLS.bind(Messages.SiriusDocumentProvider_IncorrectInputError, new Object[] { element, - "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput", }), //$NON-NLS-1$ //$NON-NLS-2$ + throw new CoreException(new Status(IStatus.ERROR, DiagramPlugin.ID, 0, + NLS.bind(Messages.SiriusDocumentProvider_IncorrectInputError, new Object[] { element, "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput", }), //$NON-NLS-1$ //$NON-NLS-2$ null)); } } finally { @@ -222,8 +224,8 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple return; } } - DiagramUIPlugin.getPlugin().getResourceMissingDocumentProvider() - .setDocumentContent(document, element, "You should use the Model Explorer view and the Design perspective to open aird files."); + DiagramUIPlugin.getPlugin().getResourceMissingDocumentProvider().setDocumentContent(document, element, + org.eclipse.sirius.diagram.ui.provider.Messages.CustomSiriusDocumentProvider_useModelExplorerToOpenMsg); } // We do not throw a RuntimeException anymore if there is no // diagram. We open an empty diagram. @@ -247,7 +249,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple * Sets up the given document as it would be provided for the given element. * The content of the document is not changed. This default implementation * is empty. Subclasses may reimplement. - * + * * @param element * the blue-print element * @param document @@ -259,7 +261,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider#createEmptyDocument() */ @Override @@ -271,7 +273,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider#doSaveDocument(org.eclipse.core.runtime.IProgressMonitor, * java.lang.Object, * org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument, @@ -288,7 +290,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider#getOperationRunner(org.eclipse.core.runtime.IProgressMonitor) */ @Override @@ -298,7 +300,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider#createInputWithEditingDomain(org.eclipse.ui.IEditorInput, * org.eclipse.emf.transaction.TransactionalEditingDomain) */ @@ -309,7 +311,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocumentProvider#getDiagramDocument(java.lang.Object) */ @Override @@ -323,7 +325,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider#isReadOnly(java.lang.Object) */ @Override @@ -335,7 +337,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider#isModifiable(java.lang.Object) */ @Override @@ -350,7 +352,8 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple URI resourceURI = inputURI.trimFragment(); Resource resource = resourceSet.getResource(resourceURI, false); if (resource == null) { - DiagramPlugin.getDefault().logError("No resource in resourceSet corresponding to " + resourceURI.toString()); + DiagramPlugin.getDefault() + .logError(MessageFormat.format(org.eclipse.sirius.diagram.ui.provider.Messages.CustomSiriusDocumentProvider_noCorrespondingResourceMsg, resourceURI.toString())); return isModifiable; } String fragment = inputURI.fragment(); @@ -371,7 +374,7 @@ public class CustomSiriusDocumentProvider extends AbstractDocumentProvider imple /** * {@inheritDoc} - * + * * @see org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocumentProvider#canSaveDocument(java.lang.Object) */ @Override diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/ResourceMissingDocumentProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/ResourceMissingDocumentProvider.java index fe8104de14..53a7ccfae5 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/ResourceMissingDocumentProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/resource/ResourceMissingDocumentProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 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 @@ -22,18 +22,17 @@ import org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory; import org.eclipse.gmf.runtime.notation.Diagram; import org.eclipse.gmf.runtime.notation.NotationFactory; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.util.GMFNotationHelper; import org.eclipse.ui.IEditorInput; /** * Provide an "error" diagram if initial resource could not be found. - * + * * @author mchauvin */ public class ResourceMissingDocumentProvider { - private static final String DEFAULT_NOTE_MESSAGE = "This diagram was not saved. You can close the editor"; - private ResourceSet errorResourceSet; private Resource errorResource; @@ -42,7 +41,7 @@ public class ResourceMissingDocumentProvider { /** * Set the document content. - * + * * @param document * the document * @param element @@ -50,12 +49,12 @@ public class ResourceMissingDocumentProvider { */ public void setDocumentContent(final IDocument document, final IEditorInput element) { // TODO get diagram name - document.setContent(getErrorDiagram(DEFAULT_NOTE_MESSAGE)); + document.setContent(getErrorDiagram(Messages.ResourceMissingDocumentProvider_defaultMessage)); } /** * Set the document content. - * + * * @param document * the document * @param element @@ -93,7 +92,7 @@ public class ResourceMissingDocumentProvider { /** * Specific command to add error diagram in error resource. - * + * * @author mporhel */ private class AddErrorCommand extends RecordingCommand { @@ -106,7 +105,7 @@ public class ResourceMissingDocumentProvider { /** * Constructor. - * + * * @param domain * the editing domain. * @param noteMessage @@ -120,7 +119,7 @@ public class ResourceMissingDocumentProvider { * the current session. */ public AddErrorCommand(TransactionalEditingDomain domain, Diagram diagram, Resource resource, String noteMessage) { - super(domain, "Navigate to another representation"); + super(domain, Messages.AddErrorCommand_label); this.diagram = diagram; this.resource = resource; this.noteMessage = noteMessage; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/util/GMFNotationUtilities.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/util/GMFNotationUtilities.java index 934a7fb834..29b3e297e2 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/util/GMFNotationUtilities.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/util/GMFNotationUtilities.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * 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 @@ -26,6 +26,7 @@ import org.eclipse.gmf.runtime.notation.RelativeBendpoints; import org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint; import org.eclipse.sirius.diagram.ui.business.api.query.EdgeQuery; import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; @@ -39,11 +40,6 @@ import com.google.common.collect.Lists; public final class GMFNotationUtilities { /** - * Error message for case where we detect an edge connected to other edge. - */ - private static final String MSG_EDGE_ON_EDGE_NOT_MANAGED = "Edge on edge not managed"; - - /** * Default constructor. */ private GMFNotationUtilities() { @@ -94,7 +90,7 @@ public final class GMFNotationUtilities { referencePointOfChangedAnchor = new PrecisionPoint(sourceFigure.getLocation().x + sourceFigure.width * newXAnchorPercentage, sourceFigure.getLocation().y + sourceFigure.height * 0.5d); } } else if (edge.getSource() instanceof Edge) { - throw new UnsupportedOperationException(MSG_EDGE_ON_EDGE_NOT_MANAGED); + throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } if (referencePointOfChangedAnchor == null) { return Options.newNone(); @@ -146,7 +142,7 @@ public final class GMFNotationUtilities { referencePointOfChangedAnchor = new PrecisionPoint(targetFigure.getLocation().x + targetFigure.width * newXAnchorPercentage, targetFigure.getLocation().y + targetFigure.height * 0.5d); } } else if (edge.getTarget() instanceof Edge) { - throw new UnsupportedOperationException(MSG_EDGE_ON_EDGE_NOT_MANAGED); + throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } if (referencePointOfChangedAnchor == null) { return Options.newNone(); @@ -244,7 +240,7 @@ public final class GMFNotationUtilities { * relativeReferencePoint.preciseY())); } } else { - throw new UnsupportedOperationException(MSG_EDGE_ON_EDGE_NOT_MANAGED); + throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } return Options.newNone(); } @@ -283,7 +279,7 @@ public final class GMFNotationUtilities { * relativeReferencePoint.preciseY())); } } else { - throw new UnsupportedOperationException(MSG_EDGE_ON_EDGE_NOT_MANAGED); + throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } return Options.newNone(); } @@ -319,14 +315,14 @@ public final class GMFNotationUtilities { sourceLocation = new PrecisionPoint(sourceBounds.x + sourceBounds.width * sourceAnchorReference.preciseX(), sourceBounds.y + sourceBounds.height * sourceAnchorReference.preciseY()); } else if (edgeToModify.getSource() instanceof Edge) { // TODO Manage edge on egde ... - throw new UnsupportedOperationException(MSG_EDGE_ON_EDGE_NOT_MANAGED); + throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } if (edgeToModify.getTarget() instanceof Node) { targetBounds = GMFHelper.getBounds((Node) edgeToModify.getTarget(), true); targetLocation = new PrecisionPoint(targetBounds.x + targetBounds.width * targetAnchorReference.preciseX(), targetBounds.y + targetBounds.height * targetAnchorReference.preciseY()); } else if (edgeToModify.getTarget() instanceof Edge) { // TODO Manage edge on egde ... - throw new UnsupportedOperationException(MSG_EDGE_ON_EDGE_NOT_MANAGED); + throw new UnsupportedOperationException(Messages.GMFNotationUtilities_edgeOnEdgeNotManaged); } if (referenceEdge.getBendpoints() instanceof RelativeBendpoints) { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/outlineview/DiagramOutlineWithBookPages.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/outlineview/DiagramOutlineWithBookPages.java index 2f05c6fd6b..50ee7e8b1b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/outlineview/DiagramOutlineWithBookPages.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/outlineview/DiagramOutlineWithBookPages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 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 @@ -18,6 +18,7 @@ import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.sirius.common.ui.tools.api.util.IObjectActionDelegateWrapper; import org.eclipse.sirius.common.ui.tools.api.util.SWTUtil; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.internal.editor.DiagramOutlinePage; import org.eclipse.sirius.diagram.ui.tools.internal.editor.DiagramOutlinePageListener; import org.eclipse.sirius.diagram.ui.tools.internal.views.providers.filters.FiltersTableViewer; @@ -43,12 +44,6 @@ public class DiagramOutlineWithBookPages extends DiagramOutlinePage { /** The id of the layers. 4 */ protected static final int ID_FILTERS = 4; - /** the layers tooltip text. */ - private static final String LAYER_TIP_TEXT = "Layers"; - - /** the layers tooltip text. */ - private static final String FILTER_TIP_TEXT = "Filters"; - /** The layers icon descriptor. */ private static final ImageDescriptor DESC_LAYER = DiagramUIPlugin.Implementation.getBundledImageDescriptor("icons/layers.gif"); //$NON-NLS-1$ @@ -113,7 +108,7 @@ public class DiagramOutlineWithBookPages extends DiagramOutlinePage { } }; showLayersAction.setImageDescriptor(DESC_LAYER); - showLayersAction.setToolTipText(LAYER_TIP_TEXT); + showLayersAction.setToolTipText(Messages.DiagramOutlineWithBookPages_layersTooltip); tbm.add(showLayersAction); } @@ -125,7 +120,7 @@ public class DiagramOutlineWithBookPages extends DiagramOutlinePage { } }; showFiltersAction.setImageDescriptor(DESC_FILTER); - showFiltersAction.setToolTipText(FILTER_TIP_TEXT); + showFiltersAction.setToolTipText(Messages.DiagramOutlineWithBookPages_filtersTooltip); tbm.add(showFiltersAction); } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/filters/FiltersTableViewer.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/filters/FiltersTableViewer.java index d6f4b97d07..ba1b901934 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/filters/FiltersTableViewer.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/filters/FiltersTableViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -17,6 +17,7 @@ import org.eclipse.jface.viewers.CheckboxCellEditor; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; @@ -31,7 +32,7 @@ import org.eclipse.swt.widgets.TableColumn; */ public final class FiltersTableViewer { - private static final String[] COLUMNS = { " ", "Filter" }; //$NON-NLS-1$ + private static final String[] COLUMNS = { " ", Messages.FiltersTableViewer_columnName }; //$NON-NLS-1$ /** * Avoid instantiation. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersCellModifier.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersCellModifier.java index 0e769aa2e6..4fba1c065e 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersCellModifier.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersCellModifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -28,6 +28,7 @@ import org.eclipse.sirius.common.tools.api.util.EqualityHelper; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.description.Layer; import org.eclipse.sirius.diagram.tools.api.command.ChangeLayerActivationCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.editor.DDiagramEditor; import org.eclipse.swt.widgets.Item; import org.eclipse.ui.IWorkbench; @@ -70,6 +71,7 @@ public class LayersCellModifier implements ICellModifier { * @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, * java.lang.String) */ + @Override public boolean canModify(final Object element, final String property) { if (property.equals(layerColumns[0])) { @@ -85,6 +87,7 @@ public class LayersCellModifier implements ICellModifier { * @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, * java.lang.String) */ + @Override public Object getValue(final Object element, final String property) { final Layer layer = (Layer) element; @@ -118,6 +121,7 @@ public class LayersCellModifier implements ICellModifier { * @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, * java.lang.String, java.lang.Object) */ + @Override public void modify(final Object element, final String property, final Object value) { Object objElement; @@ -148,8 +152,9 @@ public class LayersCellModifier implements ICellModifier { try { ps.busyCursorWhile(new IRunnableWithProgress() { + @Override public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { - monitor.beginTask("Apply layer modifications...", 1); + monitor.beginTask(Messages.LayersCellModifier_layerSelectionChangesTaskName, 1); TransactionalEditingDomain domain = TransactionUtil.getEditingDomain(dDiagram); Command changeActivatedLayersCmd = new ChangeLayerActivationCommand(domain, dDiagram, layer, monitor); domain.getCommandStack().execute(changeActivatedLayersCmd); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersTableViewer.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersTableViewer.java index 2111b43eb1..b5255e09e6 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersTableViewer.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/views/providers/layers/LayersTableViewer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2009, 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 @@ -19,6 +19,7 @@ import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.window.ToolTip; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.image.DiagramImagesPath; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; @@ -33,7 +34,7 @@ import org.eclipse.swt.widgets.TableColumn; */ public final class LayersTableViewer { - private static final String[] COLUMNS = { " ", " ", "Layer" }; //$NON-NLS-1$ + private static final String[] COLUMNS = { " ", " ", Messages.LayersTableViewer_columnName }; //$NON-NLS-1$ //$NON-NLS-2$ /** * Avoid instantiation. diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/AbstractNodeMappingItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/AbstractNodeMappingItemProvider.java index 7ca73893c9..b358a02fa3 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/AbstractNodeMappingItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/AbstractNodeMappingItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -231,7 +231,7 @@ public class AbstractNodeMappingItemProvider extends DiagramElementMappingItemPr EStructuralFeature eFeature = (EStructuralFeature) feature; featureKey = eFeature.getEContainingClass().getName() + "_" + eFeature.getName(); //$NON-NLS-1$ } else { - featureKey = "Unknown"; + featureKey = "Unknown"; //$NON-NLS-1$ } return getResourceLocator().getString("_UI_" + featureKey + "_feature_prefix"); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DescriptionItemProviderAdapterFactory.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DescriptionItemProviderAdapterFactory.java index d2e19e857f..c3ea42f0be 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DescriptionItemProviderAdapterFactory.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DescriptionItemProviderAdapterFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -39,6 +39,7 @@ import org.eclipse.sirius.diagram.description.DiagramDescription; import org.eclipse.sirius.diagram.description.Layer; import org.eclipse.sirius.diagram.description.util.DescriptionAdapterFactory; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.DecorationDescriptionsSet; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -728,7 +729,7 @@ public class DescriptionItemProviderAdapterFactory extends DescriptionAdapterFac DiagramDescription diagramDescription = DescriptionFactory.eINSTANCE.createDiagramDescription(); diagramDescription.setEnablePopupBars(true); Layer layer = DescriptionFactory.eINSTANCE.createLayer(); - layer.setName("Default"); + layer.setName(Messages.DefaultLayerName); diagramDescription.setDefaultLayer(layer); newChildDescriptors.add(createChildParameter(DescriptionPackage.Literals.VIEWPOINT__OWNED_REPRESENTATIONS, diagramDescription)); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramDescriptionItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramDescriptionItemProvider.java index d9462dc9ad..dd4c796261 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramDescriptionItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramDescriptionItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -31,6 +31,7 @@ import org.eclipse.sirius.diagram.description.Layer; import org.eclipse.sirius.diagram.description.concern.ConcernFactory; import org.eclipse.sirius.diagram.description.concern.ConcernSet; import org.eclipse.sirius.diagram.description.filter.FilterFactory; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.sirius.viewpoint.description.tool.ToolFactory; import org.eclipse.sirius.viewpoint.description.validation.ValidationFactory; @@ -451,7 +452,7 @@ public class DiagramDescriptionItemProvider extends DragAndDropTargetDescription /** * <!-- begin-user-doc --> <!-- end-user-doc --> - * + * * @generated NOT */ @Override @@ -564,7 +565,7 @@ public class DiagramDescriptionItemProvider extends DragAndDropTargetDescription ToolFactory.eINSTANCE.createInitialOperation())); Layer defaultLayer = DescriptionFactory.eINSTANCE.createLayer(); - defaultLayer.setName("Default"); + defaultLayer.setName(Messages.DefaultLayerName); newChildDescriptors.add(createChildParameter(org.eclipse.sirius.diagram.description.DescriptionPackage.Literals.DIAGRAM_DESCRIPTION__DEFAULT_LAYER, defaultLayer)); // Do not add additional layer as default layer. @@ -672,14 +673,14 @@ public class DiagramDescriptionItemProvider extends DragAndDropTargetDescription // this case we could also put only the Feature text as the only // child type currently available for is Layer (see // collectNewChildDescriptors). - return getString("_UI_CreateChild_text2", new Object[] { getTypeText(child), "Default", getTypeText(owner) }); //$NON-NLS-1$ + return getString("_UI_CreateChild_text2", new Object[] { getTypeText(child), "Default", getTypeText(owner) }); //$NON-NLS-1$ //$NON-NLS-2$ } String createChildText = super.getCreateChildText(owner, feature, child, selection); if (child != null && isNormalEdgeMapping(child)) { if (((EdgeMapping) child).isUseDomainElement()) { - createChildText = "Element Based Edge"; + createChildText = Messages.ItemProvider_elementBasedEdge; } else { - createChildText = "Relation Based Edge"; + createChildText = Messages.ItemProvider_relationBasedEdge; } } return createChildText; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramImportDescriptionItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramImportDescriptionItemProvider.java index 6e4e818904..b0cbdf1bdf 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramImportDescriptionItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/DiagramImportDescriptionItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -32,6 +32,7 @@ import org.eclipse.sirius.diagram.description.concern.ConcernSet; import org.eclipse.sirius.diagram.description.filter.FilterFactory; import org.eclipse.sirius.diagram.description.tool.ToolFactory; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.sirius.viewpoint.description.provider.DocumentedElementItemProvider; import org.eclipse.sirius.viewpoint.description.validation.ValidationFactory; @@ -685,14 +686,14 @@ public class DiagramImportDescriptionItemProvider extends DocumentedElementItemP // this case we could also put only the Feature text as the only // child type currently available for is Layer (see // collectNewChildDescriptors). - return getString("_UI_CreateChild_text2", new Object[] { getTypeText(child), "Default", getTypeText(owner) }); //$NON-NLS-1$ + return getString("_UI_CreateChild_text2", new Object[] { getTypeText(child), "Default", getTypeText(owner) }); //$NON-NLS-1$ //$NON-NLS-2$ } String createChildText = super.getCreateChildText(owner, feature, child, selection); if (child != null && isNormalEdgeMapping(child)) { if (((EdgeMapping) child).isUseDomainElement()) { - createChildText = "Element Based Edge"; + createChildText = Messages.ItemProvider_elementBasedEdge; } else { - createChildText = "Relation Based Edge"; + createChildText = Messages.ItemProvider_relationBasedEdge; } } return createChildText; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/EdgeMappingItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/EdgeMappingItemProvider.java index d2c565adf8..18723f4862 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/EdgeMappingItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/EdgeMappingItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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.diagram.description.style.BracketEdgeStyleDescription; import org.eclipse.sirius.diagram.description.style.EdgeStyleDescription; import org.eclipse.sirius.diagram.description.style.StyleFactory; import org.eclipse.sirius.diagram.description.style.StylePackage; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; /** @@ -294,9 +295,9 @@ public class EdgeMappingItemProvider extends DiagramElementMappingItemProvider { String label = new IdentifiedElementQuery((EdgeMapping) object).getLabel(); if ((label == null || label.length() == 0)) { if (((EdgeMapping) object).isUseDomainElement()) { - label = "Element Based Edge"; + label = Messages.ItemProvider_elementBasedEdge; } else { - label = "Relation Based Edge"; + label = Messages.ItemProvider_relationBasedEdge; } } return label == null || label.length() == 0 ? getString("_UI_EdgeMapping_type") : label; //$NON-NLS-1$ diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/LayerItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/LayerItemProvider.java index bcd649e049..d7ef6e5aee 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/LayerItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/LayerItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -33,6 +33,7 @@ import org.eclipse.sirius.diagram.description.style.EdgeStyleDescription; import org.eclipse.sirius.diagram.description.style.StyleFactory; import org.eclipse.sirius.diagram.description.tool.ToolFactory; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import org.eclipse.sirius.ui.tools.internal.util.EMFCoreUtil; @@ -371,9 +372,9 @@ public class LayerItemProvider extends DocumentedElementItemProvider { String createChildText = super.getCreateChildText(owner, feature, child, selection); if (child != null && isNormalEdgeMapping(child)) { if (((EdgeMapping) child).isUseDomainElement()) { - createChildText = "Element Based Edge"; + createChildText = Messages.ItemProvider_elementBasedEdge; } else { - createChildText = "Relation Based Edge"; + createChildText = Messages.ItemProvider_relationBasedEdge; } } return createChildText; diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingImportItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingImportItemProvider.java index 886a9b3590..904eb54d12 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingImportItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingImportItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -11,6 +11,7 @@ */ package org.eclipse.sirius.diagram.description.provider; +import java.text.MessageFormat; import java.util.Collection; import java.util.List; @@ -24,6 +25,7 @@ import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.sirius.business.api.query.IdentifiedElementQuery; import org.eclipse.sirius.diagram.description.NodeMappingImport; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; /** @@ -132,7 +134,7 @@ public class NodeMappingImportItemProvider extends NodeMappingItemProvider { String label = new IdentifiedElementQuery((NodeMappingImport) object).getLabel(); EStructuralFeature eContainingFeature = ((EObject) object).eContainingFeature(); if (eContainingFeature != null && eContainingFeature.getFeatureID() == org.eclipse.sirius.diagram.description.DescriptionPackage.ABSTRACT_NODE_MAPPING__BORDERED_NODE_MAPPINGS) { - return "Bordered " + label; + return MessageFormat.format(Messages.NodeMappingItemProvider_borderedLabel, label); } return label == null || label.length() == 0 ? getString("_UI_NodeMappingImport_type") : label; //$NON-NLS-1$ diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingItemProvider.java index 8ab5af7e66..79c7174bb2 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/provider/NodeMappingItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -11,6 +11,7 @@ */ package org.eclipse.sirius.diagram.description.provider; +import java.text.MessageFormat; import java.util.Collection; import java.util.List; @@ -31,6 +32,7 @@ import org.eclipse.sirius.diagram.description.NodeMapping; import org.eclipse.sirius.diagram.description.style.NodeStyleDescription; import org.eclipse.sirius.diagram.description.style.StyleFactory; import org.eclipse.sirius.diagram.description.style.WorkspaceImageDescription; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This is the item provider adapter for a @@ -140,7 +142,7 @@ public class NodeMappingItemProvider extends AbstractNodeMappingItemProvider { String label = new IdentifiedElementQuery((NodeMapping) object).getLabel(); EStructuralFeature eContainingFeature = ((EObject) object).eContainingFeature(); if (eContainingFeature != null && eContainingFeature.getFeatureID() == org.eclipse.sirius.diagram.description.DescriptionPackage.ABSTRACT_NODE_MAPPING__BORDERED_NODE_MAPPINGS) { - return "Bordered " + label; + return MessageFormat.format(Messages.NodeMappingItemProvider_borderedLabel, label); } return label == null || label.length() == 0 ? getString("_UI_NodeMapping_type") : label; //$NON-NLS-1$ } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/FlatContainerStyleDescriptionItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/FlatContainerStyleDescriptionItemProvider.java index fd85fe007d..d72fe4bce8 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/FlatContainerStyleDescriptionItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/FlatContainerStyleDescriptionItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -11,6 +11,7 @@ */ package org.eclipse.sirius.diagram.description.style.provider; +import java.text.MessageFormat; import java.util.Collection; import java.util.List; @@ -23,6 +24,7 @@ import org.eclipse.emf.edit.provider.ViewerNotification; import org.eclipse.sirius.business.api.query.ColorQuery; import org.eclipse.sirius.diagram.description.style.FlatContainerStyleDescription; import org.eclipse.sirius.diagram.description.style.StylePackage; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This is the item provider adapter for a @@ -183,7 +185,7 @@ public class FlatContainerStyleDescriptionItemProvider extends ContainerStyleDes String label = getString("_UI_FlatContainerStyleDescription_type"); //$NON-NLS-1$ if (fgColor != null & bgColor != null) { - return label + " " + bgColor + " to " + fgColor; + return MessageFormat.format(Messages.ItemProvider_foregroundBackgroundLabel, label, bgColor, fgColor); } else { return label; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/GaugeSectionDescriptionItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/GaugeSectionDescriptionItemProvider.java index eec299fc7e..8a380f6624 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/GaugeSectionDescriptionItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/style/provider/GaugeSectionDescriptionItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -11,6 +11,7 @@ */ package org.eclipse.sirius.diagram.description.style.provider; +import java.text.MessageFormat; import java.util.Collection; import java.util.List; @@ -31,6 +32,7 @@ import org.eclipse.sirius.business.api.query.ColorQuery; import org.eclipse.sirius.diagram.description.style.GaugeSectionDescription; import org.eclipse.sirius.diagram.description.style.StylePackage; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * This is the item provider adapter for a @@ -177,7 +179,7 @@ IItemPropertySource { String label = getString("_UI_GaugeSectionDescription_type"); //$NON-NLS-1$ if (fgColor != null & bgColor != null) { - return label + " " + bgColor + " to " + fgColor; + return MessageFormat.format(Messages.ItemProvider_foregroundBackgroundLabel, label, bgColor, fgColor); } else { return label; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/EdgeCreationDescriptionItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/EdgeCreationDescriptionItemProvider.java index 4cf38708ee..e55ebf52a9 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/EdgeCreationDescriptionItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/EdgeCreationDescriptionItemProvider.java @@ -148,7 +148,8 @@ public class EdgeCreationDescriptionItemProvider extends MappingBasedToolDescrip */ @Override protected void addPreconditionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_EdgeCreationDescription_precondition_feature"), //$NON-NLS-1$ getString("_UI_PropertyDescriptor_description", "_UI_AbstractToolDescription_precondition_feature", "_UI_AbstractToolDescription_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ org.eclipse.sirius.viewpoint.description.tool.ToolPackage.Literals.ABSTRACT_TOOL_DESCRIPTION__PRECONDITION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/NavigationItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/NavigationItemProvider.java index 119f0a1561..a9581a8712 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/NavigationItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-gen/org/eclipse/sirius/diagram/description/tool/provider/NavigationItemProvider.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * 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 @@ -11,6 +11,7 @@ */ package org.eclipse.sirius.diagram.description.tool.provider; +import java.text.MessageFormat; import java.util.Collection; import java.util.List; @@ -25,6 +26,7 @@ import org.eclipse.sirius.diagram.description.tool.Navigation; import org.eclipse.sirius.diagram.description.tool.ToolFactory; import org.eclipse.sirius.diagram.description.tool.ToolPackage; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.description.tool.provider.ContainerModelOperationItemProvider; /** @@ -111,9 +113,9 @@ public class NavigationItemProvider extends ContainerModelOperationItemProvider public String getText(Object object) { Navigation navigation = (Navigation) object; if (navigation.getDiagramDescription() != null && navigation.getDiagramDescription().getName() != null) { - return getString("_UI_Navigation_type") + " to " + navigation.getDiagramDescription().getName(); //$NON-NLS-1$ + return MessageFormat.format(Messages.NavigationItemProvider_labelWithDescriptionName, getString("_UI_Navigation_type"), navigation.getDiagramDescription().getName()); //$NON-NLS-1$ } else { - return getString("_UI_Navigation_type") + " " + navigation.isCreateIfNotExistent(); //$NON-NLS-1$ //$NON-NLS-2$ + return MessageFormat.format("{0} {1}", getString("_UI_Navigation_type"), navigation.isCreateIfNotExistent()); //$NON-NLS-1$ //$NON-NLS-2$ } } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/AbstractDDiagramElementLabelItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/AbstractDDiagramElementLabelItemProvider.java index 2757721f25..3d9cc24951 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/AbstractDDiagramElementLabelItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/AbstractDDiagramElementLabelItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.api.provider; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; @@ -23,28 +24,29 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider; import org.eclipse.emf.edit.provider.ItemProviderAdapter; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; /** * A custom ItemProvider to add the label of DDiagramElement. This ItemProvider * "simulates" a new child for DDiagramElement. - * + * * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> - * + * */ -public abstract class AbstractDDiagramElementLabelItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, -IItemLabelProvider, IItemPropertySource { +public abstract class AbstractDDiagramElementLabelItemProvider extends ItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * Label to compute when name of the DDiagramElement associated to this * label is empty. */ - protected static final String EMPTY_DDIAGRAMELEMENT_LABEL_LABEL = "Empty label"; + protected static final String EMPTY_DDIAGRAMELEMENT_LABEL_LABEL = Messages.AbstractDDiagramElementLabelItemProvider_emptyLabel; /** * Default constructor. - * + * * @param adapterFactory * The factory is used as a key so that we always know which * factory created this adapter. @@ -68,7 +70,7 @@ IItemLabelProvider, IItemPropertySource { * <li>It has a non-null and non-empty name</li> * </ul> * </p> - * + * * @param dDiagramElement * the DDiagramElement to determine if it can have a * DDiagramElementLabelItem has children @@ -80,7 +82,7 @@ IItemLabelProvider, IItemPropertySource { /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getParent(java.lang.Object) */ @Override @@ -90,7 +92,7 @@ IItemLabelProvider, IItemPropertySource { /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getText(java.lang.Object) */ @Override @@ -99,14 +101,14 @@ IItemLabelProvider, IItemPropertySource { if (label == null || label.length() == 0) { label = EMPTY_DDIAGRAMELEMENT_LABEL_LABEL; } else { - label = label + " label"; + label = MessageFormat.format(Messages.AbstractDDiagramElementLabelItemProvider_label, label); } return label; } /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) */ @Override @@ -116,17 +118,17 @@ IItemLabelProvider, IItemPropertySource { /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getImage(java.lang.Object) */ @Override public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("label_obj")); + return overlayImage(object, getResourceLocator().getImage("label_obj")); //$NON-NLS-1$ } /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getResourceLocator() */ @Override @@ -136,7 +138,7 @@ IItemLabelProvider, IItemPropertySource { /** * {@inheritDoc} - * + * * @see java.lang.Object#equals(java.lang.Object) */ @Override @@ -150,7 +152,7 @@ IItemLabelProvider, IItemPropertySource { /** * {@inheritDoc} - * + * * @see java.lang.Object#hashCode() */ @Override @@ -165,7 +167,7 @@ IItemLabelProvider, IItemPropertySource { /** * Return the target of kind DiagramElement or a null Option if any target * or of another kind. - * + * * @return An option of DDiagramElement. */ public Option<DDiagramElement> getDiagramElementTarget() { diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeBeginLabelItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeBeginLabelItemProvider.java index 8336f80744..47fbb799a8 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeBeginLabelItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeBeginLabelItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -10,23 +10,26 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.api.provider; +import java.text.MessageFormat; + import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.business.api.query.DEdgeQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * A custom ItemProvider to add the label of Edge. This ItemProvider "simulates" * a new child for Edge that have label. - * + * * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> - * + * */ public class DEdgeBeginLabelItemProvider extends AbstractDDiagramElementLabelItemProvider { /** * Default constructor. - * + * * @param adapterFactory * The factory is used as a key so that we always know which * factory created this adapter. @@ -50,7 +53,7 @@ public class DEdgeBeginLabelItemProvider extends AbstractDDiagramElementLabelIte * <li>It has a non-null and non-empty name</li> * </ul> * </p> - * + * * @param edge * the DEdge to determine if it can have a DEdgeLabelItem has * children @@ -68,7 +71,7 @@ public class DEdgeBeginLabelItemProvider extends AbstractDDiagramElementLabelIte /** * Tests whether a diagram element should have a label item as children. - * + * * @param dDiagramElement * he element to test. * @return <code>true</code> if the diagram element should have a label item @@ -83,7 +86,7 @@ public class DEdgeBeginLabelItemProvider extends AbstractDDiagramElementLabelIte /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getText(java.lang.Object) */ @Override @@ -92,7 +95,7 @@ public class DEdgeBeginLabelItemProvider extends AbstractDDiagramElementLabelIte if (label == null || label.length() == 0) { label = EMPTY_DDIAGRAMELEMENT_LABEL_LABEL; } else { - label = label + " label"; + label = MessageFormat.format(Messages.AbstractDDiagramElementLabelItemProvider_label, label); } return label; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeEndLabelItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeEndLabelItemProvider.java index 70480b8a69..fdd918b3c3 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeEndLabelItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeEndLabelItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -10,23 +10,26 @@ *******************************************************************************/ package org.eclipse.sirius.diagram.ui.business.api.provider; +import java.text.MessageFormat; + import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.business.api.query.DEdgeQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * A custom ItemProvider to add the label of Edge. This ItemProvider "simulates" * a new child for Edge that have label. - * + * * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> - * + * */ public class DEdgeEndLabelItemProvider extends AbstractDDiagramElementLabelItemProvider { /** * Default constructor. - * + * * @param adapterFactory * The factory is used as a key so that we always know which * factory created this adapter. @@ -50,7 +53,7 @@ public class DEdgeEndLabelItemProvider extends AbstractDDiagramElementLabelItemP * <li>It has a non-null and non-empty name</li> * </ul> * </p> - * + * * @param edge * the DEdge to determine if it can have a DEdgeLabelItem has * children @@ -68,7 +71,7 @@ public class DEdgeEndLabelItemProvider extends AbstractDDiagramElementLabelItemP /** * Tests whether a diagram element should have a label item as children. - * + * * @param dDiagramElement * he element to test. * @return <code>true</code> if the diagram element should have a label item @@ -83,7 +86,7 @@ public class DEdgeEndLabelItemProvider extends AbstractDDiagramElementLabelItemP /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getText(java.lang.Object) */ @Override @@ -92,7 +95,7 @@ public class DEdgeEndLabelItemProvider extends AbstractDDiagramElementLabelItemP if (label == null || label.length() == 0) { label = EMPTY_DDIAGRAMELEMENT_LABEL_LABEL; } else { - label = label + " label"; + label = MessageFormat.format(Messages.AbstractDDiagramElementLabelItemProvider_label, label); } return label; } diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeLabelItemProvider.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeLabelItemProvider.java index 6ba986be83..e4ce38350b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeLabelItemProvider.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/business/api/provider/DEdgeLabelItemProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 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 @@ -14,19 +14,20 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.sirius.diagram.DDiagramElement; import org.eclipse.sirius.diagram.DEdge; import org.eclipse.sirius.diagram.business.api.query.DEdgeQuery; +import org.eclipse.sirius.diagram.ui.provider.Messages; /** * A custom ItemProvider to add the label of Edge. This ItemProvider "simulates" * a new child for Edge that have label. - * + * * @author <a href="mailto:nathalie.lepine@obeo.fr">Nathalie Lepine</a> - * + * */ public class DEdgeLabelItemProvider extends AbstractDDiagramElementLabelItemProvider { /** * Default constructor. - * + * * @param adapterFactory * The factory is used as a key so that we always know which * factory created this adapter. @@ -39,12 +40,12 @@ public class DEdgeLabelItemProvider extends AbstractDDiagramElementLabelItemProv /** * {@inheritDoc} - * + * * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getText(java.lang.Object) */ @Override public String getText(Object object) { - return "label"; + return Messages.DEdgeLabelItemProvider_label; } /** @@ -60,7 +61,7 @@ public class DEdgeLabelItemProvider extends AbstractDDiagramElementLabelItemProv * <li>It has a non-null and non-empty name</li> * </ul> * </p> - * + * * @param edge * the DEdge to determine if it can have a DEdgeLabelItem has * children @@ -78,7 +79,7 @@ public class DEdgeLabelItemProvider extends AbstractDDiagramElementLabelItemProv /** * Tests whether a diagram element should have a label item as children. - * + * * @param dDiagramElement * he element to test. * @return <code>true</code> if the diagram element should have a label item diff --git a/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java new file mode 100644 index 0000000000..656bd6e5b4 --- /dev/null +++ b/plugins/org.eclipse.sirius.diagram.ui/src/org/eclipse/sirius/diagram/ui/provider/Messages.java @@ -0,0 +1,1057 @@ +/******************************************************************************* + * Copyright (c) 2015 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.sirius.diagram.ui.provider; + +import org.eclipse.sirius.ext.base.I18N; +import org.eclipse.sirius.ext.base.I18N.TranslatableMessage; + +/** + * Helper class to obtains translated strings. + * + * @author mporhel + */ +public final class Messages { + + static { + I18N.initializeMessages(Messages.class, DiagramUIPlugin.INSTANCE); + } + + // CHECKSTYLE:OFF + + @TranslatableMessage + public static String AbstractDDiagramElementLabelItemProvider_emptyLabel; + + @TranslatableMessage + public static String AbstractDDiagramElementLabelItemProvider_label; + + @TranslatableMessage + public static String AbstractExtendedContentOutlinePage_setSelectionJobName; + + @TranslatableMessage + public static String AbstractLayoutProvider_arrangeAllCommandLabel; + + @TranslatableMessage + public static String AbstractLayoutProvider_arrangeAllProfilerTaskCategory; + + @TranslatableMessage + public static String AbstractLayoutProvider_arrangeAllProfilerTaskName; + + @TranslatableMessage + public static String AbstractLayoutProvider_layoutError; + + @TranslatableMessage + public static String AbstractModelChangeOperation_name; + + @TranslatableMessage + public static String AbstractParser_setValuesCmdLabel; + + @TranslatableMessage + public static String AbstractProviderDescriptor_missingAttributeMsg; + + @TranslatableMessage + public static String AbstractSiriusLayoutDataManager_unhandledDiagramElementKind; + + @TranslatableMessage + public static String ActivateBehaviorToolsCommand_label; + + @TranslatableMessage + public static String ActivateFiltersCommand_label; + + @TranslatableMessage + public static String ActivateRulesCommand_label; + + @TranslatableMessage + public static String AddErrorCommand_label; + + @TranslatableMessage + public static String AirResizableEditPolicy_autoSizeCommandLabel; + + @TranslatableMessage + public static String AnonymousUserFixedColorName; + + @TranslatableMessage + public static String ArrangeBorderNodesAction_actionText; + + @TranslatableMessage + public static String ArrangeBorderNodesAction_commandLabel; + + @TranslatableMessage + public static String ArrangeBorderNodesAction_toolbarActionText; + + @TranslatableMessage + public static String ArrangeBorderNodesAction_toolTipText; + + @TranslatableMessage + public static String BehaviorsPropertySection_activatedBehaviorsLabel; + + @TranslatableMessage + public static String BehaviorsPropertySection_availableBehaviorsLabel; + + @TranslatableMessage + public static String BorderItemAwareLayoutProvider_invalidItemsPosition; + + @TranslatableMessage + public static String BorderItemAwareLayoutProvider_setBoundsCommandLabel; + + @TranslatableMessage + public static String BorderItemLayoutData_movedBorderItemSincePreviousLayout; + + @TranslatableMessage + public static String BorderItemLayoutData_unmovedBorderItemSincePreviousLayout; + + @TranslatableMessage + public static String BracketBendpointEditPolicy_moveBrackedCommandLabel; + + @TranslatableMessage + public static String BracketBendpointEditPolicy_rotateBracketCommandLabel; + + @TranslatableMessage + public static String BundledImageEditPart_notBundleImageMsg; + + @TranslatableMessage + public static String CenterEditPartEdgesCommand_label; + + @TranslatableMessage + public static String ChangeBendpointsOfEdgesCommand_label; + + @TranslatableMessage + public static String ChangeBendpointsOfEdgesCommand_mapGmfAnchorToDraw2dAnchorCommandLabel; + + @TranslatableMessage + public static String ChangeBendpointsOfEdgesCommand_mapGmfPointsToDraw2dPoints; + + @TranslatableMessage + public static String ChangeBendpointsOfEdgesCommand_mapGmfToDraw2dCommandLabel; + + @TranslatableMessage + public static String ChangeBendpointsOfEdgesCommand_updateLabelsOffsetCmdLabel; + + @TranslatableMessage + public static String ChangeBendpointsOfEdgesCommand_warningCommandResultMessage; + + @TranslatableMessage + public static String ChangeFilterActivation_activateFilter; + + @TranslatableMessage + public static String ChangeFilterActivation_deactivateFilter; + + @TranslatableMessage + public static String ChangeFilterActivation_label; + + @TranslatableMessage + public static String ChangeSynchronizedDagramStatusCommand_label; + + @TranslatableMessage + public static String ChildrenAdjustmentCommand_errorMsg; + + @TranslatableMessage + public static String ChildrenAdjustmentCommand_label; + + @TranslatableMessage + public static String Column_wrongColumnViewError; + + @TranslatableMessage + public static String CommandFactory_doNothingLabel; + + @TranslatableMessage + public static String CompoundEditPolicy_nullEditPolicyMsg; + + @TranslatableMessage + public static String ConcernComboContributionItem_tooltip; + + @TranslatableMessage + public static String ConnectionsFactory_edgeNotCreatedMsg; + + @TranslatableMessage + public static String CopyLayoutAction_clrearPreviousLayoutDateCommandLabel; + + @TranslatableMessage + public static String CopyLayoutAction_commandLabel; + + @TranslatableMessage + public static String CopyLayoutAction_storeLayoutCommandLabel; + + @TranslatableMessage + public static String CopyLayoutAction_text; + + @TranslatableMessage + public static String CopyLayoutAction_toolTipText; + + @TranslatableMessage + public static String CopyLayoutDataCommand_label; + + @TranslatableMessage + public static String CopyToSiriusClipboardCommand_label; + + @TranslatableMessage + public static String CreateAndStoreGMFDiagramCommand_label; + + @TranslatableMessage + public static String CreateRepresentationFromRepresentationCreationDescription_cmdLabel; + + @TranslatableMessage + public static String CustomSiriusDocumentProvider_noCorrespondingResourceMsg; + + @TranslatableMessage + public static String CustomSiriusDocumentProvider_useModelExplorerToOpenMsg; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_checkAllButtonTooltip; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_collapaseAllTooltip; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_expandAllButtonTooltip; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_regexpExplanations; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_regexpTitle; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_regexpTooltip; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_showLabelText; + + @TranslatableMessage + public static String CustomTreeSelectionDialog_uncheckAllButtonTooltip; + + @TranslatableMessage + public static String DDiagramEditorImpl_cdoServerConnectionPbMsg; + + @TranslatableMessage + public static String DDiagramEditorImpl_noAssociatedGMFDiagramMsg; + + @TranslatableMessage + public static String DDiagramEditorImpl_noSessionMsg; + + @TranslatableMessage + public static String DDiagramEditorImpl_refreshJobInterruptedMsg; + + @TranslatableMessage + public static String DDiagramEditorImpl_refreshJobLabel; + + @TranslatableMessage + public static String DeactivateBehaviorToolsCommand_label; + + @TranslatableMessage + public static String DeactivateFiltersCommand_label; + + @TranslatableMessage + public static String DeactivateRulesCommand_label; + + @TranslatableMessage + public static String DEdgeCreateCommand_executionErrorMsg; + + @TranslatableMessage + public static String DEdgeLabelItemProvider_label; + + @TranslatableMessage + public static String ResourceMissingDocumentProvider_defaultMessage; + + @TranslatableMessage + public static String DefaultLayerName; + + @TranslatableMessage + public static String DeleteRelatedNoteAttachmentsTask_label; + + @TranslatableMessage + public static String DeleteRelatedNotesTask_label; + + @TranslatableMessage + public static String DeselectAllAction_label; + + @TranslatableMessage + public static String DeselectAllAction_tooltip; + + @TranslatableMessage + public static String DiagramAppearancePreferencePage_displayHeaderGroupText; + + @TranslatableMessage + public static String DiagramAppearancePreferencePage_displayHeaderLabel; + + @TranslatableMessage + public static String DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel; + + @TranslatableMessage + public static String DiagramAppearancePreferencePage_hideShapeLabelIconsLabel; + + @TranslatableMessage + public static String DiagramAppearancePreferencePage_labelIconsGroupText; + + @TranslatableMessage + public static String DiagramConnectionsPreferencePage_enableOverrideLabel; + + @TranslatableMessage + public static String DiagramDialectEditorDialogFactory_forbiddenOperation; + + @TranslatableMessage + public static String DiagramDialectUIServices_diagramDescription; + + @TranslatableMessage + public static String DiagramDialectUIServices_diagramEditorClosingError; + + @TranslatableMessage + public static String DiagramDialectUIServices_diagramEditorOpeningError; + + @TranslatableMessage + public static String DiagramDialectUIServices_diagramEditorOpeningMonitorTaskName; + + @TranslatableMessage + public static String DiagramDialectUIServices_diagramEditPartDeactivationError; + + @TranslatableMessage + public static String DiagramDialectUIServices_diagramOpeningMonitorTaskName; + + @TranslatableMessage + public static String DiagramDialectUIServices_exportedDiagramImageCreationError; + + @TranslatableMessage + public static String DiagramDialectUIServices_refreshDiagram; + + @TranslatableMessage + public static String DiagramDialectUIServices_representationWithEmptyNameEditorName; + + @TranslatableMessage + public static String DiagramDialectUIServices_requiredViewpointsDialogMessage; + + @TranslatableMessage + public static String DiagramDialectUIServices_requiredViewpointsDialogTitle; + + @TranslatableMessage + public static String DiagramDialectUIServices_sourcePreDescription; + + @TranslatableMessage + public static String DiagramDialectUIServices_sourceViewPreDescription; + + @TranslatableMessage + public static String DiagramDialectUIServices_targetPreDescription; + + @TranslatableMessage + public static String DiagramDialectUIServices_targetViewPreDescription; + + @TranslatableMessage + public static String DiagramEdgeEditPartOperation_unknownRountingStyle; + + @TranslatableMessage + public static String DiagramEditorContextMenuProvider_arrangeMenuRenameError; + + @TranslatableMessage + public static String DiagramEditorContextMenuProvider_arrangeMenuText; + + @TranslatableMessage + public static String DiagramEditPartService_imageExportException; + + @TranslatableMessage + public static String DiagramElementEditPartOperation_partDeactivationError; + + @TranslatableMessage + public static String DiagramElementsSelectionDialog_grayedElementDialogMessage; + + @TranslatableMessage + public static String DiagramGeneralPreferencePage_arrangeAndAutoSizeContainersLabel; + + @TranslatableMessage + public static String DiagramGeneralPreferencePage_moveUnlinkedNodeLabel; + + @TranslatableMessage + public static String DiagramGeneralPreferencePage_pinMovedElementsLabel; + + @TranslatableMessage + public static String DiagramGeneralPreferencePage_removeHideNoteLabel; + + @TranslatableMessage + public static String DiagramGeneralPreferencePage_synchronizedModeLabel; + + @TranslatableMessage + public static String DiagramOutlineWithBookPages_filtersTooltip; + + @TranslatableMessage + public static String DiagramOutlineWithBookPages_layersTooltip; + + @TranslatableMessage + public static String DiagramRepairParticipant_removeDiagramElementTaskName; + + @TranslatableMessage + public static String DiagramRepairParticipant_restoreModelStateTaskName; + + @TranslatableMessage + public static String DiagramRepairParticipant_saveModelStateTaskName; + + @TranslatableMessage + public static String DiagramSelectionWizardPage_message; + + @TranslatableMessage + public static String DiagramSelectionWizardPage_title; + + @TranslatableMessage + public static String DiagramSelectionWizardPage_titleFor; + + @TranslatableMessage + public static String DistributeAction_centersHorizontallyLabel; + + @TranslatableMessage + public static String DistributeAction_centersVerticallyLabel; + + @TranslatableMessage + public static String DistributeAction_distributeCentersHorizontallyLabel; + + @TranslatableMessage + public static String DistributeAction_distributeCentersHorizontallyTooltip; + + @TranslatableMessage + public static String DistributeAction_distributeCentersVerticallyLabel; + + @TranslatableMessage + public static String DistributeAction_distributeCentersVerticallyTooltip; + + @TranslatableMessage + public static String DistributeAction_distributeGapsHorizontallyLabel; + + @TranslatableMessage + public static String DistributeAction_distributeGapsHorizontallyTooltip; + + @TranslatableMessage + public static String DistributeAction_distributeGapsVerticallyLabel; + + @TranslatableMessage + public static String DistributeAction_distributeGapsVerticallyTooltip; + + @TranslatableMessage + public static String DistributeAction_gapsHorizontallyLabel; + + @TranslatableMessage + public static String DistributeAction_gapsVerticallyLabel; + + @TranslatableMessage + public static String DistributeCommand_errorMsg; + + @TranslatableMessage + public static String DistributeMenuAction_text; + + @TranslatableMessage + public static String DistributeMenuAction_tooltip; + + @TranslatableMessage + public static String DNodeLayoutDataKey_wrongKeyMsg; + + @TranslatableMessage + public static String DocumentationPropertySection_defaultLabel; + + @TranslatableMessage + public static String DocumentationPropertySection_description; + + @TranslatableMessage + public static String EclipseImageSelectorDescriptor_extensionLoadingError; + + @TranslatableMessage + public static String EdgeReconnectionHelper_invalidReconnectionKind; + + @TranslatableMessage + public static String EdgeRoutingStyleChangedCommand_label; + + @TranslatableMessage + public static String EditPartTools_nullParameterMsg; + + @TranslatableMessage + public static String ExtendedPropertyDescriptor_categoryName; + + @TranslatableMessage + public static String ExtendedPropertyDescriptor_description; + + @TranslatableMessage + public static String ExtendedPropertyDescriptor_errorGettingValueMsg; + + @TranslatableMessage + public static String ExtendedPropertyDescriptor_errorRetrievingValueMsg; + + @TranslatableMessage + public static String ExtendedPropertyDescriptor_unknownExtensionMsg; + + @TranslatableMessage + public static String ExtendedPropertySource_errorSettingValueMsg; + + @TranslatableMessage + public static String FilteringMode_allElements; + + @TranslatableMessage + public static String FilteringMode_onlyCheckedElements; + + @TranslatableMessage + public static String FilteringMode_onlyUncheckedElements; + + @TranslatableMessage + public static String FiltersContributionItem_label; + + @TranslatableMessage + public static String FiltersPropertySection_addButtonLabel; + + @TranslatableMessage + public static String FiltersPropertySection_appliedFiltersLabel; + + @TranslatableMessage + public static String FiltersPropertySection_availableFiltersLabel; + + @TranslatableMessage + public static String FiltersPropertySection_removeButtonLabel; + + @TranslatableMessage + public static String FiltersTableViewer_columnName; + + @TranslatableMessage + public static String FontPropertySection_strikeThrough; + + @TranslatableMessage + public static String FontPropertySection_underline; + + @TranslatableMessage + public static String GMFCommandWrapper_label; + + @TranslatableMessage + public static String GMFCommandWrapper_nullCommand; + + @TranslatableMessage + public static String GMFCommandWrapper_nullDomain; + + @TranslatableMessage + public static String GMFHelper_invalidEdgeModelAndFigure; + + @TranslatableMessage + public static String GMFNotationUtilities_edgeOnEdgeNotManaged; + + @TranslatableMessage + public static String GridLayoutProvider_unknownMode; + + @TranslatableMessage + public static String HiddenElementsSelectionCommand_dialogMessage; + + @TranslatableMessage + public static String HiddenElementsSelectionCommand_dialogTitle; + + @TranslatableMessage + public static String HierarchyLabelProvider_elementWihtoutNameLabel; + + @TranslatableMessage + public static String IAbstractDiagramNodeEditPart_createViewCommandLabel; + + @TranslatableMessage + public static String IAbstractDiagramNodeEditPart_resizeCommandLabel; + + @TranslatableMessage + public static String IBorderItemLocatorWrapper_nullLocator; + + @TranslatableMessage + public static String Identifier_invalidNullObject; + + @TranslatableMessage + public static String IDiagramOutlinePage_outlineTooltip; + + @TranslatableMessage + public static String IDiagramOutlinePage_overviewTooltip; + + @TranslatableMessage + public static String InitializeHiddenElementsCommand_label; + + @TranslatableMessage + public static String InitializeLayoutCommand_label; + + @TranslatableMessage + public static String ItemProvider_elementBasedEdge; + + @TranslatableMessage + public static String ItemProvider_foregroundBackgroundLabel; + + @TranslatableMessage + public static String ItemProvider_relationBasedEdge; + + @TranslatableMessage + public static String LaunchBehaviorContributionItem_launchBehaviorButtonLabel; + + @TranslatableMessage + public static String LaunchBehaviorToolAction_label; + + @TranslatableMessage + public static String LayersCellModifier_layerSelectionChangesTaskName; + + @TranslatableMessage + public static String LayersContribution_label; + + @TranslatableMessage + public static String LayersTableViewer_columnName; + + @TranslatableMessage + public static String LayoutData_illegalTarget; + + @TranslatableMessage + public static String LayoutData_unhandledDiagramElementKind; + + @TranslatableMessage + public static String LayoutDataHelperImpl_unkownLayoutData; + + @TranslatableMessage + public static String LayoutingModeSwitchingAction_activate; + + @TranslatableMessage + public static String LayoutingModeSwitchingAction_deactivate; + + @TranslatableMessage + public static String LayoutingModeSwitchingAction_statusOn; + + @TranslatableMessage + public static String LayoutProviderDescriptor_initializationErrorMsg; + + @TranslatableMessage + public static String MarkerObserver_validationMarkerFailureMsg; + + @TranslatableMessage + public static String MiscPropertySection_nullObject; + + @TranslatableMessage + public static String MiscPropertySource_errorGettingValueMsg; + + @TranslatableMessage + public static String MoveViewOperation_nullMoveDeltaError; + + @TranslatableMessage + public static String MoveViewOperation_nullViewError; + + @TranslatableMessage + public static String NavigationItemProvider_labelWithDescriptionName; + + @TranslatableMessage + public static String NodeDeletionEditPolicy_deleteElementCommandLabel; + + @TranslatableMessage + public static String NodeMappingItemProvider_borderedLabel; + + @TranslatableMessage + public static String OpenDiagramCommand_creationErrorMsg; + + @TranslatableMessage + public static String OpenDiagramCommand_exceptionMsg; + + @TranslatableMessage + public static String OpenDiagramCommand_notDiagramElementErrorMsg; + + @TranslatableMessage + public static String OpenDiagramCommand_saveFailedMsg; + + @TranslatableMessage + public static String OpenMenuContribution_menuLabel; + + @TranslatableMessage + public static String PaletteImageProvider_noIconFor; + + @TranslatableMessage + public static String PaletteManagerImpl_alreadyExistingEntry; + + @TranslatableMessage + public static String PaletteManagerImpl_severalCandidatesInPalette; + + @TranslatableMessage + public static String PasteFromSiriusClipboardCommand_label; + + @TranslatableMessage + public static String PasteLayoutAction_commandLabel; + + @TranslatableMessage + public static String PasteLayoutAction_restoreLayoutCommandLabel; + + @TranslatableMessage + public static String PasteLayoutAction_text; + + @TranslatableMessage + public static String PasteLayoutAction_toolTipText; + + @TranslatableMessage + public static String PasteLayoutDataCommand_label; + + @TranslatableMessage + public static String PinElementsEclipseAction_text; + + @TranslatableMessage + public static String PinnedElementsHandler_notMovableMsg; + + @TranslatableMessage + public static String PinnedElementsHandler_remainOverlapsMsg; + + @TranslatableMessage + public static String PinnedElementsHandler_unknownDirection; + + @TranslatableMessage + public static String PinnedElementsSelectionCommand_dialogMessage; + + @TranslatableMessage + public static String PopupMenuContribution_storeMouseLocationCmdLabel; + + @TranslatableMessage + public static String RefreshDiagramAction_cancelled; + + @TranslatableMessage + public static String RefreshDiagramAction_error; + + @TranslatableMessage + public static String RefreshDiagramAction_refreshDiagramError; + + @TranslatableMessage + public static String RefreshDiagramOnOpeningCommand_label; + + @TranslatableMessage + public static String RefreshRunnableWithProgress_commandLabel; + + @TranslatableMessage + public static String RefreshRunnableWithProgress_taskName; + + @TranslatableMessage + public static String RegionContainerResizableEditPolicy_regionContainerAutoSizeCommandLabel; + + @TranslatableMessage + public static String RegionContainerUpdateLayoutOperation_name; + + @TranslatableMessage + public static String RegionResizableEditPolicy_regionAutoSizeCommandLabel; + + @TranslatableMessage + public static String RemoveBendpointsHandler_cmdLabel; + + @TranslatableMessage + public static String RemoveInvalidViewsCommand_label; + + @TranslatableMessage + public static String ResetOriginChangeModelOperation_name; + + @TranslatableMessage + public static String ResetOriginChangeModelOperation_nameOnContainer; + + @TranslatableMessage + public static String ResetOriginChangeModelOperation_nameOnDiagram; + + @TranslatableMessage + public static String ResetStylePropertiesToDefaultValuesAction_text; + + @TranslatableMessage + public static String ResizeImageCommand_label; + + @TranslatableMessage + public static String RevealOutlineElementsAction_label; + + @TranslatableMessage + public static String RevealOutlineLabelsAction_label; + + @TranslatableMessage + public static String RootLayoutData_unhandledDiagramElementKind; + + @TranslatableMessage + public static String SafeStyleConfiguration_customStyleInvocationError; + + @TranslatableMessage + public static String SaveAsImageFileAction_label; + + @TranslatableMessage + public static String SelectDiagramElementBackgroundImageDialog_browseButtonText; + + @TranslatableMessage + public static String SelectDiagramElementBackgroundImageDialog_pathLabelText; + + @TranslatableMessage + public static String SelectDiagramElementBackgroundImageDialog_title; + + @TranslatableMessage + public static String SelectHiddenElementsAction_tooltip; + + @TranslatableMessage + public static String SelectionWizardCommand_cancelExceptionMsg; + + @TranslatableMessage + public static String SelectPinnedElementsAction_label; + + @TranslatableMessage + public static String SelectPinnedElementsAction_tooltip; + + @TranslatableMessage + public static String SetBestHeightHeaderCommand_label; + + @TranslatableMessage + public static String SetConnectionBendpointsAccordingToExtremityMoveCommmand_sourceSidedLabel; + + @TranslatableMessage + public static String SetConnectionBendpointsAccordingToExtremityMoveCommmand_targetSidedLabel; + + @TranslatableMessage + public static String SetCurrentConcernCommand_label; + + @TranslatableMessage + public static String SetDefaultConcernCommand_label; + + @TranslatableMessage + public static String SetLabelsOffsetCommmand_label; + + @TranslatableMessage + public static String SetLayoutingModeCommand_activateLabel; + + @TranslatableMessage + public static String SetLayoutingModeCommand_deactivateLabel; + + @TranslatableMessage + public static String SetLayoutingModeCommandAndUpdateActionImage_activateLabel; + + @TranslatableMessage + public static String SetLayoutingModeCommandAndUpdateActionImage_deactivateLabel; + + @TranslatableMessage + public static String SetStyleToWorkspaceImageAction_text; + + @TranslatableMessage + public static String ShiftDirectBorderedNodesOperation_name; + + @TranslatableMessage + public static String SimpleImageTranscoder_svgImageTranscodingError; + + @TranslatableMessage + public static String SimpleStyleConfiguration_iconFileNotFound; + + @TranslatableMessage + public static String SiriusBaseItemSemanticEditPolicy_deleteCmdLabel; + + @TranslatableMessage + public static String SiriusBaseItemSemanticEditPolicy_deleteFromDiagramCmdLabel; + + @TranslatableMessage + public static String SiriusCanonicalLayoutCommand_label; + + @TranslatableMessage + public static String SiriusClipboardGlobalActionHandler_addLayoutDataCommandLabel; + + @TranslatableMessage + public static String SiriusClipboardGlobalActionHandler_pasteCommandLabel; + + @TranslatableMessage + public static String SiriusClipboardGlobalActionHandler_severalFoundPasteToolError; + + @TranslatableMessage + public static String SiriusContainerDropPolicy_dropElementsCommandLabel; + + @TranslatableMessage + public static String SiriusContainerDropPolicy_saveEditPartLayoutCommandLabel; + + @TranslatableMessage + public static String SiriusDiagramActionBarContributor_deleteFromDiagram; + + @TranslatableMessage + public static String SiriusDiagramActionBarContributor_deleteFromModel; + + @TranslatableMessage + public static String SiriusDiagramActionBarContributor_hideElement; + + @TranslatableMessage + public static String SiriusDiagramActionBarContributor_hideLabel; + + @TranslatableMessage + public static String SiriusDiagramActionBarContributor_launchBehavior; + + @TranslatableMessage + public static String SiriusDiagramActionBarContributor_refreshDiagram; + + @TranslatableMessage + public static String SiriusDiagramActionBarContributor_revealElement; + + @TranslatableMessage + public static String SiriusDiagramEditorUtil_charsetError; + + @TranslatableMessage + public static String SiriusDiagramEditorUtil_defaultFileName; + + @TranslatableMessage + public static String SiriusDiagramEditorUtil_modelAndDiagramCreationError; + + @TranslatableMessage + public static String SiriusDiagramEditorUtil_modelAndDiagramResourceSaveError; + + @TranslatableMessage + public static String SiriusDiagramSelectionCheckStateListener_errorMsg; + + @TranslatableMessage + public static String SiriusDiagramSelectionCheckStateListener_unknwonCodeResult; + + @TranslatableMessage + public static String SiriusEnhancedPrintActionHelper_invalidIworkbenchPart; + + @TranslatableMessage + public static String SiriusInitDiagramFileAction_loadResourceError; + + @TranslatableMessage + public static String SiriusLayoutDataManagerImpl_addCenterLayoutMarkerCommandLabel; + + @TranslatableMessage + public static String SiriusLayoutDataManagerImpl_addLayoutMarkerCommandLabel; + + @TranslatableMessage + public static String SiriusLayoutDataManagerImpl_addLayoutMarkerOnOpeningCommandLabel; + + @TranslatableMessage + public static String SiriusLayoutDataManagerImpl_createdViewsArrangCommandLabel; + + @TranslatableMessage + public static String SiriusLayoutDataManagerImpl_unhandledContainerKind; + + @TranslatableMessage + public static String SiriusMarkerNavigationProvider_validationMarkerCreationError; + + @TranslatableMessage + public static String SiriusNewDiagramFileWizard_errorDuringCreation; + + @TranslatableMessage + public static String SiriusNewDiagramFileWizard_errorDuringOpening; + + @TranslatableMessage + public static String SiriusNewDiagramFileWizard_invalidDiagramRootElement; + + @TranslatableMessage + public static String SiriusNewDiagramFileWizard_invalidDomainModelURI; + + @TranslatableMessage + public static String SiriusNewDiagramFileWizard_invalidEditingDomain; + + @TranslatableMessage + public static String SiriusNewDiagramFileWizard_saveFailed; + + @TranslatableMessage + public static String SiriusNewDiagramFileWizard_unsupportedURI; + + @TranslatableMessage + public static String SiriusPropertyHandlerEditPolicy_applyAppearancePropertiesCommandLabel; + + @TranslatableMessage + public static String SiriusPropertyHandlerEditPolicy_applyTabbarPropertiesCommandLabel; + + @TranslatableMessage + public static String SiriusPropertyHandlerEditPolicy_chainedStyleCommandDebugLabel; + + @TranslatableMessage + public static String SiriusReorientConnectionViewCommand_nullChild; + + @TranslatableMessage + public static String SiriusReorientConnectionViewCommand_nullEdge; + + @TranslatableMessage + public static String SiriusSWTRenderedDiagramPrinter_jobLabel; + + @TranslatableMessage + public static String SiriusSWTRenderedDiagramPrinter_printerNotSetMsg; + + @TranslatableMessage + public static String SiriusValidationDecoratorProvider_refreshFailureMsg; + + @TranslatableMessage + public static String SiriusValidationProvider_validationFailed; + + @TranslatableMessage + public static String SiriusVisualIDRegistry_parseError; + + @TranslatableMessage + public static String SpecificationMenuContribution_openDefinitionMenuLabel; + + @TranslatableMessage + public static String StatusDecorator_validationMarkersFailureMsg; + + @TranslatableMessage + public static String StatusDecorator_viewIdAccessFailureMsg; + + @TranslatableMessage + public static String StyleConfigurationRegistry_disableStyleConfigurationProviderInError; + + @TranslatableMessage + public static String StyleConfigurationRegistry_profilerTaskName; + + @TranslatableMessage + public static String StyleConfigurationRegistry_styleConfigurationProviderLoadError; + + @TranslatableMessage + public static String SubDiagramDecorator_taskName; + + @TranslatableMessage + public static String SubDiagramMenu_newLabel; + + @TranslatableMessage + public static String SVGFigure_loadError; + + @TranslatableMessage + public static String SynchronizedDiagramCommand_unsynchronizedLabel; + + @TranslatableMessage + public static String SynchronizeGMFModelCommand_label; + + @TranslatableMessage + public static String ToggleFoldingStateCommand_label; + + @TranslatableMessage + public static String ToggleUpdateManager_fieldAccessError; + + @TranslatableMessage + public static String TreeLayoutSetConnectionAnchorsCommand_nullChildInSetConnectionAnchorsCommand; + + @TranslatableMessage + public static String TreeLayoutSetConnectionAnchorsCommand_nullEdgeInSetConnectionAnchorsCommand; + + @TranslatableMessage + public static String UnpinElementsEclipseAction_text; + + @TranslatableMessage + public static String UpdateGMFEdgeStyleCommand_label; + + @TranslatableMessage + public static String UpdateVisibilityCommand_label; + + @TranslatableMessage + public static String ValidateAction_failureMessage; + + @TranslatableMessage + public static String ValidationFixResolution_editorOpeningError; + + @TranslatableMessage + public static String ValidationPropertySection_activatedRulesLabel; + + @TranslatableMessage + public static String ValidationPropertySection_availableRulesLabel; + + @TranslatableMessage + public static String ViewOrderingProviderRegistry_viewOrderingProvider_loadingProblem; + + @TranslatableMessage + public static String VisibilityUpdateCommand_label; + + @TranslatableMessage + public static String WorkspaceImageChangeDetector_invalidUri; + + @TranslatableMessage + public static String WorkspaceImageFigureRefresher_imageDescriptorUpdateError; + + @TranslatableMessage + public static String WorkspaceImagePathSelector_dialogMessage; + + @TranslatableMessage + public static String WorkspaceImagePathSelector_dialogTitle; + + @TranslatableMessage + public static String WorkspacePathValidator_invalidPahtStatusMessage; + + @TranslatableMessage + public static String WorkspacePathValidator_invalidPathDecorationDescriptionText; + + // CHECKSTYLE:ON + + private Messages() { + // Prevents instanciation. + } +} diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html index e33488923c..1886f45ed7 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html @@ -305,6 +305,9 @@ <code>org.eclipse.sirius.diagram</code> </li> <li> + <code>org.eclipse.sirius.diagram.ui</code> + </li> + <li> <code>org.eclipse.sirius.eef.adapters</code> </li> <li> @@ -1924,4 +1927,4 @@ </li> </ul> </body> -</html> +</html>
\ No newline at end of file diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile index 24bf3dba68..2c1c2c6d3c 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile @@ -73,6 +73,7 @@ Additional non-breaking changes: ** @org.eclipse.sirius.diagram.sequence@ ** @org.eclipse.sirius.diagram.sequence.ui@ ** @org.eclipse.sirius.diagram@ +** @org.eclipse.sirius.diagram.ui@ ** @org.eclipse.sirius.eef.adapters@ ** @org.eclipse.sirius.interpreter@ ** @org.eclipse.sirius.table@ diff --git a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java index 93e9d52a2f..d8ffc5ca78 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java +++ b/plugins/org.eclipse.sirius.tests.swtbot.support/src/org/eclipse/sirius/tests/swtbot/support/api/AbstractSiriusSwtBotGefTestCase.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -23,8 +23,6 @@ import java.util.Map.Entry; import java.util.NoSuchElementException; import java.util.Set; -import junit.framework.TestCase; - import org.apache.log4j.Logger; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.ResourcesPlugin; @@ -133,14 +131,16 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; +import junit.framework.TestCase; + /** * Wrapper for several UI* classes to handle ui management in tests. If needed, * new setup operations can be done in * {@link #onSetUpBeforeClosingWelcomePage()} overridden method. - * + * * {@link #onSetUpAfterOpeningDesignerPerspective()} allows developer to add * extra behavior after opening designer perspective. - * + * * @author dlecan */ @SuppressWarnings("restriction") @@ -337,7 +337,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Define the auto refresh mode to use during this tests. - * + * * @return the auto refresh mode. */ protected boolean getAutoRefreshMode() { @@ -346,7 +346,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Get the project name to create. - * + * * @return Project name. */ protected String getProjectName() { @@ -355,7 +355,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Do something before closing welcome page during setup. - * + * * @throws Exception * Error. */ @@ -366,7 +366,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Do something after opening designer perspective, just before executing * test. - * + * * @throws Exception * Error. */ @@ -459,7 +459,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * {@inheritDoc} - * + * * runtTest() method is overridden to allow to take a screenshot just after * test execution and before tearDown operation. As tearDown closes diagram * and session, after it, screenshots don't show any interesting things. @@ -479,7 +479,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Helper used by {@link #runTest()}. - * + * * @param suffix * The suffix of the screenshot to create * @see #runTest() @@ -509,7 +509,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Get the number of Status in the error log at the time of the call. - * + * * @return the number of Status in the error log at the time of the call */ public int getNbStatusInErrorLog() { @@ -527,7 +527,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Assert the editor is not an error one, close it before failing if it is * to avoid breaking further tests. - * + * * @param message * : message on failure. * @param activeEditor @@ -562,7 +562,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Undo using the command stack of the editing domain of the current * session. - * + * * @param session * current session to undo last action. */ @@ -572,7 +572,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Undo the command named cmdName with the menu Edit. - * + * * @param cmdName * the command to undo */ @@ -603,7 +603,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Redo the command named cmdName with the menu Edit. - * + * * @param cmdName * the command to redo */ @@ -614,7 +614,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Redo using the command stack of the editing domain of the current * session. - * + * * @param session * current session to redo last action. */ @@ -632,9 +632,9 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Change a boolean preference and store the old value. It will be * automatically reset during tear down. - * + * * TO CALL ONLY ONCE PER TEST (set up + test) - * + * * @param preferenceKey * The key of the preference. * @param newValue @@ -656,7 +656,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Restore this preference to its initial value. Should be called after * {@link #changeDiagramPreference(String, Boolean)} to have effect. - * + * * @param preferenceKey * The key of the preference. */ @@ -668,7 +668,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Restore this preference to its initial value. Should be called after * {@link #changeDiagramPreference(String, Boolean)} to have effect. - * + * * @param preferenceKey * The key of the preference. * @param diagramCorePreferences @@ -686,9 +686,9 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Change a boolean preference and store the old value. It will be * automatically reset during tear down. - * + * * TO CALL ONLY ONCE PER TEST (set up + test) - * + * * @param preferenceKey * The key of the preference. * @param newValue @@ -710,7 +710,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Restore this preference to its initial value. Should be called after * {@link #changeDiagramUIPreference(String, Boolean)} to have effect. - * + * * @param preferenceKey * The key of the preference. */ @@ -722,7 +722,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Restore this preference to its initial value. Should be called after * {@link #changeDiagramUIPreference(String, Boolean)} to have effect. - * + * * @param preferenceKey * The key of the preference. * @param diagramUIPreferences @@ -740,9 +740,9 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Change a boolean preference and store the old value. It will be * automatically reset during tear down. - * + * * TO CALL ONLY ONCE PER TEST (set up + test) - * + * * @param preferenceKey * The key of the preference. * @param newValue @@ -762,9 +762,9 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Change a boolean preference and store the old value. It will be * automatically reset during tear down. - * + * * TO CALL ONLY ONCE PER TEST (set up + test) - * + * * @param preferenceKey * The key of the preference. * @param newValue @@ -781,7 +781,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Change a boolean preference and store the old value to reset it after the * test. - * + * * @param preferenceKey * The key of the preference. * @param newValue @@ -855,7 +855,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Delete the selected element if possible. - * + * * @param expected * expected value of the delete menu. * @return the delete bot menu. @@ -881,7 +881,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Maximize view/editor maximize using the eclipse API. - * + * * @param swtBotDesignerEditor * The editor to maximize */ @@ -891,7 +891,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Press zoom in button. - * + * * @param swtBotDesignerEditor * The current editor */ @@ -901,7 +901,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Press "pressCount" times on zoom in button. - * + * * @param swtBotDesignerEditor * The current editor * @param pressCount @@ -928,7 +928,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Press zoom out button. - * + * * @param swtBotDesignerEditor * The current editor */ @@ -938,7 +938,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Press "pressCount" times on zoom out button. - * + * * @param swtBotDesignerEditor * The current editor * @param pressCount @@ -957,7 +957,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Restore the size of the view/editor using the eclipse API. - * + * * @param swtBotDesignerEditor * The editor to restore */ @@ -967,7 +967,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /*** * Do a arrange all of the current diagram. - * + * * @return the menu of the ArrangeAll action */ protected SWTBotMenu arrangeAll() { @@ -984,7 +984,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Get all the representation with the given representation description * name. - * + * * @param session * The session containing the searched representations. * @param representationDescriptionName @@ -1009,7 +1009,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Return the first representation with the given representation description * name and representation name. - * + * * @param session * The session containing the searched representations. * @param representationDescriptionName @@ -1038,7 +1038,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Open the first diagram with the given diagram description name and * diagram name. - * + * * @param session * The session containing the searched representations. * @param diagramDescriptionName @@ -1060,7 +1060,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Open the first representation with the given representation description * name and representation name. - * + * * @param session * The session containing the searched representations. * @param diagramDescriptionName @@ -1089,7 +1089,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Open the first representation with the given representation description * name and representation name. - * + * * @param session * The session containing the searched representations. * @param representationDescriptionName @@ -1108,7 +1108,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Open the first representation with the given representation description * name and representation name. - * + * * @param session * The session containing the searched representations. * @param representationDescriptionName @@ -1131,7 +1131,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Open the first representation with the given representation description * name and representation name. - * + * * @param session * The session containing the searched representations. * @param representationDescriptionName @@ -1185,7 +1185,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase * Get the widget bot corresponding to the button to set a workspace image * on a selected node. If tabbar parameter at true, get the button of the * tabbar, else get the button of the Appearance tab on the properties view. - * + * * @param tabbar * if tabbar parameter at true, get the button of the tabbar, * else get the button of the Appearance tab on the properties @@ -1213,7 +1213,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase * "Reset style properties to default" on a selected node/edge. If tabbar * parameter at true, get the button of the tabbar, else get the button of * the Appearance tab on the properties view. - * + * * @param tabbar * if tabbar parameter at true, get the button of the tabbar, * else get the button of the Appearance tab on the properties @@ -1245,7 +1245,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Returns the button allowing to reset the style to default from the * tabbar. - * + * * @return the button allowing to reset the style to default from the tabbar */ protected SWTBotToolbarButton getResetStylePropertiesToDefaultValuesButtonFromTabbar() { @@ -1258,7 +1258,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Click on the specified button. - * + * * @param button * the specified button */ @@ -1273,7 +1273,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Returns the button allowing to reset the style to default from the * appearance section. - * + * * @return the button allowing to reset the style to default from the * appearance section */ @@ -1288,7 +1288,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Returns the button from the 'Appearance' section at the given index, that * should have the given tooltip. - * + * * @param tooltip * the expected tooltip for this button * @return the button from the 'Appearance' section at the given index, that @@ -1328,12 +1328,8 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase public void logging(IStatus status, String plugin) { switch (status.getSeverity()) { case IStatus.ERROR: - if (!"org.eclipse.ui.views.properties.tabbed".equals(status.getPlugin()) - && status.getMessage() != null - && !status - .getMessage() - .startsWith( - "Contributor org.eclipse.ui.navigator.ProjectExplorer cannot be created., exception: org.eclipse.core.runtime.CoreException: Plug-in \"org.eclipse.ui.navigator.resources\" was unable to instantiate class \"org.eclipse.ui.internal.navigator.resources.workbench.TabbedPropertySheetTitleProvider\".")) { + if (!"org.eclipse.ui.views.properties.tabbed".equals(status.getPlugin()) && status.getMessage() != null && !status.getMessage().startsWith( + "Contributor org.eclipse.ui.navigator.ProjectExplorer cannot be created., exception: org.eclipse.core.runtime.CoreException: Plug-in \"org.eclipse.ui.navigator.resources\" was unable to instantiate class \"org.eclipse.ui.internal.navigator.resources.workbench.TabbedPropertySheetTitleProvider\".")) { errorOccurs(status, plugin); } break; @@ -1375,7 +1371,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * check if an error occurs. - * + * * @return true if an error occurs. */ protected synchronized boolean doesAnErrorOccurs() { @@ -1387,7 +1383,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * check if a warning occurs. - * + * * @return true if a warning occurs. */ protected synchronized boolean doesAWarningOccurs() { @@ -1399,7 +1395,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * check if an error catch is active. - * + * * @return true if an error catch is active. */ protected synchronized boolean isErrorCatchActive() { @@ -1408,7 +1404,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * check if a warning catch is active. - * + * * @return true if a warning catch is active. */ protected synchronized boolean isWarningCatchActive() { @@ -1417,7 +1413,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Records the error. - * + * * @param status * error status to record * @param sourcePlugin @@ -1431,7 +1427,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Records the warning. - * + * * @param status * warning status to record * @param sourcePlugin @@ -1446,7 +1442,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Activate or deactivate the external error detection: the test will fail * in an error is logged or uncaught. - * + * * @param errorCatchActive * boolean to indicate if we activate or deactivate the external * error detection @@ -1458,7 +1454,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Activate or deactivate the external warning detection: the test will fail * in a warning is logged or uncaught. - * + * * @param warningCatchActive * boolean to indicate if we activate or deactivate the external * warning detection @@ -1491,7 +1487,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Compute an error message from the detected errors. - * + * * @return the error message. */ protected synchronized String getErrorLoggersMessage() { @@ -1517,7 +1513,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Compute an error message from the detected warnings. - * + * * @return the error message. */ protected synchronized String getWarningLoggersMessage() { @@ -1727,7 +1723,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Open viewpoint specification model. - * + * * @param viewpointSpecificationModel * the name of viewpoint specification model (.odesing) * @return odesignEditor @@ -1741,7 +1737,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /*** * Copy file to test run project. - * + * * @param pluginId * corresponding to project name containing data for test * @param dataUnitDir @@ -1758,7 +1754,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Explore the current {@link SWTBotSiriusDiagramEditor} edit part children * recursively to find out a {@link TextEditPart} with the expected label. - * + * * @param label * the label of the expected {@link TextEditPart} * @return a {@link TextEditPart} with the expected label if existing, null @@ -1771,7 +1767,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Explore the {@link SWTBotSiriusDiagramEditor} edit part children * recursively to find out a {@link TextEditPart} with the expected label. - * + * * @param designerEditor * the current {@link SWTBotSiriusDiagramEditor} to look for a * {@link TextEditPart} @@ -1787,7 +1783,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Explore the {@link SWTBotGefEditPart} children recursively to find out a * {@link TextEditPart} with the expected label. - * + * * @param parent * the {@link SWTBotGefEditPart} parent to start exploration * @param label @@ -1816,7 +1812,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Change the default font. - * + * * @param fontName * the font name to set as default. * @return the previous default font name. @@ -1837,7 +1833,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Scan contained figures to find the background color of a figure typed as * figureClass. - * + * * @param editPart * EditPart containing the figures that need investigation * @param figureClass @@ -1856,7 +1852,7 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase /** * Scan contained figures to find the background color of a figure typed as * figureClass. - * + * * @param parentFigure * {@link Figure} containing the figures that need investigation * @param figureClass @@ -1904,37 +1900,31 @@ public abstract class AbstractSiriusSwtBotGefTestCase extends SWTBotGefTestCase exception = running; captureScreenshot(); } - if (exception != null) + if (exception != null) { throw exception; + } } /** * Helper used by {@link #runBare()}. Duplicate from * {@link SWTBotTestCase#captureScreenshot()} to use the constant * SWTBotPreferences.SCREENSHOTS_DIR instead of a hard coded folder. - * + * * @see #runBare() */ private void captureScreenshot() { try { int maximumScreenshots = SWTBotPreferences.MAX_ERROR_SCREENSHOT_COUNT; - String fileName = SWTBotPreferences.SCREENSHOTS_DIR + "/screenshot-" + ClassUtils.simpleClassName(getClass()) + POINT + getName() + POINT //$NON-NLS-1$ //$NON-NLS-2$ - // $NON-NLS-1$ - // $NON-NLS-1$ - // $NON-NLS-1$ - // $NON-NLS-1$ - // $NON-NLS-1$ - //$NON-NLS-1$ //$NON-NLS-3$ + String fileName = SWTBotPreferences.SCREENSHOTS_DIR + "/screenshot-" + ClassUtils.simpleClassName(getClass()) + POINT + getName() + POINT //$NON-NLS-1$ + SWTBotPreferences.SCREENSHOT_FORMAT.toLowerCase(); if (++screenshotCounter <= maximumScreenshots) { - new File(SWTBotPreferences.SCREENSHOTS_DIR).mkdirs(); // $NON-NLS-1$ + new File(SWTBotPreferences.SCREENSHOTS_DIR).mkdirs(); SWTUtils.captureScreenshot(fileName); } else { - log.info("No screenshot captured for '" + ClassUtils.simpleClassName(getClass()) + POINT + getName() //$NON-NLS-1$ //$NON-NLS-2$ - + "' because maximum number of screenshots reached: " + maximumScreenshots); //$NON-NLS-1$ + log.info("No screenshot captured for '" + ClassUtils.simpleClassName(getClass()) + POINT + getName() + "' because maximum number of screenshots reached: " + maximumScreenshots); } } catch (Exception e) { - log.warn("Could not capture screenshot", e); //$NON-NLS-1$ + log.warn("Could not capture screenshot", e); } } // CHECKSTYLE:ON diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java index 95d4ed1068..710bfee753 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/HideLabelIconsWithPreferencesTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES. + * 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 @@ -15,8 +15,8 @@ import org.eclipse.draw2d.Label; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramNameEditPart; -import org.eclipse.sirius.diagram.ui.internal.preferences.DiagramAppearancePreferencePage; import org.eclipse.sirius.diagram.ui.provider.DiagramUIPlugin; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.diagram.ui.tools.api.figure.SiriusWrapLabel; import org.eclipse.sirius.diagram.ui.tools.api.preferences.SiriusDiagramUiPreferencesKeys; import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; @@ -32,7 +32,7 @@ import org.eclipse.swtbot.swt.finder.results.VoidResult; import org.junit.Assert; /** - * + * * @author alagarde */ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTestCase { @@ -83,7 +83,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe } /** - * + * * {@inheritDoc} */ @Override @@ -234,7 +234,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe /** * Ensures that label icons are correctly displayed according to the given * parameters. - * + * * @param hideLabelIconsForShapes * indicates if all label icons of shapes (node and containers) * should be hidden @@ -255,7 +255,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe /** * Returns the current icon of the edit part with the given name (null if no * icon). - * + * * @param editPartName * the name of the edit part * @return the current icon of the edit part with the given name (null if no @@ -277,7 +277,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe /** * Changes the values of preferences related to label icons hiding using * standard API. - * + * * @param hideLabelIconsForShapes * indicates if all label icons of shapes (node and containers) * should be hidden @@ -287,6 +287,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe */ protected void changeHideLabeIconPreferencesUsingAPI(final boolean hideLabelIconsForShapes, final boolean hideLabelIconsForConnectors) { UIThreadRunnable.syncExec(new VoidResult() { + @Override public void run() { IPreferenceStore pluginPreferences = DiagramUIPlugin.getPlugin().getPreferenceStore(); pluginPreferences.setValue(SiriusDiagramUiPreferencesKeys.PREF_HIDE_LABEL_ICONS_ON_CONNECTORS.name(), hideLabelIconsForConnectors); @@ -298,7 +299,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe /** * Changes the values of preferences related to label icons hiding using the * preferences UI. - * + * * @param hideLabelIconsForShapes * indicates if all label icons of shapes (node and containers) * should be hidden @@ -312,15 +313,15 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe bot.tree().getTreeItem("Sirius").expand().select().getNode("Sirius Diagram").expand().select().getNode("Appearance").select(); if (hideLabelIconsForShapes) { - bot.checkBoxInGroup(DiagramAppearancePreferencePage.HIDE_LABEL_ICONS_ON_SHAPES_MESSAGE, DiagramAppearancePreferencePage.LABEL_ICONS_GROUP_TITLE).select(); + bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).select(); } else { - bot.checkBoxInGroup(DiagramAppearancePreferencePage.HIDE_LABEL_ICONS_ON_SHAPES_MESSAGE, DiagramAppearancePreferencePage.LABEL_ICONS_GROUP_TITLE).deselect(); + bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).deselect(); } if (hideLabelIconsForConnectors) { - bot.checkBoxInGroup(DiagramAppearancePreferencePage.HIDE_LABEL_ICONS_ON_CONNECTORS_MESSAGE, DiagramAppearancePreferencePage.LABEL_ICONS_GROUP_TITLE).select(); + bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).select(); } else { - bot.checkBoxInGroup(DiagramAppearancePreferencePage.HIDE_LABEL_ICONS_ON_CONNECTORS_MESSAGE, DiagramAppearancePreferencePage.LABEL_ICONS_GROUP_TITLE).deselect(); + bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).deselect(); } bot.button("OK").click(); @@ -330,7 +331,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe /** * Tests that label incons hiding preferences are correctly displayed in the * preference UI. - * + * * @param expectedHideLabelIconsForShapes * expected value for the hide label icons for shapes properties * @param expectedHideLabelIconsForConnectors @@ -342,10 +343,10 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe bot.waitUntil(Conditions.shellIsActive("Preferences")); bot.tree().getTreeItem("Sirius").expand().select().getNode("Sirius Diagram").expand().select().getNode("Appearance").select(); - Assert.assertEquals("Preference " + DiagramAppearancePreferencePage.HIDE_LABEL_ICONS_ON_SHAPES_MESSAGE + " has not expected value ", expectedHideLabelIconsForShapes, - bot.checkBoxInGroup(DiagramAppearancePreferencePage.HIDE_LABEL_ICONS_ON_SHAPES_MESSAGE, DiagramAppearancePreferencePage.LABEL_ICONS_GROUP_TITLE).isChecked()); + Assert.assertEquals("Preference " + Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel + " has not expected value ", expectedHideLabelIconsForShapes, + bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideShapeLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).isChecked()); Assert.assertEquals("Preference " + " Hide label icons on connectors" + " has not expected value ", expectedHideLabelIconsForConnectors, - bot.checkBoxInGroup(DiagramAppearancePreferencePage.HIDE_LABEL_ICONS_ON_CONNECTORS_MESSAGE, DiagramAppearancePreferencePage.LABEL_ICONS_GROUP_TITLE).isChecked()); + bot.checkBoxInGroup(Messages.DiagramAppearancePreferencePage_hideConnectorLabelIconsLabel, Messages.DiagramAppearancePreferencePage_labelIconsGroupText).isChecked()); bot.shell("Preferences").close(); } @@ -360,7 +361,7 @@ public class HideLabelIconsWithPreferencesTest extends AbstractSiriusSwtBotGefTe /** * Creates a new node and ensures it is displayed correctly. - * + * * @param mustHideNodeLabelIcon * indicates if the new node's label icon must be hidden * @param mustHideEdgeLabelIcon diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/TreeFoldingTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/TreeFoldingTest.java index 46021fe5b6..341525428a 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/TreeFoldingTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/TreeFoldingTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES. + * 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 @@ -17,7 +17,7 @@ import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart; import org.eclipse.sirius.diagram.DDiagram; -import org.eclipse.sirius.diagram.ui.tools.internal.commands.ToggleFoldingStateCommand; +import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; import org.eclipse.sirius.tests.swtbot.support.api.business.UIDiagramRepresentation; import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession; @@ -29,14 +29,14 @@ import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences; /** * Test class for tree folding. - * + * * @author smonnier */ public class TreeFoldingTest extends AbstractSiriusSwtBotGefTestCase { - private static final String REDO_FOLDING_LABEL = "Redo " + ToggleFoldingStateCommand.LABEL; + private static final String REDO_FOLDING_LABEL = "Redo " + Messages.ToggleFoldingStateCommand_label; - private static final String UNDO_FOLDING_LABEL = "Undo " + ToggleFoldingStateCommand.LABEL; + private static final String UNDO_FOLDING_LABEL = "Undo " + Messages.ToggleFoldingStateCommand_label; private static final String REPRESENTATION_INSTANCE_NAME = "TC 1852"; @@ -96,7 +96,7 @@ public class TreeFoldingTest extends AbstractSiriusSwtBotGefTestCase { /** * Test method. - * + * * @throws Exception * Test error. */ @@ -167,7 +167,7 @@ public class TreeFoldingTest extends AbstractSiriusSwtBotGefTestCase { /** * Test method. - * + * * @throws Exception * Test error. */ @@ -245,7 +245,7 @@ public class TreeFoldingTest extends AbstractSiriusSwtBotGefTestCase { /** * Test method. - * + * * @throws Exception * Test error. */ |
