Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2015-09-02 09:31:06 +0000
committerLaurent Redor2015-09-04 12:50:48 +0000
commit96e7c6ac5d3378cc9701750d07adba28684c0cf4 (patch)
treede356af33b879bbf4a6afcd35b00e39a3ee7f472
parent6bbcb40951c1008601451c72173bad888bd1f00d (diff)
downloadorg.eclipse.sirius-96e7c6ac5d3378cc9701750d07adba28684c0cf4.tar.gz
org.eclipse.sirius-96e7c6ac5d3378cc9701750d07adba28684c0cf4.tar.xz
org.eclipse.sirius-96e7c6ac5d3378cc9701750d07adba28684c0cf4.zip
[472057] Externalize translatable strings from oes.table.ui
Also bump the minimum version of org.eclipse.sirius.ext.base in oes.table. Bug: 472057 Change-Id: I744c82395f3d9d2505c5f987887f2088ac46c63b Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.html3
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile1
-rw-r--r--plugins/org.eclipse.sirius.table.ui/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--plugins/org.eclipse.sirius.table.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.sirius.table.ui/plugin.properties64
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/FeatureColumnMappingItemProvider.java54
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/IntersectionMappingItemProvider.java90
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/provider/Messages.java216
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/api/helper/TableUIHelper.java40
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/HierarchyLabelTableProvider.java5
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java46
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDColumnsCommand.java9
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDLinesCommand.java14
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java2
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java13
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java5
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/AbstractHideRevealAction.java27
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteLinesAction.java21
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteTargetColumnAction.java15
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateLineMenuAction.java13
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateTargetColumnMenuAction.java11
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorRefreshAction.java31
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideColumnAction.java15
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideLinesAction.java20
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealColumnsAction.java34
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealLinesAction.java45
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/PrintAction.java16
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/RefreshAction.java18
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllColumnsAction.java13
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllLinesAction.java17
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowPropertiesViewAction.java21
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortColumnsByLineAction.java19
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortLinesByColumnAction.java21
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/listeners/DTableViewerListener.java13
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/print/PrintAsImageCallback.java45
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/provider/DFeatureColumnEditingSupport.java53
-rw-r--r--plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/quickoutline/TableQuickOutlineHandler.java11
-rw-r--r--plugins/org.eclipse.sirius.table/META-INF/MANIFEST.MF2
38 files changed, 681 insertions, 368 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index ac3ab5c86b..3697c8a944 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -308,6 +308,9 @@
<code>org.eclipse.sirius.table</code>
</li>
<li>
+ <code>org.eclipse.sirius.table.ui</code>
+ </li>
+ <li>
<code>org.eclipse.sirius.tree</code>
</li>
<li>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 3b7cd8c653..0e8e2306cb 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -74,6 +74,7 @@ Additional non-breaking changes:
** @org.eclipse.sirius.eef.adapters@
** @org.eclipse.sirius.interpreter@
** @org.eclipse.sirius.table@
+** @org.eclipse.sirius.table.ui@
** @org.eclipse.sirius.tree@
** @org.eclipse.sirius.tree.ui@
diff --git a/plugins/org.eclipse.sirius.table.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.sirius.table.ui/.settings/org.eclipse.jdt.core.prefs
index fc8c7f3ddc..39e1d0d4d4 100644
--- a/plugins/org.eclipse.sirius.table.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.sirius.table.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.table.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.table.ui/META-INF/MANIFEST.MF
index e4fde9c279..ecdf965d02 100644
--- a/plugins/org.eclipse.sirius.table.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.sirius.table.ui/META-INF/MANIFEST.MF
@@ -45,6 +45,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.jface.text;bundle-version="3.8.2"
Eclipse-LazyStart: true
Bundle-ActivationPolicy: lazy
-Import-Package: org.eclipse.sirius.ext.base;version="2.0.0",
- org.eclipse.sirius.ext.emf.ui.properties,
+Import-Package: org.eclipse.sirius.ext.base;version="2.1.0",
+ org.eclipse.sirius.ext.emf.ui.properties;version="3.0.0",
org.eclipse.sirius.ext.swt;version="2.0.0"
diff --git a/plugins/org.eclipse.sirius.table.ui/plugin.properties b/plugins/org.eclipse.sirius.table.ui/plugin.properties
index 8f3ce0ce28..c00366d25f 100644
--- a/plugins/org.eclipse.sirius.table.ui/plugin.properties
+++ b/plugins/org.eclipse.sirius.table.ui/plugin.properties
@@ -1,5 +1,5 @@
# ====================================================================
-# Copyright (c) 2007, 2008 THALES GLOBAL SERVICES
+# Copyright (c) 2007, 2015 THALES GLOBAL SERVICES
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -274,3 +274,65 @@ _UI_DTableElementStyle_foregroundColor_feature = Foreground Color
_UI_DTableElementStyle_backgroundColor_feature = Background Color
_UI_DTableElementStyle_defaultForegroundStyle_feature = Default Foreground Style
_UI_DTableElementStyle_defaultBackgroundStyle_feature = Default Background Style
+
+AbstractDTableEditor_tableNotSaved = This table was not saved. You can close the editor
+Action_cancelled = Cancelled
+Action_error = Error
+Action_setValue = Set {0} value
+Action_setValues = Set {0} values
+DeleteLinesAction_label = Delete line
+DeleteLinesAction_labelMany = Delete lines
+DeleteLinesAction_tooltip = Delete the target semantic element
+DeleteLinesAction_tooltipMany = Delete the target semantic elements
+DeleteTargetColumnAction_label = Delete column
+DeleteTargetColumnAction_tooltip = Delete the target semantic element
+DFeatureColumnEditingSupport_errorGettingPropertyValue = Error while getting the property value
+DFeatureColumnEditingSupport_errorSettingPropertyValue = Error while setting the property value
+DFeatureColumnEditingSupport_notValidValue = Null value is not a valid value for this cell.
+DTableMenuListener_cvsExportException = export to csv command not found
+DTableMenuListener_exportMenuName = Export
+DTableMenuListener_newMenuName = New
+DTableMenuListener_openMenuName = Open
+DTableMenuListener_showHideMenuName = Show/Hide
+DTableViewerListener_collapseLine = Collapse {0} line
+DTableViewerListener_expandLine = Expand {0} line
+EditorCreateLineMenuAction_label = Create root lines
+EditorCreateTargetColumnMenuAction_label = Create root columns
+HideColumnAction_label = Hide column
+HideLinesAction_label = Hide line
+HideLinesAction_labelMany = Hide lines
+HideRevealColumnsAction_dialogMsg = Uncheck columns to hide them:
+HideRevealColumnsAction_dialogTitle = Hide/Show table columns
+HideRevealColumnsAction_label = Hide/Show columns...
+HideRevealLinesAction_dialogMsg = Uncheck lines to hide them:
+HideRevealLinesAction_dialogTitle = Hide/Show table lines
+HideRevealLinesAction_label = Hide/Show lines...
+HierarchyLabelTableProvider_elementWithoutName = Element without name
+PrintAction_errorDuringPrinting = An error occurs during printing: {0}
+PrintAction_tableWithoutName = table without name
+PrintAsImageCallback_pageFooter = page {0}/{1}
+RefreshAction_errorDuringRefresh = Error while refreshing table
+RefreshAction_label = Refresh table
+RefreshAtOpeningActivator_refreshTableCmdName = refresh table model at opening
+ShowAllColumnsAction_label = Show hidden columns
+ShowAllLinesAction_label = Show hidden lines
+ShowPropertiesViewAction_error = Error while showing the Property View.
+ShowPropertiesViewAction_label = Show Properties View
+SortColumnsByLineAction_label = Sort by
+SortDColumnsCommand_ascendingSorting = Ascending columns sorting
+SortDColumnsCommand_descendingSorting = Descending columns sorting
+SortDLinesCommand_ascendingSorting = Ascending lines sorting
+SortDLinesCommand_descendingSorting = Descending lines sorting
+SortLinesByColumnAction_label = Sort by
+TableDialectUIServices_newTableName = New Table
+TableDialectUIServices_tableOpening = table opening
+TableDialectUIServices_tableOpeningError = table editor opening error
+TableDialectUIServices_tableOpeningVar = table opening: {0}
+TableQuickOutlineHandler_selectLine = select line
+TableQuickOutlineHandler_selectColumn = select column
+TableUIHelper_undefinedContent = Undefined
+TableUIHelper_unsupportedColor = unsupported color : {0}
+Table_SemanticColumnElement = The semantic element corresponding to the column (only available for Intersection Mapping).
+Table_SemanticLineElement = The semantic element corresponding to the line.
+Table_SemanticRootElement = The semantic root element of the table.
+Table_CurrentSemanticElement = The semantic currently edited element. \ No newline at end of file
diff --git a/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/FeatureColumnMappingItemProvider.java b/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/FeatureColumnMappingItemProvider.java
index 1c9a4eba52..645e6aac9f 100644
--- a/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/FeatureColumnMappingItemProvider.java
+++ b/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/FeatureColumnMappingItemProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2013 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@ import org.eclipse.sirius.table.metamodel.table.description.ForegroundConditiona
import org.eclipse.sirius.table.metamodel.table.description.LabelEditTool;
import org.eclipse.sirius.table.metamodel.table.description.TableTool;
import org.eclipse.sirius.table.metamodel.table.description.TableVariable;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.interpreter.IInterpreterSiriusTableVariables;
import org.eclipse.sirius.viewpoint.description.tool.ToolFactory;
@@ -38,7 +39,7 @@ import org.eclipse.sirius.viewpoint.description.tool.ToolFactory;
* This is the item provider adapter for a
* {@link org.eclipse.sirius.table.metamodel.table.description.FeatureColumnMapping}
* object. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider {
@@ -78,11 +79,11 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
* @generated
*/
protected void addCanEditPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_CellUpdater_canEdit_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_CellUpdater_canEdit_feature", "_UI_CellUpdater_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- DescriptionPackage.Literals.CELL_UPDATER__CAN_EDIT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_BehaviorPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CellUpdater_canEdit_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_CellUpdater_canEdit_feature", "_UI_CellUpdater_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ DescriptionPackage.Literals.CELL_UPDATER__CAN_EDIT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_BehaviorPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
@@ -92,11 +93,11 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
* @generated
*/
protected void addFeatureNamePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_FeatureColumnMapping_featureName_feature"), //$NON-NLS-1$
- getString("_UI_FeatureColumnMapping_featureName_description"), //$NON-NLS-1$
- DescriptionPackage.Literals.FEATURE_COLUMN_MAPPING__FEATURE_NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_GeneralPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_FeatureColumnMapping_featureName_feature"), //$NON-NLS-1$
+ getString("_UI_FeatureColumnMapping_featureName_description"), //$NON-NLS-1$
+ DescriptionPackage.Literals.FEATURE_COLUMN_MAPPING__FEATURE_NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_GeneralPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
@@ -106,22 +107,21 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
* @generated
*/
protected void addLabelExpressionPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_FeatureColumnMapping_labelExpression_feature"), //$NON-NLS-1$
- getString("_UI_FeatureColumnMapping_labelExpression_description"), //$NON-NLS-1$
- DescriptionPackage.Literals.FEATURE_COLUMN_MAPPING__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_LabelPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors.add(
+ createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_FeatureColumnMapping_labelExpression_feature"), //$NON-NLS-1$
+ getString("_UI_FeatureColumnMapping_labelExpression_description"), //$NON-NLS-1$
+ DescriptionPackage.Literals.FEATURE_COLUMN_MAPPING__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_LabelPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
* This adds a property descriptor for the Feature Parent Expression
* feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addFeatureParentExpressionPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_FeatureColumnMapping_featureParentExpression_feature"), //$NON-NLS-1$
getString("_UI_FeatureColumnMapping_featureParentExpression_description"), //$NON-NLS-1$
DescriptionPackage.Literals.FEATURE_COLUMN_MAPPING__FEATURE_PARENT_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
@@ -136,7 +136,7 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
* {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in
* {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -154,7 +154,7 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -169,7 +169,7 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
/**
* This returns FeatureColumnMapping.gif. <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -194,7 +194,7 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
* update any cached children and by creating a viewer notification, which
* it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -255,9 +255,9 @@ public class FeatureColumnMappingItemProvider extends ColumnMappingItemProvider
LabelEditTool labelEditTool = DescriptionFactory.eINSTANCE.createLabelEditTool();
labelEditTool.setMask(ToolFactory.eINSTANCE.createEditMaskVariables());
- addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ELEMENT, "The currently edited element.");
- addVariableDescriptor(labelEditTool, IInterpreterSiriusTableVariables.LINE_SEMANTIC, "The semantic element corresponding to the line.");
- addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ROOT, "The semantic element of the table.");
+ addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ELEMENT, Messages.Table_CurrentSemanticElement);
+ addVariableDescriptor(labelEditTool, IInterpreterSiriusTableVariables.LINE_SEMANTIC, Messages.Table_SemanticLineElement);
+ addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ROOT, Messages.Table_SemanticRootElement);
newChildDescriptors.add(createChildParameter(DescriptionPackage.Literals.CELL_UPDATER__DIRECT_EDIT, labelEditTool));
diff --git a/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/IntersectionMappingItemProvider.java b/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/IntersectionMappingItemProvider.java
index 9d2a59ccb8..461a048c08 100644
--- a/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/IntersectionMappingItemProvider.java
+++ b/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/description/provider/IntersectionMappingItemProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007-2013 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,6 +33,7 @@ import org.eclipse.sirius.table.metamodel.table.description.IntersectionMapping;
import org.eclipse.sirius.table.metamodel.table.description.LabelEditTool;
import org.eclipse.sirius.table.metamodel.table.description.TableTool;
import org.eclipse.sirius.table.metamodel.table.description.TableVariable;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.interpreter.IInterpreterSiriusTableVariables;
import org.eclipse.sirius.viewpoint.description.tool.ToolFactory;
@@ -40,7 +41,7 @@ import org.eclipse.sirius.viewpoint.description.tool.ToolFactory;
* This is the item provider adapter for a
* {@link org.eclipse.sirius.table.metamodel.table.description.IntersectionMapping}
* object. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
public class IntersectionMappingItemProvider extends TableMappingItemProvider {
@@ -87,11 +88,11 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* @generated
*/
protected void addCanEditPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_CellUpdater_canEdit_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_CellUpdater_canEdit_feature", "_UI_CellUpdater_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- DescriptionPackage.Literals.CELL_UPDATER__CAN_EDIT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_BehaviorPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_CellUpdater_canEdit_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_CellUpdater_canEdit_feature", "_UI_CellUpdater_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ DescriptionPackage.Literals.CELL_UPDATER__CAN_EDIT, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_BehaviorPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
@@ -101,11 +102,11 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* @generated
*/
protected void addLineMappingPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_IntersectionMapping_lineMapping_feature"), //$NON-NLS-1$
- getString("_UI_IntersectionMapping_lineMapping_description"), //$NON-NLS-1$
- DescriptionPackage.Literals.INTERSECTION_MAPPING__LINE_MAPPING, true, false, true, null, getString("_UI_GeneralPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IntersectionMapping_lineMapping_feature"), //$NON-NLS-1$
+ getString("_UI_IntersectionMapping_lineMapping_description"), //$NON-NLS-1$
+ DescriptionPackage.Literals.INTERSECTION_MAPPING__LINE_MAPPING, true, false, true, null, getString("_UI_GeneralPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
@@ -115,11 +116,11 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* @generated
*/
protected void addColumnMappingPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_IntersectionMapping_columnMapping_feature"), //$NON-NLS-1$
- getString("_UI_IntersectionMapping_columnMapping_description"), //$NON-NLS-1$
- DescriptionPackage.Literals.INTERSECTION_MAPPING__COLUMN_MAPPING, true, false, true, null, getString("_UI_GeneralPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors.add(
+ createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IntersectionMapping_columnMapping_feature"), //$NON-NLS-1$
+ getString("_UI_IntersectionMapping_columnMapping_description"), //$NON-NLS-1$
+ DescriptionPackage.Literals.INTERSECTION_MAPPING__COLUMN_MAPPING, true, false, true, null, getString("_UI_GeneralPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
@@ -129,11 +130,11 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* @generated
*/
protected void addLabelExpressionPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_IntersectionMapping_labelExpression_feature"), //$NON-NLS-1$
- getString("_UI_IntersectionMapping_labelExpression_description"), //$NON-NLS-1$
- DescriptionPackage.Literals.INTERSECTION_MAPPING__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_LabelPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors.add(
+ createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IntersectionMapping_labelExpression_feature"), //$NON-NLS-1$
+ getString("_UI_IntersectionMapping_labelExpression_description"), //$NON-NLS-1$
+ DescriptionPackage.Literals.INTERSECTION_MAPPING__LABEL_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_LabelPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
@@ -153,7 +154,7 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
/**
* This adds a property descriptor for the Column Finder Expression feature.
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addColumnFinderExpressionPropertyDescriptor(Object object) {
@@ -167,7 +168,7 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
/**
* This adds a property descriptor for the Line Finder Expression feature.
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addLineFinderExpressionPropertyDescriptor(Object object) {
@@ -181,12 +182,11 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
/**
* This adds a property descriptor for the Semantic Candidates Expression
* feature. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addSemanticCandidatesExpressionPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
+ itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
getString("_UI_IntersectionMapping_semanticCandidatesExpression_feature"), //$NON-NLS-1$
getString("_UI_IntersectionMapping_semanticCandidatesExpression_description"), //$NON-NLS-1$
DescriptionPackage.Literals.INTERSECTION_MAPPING__SEMANTIC_CANDIDATES_EXPRESSION, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
@@ -201,17 +201,17 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* @generated
*/
protected void addDomainClassPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_IntersectionMapping_domainClass_feature"), //$NON-NLS-1$
- getString("_UI_IntersectionMapping_domainClass_description"), //$NON-NLS-1$
- DescriptionPackage.Literals.INTERSECTION_MAPPING__DOMAIN_CLASS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_DomainBasedPropertyCategory"), //$NON-NLS-1$
- null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IntersectionMapping_domainClass_feature"), //$NON-NLS-1$
+ getString("_UI_IntersectionMapping_domainClass_description"), //$NON-NLS-1$
+ DescriptionPackage.Literals.INTERSECTION_MAPPING__DOMAIN_CLASS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, getString("_UI_DomainBasedPropertyCategory"), //$NON-NLS-1$
+ null));
}
/**
* This adds a property descriptor for the Precondition Expression feature.
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
protected void addPreconditionExpressionPropertyDescriptor(Object object) {
@@ -229,10 +229,10 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* @generated
*/
protected void addCreatePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(),
- getString("_UI_IntersectionMapping_create_feature"), //$NON-NLS-1$
- getString("_UI_PropertyDescriptor_description", "_UI_IntersectionMapping_create_feature", "_UI_IntersectionMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- DescriptionPackage.Literals.INTERSECTION_MAPPING__CREATE, true, false, true, null, null, null));
+ itemPropertyDescriptors
+ .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IntersectionMapping_create_feature"), //$NON-NLS-1$
+ getString("_UI_PropertyDescriptor_description", "_UI_IntersectionMapping_create_feature", "_UI_IntersectionMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ DescriptionPackage.Literals.INTERSECTION_MAPPING__CREATE, true, false, true, null, null, null));
}
/**
@@ -242,7 +242,7 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* {@link org.eclipse.emf.edit.command.RemoveCommand} or
* {@link org.eclipse.emf.edit.command.MoveCommand} in
* {@link #createCommand}. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -261,7 +261,7 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -276,7 +276,7 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
/**
* This returns IntersectionMapping.gif. <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -301,7 +301,7 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
* update any cached children and by creating a viewer notification, which
* it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> <!--
* end-user-doc -->
- *
+ *
* @generated
*/
@Override
@@ -369,10 +369,10 @@ public class IntersectionMappingItemProvider extends TableMappingItemProvider {
LabelEditTool labelEditTool = DescriptionFactory.eINSTANCE.createLabelEditTool();
labelEditTool.setMask(ToolFactory.eINSTANCE.createEditMaskVariables());
- addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ELEMENT, "The currently edited element.");
- addVariableDescriptor(labelEditTool, IInterpreterSiriusTableVariables.LINE_SEMANTIC, "The semantic element corresponding to the line.");
- addVariableDescriptor(labelEditTool, IInterpreterSiriusTableVariables.COLUMN_SEMANTIC, "The semantic element corresponding to the column (only available for Intersection Mapping).");
- addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ROOT, "The semantic element of the table.");
+ addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ELEMENT, Messages.Table_CurrentSemanticElement);
+ addVariableDescriptor(labelEditTool, IInterpreterSiriusTableVariables.LINE_SEMANTIC, Messages.Table_SemanticLineElement);
+ addVariableDescriptor(labelEditTool, IInterpreterSiriusTableVariables.COLUMN_SEMANTIC, Messages.Table_SemanticColumnElement);
+ addVariableDescriptor(labelEditTool, IInterpreterSiriusVariables.ROOT, Messages.Table_SemanticRootElement);
newChildDescriptors.add(createChildParameter(DescriptionPackage.Literals.CELL_UPDATER__DIRECT_EDIT, labelEditTool));
diff --git a/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/provider/Messages.java b/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/provider/Messages.java
new file mode 100644
index 0000000000..c983f32f0b
--- /dev/null
+++ b/plugins/org.eclipse.sirius.table.ui/src-gen/org/eclipse/sirius/table/metamodel/table/provider/Messages.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * 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.table.metamodel.table.provider;
+
+import org.eclipse.sirius.ext.base.I18N;
+import org.eclipse.sirius.ext.base.I18N.TranslatableMessage;
+
+/**
+ * Helper class to obtains translated strings.
+ *
+ * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
+ */
+public final class Messages {
+
+ static {
+ I18N.initializeMessages(Messages.class, TableUIPlugin.INSTANCE);
+ }
+
+ // CHECKSTYLE:OFF
+ @TranslatableMessage
+ public static String AbstractDTableEditor_tableNotSaved;
+
+ @TranslatableMessage
+ public static String Action_cancelled;
+
+ @TranslatableMessage
+ public static String Action_error;
+
+ @TranslatableMessage
+ public static String Action_setValue;
+
+ @TranslatableMessage
+ public static String Action_setValues;
+
+ @TranslatableMessage
+ public static String DeleteLinesAction_label;
+
+ @TranslatableMessage
+ public static String DeleteLinesAction_labelMany;
+
+ @TranslatableMessage
+ public static String DeleteLinesAction_tooltip;
+
+ @TranslatableMessage
+ public static String DeleteLinesAction_tooltipMany;
+
+ @TranslatableMessage
+ public static String DeleteTargetColumnAction_label;
+
+ @TranslatableMessage
+ public static String DeleteTargetColumnAction_tooltip;
+
+ @TranslatableMessage
+ public static String DFeatureColumnEditingSupport_errorGettingPropertyValue;
+
+ @TranslatableMessage
+ public static String DFeatureColumnEditingSupport_errorSettingPropertyValue;
+
+ @TranslatableMessage
+ public static String DFeatureColumnEditingSupport_notValidValue;
+
+ @TranslatableMessage
+ public static String DTableMenuListener_cvsExportException;
+
+ @TranslatableMessage
+ public static String DTableMenuListener_exportMenuName;
+
+ @TranslatableMessage
+ public static String DTableMenuListener_newMenuName;
+
+ @TranslatableMessage
+ public static String DTableMenuListener_openMenuName;
+
+ @TranslatableMessage
+ public static String DTableMenuListener_showHideMenuName;
+
+ @TranslatableMessage
+ public static String DTableViewerListener_collapseLine;
+
+ @TranslatableMessage
+ public static String DTableViewerListener_expandLine;
+
+ @TranslatableMessage
+ public static String EditorCreateLineMenuAction_label;
+
+ @TranslatableMessage
+ public static String EditorCreateTargetColumnMenuAction_label;
+
+ @TranslatableMessage
+ public static String HideColumnAction_label;
+
+ @TranslatableMessage
+ public static String HideLinesAction_label;
+
+ @TranslatableMessage
+ public static String HideLinesAction_labelMany;
+
+ @TranslatableMessage
+ public static String HideRevealColumnsAction_dialogMsg;
+
+ @TranslatableMessage
+ public static String HideRevealColumnsAction_dialogTitle;
+
+ @TranslatableMessage
+ public static String HideRevealColumnsAction_label;
+
+ @TranslatableMessage
+ public static String HideRevealLinesAction_dialogMsg;
+
+ @TranslatableMessage
+ public static String HideRevealLinesAction_dialogTitle;
+
+ @TranslatableMessage
+ public static String HideRevealLinesAction_label;
+
+ @TranslatableMessage
+ public static String HierarchyLabelTableProvider_elementWithoutName;
+
+ @TranslatableMessage
+ public static String PrintAction_errorDuringPrinting;
+
+ @TranslatableMessage
+ public static String PrintAction_tableWithoutName;
+
+ @TranslatableMessage
+ public static String PrintAsImageCallback_pageFooter;
+
+ @TranslatableMessage
+ public static String RefreshAction_errorDuringRefresh;
+
+ @TranslatableMessage
+ public static String RefreshAction_label;
+
+ @TranslatableMessage
+ public static String RefreshAtOpeningActivator_refreshTableCmdName;
+
+ @TranslatableMessage
+ public static String ShowAllColumnsAction_label;
+
+ @TranslatableMessage
+ public static String ShowAllLinesAction_label;
+
+ @TranslatableMessage
+ public static String ShowPropertiesViewAction_error;
+
+ @TranslatableMessage
+ public static String ShowPropertiesViewAction_label;
+
+ @TranslatableMessage
+ public static String SortColumnsByLineAction_label;
+
+ @TranslatableMessage
+ public static String SortDColumnsCommand_ascendingSorting;
+
+ @TranslatableMessage
+ public static String SortDColumnsCommand_descendingSorting;
+
+ @TranslatableMessage
+ public static String SortDLinesCommand_ascendingSorting;
+
+ @TranslatableMessage
+ public static String SortDLinesCommand_descendingSorting;
+
+ @TranslatableMessage
+ public static String SortLinesByColumnAction_label;
+
+ @TranslatableMessage
+ public static String TableDialectUIServices_newTableName;
+
+ @TranslatableMessage
+ public static String TableDialectUIServices_tableOpening;
+
+ @TranslatableMessage
+ public static String TableDialectUIServices_tableOpeningError;
+
+ @TranslatableMessage
+ public static String TableDialectUIServices_tableOpeningVar;
+
+ @TranslatableMessage
+ public static String TableQuickOutlineHandler_selectLine;
+
+ @TranslatableMessage
+ public static String TableQuickOutlineHandler_selectColumn;
+
+ @TranslatableMessage
+ public static String TableUIHelper_undefinedContent;
+
+ @TranslatableMessage
+ public static String TableUIHelper_unsupportedColor;
+
+ @TranslatableMessage
+ public static String Table_CurrentSemanticElement;
+
+ @TranslatableMessage
+ public static String Table_SemanticColumnElement;
+
+ @TranslatableMessage
+ public static String Table_SemanticLineElement;
+
+ @TranslatableMessage
+ public static String Table_SemanticRootElement;
+
+ // CHECKSTYLE:ON
+
+ private Messages() {
+ // Prevents instanciation.
+ }
+}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/api/helper/TableUIHelper.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/api/helper/TableUIHelper.java
index 6d7c874afe..2c37f66ac5 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/api/helper/TableUIHelper.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/api/helper/TableUIHelper.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.business.api.helper;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -25,6 +26,7 @@ import org.eclipse.sirius.table.metamodel.table.DColumn;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.DTableElementStyle;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.ui.tools.api.color.VisualBindingManager;
import org.eclipse.sirius.viewpoint.RGBValues;
import org.eclipse.sirius.viewpoint.description.SystemColors;
@@ -35,9 +37,9 @@ import org.eclipse.swt.widgets.TreeItem;
/**
* Utility methods to handle Table models.
- *
+ *
* @author lredor
- *
+ *
*/
public final class TableUIHelper {
@@ -47,7 +49,7 @@ public final class TableUIHelper {
/**
* Transform a table to a table descriptor.
- *
+ *
* @param table
* table to transform.
* @param inverse
@@ -75,7 +77,7 @@ public final class TableUIHelper {
}
} else {
final List<String> header = new ArrayList<String>();
- header.add("");
+ header.add(""); //$NON-NLS-1$
for (final DLine line : table.getLines()) {
if (line.isVisible()) {
header.add(filler.getContent(line));
@@ -105,7 +107,7 @@ public final class TableUIHelper {
/**
* Transform a graphical tree to a table descriptor.
- *
+ *
* @param tree
* tree to transform.
* @param filler
@@ -160,7 +162,7 @@ public final class TableUIHelper {
/**
* Export the given table to HTML format.
- *
+ *
* @param table
* table to export.
* @param inverse
@@ -173,7 +175,7 @@ public final class TableUIHelper {
/**
* Export the given tree to HTML format.
- *
+ *
* @param tree
* tree to export.
* @return a string with the HTML table.
@@ -184,7 +186,7 @@ public final class TableUIHelper {
/**
* Transform a table descriptor to an HTML representation.
- *
+ *
* @param descriptor
* the table descriptor.
* @return an HTML table.
@@ -251,7 +253,7 @@ public final class TableUIHelper {
/**
* Add a list of strings to a table descriptor.
- *
+ *
* @param expected
* table descriptor to update.
* @param strings
@@ -264,7 +266,7 @@ public final class TableUIHelper {
/**
* Export the given table to HTML format using the named color names as
* table content.
- *
+ *
* @param table
* table to export.
* @param inverse
@@ -284,7 +286,7 @@ public final class TableUIHelper {
/**
* Export the given table to HTML format using the named color names as
* table content.
- *
+ *
* @param tree
* tree to export.
* @return a string with the HTML table.
@@ -318,7 +320,7 @@ public final class TableUIHelper {
/**
* Export the given table to HTML format using the named color names as
* table content.
- *
+ *
* @param table
* table to export.
* @param inverse
@@ -343,7 +345,7 @@ public final class TableUIHelper {
/**
* Export the given table to HTML format using the width of the column as
* table content.
- *
+ *
* @param tree
* tree to export.
* @return a string with the HTML table.
@@ -367,7 +369,7 @@ public final class TableUIHelper {
/**
* Export the given table to HTML format using the width of the column as
* table content.
- *
+ *
* @param table
* table to export.
* @param inverse
@@ -390,12 +392,12 @@ public final class TableUIHelper {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.table.business.api.helper.TableFiller#getContent(org.eclipse.sirius.table.metamodel.table.DLine)
*/
@Override
public String getContent(DLine line) {
- return "Undefined";
+ return Messages.TableUIHelper_undefinedContent;
// return
// Integer.toString(TableHelper.getTable(line).getLineHeaderWidth());
}
@@ -406,7 +408,7 @@ public final class TableUIHelper {
/**
* Export the given table to HTML format using the named color names as
* table content.
- *
+ *
* @param tree
* tree to export.
* @return a string with the HTML table.
@@ -448,7 +450,7 @@ public final class TableUIHelper {
if (exactMatch) {
return closest.getName();
} else {
- return "unsupported color : " + color;
+ return MessageFormat.format(Messages.TableUIHelper_unsupportedColor, color);
}
}
@@ -459,7 +461,7 @@ public final class TableUIHelper {
/**
* Fill a table with values.
- *
+ *
* @author lredor
*/
class TableFiller {
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/HierarchyLabelTableProvider.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/HierarchyLabelTableProvider.java
index dd4a007e91..0899736df1 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/HierarchyLabelTableProvider.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/HierarchyLabelTableProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@ import org.eclipse.sirius.business.api.query.IdentifiedElementQuery;
import org.eclipse.sirius.table.metamodel.table.description.TableDescription;
import org.eclipse.sirius.table.metamodel.table.description.TableMapping;
import org.eclipse.sirius.table.metamodel.table.description.TableNavigationDescription;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.viewpoint.description.Group;
import org.eclipse.sirius.viewpoint.description.IdentifiedElement;
import org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription;
@@ -83,7 +84,7 @@ public class HierarchyLabelTableProvider extends LabelProvider {
} else if (eObject instanceof RepresentationExtensionDescription) {
label = ((RepresentationExtensionDescription) eObject).getName();
}
- return label != null ? label : "Element whithout name";
+ return label != null ? label : Messages.HierarchyLabelTableProvider_elementWithoutName;
}
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
index 4081911dad..2f38a9bc02 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/business/internal/dialect/TableDialectUIServices.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.business.internal.dialect;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -46,6 +47,7 @@ import org.eclipse.sirius.table.metamodel.table.description.TableCreationDescrip
import org.eclipse.sirius.table.metamodel.table.description.TableDescription;
import org.eclipse.sirius.table.metamodel.table.description.TableNavigationDescription;
import org.eclipse.sirius.table.metamodel.table.description.provider.DescriptionItemProviderAdapterFactory;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.metamodel.table.provider.TableItemProviderAdapterFactory;
import org.eclipse.sirius.table.metamodel.table.provider.TableUIPlugin;
import org.eclipse.sirius.table.tools.api.export.TableExportHelper;
@@ -79,7 +81,7 @@ import com.google.common.collect.Sets;
/**
* The table dialect ui services.
- *
+ *
* @author lredor
*/
public class TableDialectUIServices implements DialectUIServices {
@@ -90,7 +92,7 @@ public class TableDialectUIServices implements DialectUIServices {
public IEditorPart openEditor(Session session, DRepresentation dRepresentation, IProgressMonitor monitor) {
IEditorPart editorPart = null;
try {
- monitor.beginTask("table opening", 10);
+ monitor.beginTask(Messages.TableDialectUIServices_tableOpening, 10);
if (dRepresentation instanceof DTable) {
DTable dTable = (DTable) dRepresentation;
DslCommonPlugin.PROFILER.startWork(SiriusTasksKey.OPEN_TABLE_KEY);
@@ -108,7 +110,7 @@ public class TableDialectUIServices implements DialectUIServices {
editorId = null;
}
if (editorId != null) {
- monitor.subTask("table opening : " + dRepresentation.getName());
+ monitor.subTask(MessageFormat.format(Messages.TableDialectUIServices_tableOpeningVar, dRepresentation.getName()));
RunnableWithResult<IEditorPart> runnable = new RunnableWithResult.Impl<IEditorPart>() {
@Override
@@ -117,7 +119,7 @@ public class TableDialectUIServices implements DialectUIServices {
try {
setResult(page.openEditor(editorInput, editorId));
} catch (final PartInitException e) {
- TableUIPlugin.getPlugin().log(new Status(IStatus.ERROR, TableUIPlugin.ID, "table editor opening error", e));
+ TableUIPlugin.getPlugin().log(new Status(IStatus.ERROR, TableUIPlugin.ID, Messages.TableDialectUIServices_tableOpeningError, e));
}
}
};
@@ -136,7 +138,7 @@ public class TableDialectUIServices implements DialectUIServices {
}
/**
- *
+ *
* {@inheritDoc}
*/
@Override
@@ -148,7 +150,7 @@ public class TableDialectUIServices implements DialectUIServices {
}
/**
- *
+ *
* {@inheritDoc}
*/
@Override
@@ -161,7 +163,7 @@ public class TableDialectUIServices implements DialectUIServices {
}
/**
- *
+ *
* {@inheritDoc}
*/
@Override
@@ -174,7 +176,7 @@ public class TableDialectUIServices implements DialectUIServices {
}
/**
- *
+ *
* {@inheritDoc}
*/
@Override
@@ -187,7 +189,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandleEditor(org.eclipse.ui.IEditorPart)
*/
@Override
@@ -197,7 +199,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#closeEditor(org.eclipse.ui.IEditorPart,
* boolean)
*/
@@ -220,7 +222,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationManagedByEditor(org.eclipse.sirius.viewpoint.DRepresentation,
* org.eclipse.ui.IEditorPart)
*/
@@ -238,7 +240,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#isRepresentationDescriptionManagedByEditor(org.eclipse.sirius.viewpoint.description.RepresentationDescription,
* org.eclipse.ui.IEditorPart)
*/
@@ -253,7 +255,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.DRepresentation)
*/
@Override
@@ -263,7 +265,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.description.RepresentationDescription)
* )
*/
@@ -274,7 +276,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#canHandle(org.eclipse.sirius.viewpoint.description.RepresentationExtensionDescription)
* )
*/
@@ -293,7 +295,7 @@ public class TableDialectUIServices 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)
*/
@@ -315,7 +317,7 @@ public class TableDialectUIServices implements DialectUIServices {
public String getEditorName(DRepresentation representation) {
String editorName = representation.getName();
if (StringUtil.isEmpty(editorName)) {
- editorName = "New Table";
+ editorName = Messages.TableDialectUIServices_newTableName;
}
return editorName;
}
@@ -338,7 +340,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getHierarchyLabelProvider(ILabelProvider)
*/
@Override
@@ -368,7 +370,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#getSelection(org.eclipse.sirius.ui.business.api.dialect.DialectEditor)
*/
@Override
@@ -388,7 +390,7 @@ public class TableDialectUIServices implements DialectUIServices {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.ui.business.api.dialect.DialectUIServices#completeToolTipText(String,
* EObject, EStructuralFeature)
*/
@@ -399,7 +401,7 @@ public class TableDialectUIServices 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.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDColumnsCommand.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDColumnsCommand.java
index 2c48ec3303..49e050308e 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDColumnsCommand.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDColumnsCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 THALES GLOBAL SERVICES.
+ * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,11 +18,12 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.table.metamodel.table.DColumn;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.DTable;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.swt.SWT;
/**
* A Command to sort {@link DColumn}s order.
- *
+ *
* @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
*/
public class SortDColumnsCommand extends RecordingCommand {
@@ -33,7 +34,7 @@ public class SortDColumnsCommand extends RecordingCommand {
/**
* Default constructor.
- *
+ *
* @param domain
* the {@link TransactionalEditingDomain} on which this command
* will be executed
@@ -45,7 +46,7 @@ public class SortDColumnsCommand extends RecordingCommand {
* the direction in which to sort. One of SWT.UP or SWT.DOWN.
*/
public SortDColumnsCommand(TransactionalEditingDomain domain, DTable dTable, DLine dLine, int sortDirection) {
- super(domain, (sortDirection == SWT.UP ? "Ascending " : "Descending ") + "columns sorting");
+ super(domain, sortDirection == SWT.UP ? Messages.SortDColumnsCommand_ascendingSorting : Messages.SortDColumnsCommand_descendingSorting);
this.dTable = dTable;
this.dColumnSorter = new DColumnSorter(dLine, sortDirection);
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDLinesCommand.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDLinesCommand.java
index 15fd34286f..51ed0079ae 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDLinesCommand.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/commands/SortDLinesCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 THALES GLOBAL SERVICES.
+ * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,16 +15,16 @@ import java.util.Comparator;
import org.eclipse.emf.common.util.ECollections;
import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.swt.SWT;
-
import org.eclipse.sirius.table.metamodel.table.DColumn;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.LineContainer;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
+import org.eclipse.swt.SWT;
/**
* A Command to sort {@link DLine}s order according to a {@link DColumn}.
- *
+ *
* @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
*/
public class SortDLinesCommand extends RecordingCommand {
@@ -35,7 +35,7 @@ public class SortDLinesCommand extends RecordingCommand {
/**
* Default constructor.
- *
+ *
* @param domain
* the {@link TransactionalEditingDomain} on which this command
* will be executed
@@ -47,7 +47,7 @@ public class SortDLinesCommand extends RecordingCommand {
* the {@link DColumn}
*/
public SortDLinesCommand(TransactionalEditingDomain domain, DTable dTable, DColumn dColumn, int sortDirection) {
- super(domain, (sortDirection == SWT.UP ? "Ascending " : "Descending ") + "lines sorting");
+ super(domain, sortDirection == SWT.UP ? Messages.SortDLinesCommand_ascendingSorting : Messages.SortDLinesCommand_descendingSorting);
this.dTable = dTable;
this.dLineSorter = new DLineSorter(dColumn, sortDirection);
}
@@ -60,7 +60,7 @@ public class SortDLinesCommand extends RecordingCommand {
/**
* Sort the lines of the lineContainer by the alphabetical order of the
* label of the cells of the column.
- *
+ *
* @param lineContainer
* The lineContainer (table or line)
* @param column
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java
index 84f8b45ae9..91fac6762d 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java
@@ -236,7 +236,7 @@ public abstract class AbstractDTableEditor extends AbstractDTreeEditor implement
if (getTableModel() == null) {
/* eclipse was closed with an editor opened and not saved */
final Label errorLabel = new Label(parent, SWT.CENTER);
- errorLabel.setText("This table was not saved. You can close the editor");
+ errorLabel.setText(org.eclipse.sirius.table.metamodel.table.provider.Messages.AbstractDTableEditor_tableNotSaved);
return;
}
treeViewerManager = new DTableViewerManager(parent, getTableModel(), getEditingDomain(), accessor, (ITableCommandFactory) emfCommandFactory, this);
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java
index 692be2d81b..724068ccbf 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/DTableMenuListener.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
@@ -44,6 +44,7 @@ import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.DTableElement;
import org.eclipse.sirius.table.metamodel.table.DTargetColumn;
import org.eclipse.sirius.table.metamodel.table.description.TableMapping;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.commands.EMFCommandFactoryUI;
import org.eclipse.sirius.table.ui.tools.internal.editor.action.AbstractLineAction;
import org.eclipse.sirius.table.ui.tools.internal.editor.action.AbstractTargetColumnAction;
@@ -263,7 +264,7 @@ public class DTableMenuListener implements IMenuListener {
*/
private void addOpenRepresentationMenu(final IMenuManager manager) {
// Create a new sub-menu manager
- final MenuManager openMenuManager = new MenuManager("Open", DTableMenuListener.MENU_OPEN_REPRESENTATION_ID);
+ final MenuManager openMenuManager = new MenuManager(Messages.DTableMenuListener_openMenuName, DTableMenuListener.MENU_OPEN_REPRESENTATION_ID);
// Create the item to add to the main manager
final SubContributionItem openMenuItem = new SubContributionItem(openMenuManager);
manager.add(openMenuItem);
@@ -293,7 +294,7 @@ public class DTableMenuListener implements IMenuListener {
*/
private void addNewRepresentationMenu(final IMenuManager manager) {
// Create a new sub-menu manager
- final MenuManager newMenuManager = new MenuManager("New", DTableMenuListener.MENU_NEW_REPRESENTATION_ID);
+ final MenuManager newMenuManager = new MenuManager(Messages.DTableMenuListener_newMenuName, DTableMenuListener.MENU_NEW_REPRESENTATION_ID);
// Create the item to add to the main manager
final SubContributionItem newMenuItem = new SubContributionItem(newMenuManager);
manager.add(newMenuItem);
@@ -429,7 +430,7 @@ public class DTableMenuListener implements IMenuListener {
private void addExportMenu(final IMenuManager manager) {
// Create a new sub-menu manager
- final MenuManager exportMenuManager = new MenuManager("Export", DTableMenuListener.MENU_EXPORT_ID);
+ final MenuManager exportMenuManager = new MenuManager(Messages.DTableMenuListener_exportMenuName, DTableMenuListener.MENU_EXPORT_ID);
// Create the item to add to the main manager
final SubContributionItem menuItem = new SubContributionItem(exportMenuManager);
menuItem.setVisible(true);
@@ -448,7 +449,7 @@ public class DTableMenuListener implements IMenuListener {
try {
handlerService.executeCommand("org.eclipse.sirius.table.ui.exportToCsv", null); //$NON-NLS-1$
} catch (final CommandException ex) {
- throw new RuntimeException("export to csv command not found");
+ throw new RuntimeException(Messages.DTableMenuListener_cvsExportException);
}
}
};
@@ -463,7 +464,7 @@ public class DTableMenuListener implements IMenuListener {
*/
private void addHideRevealMenu(final IMenuManager manager) {
// Create a new sub-menu manager
- final MenuManager hideRevealMenuManager = new MenuManager("Show/Hide", DTableMenuListener.MENU_HIDEREVEAL_ID);
+ final MenuManager hideRevealMenuManager = new MenuManager(Messages.DTableMenuListener_showHideMenuName, DTableMenuListener.MENU_HIDEREVEAL_ID);
// Create the item to add to the main manager
final SubContributionItem viewpointMenuItem = new SubContributionItem(hideRevealMenuManager);
viewpointMenuItem.setVisible(true);
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java
index c38c0c3110..eb685c30c4 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.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
@@ -17,6 +17,7 @@ import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.table.metamodel.table.DColumn;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.editor.provider.DTableEditorUtil;
import org.eclipse.sirius.table.ui.tools.internal.editor.utils.TreeColumnWidthQuery;
import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager;
@@ -107,7 +108,7 @@ public class RefreshAtOpeningActivator implements IPartListener {
private void refreshDTableModelFromTreeColumnWidth() {
if (DialectUIManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) {
- CompoundCommand refreshDTableAtOpeningCmd = new CompoundCommand("refresh table model at opening");
+ CompoundCommand refreshDTableAtOpeningCmd = new CompoundCommand(Messages.RefreshAtOpeningActivator_refreshTableCmdName);
TreeColumn[] treeColumns = tree.getColumns();
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/AbstractHideRevealAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/AbstractHideRevealAction.java
index d728589650..830cab460d 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/AbstractHideRevealAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/AbstractHideRevealAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
+import java.text.MessageFormat;
import java.util.Collection;
import java.util.List;
@@ -19,6 +20,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.window.Window;
import org.eclipse.sirius.table.metamodel.table.DTable;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.ui.dialogs.SelectionDialog;
@@ -26,7 +28,7 @@ import com.google.common.collect.Lists;
/**
* Common behaviors for hide/reveal actions. It opens a selection dialog.
- *
+ *
* @author dlecan
* @param <T>
* Current type. May be
@@ -37,7 +39,7 @@ public abstract class AbstractHideRevealAction<T extends EObject> extends Abstra
/**
* Creates a new action with the given image.
- *
+ *
* @param dTable
* {@link DTable} to use
* @param text
@@ -50,7 +52,8 @@ public abstract class AbstractHideRevealAction<T extends EObject> extends Abstra
* @param tableCommandFactory
* The EMF command factory
*/
- public AbstractHideRevealAction(final DTable dTable, final String text, final ImageDescriptor image, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
+ public AbstractHideRevealAction(final DTable dTable, final String text, final ImageDescriptor image, final TransactionalEditingDomain editingDomain,
+ final ITableCommandFactory tableCommandFactory) {
super(dTable, text, image, editingDomain, tableCommandFactory);
}
@@ -69,7 +72,7 @@ public abstract class AbstractHideRevealAction<T extends EObject> extends Abstra
// User wants to continue his action
if (Window.OK == dlg.getReturnCode() && dlg.getResult() != null) {
List<Object> newVisibles = Lists.newArrayList(dlg.getResult());
- CompoundCommand compoundCommand = new CompoundCommand("Set " + getSetVisibleMethodName() + " values");
+ CompoundCommand compoundCommand = new CompoundCommand(MessageFormat.format(Messages.Action_setValues, getSetVisibleMethodName()));
for (T element : getAllElements()) {
boolean visible = newVisibles.contains(element);
// XOR operator
@@ -88,49 +91,49 @@ public abstract class AbstractHideRevealAction<T extends EObject> extends Abstra
/**
* Get the method name of "setVisible" method.
- *
+ *
* @return The method name.
*/
protected abstract String getSetVisibleMethodName();
/**
* Get initial visible elements.
- *
+ *
* @return The initial visible elements.
*/
protected abstract Collection<T> getInitialVisibleElements();
/**
* Get dialog title name.
- *
+ *
* @return Elements name.
*/
protected abstract String getTitle();
/**
* Get dialog message.
- *
+ *
* @return Elements name.
*/
protected abstract String getMessage();
/**
* Get all current elements.
- *
+ *
* @return All current elements.
*/
protected abstract List<T> getAllElements();
/**
* Create selection dialog.
- *
+ *
* @return Selection dialog.
*/
protected abstract SelectionDialog createSelectionDialog();
/**
* Check if an element is visible.
- *
+ *
* @param element
* Element to check.
* @return <code>true</code> if element is visible, <code>false</code>
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteLinesAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteLinesAction.java
index d34dd70d35..ba41472df4 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteLinesAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteLinesAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.sirius.business.api.query.IdentifiedElementQuery;
import org.eclipse.sirius.table.business.api.query.DLineQuery;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.description.DeleteTool;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
@@ -31,14 +32,6 @@ import com.google.common.collect.Lists;
*/
public class DeleteLinesAction extends Action {
- private static final String DELETE_LINE = "Delete line";
-
- private static final String DELETE_LINES = DELETE_LINE + "s";
-
- private static final String TOOLTIP_LINE = "Delete the target semantic element";
-
- private static final String TOOLTIP_LINES = TOOLTIP_LINE + "s";
-
private final TransactionalEditingDomain editingDomain;
private final ITableCommandFactory tableCommandFactory;
@@ -57,7 +50,7 @@ public class DeleteLinesAction extends Action {
*
*/
public DeleteLinesAction(final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
- super(DELETE_LINE, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.DELETE_IMG));
+ super(Messages.DeleteLinesAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.DELETE_IMG));
this.editingDomain = editingDomain;
this.tableCommandFactory = tableCommandFactory;
}
@@ -89,8 +82,8 @@ public class DeleteLinesAction extends Action {
lines.addAll(linesToDelete);
if (linesToDelete.size() == 1) {
- setText(DELETE_LINE);
- setToolTipText(TOOLTIP_LINE);
+ setText(Messages.DeleteLinesAction_label);
+ setToolTipText(Messages.DeleteLinesAction_tooltip);
DeleteTool deleteTool = getDeleteTool(linesToDelete.iterator().next());
if (deleteTool != null) {
@@ -98,8 +91,8 @@ public class DeleteLinesAction extends Action {
setToolTipText(deleteTool.getDocumentation());
}
} else if (linesToDelete.size() > 1) {
- setText(DELETE_LINES);
- setToolTipText(TOOLTIP_LINES);
+ setText(Messages.DeleteLinesAction_labelMany);
+ setToolTipText(Messages.DeleteLinesAction_tooltipMany);
}
}
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteTargetColumnAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteTargetColumnAction.java
index 08b1cbb550..dc47b6b048 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteTargetColumnAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/DeleteTargetColumnAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@ import org.eclipse.sirius.table.business.api.helper.TableHelper;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.description.DeleteTool;
import org.eclipse.sirius.table.metamodel.table.description.TableTool;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
import org.eclipse.sirius.tools.api.interpreter.InterpreterUtil;
@@ -30,17 +31,15 @@ import org.eclipse.sirius.viewpoint.description.tool.ToolPackage;
/**
* This action delete the TargetColumn (the corresponding semantic element).<BR>
- *
+ *
* @author lredor
*/
public class DeleteTargetColumnAction extends AbstractTargetColumnAction {
- private static final String DEFAULT_NAME = "Delete column";
-
/**
* Constructor. The deleteTool can be null if there is nothing specific to
* do.
- *
+ *
* @param deleteTool
* The tool to do some other actions
* @param editingDomain
@@ -49,8 +48,8 @@ public class DeleteTargetColumnAction extends AbstractTargetColumnAction {
* The EMF command factory
*/
public DeleteTargetColumnAction(final DeleteTool deleteTool, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
- super(DEFAULT_NAME, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.DELETE_IMG), editingDomain, tableCommandFactory, deleteTool);
- setToolTipText("Delete the target semantic element");
+ super(Messages.DeleteTargetColumnAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.DELETE_IMG), editingDomain, tableCommandFactory, deleteTool);
+ setToolTipText(Messages.DeleteTargetColumnAction_tooltip);
if (getDeleteTool() != null) {
setText(new IdentifiedElementQuery(getDeleteTool()).getLabel());
setToolTipText(getDeleteTool().getDocumentation());
@@ -94,7 +93,7 @@ public class DeleteTargetColumnAction extends AbstractTargetColumnAction {
/**
* The tool of this action or null if there is no specific delete action.
- *
+ *
* @return The tool of this action or null if there is no specific delete
* action
*/
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateLineMenuAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateLineMenuAction.java
index 5579cca494..d2aace6537 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateLineMenuAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateLineMenuAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,27 +12,28 @@ package org.eclipse.sirius.table.ui.tools.internal.editor.action;
import java.util.List;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
+import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
+
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
-import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
-
/**
* This implementation is used to create the structure viewer's "Create Line"
* action.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class EditorCreateLineMenuAction extends AbstractEditorCreateMenuAction<CreateLineAction> {
/** The Id of this action. */
- public static final String ID = "CreateLineMenu";
+ public static final String ID = "CreateLineMenu"; //$NON-NLS-1$
/**
* This default constructor will instantiate an action given the
* {@link #BUNDLE bundle} resources prefixed by &quot;action.save&quot;.
*/
public EditorCreateLineMenuAction() {
- super("Create root lines", DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.CREATE_LINE));
+ super(Messages.EditorCreateLineMenuAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.CREATE_LINE));
setId(ID);
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateTargetColumnMenuAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateTargetColumnMenuAction.java
index 1a01f9f5c7..57360379e9 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateTargetColumnMenuAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorCreateTargetColumnMenuAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,15 +12,16 @@ package org.eclipse.sirius.table.ui.tools.internal.editor.action;
import java.util.List;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
+import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
+
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
-import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
-
/**
* This implementation is used to create the structure viewer's "Create Line"
* action.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class EditorCreateTargetColumnMenuAction extends AbstractEditorCreateMenuAction<CreateTargetColumnAction> {
@@ -32,7 +33,7 @@ public class EditorCreateTargetColumnMenuAction extends AbstractEditorCreateMenu
* {@link #BUNDLE bundle} resources prefixed by &quot;action.save&quot;.
*/
public EditorCreateTargetColumnMenuAction() {
- super("Create root columns", DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.CREATE_COLUMN));
+ super(Messages.EditorCreateTargetColumnMenuAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.CREATE_COLUMN));
setId(ID);
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorRefreshAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorRefreshAction.java
index 836692688f..4c04eead7a 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorRefreshAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/EditorRefreshAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,18 +18,19 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorActionDelegate;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.editor.AbstractDTableEditor;
import org.eclipse.sirius.ui.business.api.action.RefreshActionListenerRegistry;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
/**
* This action refresh the content of the table.
- *
+ *
* @author lredor
*/
public class EditorRefreshAction implements IEditorActionDelegate {
@@ -41,22 +42,25 @@ public class EditorRefreshAction implements IEditorActionDelegate {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction,
* org.eclipse.ui.IEditorPart)
*/
+ @Override
public void setActiveEditor(final IAction action, final IEditorPart targetEditor) {
setActiveWorkbenchPart(targetEditor);
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(final IAction action) {
if (workbenchPart instanceof AbstractDTableEditor) {
final IRunnableWithProgress op = new IRunnableWithProgress() {
+ @Override
public void run(final IProgressMonitor monitor) {
final AbstractDTableEditor tableEditor = (AbstractDTableEditor) workbenchPart;
tableEditor.enablePropertiesUpdate(false);
@@ -70,26 +74,27 @@ public class EditorRefreshAction implements IEditorActionDelegate {
try {
monitorDialog.run(false, false, op);
} catch (final InvocationTargetException e) {
- MessageDialog.openError(activeShell, "Error", e.getTargetException().getMessage());
- SiriusPlugin.getDefault().error("Error while refreshing table", e);
+ MessageDialog.openError(activeShell, Messages.Action_error, e.getTargetException().getMessage());
+ SiriusPlugin.getDefault().error(Messages.RefreshAction_errorDuringRefresh, e);
} catch (final InterruptedException e) {
- MessageDialog.openInformation(activeShell, "Cancelled", e.getMessage());
+ MessageDialog.openInformation(activeShell, Messages.Action_cancelled, e.getMessage());
}
}
}
/**
* {@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 selection) {
}
/**
* Set the workbench part.
- *
+ *
* @param aWorkbenchPart
* the new workbench part
*/
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideColumnAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideColumnAction.java
index 19fd993695..b34fb06dc3 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideColumnAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideColumnAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,18 +10,21 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
+import java.text.MessageFormat;
+
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandWrapper;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.table.metamodel.table.DColumn;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
/**
* Hide the column.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class HideColumnAction extends AbstractTransactionalTableAction {
@@ -31,7 +34,7 @@ public class HideColumnAction extends AbstractTransactionalTableAction {
/**
* Creates a new action.
- *
+ *
* @param dTable
* {@link DTable} to use
* @param editingDomain
@@ -40,12 +43,12 @@ public class HideColumnAction extends AbstractTransactionalTableAction {
* The EMF command factory
*/
public HideColumnAction(final DTable dTable, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
- super(dTable, "Hide column", DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_IMG), editingDomain, tableCommandFactory);
+ super(dTable, Messages.HideColumnAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_IMG), editingDomain, tableCommandFactory);
}
/**
* Set the column on which the tool of this action applied.
- *
+ *
* @param column
* the column to set
*/
@@ -56,7 +59,7 @@ public class HideColumnAction extends AbstractTransactionalTableAction {
@Override
public void run() {
super.run();
- String label = "Set " + TablePackage.eINSTANCE.getDColumn_Visible().getName() + " value";
+ String label = MessageFormat.format(Messages.Action_setValue, TablePackage.eINSTANCE.getDColumn_Visible().getName());
Command cmd = getTableCommandFactory().buildSetValue(column, TablePackage.eINSTANCE.getDColumn_Visible().getName(), false);
cmd = new CommandWrapper(label, label, cmd);
getEditingDomain().getCommandStack().execute(cmd);
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideLinesAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideLinesAction.java
index 29f32e0367..42bb691bb6 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideLinesAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideLinesAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
+import java.text.MessageFormat;
import java.util.Collection;
import org.eclipse.emf.common.command.CompoundCommand;
@@ -18,6 +19,7 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
@@ -25,15 +27,11 @@ import com.google.common.collect.Lists;
/**
* Hide the line.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class HideLinesAction extends AbstractTransactionalTableAction {
- private static final String HIDE_LINE = "Hide line";
-
- private static final String HIDE_LINES = "Hide lines";
-
/**
* The line concerned with this action
*/
@@ -41,7 +39,7 @@ public class HideLinesAction extends AbstractTransactionalTableAction {
/**
* Creates a new action.
- *
+ *
* @param dTable
* {@link DTable} to use
* @param editingDomain
@@ -50,13 +48,13 @@ public class HideLinesAction extends AbstractTransactionalTableAction {
* The EMF command factory
*/
public HideLinesAction(final DTable dTable, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
- super(dTable, HIDE_LINE, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_IMG), editingDomain, tableCommandFactory);
+ super(dTable, Messages.HideLinesAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_IMG), editingDomain, tableCommandFactory);
this.lines = Lists.newArrayList();
}
/**
* Set the line on which the tool of this action applied.
- *
+ *
* @param linesToHide
* the line to set.
*/
@@ -67,13 +65,13 @@ public class HideLinesAction extends AbstractTransactionalTableAction {
}
setEnabled(!this.lines.isEmpty());
- setText(this.lines.size() <= 1 ? HIDE_LINE : HIDE_LINES);
+ setText(this.lines.size() <= 1 ? Messages.HideLinesAction_label : Messages.HideLinesAction_labelMany);
}
@Override
public void run() {
super.run();
- String commandLabel = "Set " + TablePackage.eINSTANCE.getDLine_Visible().getName() + " value";
+ String commandLabel = MessageFormat.format(Messages.Action_setValue, TablePackage.eINSTANCE.getDLine_Visible().getName());
String name = TablePackage.eINSTANCE.getDLine_Visible().getName();
CompoundCommand compoundCommand = new CompoundCommand(commandLabel);
for (EObject instance : lines) {
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealColumnsAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealColumnsAction.java
index 8832942091..f3a75c0cfd 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealColumnsAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealColumnsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,12 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.sirius.table.metamodel.table.DColumn;
+import org.eclipse.sirius.table.metamodel.table.DTable;
+import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
+import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
+import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ListSelectionDialog;
import org.eclipse.ui.dialogs.SelectionDialog;
@@ -26,25 +32,13 @@ import org.eclipse.ui.dialogs.SelectionDialog;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
-import org.eclipse.sirius.table.metamodel.table.DColumn;
-import org.eclipse.sirius.table.metamodel.table.DTable;
-import org.eclipse.sirius.table.metamodel.table.TablePackage;
-import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
-import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
-
/**
* Hide/reveal columns action.
- *
+ *
* @author dlecan
*/
public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
- private static final String ACTION_LABEL = "Hide/Show columns...";
-
- private static final String DIALOG_TITLE = "Hide/Show table columns";
-
- private static final String DIALOG_MESSAGE = "Uncheck columns to hide them:";
-
/**
* @author dlecan
*/
@@ -71,6 +65,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
/**
* {inheritDoc}
*/
+ @Override
public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
// Nothing
}
@@ -78,6 +73,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
/**
* {inheritDoc}
*/
+ @Override
public void dispose() {
// nothing
}
@@ -85,6 +81,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
/**
* {inheritDoc}
*/
+ @Override
@SuppressWarnings("unchecked")
public Object[] getElements(final Object inputElement) {
Object[] result = null;
@@ -100,7 +97,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
/**
* Constructor.
- *
+ *
* @param dTable
* {@link DTable} to use
* @param editingDomain
@@ -109,7 +106,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
* table command factory.
*/
public HideRevealColumnsAction(final DTable dTable, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
- super(dTable, ACTION_LABEL, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_REVEAL_IMG), editingDomain, tableCommandFactory);
+ super(dTable, Messages.HideRevealColumnsAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_REVEAL_IMG), editingDomain, tableCommandFactory);
}
private ILabelProvider getLabelProvider() {
@@ -127,6 +124,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
protected Collection<DColumn> getInitialVisibleElements() {
return Collections2.filter(getAllElements(), new Predicate<DColumn>() {
+ @Override
public boolean apply(final DColumn input) {
return input.isVisible();
}
@@ -162,7 +160,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
*/
@Override
protected String getMessage() {
- return DIALOG_MESSAGE;
+ return Messages.HideRevealColumnsAction_dialogMsg;
}
/**
@@ -170,7 +168,7 @@ public class HideRevealColumnsAction extends AbstractHideRevealAction<DColumn> {
*/
@Override
protected String getTitle() {
- return DIALOG_TITLE;
+ return Messages.HideRevealColumnsAction_dialogTitle;
}
/**
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealLinesAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealLinesAction.java
index d1f11f3536..b4548b0f8e 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealLinesAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/HideRevealLinesAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,13 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.sirius.table.metamodel.table.DLine;
+import org.eclipse.sirius.table.metamodel.table.DTable;
+import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
+import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
+import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
+import org.eclipse.sirius.table.ui.tools.internal.editor.provider.DTableLineLabelProvider;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
import org.eclipse.ui.dialogs.SelectionDialog;
@@ -28,26 +35,13 @@ import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
-import org.eclipse.sirius.table.metamodel.table.DLine;
-import org.eclipse.sirius.table.metamodel.table.DTable;
-import org.eclipse.sirius.table.metamodel.table.TablePackage;
-import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
-import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
-import org.eclipse.sirius.table.ui.tools.internal.editor.provider.DTableLineLabelProvider;
-
/**
* Hide/reveal lines action. It opens a selection dialog.
- *
+ *
* @author dlecan
*/
public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
- private static final String DIALOG_TITLE = "Hide/Show table lines";
-
- private static final String DIALOG_MESSAGE = "Uncheck lines to hide them:";
-
- private static final String ACTION_LABEL = "Hide/Show lines...";
-
private final TreeViewer treeViewer;
/**
@@ -58,6 +52,7 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
/**
* {inheritDoc}
*/
+ @Override
@SuppressWarnings("unchecked")
public Object[] getElements(final Object inputElement) {
if (inputElement instanceof EList<?>) {
@@ -70,6 +65,7 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
/**
* {inheritDoc}
*/
+ @Override
public void dispose() {
// Nothing
}
@@ -77,15 +73,17 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
/**
* {inheritDoc}
*/
+ @Override
public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput) {
// Nothing
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(final Object parentElement) {
Object[] result = null;
if (parentElement instanceof DLine) {
@@ -97,9 +95,10 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(final Object element) {
if (element instanceof DLine) {
final DLine line = (DLine) element;
@@ -110,9 +109,10 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(final Object element) {
final Object[] children = getChildren(element);
return children != null && children.length > 0;
@@ -121,7 +121,7 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
/**
* Constructor.
- *
+ *
* @param dTable
* {@link DTable} to use
* @param editingDomain
@@ -132,7 +132,7 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
* Tree viewer of the current table.
*/
public HideRevealLinesAction(final DTable dTable, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory, final TreeViewer treeViewer) {
- super(dTable, ACTION_LABEL, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_REVEAL_IMG), editingDomain, tableCommandFactory);
+ super(dTable, Messages.HideRevealLinesAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.HIDE_REVEAL_IMG), editingDomain, tableCommandFactory);
this.treeViewer = treeViewer;
}
@@ -176,6 +176,7 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
protected Collection<DLine> getInitialVisibleElements() {
return Collections2.filter(getAllElements(), new Predicate<DLine>() {
+ @Override
public boolean apply(final DLine input) {
return input.isVisible();
}
@@ -189,12 +190,12 @@ public class HideRevealLinesAction extends AbstractHideRevealAction<DLine> {
@Override
protected String getMessage() {
- return DIALOG_MESSAGE;
+ return Messages.HideRevealLinesAction_dialogMsg;
}
@Override
protected String getTitle() {
- return DIALOG_TITLE;
+ return Messages.HideRevealLinesAction_dialogTitle;
}
@Override
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/PrintAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/PrintAction.java
index 3b13a8a862..a7edaa61d3 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/PrintAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/PrintAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 THALES GLOBAL SERVICES.
+ * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,13 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
+import java.text.MessageFormat;
+
import org.eclipse.jface.action.Action;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
+import org.eclipse.sirius.table.ui.tools.internal.editor.AbstractDTableEditor;
+import org.eclipse.sirius.table.ui.tools.internal.editor.print.PaperClipsPrintHelper;
+import org.eclipse.sirius.table.ui.tools.internal.editor.print.PrintHelper;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.printing.PrintDialog;
@@ -21,10 +27,6 @@ import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
-import org.eclipse.sirius.table.ui.tools.internal.editor.AbstractDTableEditor;
-import org.eclipse.sirius.table.ui.tools.internal.editor.print.PaperClipsPrintHelper;
-import org.eclipse.sirius.table.ui.tools.internal.editor.print.PrintHelper;
-
/**
* An action to print tables.
*
@@ -53,7 +55,7 @@ public class PrintAction extends Action {
if (controlToPrint != null) {
final Display display = controlToPrint.getDisplay();
final Shell shell = display.getActiveShell();
- final String tableName = editorPart.getTitle() != null ? editorPart.getTitle() : "table without name";
+ final String tableName = editorPart.getTitle() != null ? editorPart.getTitle() : Messages.PrintAction_tableWithoutName;
try {
final PrinterData data = openPrintDialog(shell);
if (data == null) {
@@ -62,7 +64,7 @@ public class PrintAction extends Action {
launchPrintWithPaperclip(data, tableName);
} catch (final SWTError e) {
final MessageBox box = new MessageBox(shell, SWT.ICON_ERROR);
- box.setMessage("An error occurs during printing : " + e.getMessage());
+ box.setMessage(MessageFormat.format(Messages.PrintAction_errorDuringPrinting, e.getMessage()));
box.open();
}
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/RefreshAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/RefreshAction.java
index 1bc4e7bc4d..bb4ac90a94 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/RefreshAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/RefreshAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,6 +21,7 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.editor.AbstractDTableEditor;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
import org.eclipse.sirius.ui.business.api.action.RefreshActionListenerRegistry;
@@ -34,23 +35,21 @@ import org.eclipse.ui.PlatformUI;
/**
* This action refresh the content of the table.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class RefreshAction extends Action implements IObjectActionDelegate {
- private static final String DEFAULT_NAME = "Refresh table";
-
private AbstractDTableEditor tableEditor;
/**
* Default constructor.
- *
+ *
* @param tableEditor
* the table editor
*/
public RefreshAction(final AbstractDTableEditor tableEditor) {
- super(DEFAULT_NAME, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.REFRESH_IMG));
+ super(Messages.RefreshAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.REFRESH_IMG));
this.tableEditor = tableEditor;
}
@@ -62,6 +61,7 @@ public class RefreshAction extends Action implements IObjectActionDelegate {
if (activeEditor instanceof AbstractDTableEditor) {
tableEditor = (AbstractDTableEditor) activeEditor;
final IRunnableWithProgress op = new IRunnableWithProgress() {
+ @Override
public void run(final IProgressMonitor monitor) {
TransactionalEditingDomain domain = tableEditor.getEditingDomain();
domain.getCommandStack().execute(new RefreshRepresentationsCommand(domain, monitor, tableEditor.getTableModel()));
@@ -74,10 +74,10 @@ public class RefreshAction extends Action implements IObjectActionDelegate {
RefreshActionListenerRegistry.INSTANCE.notifyRepresentationIsAboutToBeRefreshed(tableEditor.getTableModel());
monitorDialog.run(true, false, op);
} catch (final InvocationTargetException e) {
- MessageDialog.openError(activeShell, "Error", e.getTargetException().getMessage());
- SiriusPlugin.getDefault().error("Error while refreshing table", e);
+ MessageDialog.openError(activeShell, Messages.Action_error, e.getTargetException().getMessage());
+ SiriusPlugin.getDefault().error(Messages.RefreshAction_errorDuringRefresh, e);
} catch (final InterruptedException e) {
- MessageDialog.openInformation(activeShell, "Cancelled", e.getMessage());
+ MessageDialog.openInformation(activeShell, Messages.Action_cancelled, e.getMessage());
} finally {
tableEditor.enablePropertiesUpdate(true);
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllColumnsAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllColumnsAction.java
index e04bc19a57..9b6ce3156b 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllColumnsAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllColumnsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,25 +10,28 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
+import java.text.MessageFormat;
+
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
/**
* Action to show all the columns of the tables.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class ShowAllColumnsAction extends AbstractTransactionalTableAction {
/**
* Creates a new action.
- *
+ *
* @param dTable
* {@link DTable} to use
* @param editingDomain
@@ -37,13 +40,13 @@ public class ShowAllColumnsAction extends AbstractTransactionalTableAction {
* The EMF command factory
*/
public ShowAllColumnsAction(final DTable dTable, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
- super(dTable, "Show hidden columns", DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.REVEAL_IMG), editingDomain, tableCommandFactory);
+ super(dTable, Messages.ShowAllColumnsAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.REVEAL_IMG), editingDomain, tableCommandFactory);
}
@Override
public void run() {
super.run();
- String commandLabel = "Set " + TablePackage.eINSTANCE.getDColumn_Visible().getName() + " values";
+ String commandLabel = MessageFormat.format(Messages.Action_setValues, TablePackage.eINSTANCE.getDColumn_Visible().getName());
String name = TablePackage.eINSTANCE.getDColumn_Visible().getName();
CompoundCommand compoundCommand = new CompoundCommand(commandLabel);
for (EObject instance : getTable().getColumns()) {
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllLinesAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllLinesAction.java
index 00970298a0..81c74f8bd0 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllLinesAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowAllLinesAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
+import java.text.MessageFormat;
+
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
@@ -17,19 +19,20 @@ import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.LineContainer;
import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
/**
* Action to show all the lines of the tables.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class ShowAllLinesAction extends AbstractTransactionalTableAction {
/**
* Creates a new action.
- *
+ *
* @param dTable
* {@link DTable} to use
* @param editingDomain
@@ -38,13 +41,13 @@ public class ShowAllLinesAction extends AbstractTransactionalTableAction {
* The EMF command factory
*/
public ShowAllLinesAction(final DTable dTable, final TransactionalEditingDomain editingDomain, final ITableCommandFactory tableCommandFactory) {
- super(dTable, "Show hidden lines", DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.REVEAL_IMG), editingDomain, tableCommandFactory);
+ super(dTable, Messages.ShowAllLinesAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.REVEAL_IMG), editingDomain, tableCommandFactory);
}
@Override
public void run() {
super.run();
- CompoundCommand compoundCommand = new CompoundCommand("Set " + TablePackage.eINSTANCE.getDLine_Visible().getName() + " values");
+ CompoundCommand compoundCommand = new CompoundCommand(MessageFormat.format(Messages.Action_setValues, TablePackage.eINSTANCE.getDLine_Visible().getName()));
showLines(compoundCommand);
getEditingDomain().getCommandStack().execute(compoundCommand);
}
@@ -58,9 +61,9 @@ public class ShowAllLinesAction extends AbstractTransactionalTableAction {
/**
* Show all the lines of this line container.
- *
+ *
* @param compoundCommand
- *
+ *
* @param lineContainer
* The line container
*/
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowPropertiesViewAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowPropertiesViewAction.java
index 47f2c8ddd3..9f24b5b639 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowPropertiesViewAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/ShowPropertiesViewAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,38 +11,37 @@
package org.eclipse.sirius.table.ui.tools.internal.editor.action;
import org.eclipse.jface.action.Action;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
/**
* This action shows the Eclipse properties View.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class ShowPropertiesViewAction extends Action {
- private static final String DEFAULT_NAME = "Show Properties View";
-
/**
* Default constructor.
- *
+ *
*/
public ShowPropertiesViewAction() {
- super(DEFAULT_NAME, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.SHOW_PROPERTIES_VIEW));
+ super(Messages.ShowPropertiesViewAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.SHOW_PROPERTIES_VIEW));
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.views.PropertySheet");
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$
} catch (final PartInitException e) {
- SiriusPlugin.getDefault().error("Error while showing the Property View.", e);
+ SiriusPlugin.getDefault().error(Messages.ShowPropertiesViewAction_error, e);
}
}
}
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortColumnsByLineAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortColumnsByLineAction.java
index 5badae71df..9779e27cf1 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortColumnsByLineAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortColumnsByLineAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,22 +13,21 @@ package org.eclipse.sirius.table.ui.tools.internal.editor.action;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.action.Action;
-import org.eclipse.swt.SWT;
import org.eclipse.sirius.table.business.api.helper.TableHelper;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.description.CrossTableDescription;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.commands.SortDColumnsCommand;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
+import org.eclipse.swt.SWT;
/**
* Action to sort columns by line. This action is only for CrossTable.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class SortColumnsByLineAction extends Action {
- private static final String DEFAULT_NAME = "Sort by";
-
/**
* The last Line use to sort
*/
@@ -51,18 +50,18 @@ public class SortColumnsByLineAction extends Action {
/**
* Constructor.
- *
+ *
* @param domain
* The transactional editing domain
*/
public SortColumnsByLineAction(final TransactionalEditingDomain domain) {
- super(DEFAULT_NAME, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.SORT_BY_LINE));
+ super(Messages.SortColumnsByLineAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.SORT_BY_LINE));
this.domain = domain;
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.action.Action#run()
*/
@Override
@@ -84,7 +83,7 @@ public class SortColumnsByLineAction extends Action {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.action.Action#isEnabled()
*/
@Override
@@ -94,7 +93,7 @@ public class SortColumnsByLineAction extends Action {
/**
* Set the line on which this action applied.
- *
+ *
* @param line
* the line to set
*/
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortLinesByColumnAction.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortLinesByColumnAction.java
index 296511a6a4..2993bd1e9f 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortLinesByColumnAction.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/action/SortLinesByColumnAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2009 THALES GLOBAL SERVICES.
+ * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,22 +13,21 @@ package org.eclipse.sirius.table.ui.tools.internal.editor.action;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.jface.action.Action;
-import org.eclipse.swt.SWT;
import org.eclipse.sirius.table.business.api.helper.TableHelper;
import org.eclipse.sirius.table.metamodel.table.DColumn;
import org.eclipse.sirius.table.metamodel.table.DTable;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.commands.SortDLinesCommand;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
+import org.eclipse.swt.SWT;
/**
* Action to sort lines by column.
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class SortLinesByColumnAction extends Action {
- private static final String DEFAULT_NAME = "Sort by";
-
/**
* The last column use to sort
*/
@@ -53,18 +52,18 @@ public class SortLinesByColumnAction extends Action {
/**
* Default constructor.
- *
+ *
* @param domain
* The transactional editing domain
*/
public SortLinesByColumnAction(final TransactionalEditingDomain domain) {
- super(DEFAULT_NAME, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.SORT_BY_COLUMN));
+ super(Messages.SortLinesByColumnAction_label, DTableViewerManager.getImageRegistry().getDescriptor(DTableViewerManager.SORT_BY_COLUMN));
this.domain = domain;
}
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.action.Action#run()
*/
@Override
@@ -83,7 +82,7 @@ public class SortLinesByColumnAction extends Action {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.action.Action#isEnabled()
*/
@Override
@@ -93,7 +92,7 @@ public class SortLinesByColumnAction extends Action {
/**
* Set the column on which this action applied.
- *
+ *
* @param column
* the column to set
*/
@@ -106,7 +105,7 @@ public class SortLinesByColumnAction extends Action {
/**
* Set the table on which this action applied.
- *
+ *
* @param table
* the table to set
*/
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/listeners/DTableViewerListener.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/listeners/DTableViewerListener.java
index 207965c9a3..626cfb61d5 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/listeners/DTableViewerListener.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/listeners/DTableViewerListener.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 THALES GLOBAL SERVICES.
+ * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.listeners;
+import java.text.MessageFormat;
+
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.command.CompoundCommand;
@@ -24,6 +26,7 @@ import org.eclipse.sirius.table.metamodel.table.DColumn;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.DTable;
import org.eclipse.sirius.table.metamodel.table.TablePackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableViewerManager;
import org.eclipse.sirius.table.ui.tools.internal.editor.provider.DTableEditorUtil;
import org.eclipse.sirius.table.ui.tools.internal.editor.utils.TreeColumnWidthQuery;
@@ -36,7 +39,7 @@ import org.eclipse.swt.widgets.TreeColumn;
* A {@link ITreeViewerListener} and {@link ControlListener} to update the
* DTable model when a SWT TreeItem is collapsed/expanded and
* {@link TreeColumn#getWidth()} change.
- *
+ *
* @author <a href="mailto:esteban.dugueperoux@obeo.fr">Esteban Dugueperoux</a>
*/
public class DTableViewerListener implements ITreeViewerListener, ControlListener {
@@ -51,7 +54,7 @@ public class DTableViewerListener implements ITreeViewerListener, ControlListene
/**
* Default constructor.
- *
+ *
* @param dTableViewerManager
* the table viewer manager.
* @param modelAccessor
@@ -72,7 +75,7 @@ public class DTableViewerListener implements ITreeViewerListener, ControlListene
DLine dLine = (DLine) event.getElement();
if (dLine.isCollapsed()) {
CommandStack commandStack = domain.getCommandStack();
- CompoundCommand cmd = new CompoundCommand("Expand " + dLine.getName() + " line");
+ CompoundCommand cmd = new CompoundCommand(MessageFormat.format(Messages.DTableViewerListener_expandLine, dLine.getName()));
Command expandDLineCmd = SetCommand.create(domain, dLine, TablePackage.Literals.DLINE__COLLAPSED, false);
cmd.append(expandDLineCmd);
commandStack.execute(cmd);
@@ -86,7 +89,7 @@ public class DTableViewerListener implements ITreeViewerListener, ControlListene
DLine dLine = (DLine) event.getElement();
if (!dLine.isCollapsed()) {
CommandStack commandStack = domain.getCommandStack();
- CompoundCommand cmd = new CompoundCommand("Collapse " + dLine.getName() + " line");
+ CompoundCommand cmd = new CompoundCommand(MessageFormat.format(Messages.DTableViewerListener_collapseLine, dLine.getName()));
Command collapseDLineCmd = SetCommand.create(domain, dLine, TablePackage.Literals.DLINE__COLLAPSED, true);
cmd.append(collapseDLineCmd);
commandStack.execute(cmd);
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/print/PrintAsImageCallback.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/print/PrintAsImageCallback.java
index 3187c4bc70..e3c2dbf0d6 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/print/PrintAsImageCallback.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/print/PrintAsImageCallback.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,12 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.print;
+import java.text.MessageFormat;
+
import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
+import org.eclipse.sirius.ui.tools.api.color.VisualBindingManager;
+import org.eclipse.sirius.viewpoint.description.SystemColors;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -19,12 +24,10 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.sirius.ui.tools.api.color.VisualBindingManager;
-import org.eclipse.sirius.viewpoint.description.SystemColors;
/**
* Callback to print a given displayed control as an image.
- *
+ *
* @author mchauvin
*/
public class PrintAsImageCallback implements PrintCallback {
@@ -57,7 +60,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Create a new callback to print a control as an image.
- *
+ *
* @param pageSetup
* the page setup
* @param control
@@ -72,15 +75,16 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Take a snapshot of a given control into an image. The returned image
* should be disposed.
- *
+ *
* @param control
* the control
* @return the created snapshot image.
- *
+ *
*/
private Image takeSnapshot(final Control control) {
/* necessary to avoid blank shadow, but does not work all the time */
display.syncExec(new Runnable() {
+ @Override
public void run() {
synchronizationWithUIThread();
control.redraw();
@@ -95,6 +99,7 @@ public class PrintAsImageCallback implements PrintCallback {
});
RunnableWithResult<Image> runnable = new RunnableWithResult.Impl<Image>() {
+ @Override
public void run() {
Point size = control.getSize();
Image snap = new Image(display, size.x, size.y);
@@ -110,9 +115,10 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.viewpoint.table.ui.tools.internal.editor.print.SWTPrintHelper.PrintCallback#setParameters(org.eclipse.sirius.viewpoint.table.ui.tools.internal.editor.print.SWTPrintHelper.PrintJobParameters)
*/
+ @Override
public void setParameters(final PrintJobParameters parameters) {
this.printParameters = parameters;
this.imageData = imageToPrint.getImageData();
@@ -153,9 +159,10 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.viewpoint.table.ui.tools.internal.editor.print.SWTPrintHelper.PrintCallback#numberOfPages()
*/
+ @Override
public int numberOfPages() {
/* return the entire division +1 */
return (imageData.height / maxPageHeight) + 1;
@@ -163,7 +170,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Compute the maximum height possible for a page.
- *
+ *
* @return the maximum height possible
*/
private void computeMaxPageHeightAndMargin() {
@@ -179,7 +186,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Compute the maximum width possible for a page.
- *
+ *
* @return the maximum width possible
*/
private void computeMaxPageWidth() {
@@ -199,9 +206,10 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.sirius.viewpoint.table.ui.tools.internal.editor.print.SWTPrintHelper.PrintCallback#printPage(int)
*/
+ @Override
public void printPage(final int page) {
final ImageHeightBoundsForPage bounds = this.heightBounds[page];
@@ -210,6 +218,7 @@ public class PrintAsImageCallback implements PrintCallback {
final int destHeight = bounds.getSize();
display.syncExec(new Runnable() {
+ @Override
public void run() {
/* Get the ImageData and create a new printer Image from it */
final Image printImage = new Image(printParameters.getPrinter(), imageData);
@@ -233,7 +242,7 @@ public class PrintAsImageCallback implements PrintCallback {
final Rectangle trim = printParameters.getTrim();
gc.drawLine(-trim.x, maxPageHeight + headerMargin + 1, maxPageWidth, maxPageHeight + headerMargin + 1);
- gc.drawText("page " + page + "/" + numberOfPages(), -trim.x, maxPageHeight + headerMargin + 5); //$NON-NLS-2$
+ gc.drawText(MessageFormat.format(Messages.PrintAsImageCallback_pageFooter, page, numberOfPages()), -trim.x, maxPageHeight + headerMargin + 5); // $NON-NLS-2$
}
});
@@ -249,7 +258,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Store height bounds of an image for a page.
- *
+ *
* @author mchauvin
*/
private static class ImageHeightBoundsForPage {
@@ -262,7 +271,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Create a new instance.
- *
+ *
* @param src
* the source
* @param dest
@@ -276,7 +285,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Get the source coordinate.
- *
+ *
* @return the source coordinate
*/
public int getScr() {
@@ -285,7 +294,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Get the destination coordinate.
- *
+ *
* @return the destination coordinate
*/
public int getDest() {
@@ -294,7 +303,7 @@ public class PrintAsImageCallback implements PrintCallback {
/**
* Get the size.
- *
+ *
* @return the size the size
*/
public int getSize() {
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/provider/DFeatureColumnEditingSupport.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/provider/DFeatureColumnEditingSupport.java
index 175dc47566..fd02288844 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/provider/DFeatureColumnEditingSupport.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/provider/DFeatureColumnEditingSupport.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.table.ui.tools.internal.editor.provider;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -60,6 +61,7 @@ import org.eclipse.sirius.table.metamodel.table.DFeatureColumn;
import org.eclipse.sirius.table.metamodel.table.DLine;
import org.eclipse.sirius.table.metamodel.table.TablePackage;
import org.eclipse.sirius.table.metamodel.table.description.DescriptionPackage;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.tools.api.command.ITableCommandFactory;
import org.eclipse.sirius.table.ui.tools.internal.editor.AbstractDTableEditor;
import org.eclipse.sirius.table.ui.tools.internal.editor.DTableTreeViewer;
@@ -75,7 +77,7 @@ import org.eclipse.swt.widgets.Tree;
/**
* Support for the cells editing of a Edition DTable (with
* {@link org.eclipse.sirius.table.metamodel.table.DFeatureColumn}).
- *
+ *
* @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
*/
public class DFeatureColumnEditingSupport extends EditingSupport {
@@ -94,7 +96,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* Constructor.
- *
+ *
* @param viewer
* The columnViewer for this editingSupport
* @param featureColumn
@@ -126,7 +128,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.EditingSupport#canEdit(java.lang.Object)
*/
@Override
@@ -154,7 +156,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.EditingSupport#getCellEditor(java.lang.Object)
*/
@Override
@@ -171,7 +173,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.EditingSupport#getValue(java.lang.Object)
*/
@Override
@@ -220,7 +222,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
}
}
} catch (final FeatureNotFoundException e) {
- SiriusPlugin.getDefault().error("Error while getting the property value", e);
+ SiriusPlugin.getDefault().error(Messages.DFeatureColumnEditingSupport_errorGettingPropertyValue, e);
}
}
return result;
@@ -228,7 +230,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.EditingSupport#setValue(java.lang.Object,
* java.lang.Object)
*/
@@ -275,14 +277,14 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
}
}
} catch (final ClassCastException e) {
- SiriusPlugin.getDefault().error("Error while setting the property value", e);
+ SiriusPlugin.getDefault().error(Messages.DFeatureColumnEditingSupport_errorSettingPropertyValue, e);
}
}
}
/**
* Set the value by doing a standard eSet for the feature
- *
+ *
* @param line
* The line containing the feature to set
* @param value
@@ -291,18 +293,18 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
private void standardSetValue(final DLine line, final Object value) {
final Option<DCell> cell = TableHelper.getCell(line, featureColumn);
if (cell.some()) {
- getEditingDomain().getCommandStack().execute(new StandardSetValueRecordingCommand(getEditingDomain(), "Set " + getFeatureName() + " value", cell.get(), value));
+ getEditingDomain().getCommandStack().execute(new StandardSetValueRecordingCommand(getEditingDomain(), MessageFormat.format(Messages.Action_setValue, getFeatureName()), cell.get(), value));
}
}
/**
* Set the value by calling the user operations
- *
+ *
* @param editedCell
* The cell to set
* @param value
* the new value
- *
+ *
*/
private void specificSetValue(final DCell editedCell, final Object value) {
tableEditor.enablePropertiesUpdate(false);
@@ -316,7 +318,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* Chooses the best CellEditor depending on the type of value to edit
- *
+ *
* @param element
* The current edited element
* @param directEdit
@@ -390,7 +392,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
* {@inheritDoc} We override the doSetFocus for
* clearing the selection for the direct edition of
* the cell.
- *
+ *
* @see org.eclipse.jface.viewers.TextCellEditor#doSetFocus()
*/
@Override
@@ -427,7 +429,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc} Override for problem when the feature name defines
* in the odesign is not valid.
- *
+ *
* @see org.eclipse.jface.viewers.TextCellEditor#doSetValue(java.lang.Object)
*/
@Override
@@ -440,7 +442,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc} We override the doSetFocus for clearing the
* selection for the direct edition of the cell.
- *
+ *
* @see org.eclipse.jface.viewers.TextCellEditor#doSetFocus()
*/
@Override
@@ -455,12 +457,13 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc} Override for problem when the feature name defines
* in the odesign is not valid.
- *
+ *
* @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
*/
+ @Override
public String isValid(final Object value) {
if (value == null) {
- return "Null value is not a valid value for this cell.";
+ return Messages.DFeatureColumnEditingSupport_notValidValue;
}
return null;
}
@@ -472,7 +475,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* Calculate the list of labels for this enumeration
- *
+ *
* @param enumeration
* The enumeration
* @return A list of labels
@@ -489,7 +492,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* Get the classifier of the attribute corresponding the attribute with
* featureName of the this element.
- *
+ *
* @param element
* The current element
* @return The eClassifier
@@ -506,7 +509,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* The feature name of the column associated with this editingSupport.
- *
+ *
* @return A the feature name
*/
protected String getFeatureName() {
@@ -533,7 +536,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* Return the transactional editing domain.
- *
+ *
* @return the transactional editing domain
*/
public TransactionalEditingDomain getEditingDomain() {
@@ -612,7 +615,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* Return the propertyDescriptor corresponding to the feature of this column
* for the instance
- *
+ *
* @param instance
* the instance.
* @return the propertyDescriptor corresponding to the feature of this
@@ -640,7 +643,7 @@ public class DFeatureColumnEditingSupport extends EditingSupport {
/**
* {@inheritDoc}
- *
+ *
* @see org.eclipse.jface.viewers.EditingSupport#initializeCellEditorValue(org.eclipse.jface.viewers.CellEditor,
* org.eclipse.jface.viewers.ViewerCell)
*/
diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/quickoutline/TableQuickOutlineHandler.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/quickoutline/TableQuickOutlineHandler.java
index 02826dcba3..165ad262e5 100644
--- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/quickoutline/TableQuickOutlineHandler.java
+++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/quickoutline/TableQuickOutlineHandler.java
@@ -20,13 +20,14 @@ import org.eclipse.sirius.common.ui.tools.api.dialog.quickoutline.QuickOutlineDe
import org.eclipse.sirius.common.ui.tools.api.dialog.quickoutline.QuickOutlinePageDescriptor;
import org.eclipse.sirius.common.ui.tools.api.dialog.quickoutline.SiriusInformationPresenter;
import org.eclipse.sirius.common.ui.tools.api.dialog.quickoutline.SiriusInformationPresenterFactory;
+import org.eclipse.sirius.table.metamodel.table.provider.Messages;
import org.eclipse.sirius.table.ui.tools.api.editor.DTableEditor;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
/**
* Handler for the quick outline of the Table editor.
- *
+ *
* @author ymortier
*/
public class TableQuickOutlineHandler extends AbstractHandler {
@@ -45,7 +46,7 @@ public class TableQuickOutlineHandler extends AbstractHandler {
/**
* Create the quick outline descriptor.
- *
+ *
* @param editor
* the table editor.
* @return the quick outline descriptor.
@@ -56,9 +57,9 @@ public class TableQuickOutlineHandler extends AbstractHandler {
TableOutlineCallback callBack = new TableOutlineCallback(editor);
- QuickOutlinePageDescriptor page = new QuickOutlinePageDescriptor(callBack, labelProvider, new DLineQuickOutlineContentProvider(), "select line");
+ QuickOutlinePageDescriptor page = new QuickOutlinePageDescriptor(callBack, labelProvider, new DLineQuickOutlineContentProvider(), Messages.TableQuickOutlineHandler_selectLine);
- QuickOutlinePageDescriptor columnsPage = new QuickOutlinePageDescriptor(callBack, labelProvider, new DColumnOutlineContentProvider(), "select column");
+ QuickOutlinePageDescriptor columnsPage = new QuickOutlinePageDescriptor(callBack, labelProvider, new DColumnOutlineContentProvider(), Messages.TableQuickOutlineHandler_selectColumn);
QuickOutlineDescriptor descriptor = new QuickOutlineDescriptor();
descriptor.addPage(page);
@@ -69,7 +70,7 @@ public class TableQuickOutlineHandler extends AbstractHandler {
/**
* Returns the currently active editor if it's a {@link DTableEditor}.
- *
+ *
* @return The currently active editor if it's a {@link DTableEditor},
* <code>null</code> otherwise.
*/
diff --git a/plugins/org.eclipse.sirius.table/META-INF/MANIFEST.MF b/plugins/org.eclipse.sirius.table/META-INF/MANIFEST.MF
index baaeaecad4..a48e017cb7 100644
--- a/plugins/org.eclipse.sirius.table/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.sirius.table/META-INF/MANIFEST.MF
@@ -45,6 +45,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
Eclipse-LazyStart: true
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.sirius.table.tools.internal.TablePlugin$Implementation
-Import-Package: org.eclipse.sirius.ext.base;version="2.0.0",
+Import-Package: org.eclipse.sirius.ext.base;version="2.1.0",
org.eclipse.sirius.ext.base.collect;version="2.0.0",
org.eclipse.sirius.ext.emf;version="2.0.0"

Back to the top