use of com.mucommander.commons.util.ui.layout.XBoxPanel in project mucommander by mucommander.
the class CustomizeDialog method initUI.
private void initUI() {
XBoxPanel buttonsPanel;
JPanel tempPanel;
Container contentPane;
// Get content-pane and set its layout.
contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
// Add customization panel
contentPane.add(createCustomizationPanel(), BorderLayout.CENTER);
// Buttons panel.
buttonsPanel = new XBoxPanel();
buttonsPanel.add(applyButton = new JButton(Translator.get("apply")));
buttonsPanel.addSpace(20);
buttonsPanel.add(okButton = new JButton(Translator.get("ok")));
buttonsPanel.add(cancelButton = new JButton(Translator.get("cancel")));
// Disable "commit buttons".
applyButton.setEnabled(false);
okButton.setEnabled(false);
// Buttons listening.
applyButton.addActionListener(this);
okButton.addActionListener(this);
cancelButton.addActionListener(this);
// Aligns the button panel to the right.
tempPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
tempPanel.add(buttonsPanel);
contentPane.add(tempPanel, BorderLayout.SOUTH);
// Selects OK when enter is pressed
getRootPane().setDefaultButton(cancelButton);
// Set preferred size
setPreferredSize(PREFERRED_SIZE);
}
use of com.mucommander.commons.util.ui.layout.XBoxPanel in project mucommander by mucommander.
the class RunDialog method createButtonsArea.
/**
* Creates a panel containing the dialog's buttons.
* @return a panel containing the dialog's buttons.
*/
private XBoxPanel createButtonsArea() {
// Buttons panel
XBoxPanel buttonsPanel;
buttonsPanel = new XBoxPanel();
// 'Clear history' button.
buttonsPanel.add(clearButton = new JButton(Translator.get("run_dialog.clear_history")));
clearButton.addActionListener(this);
// Separator.
buttonsPanel.add(Box.createHorizontalGlue());
// 'Run / stop' and 'Cancel' buttons.
buttonsPanel.add(DialogToolkit.createOKCancelPanel(runStopButton = new JButton(Translator.get("run_dialog.run")), cancelButton = new JButton(Translator.get("cancel")), getRootPane(), this));
return buttonsPanel;
}
use of com.mucommander.commons.util.ui.layout.XBoxPanel in project mucommander by mucommander.
the class BatchRenameDialog method getPnlTop.
/**
* Creates a panel with edit controls.
*/
private JPanel getPnlTop() {
// file & extension mask
edtFileNameMask = new JTextField("[N].[E]");
edtFileNameMask.setColumns(20);
edtFileNameMask.getDocument().addDocumentListener(this);
edtFileNameMask.setToolTipText(getPatternHelp());
// search & replace
edtSearchFor = new JTextField();
edtSearchFor.setColumns(20);
edtSearchFor.getDocument().addDocumentListener(this);
edtReplaceWith = new JTextField();
edtReplaceWith.setColumns(20);
edtReplaceWith.getDocument().addDocumentListener(this);
// upper/lower case
Vector<String> ulcase = new Vector<String>();
ulcase.add(Translator.get("batch_rename_dialog.no_change"));
ulcase.add(Translator.get("batch_rename_dialog.lower_case"));
ulcase.add(Translator.get("batch_rename_dialog.upper_case"));
ulcase.add(Translator.get("batch_rename_dialog.first_upper"));
ulcase.add(Translator.get("batch_rename_dialog.word"));
cbCase = new JComboBox<>(ulcase);
cbCase.addActionListener(this);
// counter
edtCounterStart = new JTextField("1");
edtCounterStart.getDocument().addDocumentListener(this);
edtCounterStart.setColumns(2);
edtCounterStep = new JTextField("1");
edtCounterStep.getDocument().addDocumentListener(this);
edtCounterStep.setColumns(2);
Vector<String> digits = new Vector<String>();
String zeros = "0000";
for (int i = 1; i <= 5; i++) {
digits.add(zeros.substring(0, i - 1) + "1");
}
cbCounterDigits = new JComboBox<>(digits);
cbCounterDigits.addActionListener(this);
// add controls
XBoxPanel pnlTop = new XBoxPanel();
YBoxPanel pnl1 = new YBoxPanel();
pnl1.setBorder(BorderFactory.createTitledBorder(Translator.get("batch_rename_dialog.mask")));
pnl1.add(edtFileNameMask);
JPanel pnl1Btns = new JPanel(new GridLayout(3, 2));
btnName = new JButton("[N] - " + Translator.get("name"));
btnName.addActionListener(this);
btnName.setHorizontalAlignment(SwingConstants.LEFT);
pnl1Btns.add(btnName);
btnExtension = new JButton("[E] - " + Translator.get("extension"));
btnExtension.addActionListener(this);
btnExtension.setHorizontalAlignment(SwingConstants.LEFT);
pnl1Btns.add(btnExtension);
btnNameRange = new JButton("[N#-#] - " + Translator.get("batch_rename_dialog.range"));
btnNameRange.addActionListener(this);
btnNameRange.setHorizontalAlignment(SwingConstants.LEFT);
pnl1Btns.add(btnNameRange);
btnCounter = new JButton("[C] - " + Translator.get("batch_rename_dialog.counter"));
btnCounter.addActionListener(this);
btnCounter.setHorizontalAlignment(SwingConstants.LEFT);
pnl1Btns.add(btnCounter);
pnl1.add(pnl1Btns);
pnl1.add(new JPanel());
pnlTop.add(pnl1);
XAlignedComponentPanel pnl2 = new XAlignedComponentPanel(5);
pnl2.setBorder(BorderFactory.createTitledBorder(Translator.get("batch_rename_dialog.search_replace")));
pnl2.addRow(Translator.get("batch_rename_dialog.search_for"), edtSearchFor, 5);
pnl2.addRow(Translator.get("batch_rename_dialog.replace_with"), edtReplaceWith, 5);
pnl2.addRow(Translator.get("batch_rename_dialog.upper_lower_case"), cbCase, 5);
pnlTop.add(pnl2);
XAlignedComponentPanel pnl3 = new XAlignedComponentPanel(5);
pnl3.setBorder(BorderFactory.createTitledBorder(Translator.get("batch_rename_dialog.counter") + " [C]"));
pnl3.addRow(Translator.get("batch_rename_dialog.start_at"), edtCounterStart, 5);
pnl3.addRow(Translator.get("batch_rename_dialog.step_by"), edtCounterStep, 5);
pnl3.addRow(Translator.get("batch_rename_dialog.format"), cbCounterDigits, 5);
pnlTop.add(pnl3);
return pnlTop;
}
use of com.mucommander.commons.util.ui.layout.XBoxPanel in project mucommander by mucommander.
the class BatchRenameDialog method getPnlButtons.
/**
* Creates bottom panel with buttons.
*/
private JPanel getPnlButtons() {
JPanel pnlButtons = new JPanel(new BorderLayout());
pnlButtons.add(new JButton(getActRemove()), BorderLayout.WEST);
XBoxPanel pnlButtonsRight = new XBoxPanel();
lblDuplicates = new JLabel(Translator.get("batch_rename_dialog.duplicate_names"));
lblDuplicates.setForeground(Color.red);
lblDuplicates.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 15));
pnlButtonsRight.add(lblDuplicates);
btnRename = new JButton(Translator.get("rename"));
btnRename.addActionListener(this);
pnlButtonsRight.add(btnRename);
btnClose = new JButton(Translator.get("cancel"));
btnClose.addActionListener(this);
pnlButtonsRight.add(btnClose);
pnlButtons.add(pnlButtonsRight, BorderLayout.EAST);
return pnlButtons;
}
use of com.mucommander.commons.util.ui.layout.XBoxPanel in project mucommander by mucommander.
the class TabTitleDialog method createInnerPanel.
private JPanel createInnerPanel() {
XBoxPanel panel = new XBoxPanel();
panel.add(new JLabel(Translator.get("title") + ":"));
panel.addSpace(10);
// , BorderLayout.CENTER);
panel.add(titleTextField);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
return panel;
}
Aggregations