Search in sources :

Example 1 with PrefEncodingSelectBox

use of com.mucommander.ui.dialog.pref.component.PrefEncodingSelectBox in project mucommander by mucommander.

the class MiscPanel method createShellEncodingPanel.

private JPanel createShellEncodingPanel(PreferencesDialog parent) {
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEADING));
    shellEncodingAutoDetectCheckbox = new PrefCheckBox(Translator.get("prefs_dialog.auto_detect_shell_encoding"), () -> MuConfigurations.getPreferences().getVariable(MuPreference.AUTODETECT_SHELL_ENCODING, MuPreferences.DEFAULT_AUTODETECT_SHELL_ENCODING));
    shellEncodingAutoDetectCheckbox.addDialogListener(parent);
    shellEncodingAutoDetectCheckbox.addItemListener(this);
    panel.add(shellEncodingAutoDetectCheckbox);
    shellEncodingSelectBox = new PrefEncodingSelectBox(new DialogOwner(parent), MuConfigurations.getPreferences().getVariable(MuPreference.SHELL_ENCODING)) {

        public boolean hasChanged() {
            return !MuConfigurations.getPreferences().getVariable(MuPreference.SHELL_ENCODING).equals(getSelectedEncoding());
        }
    };
    shellEncodingSelectBox.addDialogListener(parent);
    shellEncodingSelectBox.setEnabled(!shellEncodingAutoDetectCheckbox.isSelected());
    panel.add(shellEncodingSelectBox);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) PrefEncodingSelectBox(com.mucommander.ui.dialog.pref.component.PrefEncodingSelectBox) FlowLayout(java.awt.FlowLayout) PrefCheckBox(com.mucommander.ui.dialog.pref.component.PrefCheckBox) DialogOwner(com.mucommander.commons.util.ui.dialog.DialogOwner)

Aggregations

DialogOwner (com.mucommander.commons.util.ui.dialog.DialogOwner)1 PrefCheckBox (com.mucommander.ui.dialog.pref.component.PrefCheckBox)1 PrefEncodingSelectBox (com.mucommander.ui.dialog.pref.component.PrefEncodingSelectBox)1 FlowLayout (java.awt.FlowLayout)1 JPanel (javax.swing.JPanel)1