Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » How to create new control object on context menu.
How to create new control object on context menu. [message #616986] Wed, 12 March 2008 08:20
Eclipse UserFriend
Originally posted by:

Hi all.
I'm trying to create new awt.Button object on context menu.
I've added the "add Button" to the menu.(I refered other contribution)

And,I made MyAddButtonActionDelegate(based IObjectActionDelegate).
but, I can't create new awt.Button object.
A cause is CommandInstance was UnExecutableCommand...
I read "Extending The Visual Editor", but deeper info was not there.
Please give me some advice.

This is my code.( MyAddButtonActionDelegate#run())
EditPart targetEp = (EditPart)selectedEditParts.get( 0 );
JavaObjectInstance targetObj = (JavaObjectInstance)targetEp.getModel();

Rectangle rect = new Rectangle(0,0,30,30);

CreateRequest cReq = new CreateRequest();
EClass eBtnCls = EcoreFactory.eINSTANCE.createEClass();


CreationFactory cFct = new EMFCreationFactory( eBtnCls );

Command cmd = targetEp.getCommand(cReq); // UnexecutableCommand...
EditDomain ed = targetEp.getViewer().getEditDomain();
Previous Topic:How to create new control object on context menu.
Next Topic:My tip for how to improve RCP
Goto Forum:

Current Time: Sun Nov 29 21:18:21 GMT 2015

Powered by FUDForum. Page generated in 0.02618 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software