Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 42557 Details for
Bug 143686
Lite Tests: Nodes are not created in tests: getCreateNodeCommand returns null
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fixes the subj
143686.patch (text/plain), 10.02 KB, created by
Boris Blajer
on 2006-05-25 07:32:27 EDT
(
hide
)
Description:
Fixes the subj
Filename:
MIME Type:
Creator:
Boris Blajer
Created:
2006-05-25 07:32:27 EDT
Size:
10.02 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.tests.lite >Index: src/org/eclipse/gmf/tests/lite/gen/LiteGeneratorConfiguration.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gen/LiteGeneratorConfiguration.java,v >retrieving revision 1.1 >diff -u -r1.1 LiteGeneratorConfiguration.java >--- src/org/eclipse/gmf/tests/lite/gen/LiteGeneratorConfiguration.java 22 May 2006 18:14:09 -0000 1.1 >+++ src/org/eclipse/gmf/tests/lite/gen/LiteGeneratorConfiguration.java 25 May 2006 11:32:49 -0000 >@@ -18,6 +18,8 @@ > import org.eclipse.core.commands.ExecutionException; > import org.eclipse.core.commands.operations.IUndoableOperation; > import org.eclipse.core.runtime.NullProgressMonitor; >+import org.eclipse.draw2d.geometry.Dimension; >+import org.eclipse.draw2d.geometry.Point; > import org.eclipse.emf.common.command.AbstractCommand; > import org.eclipse.emf.ecore.EObject; > import org.eclipse.emf.ecore.EStructuralFeature; >@@ -31,11 +33,13 @@ > import org.eclipse.gef.commands.Command; > import org.eclipse.gef.requests.CreateConnectionRequest; > import org.eclipse.gef.requests.CreateRequest; >+import org.eclipse.gef.requests.CreationFactory; > import org.eclipse.gmf.codegen.gmfgen.GenCommonBase; > import org.eclipse.gmf.codegen.gmfgen.GenDiagram; > import org.eclipse.gmf.internal.codegen.lite.Generator; > import org.eclipse.gmf.internal.common.codegen.GeneratorBase; > import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; >+import org.eclipse.gmf.runtime.notation.Node; > import org.eclipse.gmf.runtime.notation.View; > import org.eclipse.gmf.tests.EPath; > import org.eclipse.gmf.tests.setup.RuntimeBasedGeneratorConfiguration; >@@ -66,6 +70,11 @@ > try { > Class requestClass = loadGeneratedClass(getGenModel().getGenDiagram().getPalette().getFactoryQualifiedClassName() + "$CreateRequestEx"); > CreateRequest req = (CreateRequest) requestClass.getConstructor(new Class[] {int[].class}).newInstance(new Object[] {new int[] {nodeType.getVisualID()}}); >+ req.setLocation(new Point(0,0)); >+ req.setSize(new Dimension(100, 100)); >+ Class factoryClass = loadGeneratedClass(getGenModel().getGenDiagram().getPalette().getFactoryQualifiedClassName() + "$ModelCreationFactory"); >+ CreationFactory factory = (CreationFactory) factoryClass.getConstructor(new Class[] {Class.class}).newInstance(new Object[] {Node.class}); >+ req.setFactory(factory); > return findEditPart(parentView).getCommand(req); > } catch (Exception e) { > return null; >#P org.eclipse.gmf.codegen.lite >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java,v >retrieving revision 1.3 >diff -u -r1.3 PaletteFactoryGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java 26 Apr 2006 11:58:48 -0000 1.3 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/PaletteFactoryGenerator.java 25 May 2006 11:32:50 -0000 >@@ -78,7 +78,7 @@ > protected final String TEXT_59 = ".class), smallImage, largeImage) {" + NL + "\t\t\tpublic Tool createTool() {" + NL + "\t\t\t\tTool result = new ConnectionCreationTool() {" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tsetUnloadWhenFinished(true);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected Request createTargetRequest() {" + NL + "\t\t\t\t\t\tCreateConnectionRequestEx request = new CreateConnectionRequestEx(visualIds);" + NL + "\t\t\t\t\t\trequest.setFactory(getFactory());" + NL + "\t\t\t\t\t\treturn request;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\tresult.setProperties(getToolProperties());" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t}"; > protected final String TEXT_60 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PaletteContainer createContainer(String title) {" + NL + "\t\treturn new PaletteDrawer(title);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ImageDescriptor getImage(Object o) {" + NL + "\t\tIItemLabelProvider labelProvider = (IItemLabelProvider) domainAdapterFactory.adapt(o, IItemLabelProvider.class);" + NL + "\t\tif (labelProvider != null) {" + NL + "\t\t\treturn ExtendedImageRegistry.getInstance().getImageDescriptor(labelProvider.getImage(o));" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class CreateRequestEx extends "; > protected final String TEXT_61 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final int[] visualIds;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic CreateRequestEx(int[] visualIds) {" + NL + "\t\t\tthis.visualIds = visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int[] getVisualIds() {" + NL + "\t\t\treturn visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\t((ModelCreationFactory)getFactory()).setCreatedObject(createdObject);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class CreateConnectionRequestEx extends "; >- protected final String TEXT_62 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final int[] visualIds;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic CreateConnectionRequestEx(int[] visualIds) {" + NL + "\t\t\tthis.visualIds = visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int[] getVisualIds() {" + NL + "\t\t\treturn visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\t((ModelCreationFactory)getFactory()).setCreatedObject(createdObject);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class ModelCreationFactory implements CreationFactory {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Object createdObject;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Class createdObjectType;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ModelCreationFactory(Class objectType) {" + NL + "\t\t\tcreatedObjectType = objectType;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object getNewObject() {" + NL + "\t\t\treturn createdObject;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object getObjectType() {" + NL + "\t\t\treturn createdObjectType;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\tthis.createdObject = createdObject;" + NL + "\t\t}" + NL + "\t}" + NL + "}"; >+ protected final String TEXT_62 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final int[] visualIds;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic CreateConnectionRequestEx(int[] visualIds) {" + NL + "\t\t\tthis.visualIds = visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int[] getVisualIds() {" + NL + "\t\t\treturn visualIds;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\t((ModelCreationFactory)getFactory()).setCreatedObject(createdObject);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class ModelCreationFactory implements CreationFactory {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Object createdObject;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Class createdObjectType;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ModelCreationFactory(Class objectType) {" + NL + "\t\t\tcreatedObjectType = objectType;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object getNewObject() {" + NL + "\t\t\treturn createdObject;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object getObjectType() {" + NL + "\t\t\treturn createdObjectType;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setCreatedObject(Object createdObject) {" + NL + "\t\t\tthis.createdObject = createdObject;" + NL + "\t\t}" + NL + "\t}" + NL + "}"; > protected final String TEXT_63 = NL; > > public String generate(Object argument) >Index: templates/editor/PaletteFactory.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/PaletteFactory.javajet,v >retrieving revision 1.3 >diff -u -r1.3 PaletteFactory.javajet >--- templates/editor/PaletteFactory.javajet 26 Apr 2006 11:58:49 -0000 1.3 >+++ templates/editor/PaletteFactory.javajet 25 May 2006 11:32:50 -0000 >@@ -312,7 +312,7 @@ > /** > * @generated > */ >- private static class ModelCreationFactory implements CreationFactory { >+ public static class ModelCreationFactory implements CreationFactory { > /** > * @generated > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 143686
: 42557