[View]
public static final String ID = "com.lawmin.view";
public static final String ID = "com.lawmin.view";
...
MenuManager menuManager = new MenuManager();
Menu menu = menuManager.createContextMenu(tbRows);
// Set the MenuManager
tbRows.setMenu(menu);
menu.setData(tbvRows); // 이건... 이벤트 발생시 source 추적하기 위해...
menu.setData(tbvRows); // 이건... 이벤트 발생시 source 추적하기 위해...
getSite().registerContextMenu(menuManager, tbvRows);
// Make the selection available
getSite().setSelectionProvider(tbvRows);
...
[Handler]
[plugin.xml]
...
[Handler]
public class LawminHandler extends AbstractHandler {
public Object execute(ExecutionEvent event) throws ExecutionException {
Event ev = (Event)event.getTrigger();
MenuItem item = (MenuItem)ev.widget;
System.out.println(item.getParent().getData()); // 아까 저장한 source 정보
...[plugin.xml]
<menuContribution allPopups="false" locationURI="popup:com.lawmin.view">
<command commandId="com.lawmin.command" label="메뉴1" style="push"></command>
</menuContribution>
<command id="
com.lawmin.command " name="File Export"></command>
<handler class="핸들러클래스" commandId="com.lawmin.command"></handler>