use of javax.swing.JMenuBar in project processdash by dtuma.
the class AddTaskDialog method createTaskTypeSelector.
private Component createTaskTypeSelector() {
List<AddTaskTypeOption> taskTypes = handler.getTaskTypes(targetParent.path(), activeTask.path());
taskTypeIcon = new JLabel();
if (taskTypes.size() == 1) {
setSelectedTaskType(taskTypes.get(0));
return null;
} else {
JMenu typeMenu = makeTaskTypeMenu(taskTypes);
new MouseHandler(typeMenu, taskTypeIcon);
JMenuBar menuBar = new JMenuBar();
menuBar.setMinimumSize(new Dimension(0, 0));
menuBar.setPreferredSize(new Dimension(0, 1));
menuBar.setMaximumSize(new Dimension(0, 100));
menuBar.add(typeMenu);
if (this.taskType == null)
setSelectedTaskType(taskTypes.get(0));
return menuBar;
}
}
use of javax.swing.JMenuBar in project processdash by dtuma.
the class TeamProjectBrowser method augmentTeamDashboardFileMenu.
/**
* Add team-project-related items to the File menu.
*/
private void augmentTeamDashboardFileMenu(ProcessDashboard dash) {
JMenuBar menuBar = dash.getConfigurationMenus();
if (Settings.isReadWrite()) {
JMenu fileMenu = menuBar.getMenu(0);
fileMenu.insert(new NewProjectAction(), 0);
fileMenu.insert(new AlterTeamProjectMenu(), 1);
}
UserGroupManager groupMgr = UserGroupManager.getInstance();
if (groupMgr.isEnabled()) {
GroupFilterMenu groupFilterMenu = new GroupFilterMenu(UserGroup.EVERYONE, groupMgr.isIndivFilteringSupported());
groupFilterMenu.addGroupChangeListener(handler);
menuBar.add(Box.createHorizontalGlue());
menuBar.add(groupFilterMenu);
}
}
use of javax.swing.JMenuBar in project gitblit by gitblit.
the class GitblitManager method getCenterPanel.
private JPanel getCenterPanel() {
serverTabs = new JTabbedPane(JTabbedPane.TOP);
JMenuBar menubar = setupMenu();
JPanel panel = new JPanel(new BorderLayout());
panel.add(menubar, BorderLayout.NORTH);
panel.add(serverTabs, BorderLayout.CENTER);
return panel;
}
use of javax.swing.JMenuBar in project gitblit by gitblit.
the class GitblitManager method setupMenu.
private JMenuBar setupMenu() {
JMenuBar menuBar = new JMenuBar();
JMenu serversMenu = new JMenu(Translation.get("gb.servers"));
menuBar.add(serversMenu);
recentMenu = new JMenu(Translation.get("gb.recent"));
serversMenu.add(recentMenu);
JMenuItem manage = new JMenuItem(Translation.get("gb.manage") + "...");
manage.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_DOWN_MASK, false));
manage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
manageRegistrations();
}
});
serversMenu.add(manage);
return menuBar;
}
use of javax.swing.JMenuBar in project libgdx by libgdx.
the class PreAlpha method initializeComponents.
private void initializeComponents() {
//Create the menu bar.
JMenuBar menuBar = new JMenuBar();
//Build the first menu.
JMenu menu = new JMenu("File");
menuBar.add(menu);
//a group of JMenuItems
JMenuItem menuItem = new JMenuItem("Open");
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
open();
}
});
menu.add(menuItem);
menuItem = new JMenuItem("Save");
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
save();
}
});
menu.add(menuItem);
setJMenuBar(menuBar);
imagePanel = new ImagePanel();
getContentPane().add(imagePanel);
}
Aggregations