Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordstadnik2009-02-11 17:13:48 +0000
committerdstadnik2009-02-11 17:13:48 +0000
commit1305b615d7417f94ff462fa8194932048e4619ea (patch)
treed7725846c9dde64496a42e2d8ff7c1ef471fd9f8 /examples
parent3b4944ba9e78adeddad08b28cb00274c8d370bd2 (diff)
downloadorg.eclipse.gmf-tooling-1305b615d7417f94ff462fa8194932048e4619ea.tar.gz
org.eclipse.gmf-tooling-1305b615d7417f94ff462fa8194932048e4619ea.tar.xz
org.eclipse.gmf-tooling-1305b615d7417f94ff462fa8194932048e4619ea.zip
regenerated
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/META-INF/MANIFEST.MF4
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/messages.properties7
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.properties2
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.xml125
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/commands/BuildingCreateCommand.java49
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/parts/BuildingEditPart.java1
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/PortItemSemanticEditPolicy.java3
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanBaseItemSemanticEditPolicy.java23
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextNonResizableEditPolicy.java23
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextSelectionEditPolicy.java23
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/AbstractParser.java32
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/NativeParser.java85
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/LoadResourceAction.java41
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/Messages.java14
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDiagramActionBarContributor.java15
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDocumentProvider.java10
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanInitDiagramFileAction.java5
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanNewDiagramFileWizard.java2
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/preferences/DiagramPreferenceInitializer.java1
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanModelingAssistantProvider.java2
-rw-r--r--examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanParserProvider.java3
21 files changed, 366 insertions, 104 deletions
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/META-INF/MANIFEST.MF b/examples/org.eclipse.gmf.examples.taipan.port.diagram/META-INF/MANIFEST.MF
index f132beee2..58015e70b 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/META-INF/MANIFEST.MF
@@ -33,4 +33,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.gmf.examples.taipan.ui;visibility:=reexport,
org.eclipse.gmf.examples.taipan.edit;visibility:=reexport,
org.eclipse.gef;visibility:=reexport,
- org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport
+ org.eclipse.gmf.runtime.draw2d.ui;visibility:=reexport,
+ org.eclipse.draw2d;visibility:=reexport
+Eclipse-LazyStart: true
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/messages.properties b/examples/org.eclipse.gmf.examples.taipan.port.diagram/messages.properties
index 1e6fe8a7d..fe9f54fcf 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/messages.properties
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/messages.properties
@@ -55,3 +55,10 @@ AbstractParser_UnknownLiteralMessage=Unknown literal: {0}
MessageFormatParser_InvalidInputError=Invalid input at {0}
TaiPanModelingAssistantProviderTitle=Select domain model element
TaiPanModelingAssistantProviderMessage=Available domain model elements:
+InitDiagramFile_ResourceErrorDialogTitle=Error
+InitDiagramFile_ResourceErrorDialogMessage=Model file loading failed
+InitDiagramFile_WizardTitle=Initialize new {0} diagram file
+InitDiagramFile_OpenModelFileDialogTitle=Select domain model
+AbstractParser_UnexpectedValueType=Value of type {0} is expected
+AbstractParser_WrongStringConversion=String value does not convert to {0} value
+AbstractParser_UnknownLiteral=Unknown literal: {0}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.properties b/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.properties
index 967702a13..f0e60ce38 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.properties
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.properties
@@ -47,3 +47,5 @@ prefpage.org.eclipse.gmf.examples.taipan.diagram.connections=Connections
prefpage.org.eclipse.gmf.examples.taipan.diagram.printing=Printing
prefpage.org.eclipse.gmf.examples.taipan.diagram.rulersAndGrid=Rulers And Grid
prefpage.org.eclipse.gmf.examples.taipan.diagram.pathmaps=Pathmaps
+cmdcategory.name=Port Editor Commands
+cmdcategory.desc=Port Editor Commands
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.xml b/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.xml
index 596887385..e5c41a7f2 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.xml
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/plugin.xml
@@ -13,15 +13,12 @@ Contributors:
-->
<plugin>
- <extension point="org.eclipse.team.core.fileTypes">
+ <extension point="org.eclipse.team.core.fileTypes" id="repo-ftype">
<?gmfgen generated="true"?>
- <fileTypes
- type="text"
- extension="port_diagram">
- </fileTypes>
+ <fileTypes type="text" extension="port_diagram"/>
</extension>
- <extension point="org.eclipse.emf.ecore.extension_parser">
+ <extension point="org.eclipse.emf.ecore.extension_parser" id="resource-factory">
<?gmfgen generated="true"?>
<parser
type="port_diagram"
@@ -29,7 +26,7 @@ Contributors:
</parser>
</extension>
- <extension point="org.eclipse.ui.editors">
+ <extension point="org.eclipse.ui.editors" id="gmf-editor">
<?gmfgen generated="true"?>
<editor
id="org.eclipse.gmf.examples.taipan.port.diagram.part.PortDiagramEditorID"
@@ -43,7 +40,7 @@ Contributors:
</editor>
</extension>
- <extension point="org.eclipse.ui.newWizards">
+ <extension point="org.eclipse.ui.newWizards" id="creation-wizard">
<?gmfgen generated="true"?>
<wizard
name="%newWizardName"
@@ -55,23 +52,7 @@ Contributors:
</wizard>
</extension>
- <extension point="org.eclipse.ui.popupMenus">
- <?gmfgen generated="true"?>
- <objectContribution
- adaptable="false"
- id="org.eclipse.gmf.examples.taipan.port.diagram.LoadResource"
- objectClass="org.eclipse.gmf.examples.taipan.port.diagram.edit.parts.PortEditPart">
- <action
- class="org.eclipse.gmf.examples.taipan.port.diagram.part.TaiPanLoadResourceAction"
- enablesFor="1"
- id="org.eclipse.gmf.examples.taipan.port.diagram.LoadResourceAction"
- label="%loadResourceActionLabel"
- menubarPath="additions">
- </action>
- </objectContribution>
- </extension>
-
- <extension point="org.eclipse.ui.popupMenus">
+ <extension point="org.eclipse.ui.popupMenus" id="init-diagram-action">
<?gmfgen generated="true"?>
<objectContribution
id="org.eclipse.gmf.examples.taipan.port.diagram.InitDiagram"
@@ -86,8 +67,9 @@ Contributors:
</action>
</objectContribution>
</extension>
-
- <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders">
+
+
+ <extension point="org.eclipse.gmf.runtime.common.ui.services.action.globalActionHandlerProviders" id="global-actions">
<?gmfgen generated="true"?>
<GlobalActionHandlerProvider
class="org.eclipse.gmf.runtime.diagram.ui.providers.DiagramGlobalActionHandlerProvider"
@@ -128,12 +110,12 @@ Contributors:
- <extension point="org.eclipse.core.runtime.preferences">
+ <extension point="org.eclipse.core.runtime.preferences" id="prefs">
<?gmfgen generated="true"?>
<initializer class="org.eclipse.gmf.examples.taipan.port.diagram.preferences.DiagramPreferenceInitializer"/>
</extension>
- <extension point="org.eclipse.ui.preferencePages">
+ <extension point="org.eclipse.ui.preferencePages" id="prefpages">
<?gmfgen generated="true"?>
<page
id="org.eclipse.gmf.examples.taipan.diagram.general"
@@ -164,15 +146,9 @@ Contributors:
category="org.eclipse.gmf.examples.taipan.diagram.general"
class="org.eclipse.gmf.examples.taipan.port.diagram.preferences.DiagramRulersAndGridPreferencePage">
</page>
- <page
- id="org.eclipse.gmf.examples.taipan.diagram.pathmaps"
- name="%prefpage.org.eclipse.gmf.examples.taipan.diagram.pathmaps"
- category="org.eclipse.gmf.examples.taipan.diagram.general"
- class="org.eclipse.gmf.runtime.emf.ui.preferences.PathmapsPreferencePage">
- </page>
</extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor">
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyContributor" id="prop-contrib">
<?gmfgen generated="true"?>
<propertyContributor
contributorId="org.eclipse.gmf.examples.taipan.port.diagram"
@@ -183,7 +159,7 @@ Contributors:
</propertyContributor>
</extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs">
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertyTabs" id="proptabs">
<?gmfgen generated="true"?>
<propertyTabs contributorId="org.eclipse.gmf.examples.taipan.port.diagram">
<propertyTab
@@ -201,7 +177,7 @@ Contributors:
</propertyTabs>
</extension>
- <extension point="org.eclipse.ui.views.properties.tabbed.propertySections">
+ <extension point="org.eclipse.ui.views.properties.tabbed.propertySections" id="propsections">
<?gmfgen generated="true"?>
<propertySections contributorId="org.eclipse.gmf.examples.taipan.port.diagram">
<propertySection id="property.section.ConnectorAppearancePropertySection"
@@ -234,45 +210,63 @@ Contributors:
</propertySections>
</extension>
- <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders">
+ <extension point="org.eclipse.gmf.runtime.diagram.core.viewProviders" id="view-provider">
<?gmfgen generated="true"?>
<viewProvider class="org.eclipse.gmf.examples.taipan.port.diagram.providers.TaiPanViewProvider">
<Priority name="Lowest"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Diagram" semanticHints="Port"/>
- <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints=""/>
+ <context viewClass="org.eclipse.gmf.runtime.notation.Node" semanticHints="2001"/>
<context viewClass="org.eclipse.gmf.runtime.notation.Edge" semanticHints=""/>
</viewProvider>
</extension>
- <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders">
+ <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders" id="ep-provider">
<?gmfgen generated="true"?>
<editpartProvider class="org.eclipse.gmf.examples.taipan.port.diagram.providers.TaiPanEditPartProvider">
<Priority name="Lowest"/>
+ <object class="org.eclipse.gmf.runtime.notation.Diagram" id="generated-diagram">
+ <method name="getType()" value="Port"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-nodes">
+ <method name="getType()" value="2001"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Edge" id="generated-links">
+ <method name="getType()" value=""/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-labels">
+ <method name="getType()" value="3001"/>
+ </object>
+ <object class="org.eclipse.gmf.runtime.notation.Node" id="generated-compartments">
+ <method name="getType()" value=""/>
+ </object>
+ <context views="generated-diagram,generated-nodes,generated-links,generated-labels,generated-compartments"/>
</editpartProvider>
</extension>
- <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders">
+ <extension point="org.eclipse.gmf.runtime.emf.ui.modelingAssistantProviders" id="modelassist-provider">
<?gmfgen generated="true"?>
<modelingAssistantProvider class="org.eclipse.gmf.examples.taipan.port.diagram.providers.TaiPanModelingAssistantProvider">
<Priority name="Lowest"/>
+ <object class="org.eclipse.gmf.examples.taipan.port.diagram.edit.parts.BuildingEditPart" id="Building_2001"/>
+ <context elements="Building_2001"/>
</modelingAssistantProvider>
</extension>
- <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders">
+ <extension point="org.eclipse.gmf.runtime.common.ui.services.iconProviders" id="icon-provider">
<?gmfgen generated="true"?>
<IconProvider class="org.eclipse.gmf.examples.taipan.port.diagram.providers.TaiPanIconProvider">
<Priority name="Low"/>
</IconProvider>
</extension>
- <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders">
+ <extension point="org.eclipse.gmf.runtime.common.ui.services.parserProviders" id="parser-provider">
<?gmfgen generated="true"?>
<ParserProvider class="org.eclipse.gmf.examples.taipan.port.diagram.providers.TaiPanParserProvider">
<Priority name="Lowest"/>
</ParserProvider>
</extension>
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes">
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
<?gmfgen generated="true"?>
<metamodel nsURI="http://www.eclipse.org/examples/gmf/taipan">
<metamodelType
@@ -296,7 +290,7 @@ Contributors:
</metamodel>
</extension>
- <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings">
+ <extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypeBindings" id="element-types-bindings">
<?gmfgen generated="true"?>
<clientContext id="org.eclipse.gmf.examples.taipan.port.diagram.TypeContext">
<enablement>
@@ -312,7 +306,7 @@ Contributors:
</binding>
</extension>
- <extension point="org.eclipse.ui.contexts">
+ <extension point="org.eclipse.ui.contexts" id="ui-context">
<?gmfgen generated="true"?>
<context
description="%context.description"
@@ -322,7 +316,7 @@ Contributors:
</context>
</extension>
- <extension point="org.eclipse.ui.commands">
+ <extension point="org.eclipse.ui.commands" id="update-cmd">
<?gmfgen generated="true"?>
<command
categoryId="org.eclipse.ui.category.edit"
@@ -332,7 +326,7 @@ Contributors:
name="%update.diagram.name"/>
</extension>
- <extension point="org.eclipse.ui.bindings">
+ <extension point="org.eclipse.ui.bindings" id="update-cmd-binding">
<?gmfgen generated="true"?>
<key
commandId="org.eclipse.gmf.examples.taipan.port.diagram.updateDiagram"
@@ -340,5 +334,38 @@ Contributors:
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="F5"/>
</extension>
+<extension point="org.eclipse.ui.menus" id="context-menus">
+ <?gmfgen generated="true"?>
+ <!-- menuContribution locationURI="menu:org.eclipse.ui.main.menu?after=">
+ </menuContribution>
+ <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=">
+ </menuContribution -->
+ <menuContribution locationURI="popup:org.eclipse.gmf.runtime.diagram.ui.DiagramEditorContextMenu">
+ <command commandId="org.eclipse.gmf.examples.taipan.port.diagram.LoadResourceAction">
+ <visibleWhen>
+ <and>
+ <with variable="activePartId"><equals value="org.eclipse.gmf.examples.taipan.port.diagram.part.PortDiagramEditorID"/></with>
+ <with variable="selection"><iterate ifEmpty="false">
+ <instanceof value="org.eclipse.gmf.examples.taipan.port.diagram.edit.parts.PortEditPart"/>
+ </iterate></with>
+ </and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+
+<extension point="org.eclipse.ui.commands" id="menu-commands">
+ <?gmfgen generated="true"?>
+ <category id="org.eclipse.gmf.examples.taipan.port.diagram.part.PortDiagramEditorID" name="%cmdcategory.name" description="%cmdcategory.desc"/>
+ <command id="org.eclipse.gmf.examples.taipan.port.diagram.LoadResourceAction"
+ name="Load Resource"
+ categoryId="org.eclipse.gmf.examples.taipan.port.diagram.part.PortDiagramEditorID"
+ defaultHandler="org.eclipse.gmf.examples.taipan.port.diagram.part.LoadResourceAction"/>
+ </extension>
+
+<extension point="org.eclipse.ui.handlers" id="menu-handlers">
+ <?gmfgen generated="true"?>
+ </extension>
+
</plugin>
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/commands/BuildingCreateCommand.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/commands/BuildingCreateCommand.java
index 5bace7478..93e7f878d 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/commands/BuildingCreateCommand.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/commands/BuildingCreateCommand.java
@@ -11,23 +11,34 @@
*/
package org.eclipse.gmf.examples.taipan.port.diagram.edit.commands;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.examples.taipan.Building;
+import org.eclipse.gmf.examples.taipan.Port;
+import org.eclipse.gmf.examples.taipan.TaiPanFactory;
import org.eclipse.gmf.examples.taipan.TaiPanPackage;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.commands.CreateElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
*/
-public class BuildingCreateCommand extends CreateElementCommand {
+public class BuildingCreateCommand extends EditElementCommand {
/**
* @generated
*/
public BuildingCreateCommand(CreateElementRequest req) {
- super(req);
+ super(req.getLabel(), null, req);
}
/**
@@ -44,8 +55,38 @@ public class BuildingCreateCommand extends CreateElementCommand {
/**
* @generated
*/
- protected EClass getEClassToEdit() {
- return TaiPanPackage.eINSTANCE.getPort();
+ public boolean canExecute() {
+ return true;
+
+ }
+
+ /**
+ * @generated
+ */
+ protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ Building newElement = TaiPanFactory.eINSTANCE.createBuilding();
+
+ Port owner = (Port) getElementToEdit();
+ owner.getBuildings().add(newElement);
+
+ doConfigure(newElement, monitor, info);
+
+ ((CreateElementRequest) getRequest()).setNewElement(newElement);
+ return CommandResult.newOKCommandResult(newElement);
+ }
+
+ /**
+ * @generated
+ */
+ protected void doConfigure(Building newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
+ IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
+ ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
+ configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
+ configureRequest.addParameters(getRequest().getParameters());
+ ICommand configureCommand = elementType.getEditCommand(configureRequest);
+ if (configureCommand != null && configureCommand.canExecute()) {
+ configureCommand.execute(monitor, info);
+ }
}
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/parts/BuildingEditPart.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/parts/BuildingEditPart.java
index 4a0f244b0..7a358ebf5 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/parts/BuildingEditPart.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/parts/BuildingEditPart.java
@@ -225,7 +225,6 @@ public class BuildingEditPart extends ShapeNodeEditPart {
* @generated
*/
protected IFigure getContentPaneFor(IGraphicalEditPart editPart) {
-
return getContentPane();
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/PortItemSemanticEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/PortItemSemanticEditPolicy.java
index 4133328f9..7d5149d48 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/PortItemSemanticEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/PortItemSemanticEditPolicy.java
@@ -38,9 +38,6 @@ public class PortItemSemanticEditPolicy extends TaiPanBaseItemSemanticEditPolicy
*/
protected Command getCreateCommand(CreateElementRequest req) {
if (TaiPanElementTypes.Building_2001 == req.getElementType()) {
- if (req.getContainmentFeature() == null) {
- req.setContainmentFeature(TaiPanPackage.eINSTANCE.getPort_Buildings());
- }
return getGEFWrapper(new BuildingCreateCommand(req));
}
return super.getCreateCommand(req);
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanBaseItemSemanticEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanBaseItemSemanticEditPolicy.java
index d09177183..988f68a8b 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanBaseItemSemanticEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanBaseItemSemanticEditPolicy.java
@@ -114,19 +114,20 @@ public class TaiPanBaseItemSemanticEditPolicy extends SemanticEditPolicy {
IEditCommandRequest completedRequest = completeRequest(request);
Command semanticCommand = getSemanticCommandSwitch(completedRequest);
semanticCommand = getEditHelperCommand(completedRequest, semanticCommand);
- boolean shouldProceed = true;
if (completedRequest instanceof DestroyRequest) {
- shouldProceed = shouldProceed((DestroyRequest) completedRequest);
+ DestroyRequest destroyRequest = (DestroyRequest) completedRequest;
+ return shouldProceed(destroyRequest) ? addDeleteViewCommand(semanticCommand, destroyRequest) : null;
}
- if (shouldProceed) {
- if (completedRequest instanceof DestroyRequest) {
- TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
- Command deleteViewCommand = new ICommandProxy(new DeleteCommand(editingDomain, (View) getHost().getModel()));
- semanticCommand = semanticCommand == null ? deleteViewCommand : semanticCommand.chain(deleteViewCommand);
- }
- return semanticCommand;
- }
- return null;
+ return semanticCommand;
+ }
+
+ /**
+ * @generated
+ */
+ protected Command addDeleteViewCommand(Command mainCommand, DestroyRequest completedRequest) {
+ TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
+ Command deleteViewCommand = getGEFWrapper(new DeleteCommand(editingDomain, (View) getHost().getModel()));
+ return mainCommand == null ? deleteViewCommand : mainCommand.chain(deleteViewCommand);
}
/**
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextNonResizableEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextNonResizableEditPolicy.java
index a0045bc05..cda566900 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextNonResizableEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextNonResizableEditPolicy.java
@@ -16,6 +16,7 @@ import java.util.List;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
@@ -45,6 +46,11 @@ public class TaiPanTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
/**
* @generated
*/
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
protected void showPrimarySelection() {
if (getHostFigure() instanceof WrappingLabel) {
((WrappingLabel) getHostFigure()).setSelected(true);
@@ -65,6 +71,7 @@ public class TaiPanTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
refreshSelectionFeedback();
hideFocus();
}
@@ -80,6 +87,7 @@ public class TaiPanTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
} else {
if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
}
hideFocus();
@@ -202,6 +210,21 @@ public class TaiPanTextNonResizableEditPolicy extends NonResizableEditPolicyEx {
/**
* @generated
*/
+ private FigureListener getHostPositionListener() {
+ if (hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
+
+ /**
+ * @generated
+ */
protected List createSelectionHandles() {
MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
moveHandle.setBorder(null);
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextSelectionEditPolicy.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextSelectionEditPolicy.java
index 8ac429c13..71e010ada 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextSelectionEditPolicy.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/edit/policies/TaiPanTextSelectionEditPolicy.java
@@ -13,6 +13,7 @@ package org.eclipse.gmf.examples.taipan.port.diagram.edit.policies;
import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureListener;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
@@ -39,6 +40,11 @@ public class TaiPanTextSelectionEditPolicy extends SelectionEditPolicy {
/**
* @generated
*/
+ private FigureListener hostPositionListener;
+
+ /**
+ * @generated
+ */
protected void showPrimarySelection() {
if (getHostFigure() instanceof WrappingLabel) {
((WrappingLabel) getHostFigure()).setSelected(true);
@@ -59,6 +65,7 @@ public class TaiPanTextSelectionEditPolicy extends SelectionEditPolicy {
} else {
hideSelection();
addFeedback(selectionFeedbackFigure = createSelectionFeedbackFigure());
+ getHostFigure().addFigureListener(getHostPositionListener());
refreshSelectionFeedback();
hideFocus();
}
@@ -74,6 +81,7 @@ public class TaiPanTextSelectionEditPolicy extends SelectionEditPolicy {
} else {
if (selectionFeedbackFigure != null) {
removeFeedback(selectionFeedbackFigure);
+ getHostFigure().removeFigureListener(getHostPositionListener());
selectionFeedbackFigure = null;
}
hideFocus();
@@ -192,4 +200,19 @@ public class TaiPanTextSelectionEditPolicy extends SelectionEditPolicy {
refreshSelectionFeedback();
refreshFocusFeedback();
}
+
+ /**
+ * @generated
+ */
+ private FigureListener getHostPositionListener() {
+ if (hostPositionListener == null) {
+ hostPositionListener = new FigureListener() {
+
+ public void figureMoved(IFigure source) {
+ refreshFeedback();
+ }
+ };
+ }
+ return hostPositionListener;
+ }
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/AbstractParser.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/AbstractParser.java
index 37f37871a..6afde88b7 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/AbstractParser.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/AbstractParser.java
@@ -257,7 +257,7 @@ public abstract class AbstractParser implements IParser {
} else if (value instanceof String) {
value = Boolean.valueOf((String) value);
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (Character.TYPE.equals(iClass)) {
if (value instanceof Character) {
@@ -270,7 +270,7 @@ public abstract class AbstractParser implements IParser {
value = new Character(s.charAt(0));
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (Byte.TYPE.equals(iClass)) {
if (value instanceof Byte) {
@@ -285,11 +285,11 @@ public abstract class AbstractParser implements IParser {
try {
value = Byte.valueOf(s);
} catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversionMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
}
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (Short.TYPE.equals(iClass)) {
if (value instanceof Short) {
@@ -304,11 +304,11 @@ public abstract class AbstractParser implements IParser {
try {
value = Short.valueOf(s);
} catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversionMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
}
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (Integer.TYPE.equals(iClass)) {
if (value instanceof Integer) {
@@ -323,11 +323,11 @@ public abstract class AbstractParser implements IParser {
try {
value = Integer.valueOf(s);
} catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversionMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
}
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (Long.TYPE.equals(iClass)) {
if (value instanceof Long) {
@@ -342,11 +342,11 @@ public abstract class AbstractParser implements IParser {
try {
value = Long.valueOf(s);
} catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversionMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
}
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (Float.TYPE.equals(iClass)) {
if (value instanceof Float) {
@@ -361,11 +361,11 @@ public abstract class AbstractParser implements IParser {
try {
value = Float.valueOf(s);
} catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversionMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
}
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (Double.TYPE.equals(iClass)) {
if (value instanceof Double) {
@@ -380,22 +380,22 @@ public abstract class AbstractParser implements IParser {
try {
value = Double.valueOf(s);
} catch (NumberFormatException nfe) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversionMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_WrongStringConversion, iClass.getName()));
}
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, iClass.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, iClass.getName()));
}
} else if (type instanceof EEnum) {
if (value instanceof String) {
EEnumLiteral literal = ((EEnum) type).getEEnumLiteralByLiteral((String) value);
if (literal == null) {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnknownLiteralMessage, value));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnknownLiteral, value));
} else {
value = literal.getInstance();
}
} else {
- value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueTypeMessage, String.class.getName()));
+ value = new InvalidValue(NLS.bind(Messages.AbstractParser_UnexpectedValueType, String.class.getName()));
}
}
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/NativeParser.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/NativeParser.java
new file mode 100644
index 000000000..538b56d1e
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/parsers/NativeParser.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and 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:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.port.diagram.parsers;
+
+import java.util.Arrays;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus;
+import org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus;
+
+/**
+ * @generated
+ */
+public class NativeParser extends AbstractParser {
+
+ /**
+ * @generated
+ */
+ public NativeParser(EAttribute[] features) {
+ super(features);
+ if (features.length != 1) {
+ throw new IllegalArgumentException(Arrays.toString(features));
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public NativeParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ if (features.length != 1) {
+ throw new IllegalArgumentException(Arrays.toString(features));
+ }
+ if (editableFeatures.length != 1) {
+ throw new IllegalArgumentException(Arrays.toString(editableFeatures));
+ }
+ }
+
+ /**
+ * @generated
+ */
+ public String getEditString(IAdaptable adapter, int flags) {
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
+ String s = EcoreUtil.convertToString(editableFeatures[0].getEAttributeType(), element.eGet(editableFeatures[0]));
+ return s != null ? s : ""; //$NON-NLS-1$
+ }
+
+ /**
+ * @generated
+ */
+ public IParserEditStatus isValidEditString(IAdaptable adapter, String editString) {
+ return ParserEditStatus.EDITABLE_STATUS;
+ }
+
+ /**
+ * @generated
+ */
+ public ICommand getParseCommand(IAdaptable adapter, String newString, int flags) {
+ Object value = EcoreUtil.createFromString(editableFeatures[0].getEAttributeType(), newString);
+ return getParseCommand(adapter, new Object[] { value }, flags);
+ }
+
+ /**
+ * @generated
+ */
+ public String getPrintString(IAdaptable adapter, int flags) {
+ EObject element = (EObject) adapter.getAdapter(EObject.class);
+ String s = EcoreUtil.convertToString(features[0].getEAttributeType(), element.eGet(features[0]));
+ return s != null ? s : ""; //$NON-NLS-1$
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/LoadResourceAction.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/LoadResourceAction.java
new file mode 100644
index 000000000..fde939f02
--- /dev/null
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/LoadResourceAction.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and 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:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+package org.eclipse.gmf.examples.taipan.port.diagram.part;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * @generated
+ */
+public class LoadResourceAction extends AbstractHandler {
+
+ /**
+ * @generated
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IEditorPart diagramEditor = HandlerUtil.getActiveEditorChecked(event);
+ Shell shell = diagramEditor.getEditorSite().getShell();
+ assert diagramEditor instanceof DiagramEditor;
+ TransactionalEditingDomain editingDomain = ((DiagramEditor) diagramEditor).getEditingDomain();
+ org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog loadResourceDialog = new org.eclipse.emf.edit.ui.action.LoadResourceAction.LoadResourceDialog(shell, editingDomain);
+ loadResourceDialog.open();
+ return null;
+ }
+
+}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/Messages.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/Messages.java
index c535cdc04..813477a22 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/Messages.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/Messages.java
@@ -139,22 +139,22 @@ public class Messages extends NLS {
/**
* @generated
*/
- public static String TaiPanInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle;
+ public static String InitDiagramFile_ResourceErrorDialogTitle;
/**
* @generated
*/
- public static String TaiPanInitDiagramFileAction_InitDiagramFileResourceErrorDialogMessage;
+ public static String InitDiagramFile_ResourceErrorDialogMessage;
/**
* @generated
*/
- public static String TaiPanInitDiagramFileAction_InitDiagramFileWizardTitle;
+ public static String InitDiagramFile_WizardTitle;
/**
* @generated
*/
- public static String TaiPanInitDiagramFileAction_OpenModelFileDialogTitle;
+ public static String InitDiagramFile_OpenModelFileDialogTitle;
/**
* @generated
@@ -274,17 +274,17 @@ public class Messages extends NLS {
/**
* @generated
*/
- public static String AbstractParser_UnexpectedValueTypeMessage;
+ public static String AbstractParser_UnexpectedValueType;
/**
* @generated
*/
- public static String AbstractParser_WrongStringConversionMessage;
+ public static String AbstractParser_WrongStringConversion;
/**
* @generated
*/
- public static String AbstractParser_UnknownLiteralMessage;
+ public static String AbstractParser_UnknownLiteral;
/**
* @generated
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDiagramActionBarContributor.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDiagramActionBarContributor.java
index 379d33b08..c46892617 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDiagramActionBarContributor.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDiagramActionBarContributor.java
@@ -12,6 +12,10 @@
package org.eclipse.gmf.examples.taipan.port.diagram.part;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPage;
/**
* @generated
@@ -31,4 +35,15 @@ public class TaiPanDiagramActionBarContributor extends DiagramActionBarContribut
protected String getEditorId() {
return PortDiagramEditor.ID;
}
+
+ /**
+ * @generated
+ */
+ public void init(IActionBars bars, IWorkbenchPage page) {
+ super.init(bars, page);
+ // print preview
+ IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(IWorkbenchActionConstants.M_FILE);
+ assert fileMenu != null;
+ fileMenu.remove("pageSetupAction"); //$NON-NLS-1$
+ }
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDocumentProvider.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDocumentProvider.java
index 3c408c45e..54e01ea59 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDocumentProvider.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanDocumentProvider.java
@@ -76,7 +76,7 @@ public class TaiPanDocumentProvider extends AbstractDocumentProvider implements
protected ElementInfo createElementInfo(Object element) throws CoreException {
if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
throw new CoreException(new Status(IStatus.ERROR, PortDiagramEditorPlugin.ID, 0, NLS.bind(Messages.TaiPanDocumentProvider_IncorrectInputError, new Object[] { element,
- "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
null));
}
IEditorInput editorInput = (IEditorInput) element;
@@ -94,7 +94,7 @@ public class TaiPanDocumentProvider extends AbstractDocumentProvider implements
protected IDocument createDocument(Object element) throws CoreException {
if (false == element instanceof FileEditorInput && false == element instanceof URIEditorInput) {
throw new CoreException(new Status(IStatus.ERROR, PortDiagramEditorPlugin.ID, 0, NLS.bind(Messages.TaiPanDocumentProvider_IncorrectInputError, new Object[] { element,
- "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
null));
}
IDocument document = createEmptyDocument();
@@ -239,7 +239,7 @@ public class TaiPanDocumentProvider extends AbstractDocumentProvider implements
}
} else {
throw new CoreException(new Status(IStatus.ERROR, PortDiagramEditorPlugin.ID, 0, NLS.bind(Messages.TaiPanDocumentProvider_IncorrectInputError, new Object[] { element,
- "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
null));
}
}
@@ -553,13 +553,13 @@ public class TaiPanDocumentProvider extends AbstractDocumentProvider implements
} else {
fireElementStateChangeFailed(element);
throw new CoreException(new Status(IStatus.ERROR, PortDiagramEditorPlugin.ID, 0, NLS.bind(Messages.TaiPanDocumentProvider_IncorrectInputError, new Object[] { element,
- "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
+ "org.eclipse.ui.part.FileEditorInput", "org.eclipse.emf.common.ui.URIEditorInput" }), //$NON-NLS-1$ //$NON-NLS-2$
null));
}
if (false == document instanceof IDiagramDocument) {
fireElementStateChangeFailed(element);
throw new CoreException(new Status(IStatus.ERROR, PortDiagramEditorPlugin.ID, 0,
- "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
+ "Incorrect document used: " + document + " instead of org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument", null)); //$NON-NLS-1$ //$NON-NLS-2$
}
IDiagramDocument diagramDocument = (IDiagramDocument) document;
final Resource newResource = diagramDocument.getEditingDomain().getResourceSet().createResource(newResoruceURI);
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanInitDiagramFileAction.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanInitDiagramFileAction.java
index 13415ff7a..4b5f6e8f2 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanInitDiagramFileAction.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanInitDiagramFileAction.java
@@ -87,12 +87,11 @@ public class TaiPanInitDiagramFileAction implements IObjectActionDelegate {
PortDiagramEditorPlugin.getInstance().logError("Unable to load resource: " + domainModelURI, ex); //$NON-NLS-1$
}
if (diagramRoot == null) {
- MessageDialog.openError(getShell(), Messages.TaiPanInitDiagramFileAction_InitDiagramFileResourceErrorDialogTitle,
- Messages.TaiPanInitDiagramFileAction_InitDiagramFileResourceErrorDialogMessage);
+ MessageDialog.openError(getShell(), Messages.InitDiagramFile_ResourceErrorDialogTitle, Messages.InitDiagramFile_ResourceErrorDialogMessage);
return;
}
Wizard wizard = new TaiPanNewDiagramFileWizard(domainModelURI, diagramRoot, editingDomain);
- wizard.setWindowTitle(NLS.bind(Messages.TaiPanInitDiagramFileAction_InitDiagramFileWizardTitle, PortEditPart.MODEL_ID));
+ wizard.setWindowTitle(NLS.bind(Messages.InitDiagramFile_WizardTitle, PortEditPart.MODEL_ID));
TaiPanDiagramEditorUtil.runWizard(getShell(), wizard, "InitDiagramFile"); //$NON-NLS-1$
}
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanNewDiagramFileWizard.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanNewDiagramFileWizard.java
index c4cac0f30..bbe64c0da 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanNewDiagramFileWizard.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/part/TaiPanNewDiagramFileWizard.java
@@ -73,7 +73,7 @@ public class TaiPanNewDiagramFileWizard extends Wizard {
myFileCreationPage.setTitle(Messages.TaiPanNewDiagramFileWizard_CreationPageTitle);
myFileCreationPage.setDescription(NLS.bind(Messages.TaiPanNewDiagramFileWizard_CreationPageDescription, PortEditPart.MODEL_ID));
IPath filePath;
- String fileName = domainModelURI.trimFileExtension().lastSegment();
+ String fileName = URI.decode(domainModelURI.trimFileExtension().lastSegment());
if (domainModelURI.isPlatformResource()) {
filePath = new Path(domainModelURI.trimSegments(1).toPlatformString(true));
} else if (domainModelURI.isFile()) {
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/preferences/DiagramPreferenceInitializer.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/preferences/DiagramPreferenceInitializer.java
index 7527158ec..e7e7c5e74 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/preferences/DiagramPreferenceInitializer.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/preferences/DiagramPreferenceInitializer.java
@@ -32,7 +32,6 @@ public class DiagramPreferenceInitializer extends AbstractPreferenceInitializer
*/
public void initializeDefaultPreferences() {
IPreferenceStore store = getPreferenceStore();
- DiagramPrintingPreferencePage.initDefaults(store);
store.setDefault(IPreferenceConstants.PREF_SHOW_CONNECTION_HANDLES, true);
store.setDefault(IPreferenceConstants.PREF_SHOW_POPUP_BARS, true);
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanModelingAssistantProvider.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanModelingAssistantProvider.java
index a795617a7..b5a156cc1 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanModelingAssistantProvider.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanModelingAssistantProvider.java
@@ -46,7 +46,7 @@ public class TaiPanModelingAssistantProvider extends ModelingAssistantProvider {
public List getTypesForPopupBar(IAdaptable host) {
IGraphicalEditPart editPart = (IGraphicalEditPart) host.getAdapter(IGraphicalEditPart.class);
if (editPart instanceof PortEditPart) {
- List types = new ArrayList();
+ ArrayList types = new ArrayList(1);
types.add(TaiPanElementTypes.Building_2001);
return types;
}
diff --git a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanParserProvider.java b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanParserProvider.java
index 23e1f50d7..362dcdc1a 100644
--- a/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanParserProvider.java
+++ b/examples/org.eclipse.gmf.examples.taipan.port.diagram/src/org/eclipse/gmf/examples/taipan/port/diagram/providers/TaiPanParserProvider.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.examples.taipan.TaiPanPackage;
import org.eclipse.gmf.examples.taipan.port.diagram.edit.parts.BuildingInfoEditPart;
+import org.eclipse.gmf.examples.taipan.port.diagram.parsers.NativeParser;
import org.eclipse.gmf.examples.taipan.port.diagram.part.TaiPanVisualIDRegistry;
import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
import org.eclipse.gmf.runtime.common.core.service.IOperation;
@@ -43,7 +44,7 @@ public class TaiPanParserProvider extends AbstractProvider implements IParserPro
private IParser getBuildingInfo_3001Parser() {
if (buildingInfo_3001Parser == null) {
EAttribute[] features = new EAttribute[] { TaiPanPackage.eINSTANCE.getBuilding_Info() };
- Parser_1_1 parser = new Parser_1_1(features);
+ NativeParser parser = new NativeParser(features);
buildingInfo_3001Parser = parser;
}
return buildingInfo_3001Parser;

Back to the top