FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
Eclipse rcp 정리(enabled when, contextmenu)
1. activeWhen, enabledWhen
1. Workbench core expression
2. Expression Definitions
http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide
%2Fworkbench_cmd_expressions.html
3. Difference :
To show / hide commands from menus, play with the activeWhen clause
To grey / ungrey commands from menu, play with the enabledWhen clause
A command is enabled when at least 1 handler is active and enabled
4. Add extension : plugin.xml > Extensions
<extension point="org.eclipse.ui.handlers">
<handler class="filebrowser.AboutHandler"
commandId="FileBrowser.command.About">
<enabledWhen>
<with variable="activePart">
<instanceof value="filebrowser.BrowserView">
</instanceof>
</with>
</enabledWhen>
</handler>
</extension>
07.15 학습내용
2. Context Menu
1. Add extension : pluin.xml > Extensions
Org.eclipse.ui.menu : context 메뉴를 사용할 클래스의 ID를 LocationURL에 입력
Ex) popup:FileBrowser.browserView
해당 extentsion에 메뉴에 들어갈 command 추가
2. 해당 클래스에 menuManget와 menu생성
MenuManager menuManager = new MenuManager();
Menu menu = menuManager.createContextMenu(Control parent);
parent.setMenu(menu);
getSite().registerContextMenu(menuManager, ISelectionProvider);