use of net.sourceforge.processdash.ui.lib.BoxUtils in project processdash by dtuma.
the class UserEditor method makeToolbar.
private Component makeToolbar(boolean editable) {
FilterHandler filterer = EventHandler.create(FilterHandler.class, this, "updateFilter");
BoxUtils toolbar = BoxUtils.hbox();
searchField = new JTextField(10);
searchField.getDocument().addDocumentListener(filterer);
toolbar.addItems(resources.getString("Find") + ":", 3, searchField, 20);
showInactiveCheckbox = new JCheckBox(resources.getString("Show_Inactive"));
showInactiveCheckbox.addActionListener(filterer);
if (isLegacyPdesMode()) {
showInactiveCheckbox.setSelected(true);
} else {
toolbar.addItem(showInactiveCheckbox);
}
toolbar.addItems(100, BoxUtils.GLUE);
if (editable) {
AbstractAction add = (//
PersonLookupDialog.isLookupServerConfigured() ? new AddPdesUserAction() : new AddPlainUserAction());
toolbar.addItems(5, new JButton(add));
}
toolbar.addItems(5, new JButton(new ViewAction()));
if (editable)
toolbar.addItems(5, new JButton(new DeleteAction()));
toolbar.addItem(new JOptionPaneTweaker.MakeResizable());
toolbar.addItem(new JOptionPaneTweaker.DisableKeys());
return toolbar;
}
use of net.sourceforge.processdash.ui.lib.BoxUtils in project processdash by dtuma.
the class TaskScheduleChart method showSaveAsDialog.
private TaskScheduleChartSettings showSaveAsDialog(TaskScheduleChartSettings currentSettings, String chartID) {
String title = resources.getString("Configure.Save_As.Window_Title");
String namePrompt = resources.getString("Configure.Save_As.Name_Prompt");
JTextField chartNameField = new JTextField();
if (currentSettings != null)
chartNameField.setText(currentSettings.getCustomName());
new JOptionPaneActionHandler().install(chartNameField);
String scopePrompt = resources.getString("Configure.Save_As.Scope_Prompt");
ButtonGroup group = new ButtonGroup();
JRadioButton localScopeButton = new JRadioButton(resources.getString("Configure.Save_As.Scope_Local"));
group.add(localScopeButton);
JRadioButton globalScopeButton = new JRadioButton(resources.getString("Configure.Save_As.Scope_Global"));
group.add(globalScopeButton);
boolean global = (currentSettings != null && currentSettings.isGlobal());
(global ? globalScopeButton : localScopeButton).setSelected(true);
String errorKey = null;
while (true) {
BoxUtils errorBox;
if (errorKey != null) {
JLabel errorLabel = new JLabel(resources.getString(errorKey));
errorLabel.setForeground(Color.RED);
errorBox = BoxUtils.hbox(20, errorLabel);
} else {
errorBox = BoxUtils.hbox();
}
Object[] message = { namePrompt, BoxUtils.hbox(20, chartNameField), new JOptionPaneTweaker.GrabFocus(chartNameField), errorBox, scopePrompt, BoxUtils.hbox(20, localScopeButton), BoxUtils.hbox(20, globalScopeButton) };
int userChoice = JOptionPane.showConfirmDialog(configurationDialog, message, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
if (userChoice != JOptionPane.OK_OPTION)
return null;
String chartName = chartNameField.getText();
chartName = (chartName == null ? "" : chartName.trim());
if (chartName.length() == 0) {
errorKey = "Configure.Save_As.Name_Missing";
continue;
}
TaskScheduleChartSettings result = new TaskScheduleChartSettings();
if (localScopeButton.isSelected())
result.setTaskListID(taskList.getID());
result.setChartID(chartID);
result.setCustomName(chartName);
if (result.hasSameNameAs(currentSettings) == false && chartNameIsTaken(chartName)) {
errorKey = "Configure.Save_As.Duplicate_Name";
continue;
}
return result;
}
}
use of net.sourceforge.processdash.ui.lib.BoxUtils in project processdash by dtuma.
the class AddTaskDialog method makeNewTaskComponentRow.
private Component makeNewTaskComponentRow() {
BoxUtils result = BoxUtils.hbox();
// create an icon to suggest the parent-child relationship
JLabel childIcon = new JLabel(new ChildIcon());
childIcon.setAlignmentY(0.5f);
result.addItem(childIcon);
// create components for selecting and displaying the task type
result.addItem(createTaskTypeSelector());
taskTypeIcon.setAlignmentY(0.5f);
result.addItem(taskTypeIcon);
result.addItem(4);
// create a text field for entering the new task name
taskName = new JHintTextField(resources.getString("Task_Name_Hint"));
taskName.setDocument(new NodeNameDocument());
taskName.setAlignmentY(0.5f);
result.addItem(taskName);
return result;
}
use of net.sourceforge.processdash.ui.lib.BoxUtils in project processdash by dtuma.
the class SvnLOCDiffPanel method hbox.
private Component hbox(Object... contents) {
BoxUtils result = BoxUtils.hbox(contents);
Dimension d = result.getPreferredSize();
d.width = 3000;
result.setMaximumSize(d);
return result;
}
use of net.sourceforge.processdash.ui.lib.BoxUtils in project processdash by dtuma.
the class FileSystemLOCDiffPanel method hbox.
private Component hbox(Object... contents) {
BoxUtils result = BoxUtils.hbox(contents);
Dimension d = result.getPreferredSize();
d.width = 3000;
result.setMaximumSize(d);
return result;
}
Aggregations