java - Modifying Eclipse EMF Editor New Child menu without changing providers -


i having problem modifying emf's automatically created "new child" menu create submenus kinds of items. found that, default, pipe symbol used separator, child object name hamburger | megaplusbig results in hamburger submenu appearing. this page seems suggest overriding getcreatechildtext() in relevant item provider option.

what want types of model items appear in submenu, , achieve i'd make sure mysubmenu | gets prepended name. problem classes model i'm editing in eclipse in separate jar file can't (or rather shouldn't) modify.

and have not had luck trying achieve in way. other attempt extending basicmodeleditactionprovider , overriding fillcontextmenu() , updateactions() methods. latter create submenus through call basicactionprovider.extractsubmenuactions(), again override, information model objects lost in abstraction. method works on iaction lists , if cast action staticselectioncommandaction (which is), command field has no public getter, , it's through fields of command see actual emf eobject somewhere.

i'm looking not-too-ugly solution doesn't involve modifying item providers in jar file, unless have way.

so in end, solution worked unfortunately hack. went overriding extractsubmenuactions() in basicmodeleditactionprovider, changing give me submenus wanted. ugly part finding emf object to-be-added, unfortunately used reflection forcefully read protected command field of abstracted iaction.

this forcefully breaks encapsulation due external constraints on code, unable modify item providers of model. reflective solution not pretty, works perfectly.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -