Skip to main content

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 #143996] 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:My vision for SWT editors
Next Topic:How to create new control object on context menu.
Goto Forum:

Current Time: Thu Sep 20 04:29:08 GMT 2018

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

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

Back to the top