bar = new JMenuBar();
if (!isOnlyViewer)
setJMenuBar(bar);
// Allocation of the menus
mProject = new JMenu();
mMRU = new JMenu();
mMRU.setIcon(new ImageIcon(getClass().getResource(
"/icons/recent_16.gif")));
mEdit = new JMenu();
// mView = new JMenu ();
mTask = new JMenu();
mHuman = new JMenu();
mHelp = new JMenu();
mCalendar = new JMenu();
miUndo = new JMenuItem(new UndoAction(getUndoManager(), "16", this));
mEdit.add(miUndo);
// miUndo.setEnabled(false);
miRedo = new JMenuItem(new RedoAction(getUndoManager(), "16", this));
mEdit.add(miRedo);
// miRedo.setEnabled(false);
mEdit.addSeparator();
createProjectMenu();
miRefresh = new JMenuItem(myRefreshAction);
// miRefresh.setAccelerator((KeyStroke)myRefreshAction.getValue(Action.ACCELERATOR_KEY));
mEdit.add(miRefresh);
mEdit.addSeparator();
//miCut = new JMenuItem(myCutAction);
mEdit.add(getViewManager().getCutAction());
//miCopy = new JMenuItem(myCopyAction);
mEdit.add(getViewManager().getCopyAction());
//miPaste = new JMenuItem(myPasteAction);
mEdit.add(getViewManager().getPasteAction());
mEdit.addSeparator();
miOptions = createNewItem("/icons/settings_16.gif");
mEdit.add(miOptions);
myNewTaskAction = new NewTaskAction((IGanttProject) this);
mTask.add(myNewTaskAction);
miDeleteTask = createNewItem("/icons/delete_16.gif");
mTask.add(miDeleteTask);
myTaskPropertiesAction = new TaskPropertiesAction(getProject(), Mediator.getTaskSelectionManager(), getUIFacade());
mTask.add(myTaskPropertiesAction);
getTree().setTaskPropertiesAction(myTaskPropertiesAction);
getResourcePanel().setTaskPropertiesAction(myTaskPropertiesAction);
//
//
myNewHumanAction = new NewHumanAction(getHumanResourceManager(),
getRoleManager(), this, this) {
public void actionPerformed(ActionEvent event) {
super.actionPerformed(event);
getTabs().setSelectedIndex(UIFacade.RESOURCES_INDEX);
}
};
mHuman.add(myNewHumanAction);
myDeleteHumanAction = getResourceActions().getDeleteHumanAction();
miDelHuman = new JMenuItem(myDeleteHumanAction);
mHuman.add(miDelHuman);
//miPropHuman = createNewItem("/icons/properties_16.gif");
//mHuman.add(miPropHuman);
mHuman.add(getResourcePanel().getResourcePropertiesAction());
miSendMailHuman = createNewItem("/icons/send_mail_16.gif");
mHuman.add(miSendMailHuman);
mHuman.add(new ImportResources(getHumanResourceManager(),
getTaskManager(), getRoleManager(), this));
miEditCalendar = createNewItem("/icons/clock_16.gif");
mCalendar.add(miEditCalendar);
miPrjCal = createNewItem("/icons/default_calendar_16.gif");
mCalendar.add(miPrjCal);
miWebPage = createNewItem("/icons/home_16.gif");
mHelp.add(miWebPage);
miManual = createNewItem("/icons/help_16.gif");
try { // See if helpgui library is on the classpath
Class.forName("net.sourceforge.helpgui.HelpGui");
mHelp.add(miManual);
miManual.setAccelerator(KeyStroke.getKeyStroke("F1"));
} catch (Exception ex) {
// Not add the help button on the ui
}
miTips = createNewItem("/icons/about_16.gif");
mHelp.add(miTips);
miAbout = createNewItem("/icons/manual_16.gif");
mHelp.add(miAbout);
if (!isApplet) {
bar.add(mProject); // for a applet veiwer, Project menu is not
// neccessary By CL
}
bar.add(mEdit);
JMenu viewMenu = createViewMenu();
if (viewMenu != null)
bar.add(viewMenu);
// bar.add (mView);
bar.add(mTask);
bar.add(mHuman);