use of net.sourceforge.processdash.ui.lib.DropDownButton in project processdash by dtuma.
the class TaskScheduleDialog method makeDropDownButton.
private DropDownButton makeDropDownButton(TSAction... actions) {
DropDownButton result = new DropDownButton(actions[0]);
for (int i = 1; i < actions.length; i++) result.getMenu().add(actions[i]);
result.setRunFirstMenuOption(false);
return result;
}
use of net.sourceforge.processdash.ui.lib.DropDownButton in project processdash by dtuma.
the class TimeLogEditor method constructFilterPanel.
private JPanel constructFilterPanel() {
JPanel retPanel = new JPanel(false);
retPanel.setLayout(new BoxLayout(retPanel, BoxLayout.X_AXIS));
retPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
DropDownButton button;
JLabel label;
retPanel.add(Box.createHorizontalGlue());
addTimeFormatControl(retPanel);
retPanel.add(new JLabel(" "));
label = new JLabel(getResource("Filter.Label") + " ");
retPanel.add(label);
retPanel.add(Box.createHorizontalStrut(5));
addScrollButton(retPanel, "Filter.Scroll_Backward", "scrollFilterBackward");
fromDate = addDateField(retPanel, "Filter.From");
toDate = addDateField(retPanel, "Filter.To");
addScrollButton(retPanel, "Filter.Scroll_Forward", "scrollFilterForward");
button = new DropDownButton(getResource("Filter.Apply"));
button.setRunFirstMenuOption(false);
button.getButton().addActionListener(createActionListener("applyFilter"));
JMenu menu = button.getMenu();
addFilterMenuItem(menu, "Filter.Today", "filterToday");
addFilterMenuItem(menu, "Filter.Week", "filterThisWeek");
menu.add(createWeekFilterStartDaySubmenu());
addFilterMenuItem(menu, "Filter.Month", "filterThisMonth");
menu.addSeparator();
addFilterMenuItem(menu, "Filter.Remove", "clearFilter");
retPanel.add(button);
retPanel.add(Box.createHorizontalGlue());
return retPanel;
}
use of net.sourceforge.processdash.ui.lib.DropDownButton in project processdash by dtuma.
the class DefectLogEditor method createImportButton.
private DropDownButton createImportButton() {
List importActions = ExtensionManager.getExecutableExtensions("defect-importer", dashboard);
if (importActions.isEmpty())
return null;
DropDownButton result = new DropDownButton(resources.getString("Log.Import_Button"));
result.setMainButtonBehavior(DropDownButton.OPEN_DROP_DOWN_MENU);
result.getMenu().getPopupMenu().addPopupMenuListener(new PopupMenuListener() {
public void popupMenuCanceled(PopupMenuEvent e) {
}
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
}
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
reupdateImportActions();
}
});
for (Iterator i = importActions.iterator(); i.hasNext(); ) {
Action a = (Action) i.next();
if (a.getValue(IMPORT_ACTION_INVALID) != null)
i.remove();
else
result.getMenu().add(a);
}
if (result.isEmpty())
return null;
else
return result;
}
Aggregations