Package com.mucommander.ui.dialog.pref.component

Examples of com.mucommander.ui.dialog.pref.component.PrefRadioButton


        setLayout(new BorderLayout());

        YBoxPanel northPanel = new YBoxPanel();

        JRadioButton useDefaultShellRadioButton = new JRadioButton(Translator.get("prefs_dialog.default_shell") + ':');
        useCustomShellRadioButton = new PrefRadioButton(Translator.get("prefs_dialog.custom_shell") + ':') {
      public boolean hasChanged() {
        return isSelected() != MuConfigurations.getPreferences().getVariable(MuPreference.USE_CUSTOM_SHELL, MuPreferences.DEFAULT_USE_CUSTOM_SHELL);
      }
        };
View Full Code Here


        // Time format
        YBoxPanel timeFormatPanel = new YBoxPanel();
        timeFormatPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("prefs_dialog.time")));

        time12RadioButton = new PrefRadioButton(Translator.get("prefs_dialog.time_12_hour")) {
      public boolean hasChanged() {
        String timeFormat = MuConfigurations.getPreferences().getVariable(MuPreference.TIME_FORMAT);
            return isSelected() != (timeFormat.equals(HOUR_12_TIME_FORMAT) || timeFormat.equals(HOUR_12_TIME_FORMAT_WITH_SECONDS));
      }
        };
        time12RadioButton.addActionListener(this);
        PrefRadioButton time24RadioButton = new PrefRadioButton(Translator.get("prefs_dialog.time_24_hour")) {
      public boolean hasChanged() {
        String timeFormat = MuConfigurations.getPreferences().getVariable(MuPreference.TIME_FORMAT);
            return isSelected() != (timeFormat.equals(HOUR_24_TIME_FORMAT) || timeFormat.equals(HOUR_24_TIME_FORMAT_WITH_SECONDS));
      }
        };
        time24RadioButton.addActionListener(this);
       
        String timeFormat = MuConfigurations.getPreferences().getVariable(MuPreference.TIME_FORMAT);
        if(timeFormat.equals(HOUR_12_TIME_FORMAT) || timeFormat.equals(HOUR_12_TIME_FORMAT_WITH_SECONDS))
            time12RadioButton.setSelected(true);
        else
            time24RadioButton.setSelected(true);
           
        ButtonGroup buttonGroup = new ButtonGroup();
        buttonGroup.add(time12RadioButton);
        buttonGroup.add(time24RadioButton);

        timeFormatPanel.add(time12RadioButton);
        timeFormatPanel.add(time24RadioButton);
        timeFormatPanel.addSpace(10);

        showSecondsCheckBox = new PrefCheckBox(Translator.get("prefs_dialog.show_seconds")) {
      public boolean hasChanged() {
        return isSelected() != (MuConfigurations.getPreferences().getVariable(MuPreference.TIME_FORMAT).indexOf(":ss")!=-1);
      }
        };
        showSecondsCheckBox.setSelected(timeFormat.indexOf(":ss")!=-1);
        showSecondsCheckBox.addItemListener(this);
        timeFormatPanel.add(showSecondsCheckBox);
        timeFormatPanel.addSpace(10);
        gridPanel.add(timeFormatPanel);

        dateTimeFormatPanel.add(gridPanel);

        // Date/time preview
        tempPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        tempPanel.add(new JLabel(Translator.get("example")+": "));
        previewLabel = new JLabel();
        Calendar calendar = Calendar.getInstance();
        calendar.set(calendar.get(Calendar.YEAR)-1, 11, 31, 23, 59);
        exampleDate = calendar.getTime();
        updatePreviewLabel();
        tempPanel.add(previewLabel);

        dateTimeFormatPanel.add(tempPanel);
     
        mainPanel.add(dateTimeFormatPanel);

        add(mainPanel, BorderLayout.NORTH);
       
        languageComboBox.addDialogListener(parent);
        time12RadioButton.addDialogListener(parent);
        time24RadioButton.addDialogListener(parent);
        dateFormatComboBox.addDialogListener(parent);
        dateSeparatorField.addDialogListener(parent);
        showSecondsCheckBox.addDialogListener(parent);
        showCenturyCheckBox.addDialogListener(parent);
    }
View Full Code Here

        // Startup folders panel
        YBoxPanel startupFolderPanel = new YBoxPanel();
        startupFolderPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("prefs_dialog.startup_folders")));
   
        // Last folders or custom folders selections
        lastFoldersRadioButton = new PrefRadioButton(Translator.get("prefs_dialog.last_folder")) {
      public boolean hasChanged() {
        return !(isSelected() ?
            MuPreferences.STARTUP_FOLDERS_LAST  : MuPreferences.STARTUP_FOLDERS_CUSTOM).equals(
                MuConfigurations.getPreferences().getVariable(MuPreference.STARTUP_FOLDERS));
      }
    };
    customFoldersRadioButton = new PrefRadioButton(Translator.get("prefs_dialog.custom_folder")) {
      public boolean hasChanged() {
        return !(isSelected() ?
            MuPreferences.STARTUP_FOLDERS_CUSTOM : MuPreferences.STARTUP_FOLDERS_LAST).equals(
                MuConfigurations.getPreferences().getVariable(MuPreference.STARTUP_FOLDERS));
      }
View Full Code Here

TOP

Related Classes of com.mucommander.ui.dialog.pref.component.PrefRadioButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.