Search in sources :

Example 1 with DialogOwner

use of com.mucommander.commons.util.ui.dialog.DialogOwner in project mucommander by mucommander.

the class BinaryViewer method extendMenu.

@Override
public void extendMenu(JMenuBar menuBar) {
    menuBar.add(editMenu);
    menuBar.add(viewMenu);
    EncodingMenu encodingMenu = new EncodingMenu(new DialogOwner(presenter.getWindowFrame()), binaryComponent.getCodeArea().getCharset().name());
    encodingMenu.addEncodingListener((source, oldEncoding, newEncoding) -> changeEncoding(newEncoding));
    menuBar.add(encodingMenu);
}
Also used : EncodingMenu(com.mucommander.ui.encoding.EncodingMenu) DialogOwner(com.mucommander.commons.util.ui.dialog.DialogOwner)

Example 2 with DialogOwner

use of com.mucommander.commons.util.ui.dialog.DialogOwner 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)

Example 3 with DialogOwner

use of com.mucommander.commons.util.ui.dialog.DialogOwner in project mucommander by mucommander.

the class TextEditor method extendMenu.

@Override
public void extendMenu(JMenuBar menuBar) {
    super.extendMenu(menuBar);
    // Encoding menu
    EncodingMenu encodingMenu = new EncodingMenu(new DialogOwner(presenter.getWindowFrame()), textViewerDelegate.getEncoding());
    encodingMenu.addEncodingListener(this);
    menuBar.add(editMenu);
    menuBar.add(viewMenu);
    menuBar.add(encodingMenu);
}
Also used : EncodingMenu(com.mucommander.ui.encoding.EncodingMenu) DialogOwner(com.mucommander.commons.util.ui.dialog.DialogOwner)

Example 4 with DialogOwner

use of com.mucommander.commons.util.ui.dialog.DialogOwner in project mucommander by mucommander.

the class BinaryEditor method extendMenu.

@Override
public void extendMenu(JMenuBar menuBar) {
    menuBar.add(fileMenu);
    menuBar.add(editMenu);
    menuBar.add(viewMenu);
    EncodingMenu encodingMenu = new EncodingMenu(new DialogOwner(presenter.getWindowFrame()), binaryComponent.getCodeArea().getCharset().name());
    encodingMenu.addEncodingListener((source, oldEncoding, newEncoding) -> changeEncoding(newEncoding));
    menuBar.add(encodingMenu);
}
Also used : EncodingMenu(com.mucommander.ui.encoding.EncodingMenu) DialogOwner(com.mucommander.commons.util.ui.dialog.DialogOwner)

Example 5 with DialogOwner

use of com.mucommander.commons.util.ui.dialog.DialogOwner in project mucommander by mucommander.

the class TextViewer method extendMenu.

@Override
public void extendMenu(JMenuBar menuBar) {
    // Encoding menu
    EncodingMenu encodingMenu = new EncodingMenu(new DialogOwner(presenter.getWindowFrame()), encoding);
    encodingMenu.addEncodingListener(this);
    menuBar.add(editMenu);
    menuBar.add(viewMenu);
    menuBar.add(encodingMenu);
}
Also used : EncodingMenu(com.mucommander.ui.encoding.EncodingMenu) DialogOwner(com.mucommander.commons.util.ui.dialog.DialogOwner)

Aggregations

DialogOwner (com.mucommander.commons.util.ui.dialog.DialogOwner)5 EncodingMenu (com.mucommander.ui.encoding.EncodingMenu)4 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