View | Details | Raw Unified | Return to bug 109445 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/DiagramPlugin.java (-8 lines)
Lines 11-18 Link Here
11
11
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal;
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal;
13
13
14
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramResourceManager;
15
import org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager;
16
import org.eclipse.gmf.runtime.common.ui.plugin.XToolsUIPlugin;
14
import org.eclipse.gmf.runtime.common.ui.plugin.XToolsUIPlugin;
17
import org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager;
15
import org.eclipse.gmf.runtime.emf.core.internal.util.MSLAdapterFactoryManager;
18
import org.eclipse.gmf.runtime.emf.core.internal.util.MSLMetaModelManager;
16
import org.eclipse.gmf.runtime.emf.core.internal.util.MSLMetaModelManager;
Lines 71-80 Link Here
71
		MSLMetaModelManager.register(NotationPackage.eINSTANCE, null);
69
		MSLMetaModelManager.register(NotationPackage.eINSTANCE, null);
72
	}
70
	}
73
71
74
	/* (non-Javadoc)
75
	 * @see org.eclipse.gmf.runtime.common.ui.plugin.XToolsUIPlugin#getResourceManager()
76
	 */
77
	public AbstractResourceManager getResourceManager() {
78
		return DiagramResourceManager.getInstance();
79
	}
80
}
72
}
(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/l10n/DiagramResourceManager.java (-79 lines)
Removed Link Here
1
/******************************************************************************
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n;
13
14
import org.eclipse.core.runtime.Plugin;
15
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.DiagramPlugin;
16
import org.eclipse.gmf.runtime.common.ui.l10n.AbstractUIResourceManager;
17
18
19
/**
20
 * A singleton resource manager object that manages string, image, font and
21
 * cursor types of resources for this plug-in
22
 * 
23
 * @author qili
24
 */
25
public class DiagramResourceManager extends AbstractUIResourceManager {
26
27
		/**
28
		 * Singleton instance for the resource manager
29
		 */
30
		private static AbstractUIResourceManager resourceManager =
31
			new DiagramResourceManager();
32
33
		/**
34
		 * Constructor for DiagramResourceManager.
35
		 */
36
		public DiagramResourceManager() {
37
			super();
38
		}
39
40
		/**
41
		 * Return singleton instance of the resource manager
42
		 * @return AbstractResourceManager
43
		 */
44
		public static AbstractUIResourceManager getInstance() {
45
			return resourceManager;
46
		}
47
48
		/**
49
		 * A shortcut method to get localized string
50
		 * @param key - resource bundle key. 
51
		 * @return - localized string value or a key if the bundle does not contain
52
		 * 			  this entry
53
		 */
54
		public static String getI18NString(String key) {
55
			return getInstance().getString(key);
56
		}
57
58
		/* (non-Javadoc)
59
		 * @see org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager#initializeResources()
60
		 */
61
		protected void initializeResources() {
62
			//do nothing
63
		}
64
		
65
		/* (non-Javadoc)
66
		 * @see org.eclipse.gmf.runtime.common.ui.l10n.AbstractUIResourceManager#initializeUIResources()
67
		 */
68
		protected void initializeUIResources() {
69
			initializeMessageResources();
70
		}
71
72
		/**
73
		 * @see org.eclipse.gmf.runtime.common.core.l10n.AbstractResourceManager#getPlugin()
74
		 */
75
		protected Plugin getPlugin() {
76
			return DiagramPlugin.getInstance();
77
		}
78
79
	}
(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/l10n/messages.properties (-63 lines)
Removed Link Here
1
# ==============================================================================
2
#*+------------------------------------------------------------------------+
3
#*| Copyright (c) 2005  IBM Corporation and others.                        |
4
#*| All rights reserved. This program and the accompanying materials       |
5
#*| are made available under the terms of the Eclipse Public License v1.0  |
6
#*| which accompanies this distribution, and is available at               |
7
#*| http://www.eclipse.org/legal/epl-v10.html                              |
8
#*|                                                                        |
9
#*| Contributors:                                                          |
10
#*|    IBM Corporation - initial API and implementation                    |
11
#*+------------------------------------------------------------------------+
12
# ==============================================================================
13
# ==============================================================================
14
# GEO Visualizer General - Translation Instruction: section to be translated
15
# ==============================================================================
16
17
# --- File creation --- 
18
GEOVisualizer.DefaultGeoshapeDiagramFileName=geoshapediagram
19
GEOVisualizer.DefaultSavedBrowseDiagramDiagramProject=Saved Browse Diagrams
20
21
# ==============================================================================
22
# Wizards - Translation Instruction: section to be translated
23
# ==============================================================================
24
25
# --- Class Diagram Wizard ---
26
CreationWizard.New_Class_Diagram=New Class Diagram
27
ClassDiagramWizardPage.Title=Create Class Diagram
28
ClassDiagramWizardPage.Description=Create a new class diagram.
29
30
# --- Geoshape Diagram Wizard ---
31
CreationWizard.New_Geoshape_Diagram=New Geoshape Diagram
32
GeoshapeWizardPage.Title=Create Geoshape Diagram
33
GeoshapeWizardPage.Description=Create a new geoshape diagram.
34
35
# --- Deployment Diagram Wizard ---
36
CreationWizard.New_Deployment_Diagram=New Deployment Diagram
37
38
# ==============================================================================
39
# Dialogs - Translation Instruction: section to be translated
40
# ==============================================================================
41
42
# --- Topic Diagram ---
43
GEOVisualizerTopicDiagramEditor.Unable_To_Save_Viz_Diagram_Title=Unable to Save Diagram.
44
GEOVisualizerTopicDiagramEditor.Unable_To_Save_Viz_Diagram_Text=Unable to save diagram from the current topic diagram.
45
GEOVisualizerTopicDiagramEditor.Viz_Diagram_Exists=File Exists
46
GEOVisualizerTopicDiagramEditor.Viz_Diagram_Exists_Text=Cannot overwrite the existing diagram. Please specify a different diagram file name.
47
48
# ==============================================================================
49
# Exceptions and Errors - Translation Instruction : needs Translation.
50
# ==============================================================================
51
52
#--- Errors ---
53
WizardPage.Message.FileExists_ERROR_=The same name already exists.
54
55
#--- Parameter passed here is the serialized form of the VizRef for which visualization failed ---
56
GEOVisualizerEditor.EDITOR_OPEN_EXC_=Unable to open the editor
57
58
# ===========================================================================
59
#  General Tab related strings - Translation Instruction: needs Translation.
60
# ===========================================================================
61
62
GeoShapeGeneralDetails.GeoShapeDescriptionLabel.text=Description:
63
GeoShapeGeneralDetails.GeoShapeDescriptionChangeCommand.text=Description
(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/section/GeoShapeGeneralSection.java (-15 / +14 lines)
Lines 15-33 Link Here
15
import org.eclipse.emf.ecore.EClass;
15
import org.eclipse.emf.ecore.EClass;
16
import org.eclipse.emf.ecore.EObject;
16
import org.eclipse.emf.ecore.EObject;
17
import org.eclipse.emf.ecore.resource.Resource;
17
import org.eclipse.emf.ecore.resource.Resource;
18
import org.eclipse.swt.SWT;
18
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramGeoshapesMessages;
19
import org.eclipse.swt.custom.CLabel;
20
import org.eclipse.swt.layout.FormAttachment;
21
import org.eclipse.swt.layout.FormData;
22
import org.eclipse.swt.widgets.Composite;
23
import org.eclipse.swt.widgets.Control;
24
import org.eclipse.swt.widgets.Text;
25
import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
26
import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
27
28
import org.eclipse.gmf.runtime.common.core.command.ICommand;
19
import org.eclipse.gmf.runtime.common.core.command.ICommand;
29
import org.eclipse.gmf.runtime.common.core.util.StringStatics;
20
import org.eclipse.gmf.runtime.common.core.util.StringStatics;
30
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramResourceManager;
31
import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractModelerPropertySection;
21
import org.eclipse.gmf.runtime.diagram.ui.properties.sections.AbstractModelerPropertySection;
32
import org.eclipse.gmf.runtime.diagram.ui.properties.views.TextChangeHelper;
22
import org.eclipse.gmf.runtime.diagram.ui.properties.views.TextChangeHelper;
33
import org.eclipse.gmf.runtime.notation.DescriptionStyle;
23
import org.eclipse.gmf.runtime.notation.DescriptionStyle;
Lines 35-40 Link Here
35
import org.eclipse.gmf.runtime.notation.NotationPackage;
25
import org.eclipse.gmf.runtime.notation.NotationPackage;
36
import org.eclipse.gmf.runtime.notation.Style;
26
import org.eclipse.gmf.runtime.notation.Style;
37
import org.eclipse.gmf.runtime.notation.View;
27
import org.eclipse.gmf.runtime.notation.View;
28
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.custom.CLabel;
30
import org.eclipse.swt.layout.FormAttachment;
31
import org.eclipse.swt.layout.FormData;
32
import org.eclipse.swt.widgets.Composite;
33
import org.eclipse.swt.widgets.Control;
34
import org.eclipse.swt.widgets.Text;
35
import org.eclipse.wst.common.ui.properties.internal.provisional.ITabbedPropertyConstants;
36
import org.eclipse.wst.common.ui.properties.internal.provisional.TabbedPropertySheetPage;
38
37
39
/**
38
/**
40
 * @author Eliza Tworkowska
39
 * @author Eliza Tworkowska
Lines 44-55 Link Here
44
	extends AbstractModelerPropertySection {
43
	extends AbstractModelerPropertySection {
45
44
46
	// Labels
45
	// Labels
47
	protected static final String DESCRIPTION_LABEL = DiagramResourceManager
46
	protected static final String DESCRIPTION_LABEL = 
48
		.getI18NString("GeoShapeGeneralDetails.GeoShapeDescriptionLabel.text"); //$NON-NLS-1$
47
		DiagramGeoshapesMessages.GeoShapeGeneralDetailsGeoShapeDescriptionLabel_text;
49
48
50
	// properties
49
	// properties
51
	protected static final String DESCRIPTION = DiagramResourceManager
50
	protected static final String DESCRIPTION = 
52
		.getI18NString("GeoShapeGeneralDetails.GeoShapeDescriptionChangeCommand.text"); //$NON-NLS-1$
51
		DiagramGeoshapesMessages.GeoShapeGeneralDetailsGeoShapeDescriptionChangeCommand_text;
53
52
54
	// 	commads - used as a label for Edit -> Undo/Redo, used message format for concatenating strings
53
	// 	commads - used as a label for Edit -> Undo/Redo, used message format for concatenating strings
55
	private static final String DESCRIPTION_PROPERTY_CHANGE_COMMAND_NAME = DESCRIPTION + VALUE_CHANGED_STRING;
54
	private static final String DESCRIPTION_PROPERTY_CHANGE_COMMAND_NAME = DESCRIPTION + VALUE_CHANGED_STRING;
(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/wizards/DiagramCreationWizard.java (-8 / +5 lines)
Lines 11-22 Link Here
11
11
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.wizards;
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.wizards;
13
13
14
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.DiagramPlugin;
15
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramGeoshapesMessages;
16
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.wizards.EditorCreationWizard;
14
import org.eclipse.jface.viewers.IStructuredSelection;
17
import org.eclipse.jface.viewers.IStructuredSelection;
15
import org.eclipse.ui.IWorkbench;
18
import org.eclipse.ui.IWorkbench;
16
19
17
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramResourceManager;
18
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.wizards.EditorCreationWizard;
19
20
20
21
/**
21
/**
22
 * @author qili
22
 * @author qili
Lines 40-50 Link Here
40
	
40
	
41
	public void init(IWorkbench workbench, IStructuredSelection sel) {
41
	public void init(IWorkbench workbench, IStructuredSelection sel) {
42
		super.init(workbench, sel);
42
		super.init(workbench, sel);
43
43
		setWindowTitle(DiagramGeoshapesMessages.CreationWizardNewGeoshapeDiagram_label);
44
		setWindowTitle(DiagramResourceManager
44
		setDefaultPageImageDescriptor(DiagramPlugin.imageDescriptorFromPlugin(DiagramPlugin.getPluginId(), "wizards/geoshapes_wiz.gif")); //$NON-NLS-1$
45
				.getI18NString("CreationWizard.New_Geoshape_Diagram")); //$NON-NLS-1$
46
		setDefaultPageImageDescriptor(DiagramResourceManager.getInstance()
47
				.getImageDescriptor("wizards/geoshapes_wiz.gif")); //$NON-NLS-1$
48
		setNeedsProgressMonitor(true);
45
		setNeedsProgressMonitor(true);
49
	}
46
	}
50
47
(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/wizards/DiagramWizardPage.java (-7 / +4 lines)
Lines 11-17 Link Here
11
11
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.wizards;
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.wizards;
13
13
14
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramResourceManager;
14
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramGeoshapesMessages;
15
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.util.GeoShapeDiagramFileCreator;
15
import org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.util.GeoShapeDiagramFileCreator;
16
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.wizards.EditorWizardPage;
16
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide.wizards.EditorWizardPage;
17
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.util.DiagramFileCreator;
17
import org.eclipse.gmf.runtime.diagram.ui.resources.editor.util.DiagramFileCreator;
Lines 38-55 Link Here
38
	public DiagramWizardPage(IWorkbench aWorkbench,
38
	public DiagramWizardPage(IWorkbench aWorkbench,
39
			IStructuredSelection selection) {
39
			IStructuredSelection selection) {
40
		super("GeoshapeDiagramPage", aWorkbench, selection); //$NON-NLS-1$
40
		super("GeoshapeDiagramPage", aWorkbench, selection); //$NON-NLS-1$
41
		this.setTitle(DiagramResourceManager
41
		setTitle(DiagramGeoshapesMessages.GeoshapeWizardPage_title);
42
			.getI18NString("GeoshapeWizardPage.Title")); //$NON-NLS-1$
42
		setDescription(DiagramGeoshapesMessages.GeoshapeWizardPage_description);
43
		this.setDescription(DiagramResourceManager
44
			.getI18NString("GeoshapeWizardPage.Description")); //$NON-NLS-1$
45
	}
43
	}
46
	
44
	
47
	/* (non-Javadoc)
45
	/* (non-Javadoc)
48
	 * @see com.ibm.xtools.viz.ui.internal.wizards.DiagramWizardPage#getDefaultFileName()
46
	 * @see com.ibm.xtools.viz.ui.internal.wizards.DiagramWizardPage#getDefaultFileName()
49
	 */
47
	 */
50
	protected String getDefaultFileName() {
48
	protected String getDefaultFileName() {
51
		return DiagramResourceManager
49
		return DiagramGeoshapesMessages.DefaultGeoshapeDiagramFileName;
52
			.getI18NString("GEOVisualizer.DefaultGeoshapeDiagramFileName"); //$NON-NLS-1$;
53
	}
50
	}
54
	
51
	
55
	/* (non-Javadoc)
52
	/* (non-Javadoc)
(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/l10n/DiagramGeoshapesMessages.java (+49 lines)
Added Link Here
1
/******************************************************************************
2
 * Copyright (c) 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
10
 ****************************************************************************/
11
12
package org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n;
13
14
import org.eclipse.osgi.util.NLS;
15
16
/**
17
 * An accessor class for externalized strings.
18
 * 
19
 * @author Chris Aniszczyk (zx)
20
 */
21
public class DiagramGeoshapesMessages extends NLS {
22
	
23
	private static final String BUNDLE_NAME = "org.eclipse.gmf.examples.runtime.diagram.geoshapes.internal.l10n.DiagramGeoshapesMessages";//$NON-NLS-1$
24
	
25
	public static String DefaultGeoshapeDiagramFileName;
26
	public static String DefaultSavedBrowseDiagramDiagramProject;
27
	public static String CreationWizardNewClassDiagram_label;
28
	public static String ClassDiagramWizardPage_title;
29
	public static String ClassDiagramWizardPage_description;
30
	public static String GeoshapeWizardPage_title;
31
	public static String CreationWizardNewGeoshapeDiagram_label;
32
	public static String GeoshapeWizardPage_description;
33
	public static String CreationWizardNewDeploymentDiagram_label;
34
	public static String GEOVisualizerTopicDiagramEditorUnableToSaveVizDiagram_title;
35
	public static String GEOVisualizerTopicDiagramEditorUnableToSaveVizDiagram_text;
36
	public static String GEOVisualizerTopicDiagramEditorVizDiagramExists_label;
37
	public static String GEOVisualizerTopicDiagramEditorVizDiagramExists_text;
38
	public static String WizardPageMessageFileExistsError_label;
39
	public static String GEOVisualizerEditorEditorOpen_label;
40
	public static String GeoShapeGeneralDetailsGeoShapeDescriptionLabel_text;
41
	public static String GeoShapeGeneralDetailsGeoShapeDescriptionChangeCommand_text;
42
	
43
	private DiagramGeoshapesMessages() {}
44
	
45
	static {
46
		NLS.initializeMessages(BUNDLE_NAME, DiagramGeoshapesMessages.class);
47
	}
48
	
49
}
(-)src/org/eclipse/gmf/examples/runtime/diagram/geoshapes/internal/l10n/DiagramGeoshapesMessages.properties (+63 lines)
Added Link Here
1
# ==============================================================================
2
#*+------------------------------------------------------------------------+
3
#*| Copyright (c) 2005  IBM Corporation and others.                        |
4
#*| All rights reserved. This program and the accompanying materials       |
5
#*| are made available under the terms of the Eclipse Public License v1.0  |
6
#*| which accompanies this distribution, and is available at               |
7
#*| http://www.eclipse.org/legal/epl-v10.html                              |
8
#*|                                                                        |
9
#*| Contributors:                                                          |
10
#*|    IBM Corporation - initial API and implementation                    |
11
#*+------------------------------------------------------------------------+
12
# ==============================================================================
13
# ==============================================================================
14
# GEO Visualizer General - Translation Instruction: section to be translated
15
# ==============================================================================
16
17
# --- File creation --- 
18
DefaultGeoshapeDiagramFileName=geoshapediagram
19
DefaultSavedBrowseDiagramDiagramProject=Saved Browse Diagrams
20
21
# ==============================================================================
22
# Wizards - Translation Instruction: section to be translated
23
# ==============================================================================
24
25
# --- Class Diagram Wizard ---
26
CreationWizardNewClassDiagram_label=New Class Diagram
27
ClassDiagramWizardPage_title=Create Class Diagram
28
ClassDiagramWizardPage_description=Create a new class diagram.
29
30
# --- Geoshape Diagram Wizard ---
31
CreationWizardNewGeoshapeDiagram_label=New Geoshape Diagram
32
GeoshapeWizardPage_title=Create Geoshape Diagram
33
GeoshapeWizardPage_description=Create a new geoshape diagram.
34
35
# --- Deployment Diagram Wizard ---
36
CreationWizardNewDeploymentDiagram_label=New Deployment Diagram
37
38
# ==============================================================================
39
# Dialogs - Translation Instruction: section to be translated
40
# ==============================================================================
41
42
# --- Topic Diagram ---
43
GEOVisualizerTopicDiagramEditorUnableToSaveVizDiagram_title=Unable to Save Diagram.
44
GEOVisualizerTopicDiagramEditorUnableToSaveVizDiagram_text=Unable to save diagram from the current topic diagram.
45
GEOVisualizerTopicDiagramEditorVizDiagramExists_label=File Exists
46
GEOVisualizerTopicDiagramEditorVizDiagramExists_text=Cannot overwrite the existing diagram. Please specify a different diagram file name.
47
48
# ==============================================================================
49
# Exceptions and Errors - Translation Instruction : needs Translation.
50
# ==============================================================================
51
52
#--- Errors ---
53
WizardPageMessageFileExistsError_label=The same name already exists.
54
55
#--- Parameter passed here is the serialized form of the VizRef for which visualization failed ---
56
GEOVisualizerEditorEditorOpen_label=Unable to open the editor
57
58
# ===========================================================================
59
#  General Tab related strings - Translation Instruction: needs Translation.
60
# ===========================================================================
61
62
GeoShapeGeneralDetailsGeoShapeDescriptionLabel_text=Description:
63
GeoShapeGeneralDetailsGeoShapeDescriptionChangeCommand_text=Description

Return to bug 109445