EditpartFactory does not get called [message #244738] |
Thu, 31 July 2008 14:46 |
Eclipse User |
|
|
|
Originally posted by: dkdle.gmail.com
Hi
I got some strange behavior. I created a custom tool in the palette and
when I click the palette. The tool is working fine but the only problem is
that EditpartFactory does not get called when I call XXWritingShape. Apart
from XXWritingShape, everything is working well.
Here is the part of code.
private static PaletteContainer createToolsGroup(PaletteRoot palette) {
toolGroup.add(new XXwritingToolEntry());
}
public class FreeHandwritingToolEntry extends ToolEntry {
public Tool createTool()
{
return new XXwritingTool();
}
}
public class XXwritingTool extends CreationTool {
public XXwritingTool()
{
super();
setFactory(new XXwritingToolFactory());
setUnloadWhenFinished(false);
}
public class XXEditPartFactory implements EditPartFactory {
private EditPart getPartForElement(Object modelElement) {
if (modelElement instanceof XXDiagram) {
return new XXDiagramEditPart(modelElement);
}
if (modelElement instanceof Shape) {
eturn new ShapeEditPart(modelElement);
}
if (modelElement instanceof Connection) {
return new ConnectionEditPart(modelElement);
}
if(modelElement instanceof XXWritingShape) {
return new XXShapeEditPart();
}
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.02703 seconds