menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
ModuleNameTreeEntry entry = (ModuleNameTreeEntry)content.getStructuredSelection().getFirstElement();
- if(!entry.isModule)
- manager.add(new Action("New Module...") {
- @Override
- public void run() {
- CreateModuleDialog dialog = new CreateModuleDialog(content.getControl().getShell(), SCLModuleBrowser.this);
- dialog.setPackage(entry.fullName);
- dialog.open();
- }
- });
+ manager.add(new Action("New Module...") {
+ @Override
+ public void run() {
+ CreateModuleDialog dialog = new CreateModuleDialog(content.getControl().getShell(), SCLModuleBrowser.this);
+ dialog.setPackage(entry.fullName);
+ dialog.open();
+ }
+ });
}
});
Menu menu = menuMgr.createContextMenu(content.getControl());