[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Integration between Graphical editor and outline view

Gaurav dubey wrote:
hi zeidler,
Thanks for the reply, it really help me a lot. Now i am able to show tree view in outline, now i want to add a menu in the tree for deleting the widget from graphics editor. Cause when i delete a widget from diagram editor the tree item removes but from outline view deletion is not working. Can u give me some idea about how to delete a widget from graphics editor when i select a tree item and press the delete key.



Thanks in advance.

Regards
gaurav


You can do something like this in xxxNavigator :

protected void createEMFMenu(IMenuManager manager, EObject selectedObject) {

		if (!isEMFMenuEnabledFor(selectedObject)) {
			

			return;
		}

TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(getDiagramResource());

IStructuredSelection structuredSelection= new StructuredSelection(selectedObject);
DeleteAction deleteAction = new DeleteAction(editingDomain);
deleteAction.updateSelection(structuredSelection);
manager.add(new ActionContributionItem(deleteAction));


...

greetings urs.