if (newMenu == null) {
newMenu = new MenuManager(Messages.UDIGWorkbenchAdvisor_new, ActionFactory.NEW.getId());
fileMenu.insertAfter(Constants.FILE_START, newMenu);
}
newMenu.add(new GroupMarker(Constants.NEW_START));
List<IConfigurationElement> list = ExtensionPointList
.getExtensionPointList(NewObjectContribution.NEW_ACTION_ID);
Collections.sort(list, new NewObjectDelegateComparator());
for( IConfigurationElement element : list ) {
final NewObjectDelegate item = new NewObjectDelegate(element, window);
Action newAction = new Action(){
@Override
public void runWithEvent( org.eclipse.swt.widgets.Event event ) {
item.runAction();
}
};
newAction.setText(item.text);
newAction.setImageDescriptor(item.icon);
newMenu.appendToGroup(Constants.NEW_START, newAction);
}
newMenu.add(ContributionItemFactory.NEW_WIZARD_SHORTLIST.create(window));
if (fileMenu.findUsingPath(ActionFactory.CLOSE.getId()) == null) {
IAction close = ActionFactory.CLOSE.create(window);
fileMenu.insertAfter(Constants.CLOSE_EXT, close);
}
if (fileMenu.findUsingPath(ActionFactory.CLOSE_ALL.getId()) == null) {
IAction closeAll = ActionFactory.CLOSE_ALL.create(window);
fileMenu.insertAfter(ActionFactory.CLOSE.getId(), closeAll);
}
if (fileMenu.findUsingPath(ActionFactory.SAVE.getId()) == null) {
IAction save = ActionFactory.SAVE.create(window);
fileMenu.insertBefore(Constants.SAVE_EXT, save);
}
if (fileMenu.findUsingPath(ActionFactory.SAVE_ALL.getId()) == null) {
IAction saveAll = ActionFactory.SAVE_ALL.create(window);
fileMenu.insertBefore(Constants.SAVE_EXT, saveAll);
}
//fileMenu.insertAfter(Constants.SAVE_EXT, new GroupMarker(Constants.REVERT_EXT));
fileMenu.insertAfter(Constants.SAVE_EXT, new GroupMarker(Constants.COMMIT_EXT));
fileMenu.insertBefore(Constants.FILE_END, new GroupMarker(Constants.RENAME_EXT));
fileMenu.insertAfter(Constants.RENAME_EXT, new Separator());
if (fileMenu.findUsingPath(ActionFactory.REFRESH.getId()) == null) {
fileMenu.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, new GroupMarker(
ActionFactory.REFRESH.getId()));
}
if (fileMenu.findUsingPath(ActionFactory.IMPORT.getId()) == null) {
IAction _import = ActionFactory.IMPORT.create(window);
fileMenu.insertBefore(Constants.FILE_END, _import);
fileMenu.insertAfter(ActionFactory.IMPORT.getId(), new Separator());
}
if (fileMenu.findUsingPath(ActionFactory.EXPORT.getId()) == null) {
IAction _export = ActionFactory.EXPORT.create(window);
fileMenu.insertBefore(Constants.FILE_END, _export);
fileMenu.insertAfter(ActionFactory.EXPORT.getId(), new Separator());
}
fileMenu.insertBefore(Constants.FILE_END, new GroupMarker(Constants.CONFIG_EXT));
fileMenu.insertAfter(Constants.CONFIG_EXT, new Separator());
if (fileMenu.findUsingPath(ActionFactory.QUIT.getId()) == null) {
IAction exit = ActionFactory.QUIT.create(window);
fileMenu.insertAfter(Constants.FILE_END, exit);