Search in sources :

Example 1 with XBoxPanel

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);
}
Also used : XBoxPanel(com.mucommander.commons.util.ui.layout.XBoxPanel)

Example 2 with XBoxPanel

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;
}
Also used : XBoxPanel(com.mucommander.commons.util.ui.layout.XBoxPanel) JButton(javax.swing.JButton)

Example 3 with XBoxPanel

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;
}
Also used : GridLayout(java.awt.GridLayout) XBoxPanel(com.mucommander.commons.util.ui.layout.XBoxPanel) XAlignedComponentPanel(com.mucommander.commons.util.ui.layout.XAlignedComponentPanel) YBoxPanel(com.mucommander.commons.util.ui.layout.YBoxPanel)

Example 4 with XBoxPanel

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;
}
Also used : XBoxPanel(com.mucommander.commons.util.ui.layout.XBoxPanel) BorderLayout(java.awt.BorderLayout)

Example 5 with XBoxPanel

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;
}
Also used : XBoxPanel(com.mucommander.commons.util.ui.layout.XBoxPanel) JLabel(javax.swing.JLabel)

Aggregations

XBoxPanel (com.mucommander.commons.util.ui.layout.XBoxPanel)7 BorderLayout (java.awt.BorderLayout)3 XAlignedComponentPanel (com.mucommander.commons.util.ui.layout.XAlignedComponentPanel)2 Container (java.awt.Container)2 JButton (javax.swing.JButton)2 JLabel (javax.swing.JLabel)2 ComboBoxListener (com.mucommander.commons.util.ui.combobox.ComboBoxListener)1 EditableComboBox (com.mucommander.commons.util.ui.combobox.EditableComboBox)1 SaneComboBox (com.mucommander.commons.util.ui.combobox.SaneComboBox)1 YBoxPanel (com.mucommander.commons.util.ui.layout.YBoxPanel)1 FilePathField (com.mucommander.ui.text.FilePathField)1 FlowLayout (java.awt.FlowLayout)1 GridLayout (java.awt.GridLayout)1 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 JCheckBox (javax.swing.JCheckBox)1 JPanel (javax.swing.JPanel)1 JSpinner (javax.swing.JSpinner)1 JTabbedPane (javax.swing.JTabbedPane)1 JTextField (javax.swing.JTextField)1