Examples of YBoxPanel


Examples of com.mucommander.ui.layout.YBoxPanel


    public ChangeDateDialog(MainFrame mainFrame, FileSet files) {
        super(mainFrame, ActionProperties.getActionLabel(ChangeDateAction.Descriptor.ACTION_ID), files);

        YBoxPanel mainPanel = new YBoxPanel();

        mainPanel.add(new JLabel(ActionProperties.getActionLabel(ChangeDateAction.Descriptor.ACTION_ID)+" :"));
        mainPanel.addSpace(5);

        ButtonGroup buttonGroup = new ButtonGroup();

        AbstractFile destFile = files.size()==1?files.elementAt(0):files.getBaseFolder();
        boolean canChangeDate = destFile.isFileOperationSupported(FileOperation.CHANGE_DATE);

        nowRadioButton = new JRadioButton(Translator.get("change_date_dialog.now"));
        nowRadioButton.setSelected(true);
        nowRadioButton.addItemListener(this);

        mainPanel.add(new FluentPanel(new FlowLayout(FlowLayout.LEFT)).add(nowRadioButton));

        buttonGroup.add(nowRadioButton);
        JRadioButton specificDateRadioButton = new JRadioButton(Translator.get("change_date_dialog.specific_date"));
        buttonGroup.add(specificDateRadioButton);

        this.dateSpinner = new JSpinner(new SpinnerDateModel());
        dateSpinner.setEditor(new JSpinner.DateEditor(dateSpinner, CustomDateFormat.getDateFormatString()));
        // Use the selected file's date if there is only one file, if not use base folder's date.
        dateSpinner.setValue(new Date(destFile.getDate()));
        // Spinner is disabled until the 'Specific date' radio button is selected
        dateSpinner.setEnabled(false);

        mainPanel.add(new FluentPanel(new FlowLayout(FlowLayout.LEFT))
                          .add(specificDateRadioButton)
                          .add(dateSpinner));

        mainPanel.addSpace(10);
        recurseDirCheckBox = new JCheckBox(Translator.get("recurse_directories"));
        mainPanel.add(recurseDirCheckBox);

        mainPanel.addSpace(15);

        // Create file details button and OK/cancel buttons and lay them out a single row
        JPanel fileDetailsPanel = createFileDetailsPanel();

        okButton = new JButton(Translator.get("change"));
        cancelButton = new JButton(Translator.get("cancel"));

        mainPanel.add(createButtonsPanel(createFileDetailsButton(fileDetailsPanel),
                DialogToolkit.createOKCancelPanel(okButton, cancelButton, getRootPane(), this)));
        mainPanel.add(fileDetailsPanel);

        getContentPane().add(mainPanel, BorderLayout.NORTH);

        if(!canChangeDate) {
            nowRadioButton.setEnabled(false);
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

        super(parent, Translator.get("theme_editor.shell_tab"), themeData);
        initUI();
    }

    private JComponent createConfigurationPanel(int fontId, int foregroundId, int backgroundId, int selectedForegroundId, int selectedBackgroundId, JComponent fontListener) {
        YBoxPanel             mainPanel;
        ProportionalGridPanel colorPanel;
        JPanel                flowPanel;
        FontChooser           fontChooser;

        mainPanel = new YBoxPanel();

        fontChooser = createFontChooser(fontId);
        mainPanel.add(fontChooser);
        mainPanel.addSpace(10);
        addFontChooserListener(fontChooser, fontListener);

        colorPanel = new ProportionalGridPanel(3);
        addLabelRow(colorPanel, false);

        addColorButtons(colorPanel, fontChooser, "theme_editor.normal", foregroundId, backgroundId).addPropertyChangeListener(this);
        addColorButtons(colorPanel, fontChooser, "theme_editor.selected", selectedForegroundId, selectedBackgroundId).addPropertyChangeListener(this);

        flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        flowPanel.add(colorPanel);
        flowPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));

        mainPanel.add(flowPanel);

        return createScrollPane(mainPanel);
    }
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

        return createScrollPane(mainPanel);
    }

    private JPanel createPreviewPanel() {
        JPanel      panel;
        YBoxPanel   headerPanel;
        JScrollPane scroll;

        panel = new JPanel(new BorderLayout());
        panel.setBorder(BorderFactory.createTitledBorder(Translator.get("preview")));

        headerPanel = new YBoxPanel();
        headerPanel.add(new JLabel(Translator.get("run_dialog.run_command_description") + ":"));
        headerPanel.add(historyPreview = new EditableComboBox(new JTextField("mucommander -v")));
        historyPreview.addItem("mucommander -v");
        historyPreview.addItem("java -version");

        headerPanel.addSpace(10);
        headerPanel.add(new JLabel(Translator.get("run_dialog.command_output")+":"));

        panel.add(headerPanel, BorderLayout.NORTH);

        shellPreview = new JTextArea(15, 15);
        panel.add(scroll = new JScrollPane(shellPreview, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED), BorderLayout.CENTER);
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

        this.mainFrame = mainFrame;
        this.mkfileMode = mkfileMode;

        Container contentPane = getContentPane();

        YBoxPanel mainPanel = new YBoxPanel();
        mainPanel.add(new JLabel(ActionProperties.getActionTooltip(mkfileMode?MkfileAction.Descriptor.ACTION_ID:MkdirAction.Descriptor.ACTION_ID)+" :"));

        // Create a path field with auto-completion capabilities
        pathField = new FilePathField();
        pathField.addActionListener(this);
        mainPanel.add(pathField);

        if(mkfileMode) {
            JPanel tempPanel = new JPanel(new BorderLayout());

            allocateSpaceCheckBox = new JCheckBox(Translator.get("mkfile_dialog.allocate_space")+":", false);
            allocateSpaceCheckBox.addItemListener(this);
            tempPanel.add(allocateSpaceCheckBox, BorderLayout.WEST);

            allocateSpaceChooser = new SizeChooser(false);
            allocateSpaceChooser.setEnabled(false);
            tempPanel.add(allocateSpaceChooser, BorderLayout.EAST);

            mainPanel.add(tempPanel);
        }
       
        mainPanel.addSpace(10);
        contentPane.add(mainPanel, BorderLayout.NORTH);
       
        okButton = new JButton(Translator.get("create"));
        JButton cancelButton = new JButton(Translator.get("cancel"));
        contentPane.add(DialogToolkit.createOKCancelPanel(okButton, cancelButton, getRootPane(), this), BorderLayout.SOUTH);
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

    private boolean proceedWithRename = false;
    public BatchRenameConfirmationDialog(MainFrame mainFrame, FileSet files, int changed, int unchanged) {
        super(mainFrame, ActionProperties.getActionLabel(BatchRenameAction.Descriptor.ACTION_ID), mainFrame);

        YBoxPanel mainPanel = new YBoxPanel();
        String msg = Translator.get("batch_rename_dialog.proceed_renaming", Integer.toString(changed), Integer.toString(unchanged));
        mainPanel.add(new InformationPane(msg,
                Translator.get("this_operation_cannot_be_undone"),
                Font.BOLD, InformationPane.getPredefinedIcon(InformationPane.WARNING_ICON)));
        mainPanel.addSpace(10);
        btnRename = new JButton(Translator.get("rename"));
        JButton cancelButton = new JButton(Translator.get("cancel"));
        mainPanel.add(DialogToolkit.createOKCancelPanel(btnRename, cancelButton, getRootPane(), this));
        getContentPane().add(mainPanel);
        setInitialFocusComponent(btnRename);

        // Call dispose() when dialog is closed
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel


    // - UI initialisation ------------------------------------------------------
    // --------------------------------------------------------------------------
    private void initUI() {
        YBoxPanel mainPanel;

        mainPanel = new YBoxPanel();

        // Look and feel.
        mainPanel.add(createLookAndFeelPanel());
        mainPanel.add(Box.createRigidArea(new Dimension(0, 10)));

        // Themes.
        mainPanel.add(createThemesPanel());
        mainPanel.add(Box.createRigidArea(new Dimension(0, 10)));

        // System icons.
        mainPanel.add(createSystemIconsPanel());
        mainPanel.add(Box.createVerticalGlue());

        // Icon size.
        mainPanel.add(createIconSizePanel());
        mainPanel.add(Box.createRigidArea(new Dimension(0, 10)));

        setLayout(new BorderLayout());
        add(mainPanel, BorderLayout.NORTH);
       
        lookAndFeelComboBox.addDialogListener(parent);
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

     */
    private JPanel createLookAndFeelPanel() {
        JPanel lnfPanel;

        // Creates the panel.
        lnfPanel = new YBoxPanel();
        lnfPanel.setAlignmentX(LEFT_ALIGNMENT);
        lnfPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("prefs_dialog.look_and_feel")));

        // Creates the look and feel combo box.
        lookAndFeelComboBox = new PrefComboBox() {
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

        super(mainFrame, title, files);

        this.errorDialogTitle = errorDialogTitle;
        this.enableTransferOptions = enableTransferOptions;

        mainPanel = new YBoxPanel();
        mainPanel.add(new JLabel(labelText+" :"));

        // Create a path field with auto-completion capabilities
        pathField = new FilePathField();

        JPanel borderPanel = new JPanel(new BorderLayout());
        borderPanel.add(pathField, BorderLayout.CENTER);
        // Spinning dial displayed while I/O-bound operations are being performed in a separate thread
        spinningDial = new SpinningDial(false);
        borderPanel.add(new JLabel(spinningDial), BorderLayout.EAST);
        mainPanel.add(borderPanel);
        mainPanel.addSpace(10);
        pathField.getDocument().addDocumentListener(this);

        // Path field will receive initial focus
        setInitialFocusComponent(pathField);   

        if(enableTransferOptions) {
            // Combo box that allows the user to choose the default action when a file already exists in destination
            mainPanel.add(new JLabel(Translator.get("destination_dialog.file_exists_action")+" :"));
            fileExistsActionComboBox = new JComboBox();
            fileExistsActionComboBox.addItem(Translator.get("ask"));
            int nbChoices = DEFAULT_ACTIONS_TEXT.length;
            for(int i=0; i<nbChoices; i++)
                fileExistsActionComboBox.addItem(DEFAULT_ACTIONS_TEXT[i]);
            mainPanel.add(fileExistsActionComboBox);

            skipErrorsCheckBox = new JCheckBox(Translator.get("destination_dialog.skip_errors"));
            mainPanel.add(skipErrorsCheckBox);

            verifyIntegrityCheckBox = new JCheckBox(Translator.get("destination_dialog.verify_integrity"));
            mainPanel.add(verifyIntegrityCheckBox);

            mainPanel.addSpace(10);
        }

        getContentPane().add(mainPanel, BorderLayout.NORTH);

        // Create file details button and OK/cancel buttons and lay them out a single row
        JPanel fileDetailsPanel = createFileDetailsPanel();

        okButton = new JButton(okText);
        // Prevent the dialog from being validated while the initial path is being set.
        okButton.setEnabled(false);
        JButton cancelButton = new JButton(Translator.get("cancel"));

        YBoxPanel buttonsPanel = new YBoxPanel();
        buttonsPanel.add(createButtonsPanel(createFileDetailsButton(fileDetailsPanel),
                DialogToolkit.createOKCancelPanel(okButton, cancelButton, getRootPane(), this)));
        buttonsPanel.add(fileDetailsPanel);

        getContentPane().add(buttonsPanel, BorderLayout.SOUTH);

        // Set minimum/maximum dimension
        setMinimumSize(MINIMUM_DIALOG_DIMENSION);
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

            // Figures out which files to send and calculates the number of files and the number of bytes
            this.flattenedFiles = getFlattenedFiles(files);
     
            Container contentPane = getContentPane();
     
            YBoxPanel mainPanel = new YBoxPanel(5);
 
            // Text fields panel
            XAlignedComponentPanel compPanel = new XAlignedComponentPanel();

            // From (sender) field, non editable
            JLabel fromLabel = new JLabel(MuConfigurations.getPreferences().getVariable(MuPreference.MAIL_SENDER_NAME)
                                          +" <"+MuConfigurations.getPreferences().getVariable(MuPreference.MAIL_SENDER_ADDRESS)+">");
            //      fromField.setEditable(false);
            compPanel.addRow(Translator.get("email_dialog.from")+":", fromLabel, 10);
     
            // To (recipients) field
            toField = new JTextField(lastTo);
            compPanel.addRow(Translator.get("email_dialog.to")+":", toField, 10);
     
            // Subject field
            subjectField = new JTextField(lastSubject);
            compPanel.addRow(Translator.get("email_dialog.subject")+":", subjectField, 15);

            mainPanel.add(compPanel);   
 
            // Body area
            bodyArea = new JTextArea(lastBody);
            bodyArea.setRows(6);
            bodyArea.setLineWrap(true);
            JScrollPane scrollPane = new JScrollPane(bodyArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            mainPanel.add(scrollPane);
     
            mainPanel.addSpace(15);
     
            // Label showing the number of files and total size
            infoLabel = new JLabel();
            mainPanel.add(infoLabel);     

            contentPane.add(mainPanel, BorderLayout.NORTH);
     
            // checkbox showing all files that are to be sent, allowing them to be unselected
            int nbFiles = flattenedFiles.size();
            fileCheckboxes = new JCheckBox[nbFiles];
            if(nbFiles>0) {
                YBoxPanel tempPanel2 = new YBoxPanel();
                AbstractFile file;
                for(int i=0; i<nbFiles; i++) {
                    file = flattenedFiles.elementAt(i);
                    fileCheckboxes[i] = new JCheckBox(file.getName()
                                                      +" ("+ SizeFormat.format(file.getSize(), SizeFormat.DIGITS_MEDIUM| SizeFormat.UNIT_SHORT| SizeFormat.INCLUDE_SPACE| SizeFormat.ROUND_TO_KB)+")", true);
                    fileCheckboxes[i].addItemListener(this);
                    tempPanel2.add(fileCheckboxes[i]);
                }
                scrollPane = new JScrollPane(tempPanel2, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
                contentPane.add(scrollPane, BorderLayout.CENTER);
            }
            updateInfoLabel();
View Full Code Here

Examples of com.mucommander.ui.layout.YBoxPanel

        setLayout(new BorderLayout());


        // 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));
      }
        };
        startupFolderPanel.add(lastFoldersRadioButton);
        startupFolderPanel.addSpace(5);
        startupFolderPanel.add(customFoldersRadioButton);

        ButtonGroup buttonGroup = new ButtonGroup();
        buttonGroup.add(lastFoldersRadioButton);
        buttonGroup.add(customFoldersRadioButton);

        customFoldersRadioButton.addItemListener(this);
       
        // Custom folders specification
        JLabel leftFolderLabel = new JLabel(Translator.get("prefs_dialog.left_folder"));
        leftFolderLabel.setAlignmentX(LEFT_ALIGNMENT);

        JLabel rightFolderLabel = new JLabel(Translator.get("prefs_dialog.right_folder"));
        rightFolderLabel.setAlignmentX(LEFT_ALIGNMENT);

        // Panel that contains the text field and button for specifying custom left folder
        XBoxPanel leftCustomFolderSpecifyingPanel = new XBoxPanel(5);
        leftCustomFolderSpecifyingPanel.setAlignmentX(LEFT_ALIGNMENT);
       
        // Create a path field with auto-completion capabilities
        leftCustomFolderTextField = new PrefFilePathFieldWithDefaultValue(true);
        leftCustomFolderTextField.addKeyListener(this);
        leftCustomFolderSpecifyingPanel.add(leftCustomFolderTextField);

        leftCustomFolderButton = new JButton("...");
        leftCustomFolderButton.addActionListener(this);
        leftCustomFolderSpecifyingPanel.add(leftCustomFolderButton);

        // Panel that contains the text field and button for specifying custom right folder
        XBoxPanel rightCustomFolderSpecifyingPanel = new XBoxPanel(5);
        rightCustomFolderSpecifyingPanel.setAlignmentX(LEFT_ALIGNMENT);

        // Create a path field with auto-completion capabilities
        rightCustomFolderTextField = new PrefFilePathFieldWithDefaultValue(false);
        rightCustomFolderTextField.addKeyListener(this);
        rightCustomFolderSpecifyingPanel.add(rightCustomFolderTextField);

        rightCustomFolderButton = new JButton("...");
        rightCustomFolderButton.addActionListener(this);
        rightCustomFolderSpecifyingPanel.add(rightCustomFolderButton);
       
        JPanel container = new JPanel(new SpringLayout());
        container.add(leftFolderLabel);
        container.add(leftCustomFolderSpecifyingPanel);
        container.add(rightFolderLabel);
        container.add(rightCustomFolderSpecifyingPanel);
       
        //Lay out the panel.
        SpringUtilities.makeCompactGrid(container,
                                        2, 2, //rows, cols
                                        20, 6,        //initX, initY
                                        6, 6);       //xPad, yPad
       
        startupFolderPanel.add(container);
       
        if(MuConfigurations.getPreferences().getVariable(MuPreference.STARTUP_FOLDERS, "").equals(MuPreferences.STARTUP_FOLDERS_LAST)) {
            lastFoldersRadioButton.setSelected(true);
            setCustomFolderComponentsEnabled(false);
        }
        else
            customFoldersRadioButton.setSelected(true);
       
        // --------------------------------------------------------------------------------------------------------------

        YBoxPanel northPanel = new YBoxPanel();
        northPanel.add(startupFolderPanel);
        northPanel.addSpace(5);
   
        showHiddenFilesCheckBox = new PrefCheckBox(Translator.get("prefs_dialog.show_hidden_files")){
      public boolean hasChanged() {
        return isSelected() != MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_HIDDEN_FILES, MuPreferences.DEFAULT_SHOW_HIDDEN_FILES);
      }         
        };
        showHiddenFilesCheckBox.setSelected(MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_HIDDEN_FILES, MuPreferences.DEFAULT_SHOW_HIDDEN_FILES));
        northPanel.add(showHiddenFilesCheckBox);

        // Mac OS X-only options
        if(OsFamily.MAC_OS_X.isCurrent()) {
            // Monitor showHiddenFilesCheckBox state to disable 'show .DS_Store files' option
            // when 'Show hidden files' is disabled, as .DS_Store files are hidden files
            showHiddenFilesCheckBox.addItemListener(this);

            showDSStoreFilesCheckBox = new PrefCheckBox(Translator.get("prefs_dialog.show_ds_store_files")){
        public boolean hasChanged() {
          return isSelected() != MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_DS_STORE_FILES, MuPreferences.DEFAULT_SHOW_DS_STORE_FILES);
        }
            };
            showDSStoreFilesCheckBox.setSelected(MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_DS_STORE_FILES,
                                                                                  MuPreferences.DEFAULT_SHOW_DS_STORE_FILES));
            showDSStoreFilesCheckBox.setEnabled(showHiddenFilesCheckBox.isSelected());
            // Shift the check box to the right to indicate that it is a sub-option
            northPanel.add(showDSStoreFilesCheckBox, 20);
        }

        if (OsFamily.MAC_OS_X.isCurrent() || OsFamily.WINDOWS.isCurrent()) {
          showSystemFoldersCheckBox = new PrefCheckBox(Translator.get("prefs_dialog.show_system_folders")) {
            public boolean hasChanged() {
              return isSelected() != MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_SYSTEM_FOLDERS, MuPreferences.DEFAULT_SHOW_SYSTEM_FOLDERS);
            }
          };
          showSystemFoldersCheckBox.setSelected(MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_SYSTEM_FOLDERS,
              MuPreferences.DEFAULT_SHOW_SYSTEM_FOLDERS));
          northPanel.add(showSystemFoldersCheckBox);         
        }

        compactSizeCheckBox = new PrefCheckBox(Translator.get("prefs_dialog.compact_file_size")) {
      public boolean hasChanged() {
        return isSelected() != MuConfigurations.getPreferences().getVariable(MuPreference.DISPLAY_COMPACT_FILE_SIZE, MuPreferences.DEFAULT_DISPLAY_COMPACT_FILE_SIZE);
      }
        };
        compactSizeCheckBox.setSelected(MuConfigurations.getPreferences().getVariable(MuPreference.DISPLAY_COMPACT_FILE_SIZE,
                                                                         MuPreferences.DEFAULT_DISPLAY_COMPACT_FILE_SIZE));
        northPanel.add(compactSizeCheckBox);

        followSymlinksCheckBox = new PrefCheckBox(Translator.get("prefs_dialog.follow_symlinks_when_cd")) {
      public boolean hasChanged() {
        return isSelected() != MuConfigurations.getPreferences().getVariable(MuPreference.CD_FOLLOWS_SYMLINKS, MuPreferences.DEFAULT_CD_FOLLOWS_SYMLINKS);
      }
        };
        followSymlinksCheckBox.setSelected(MuConfigurations.getPreferences().getVariable(MuPreference.CD_FOLLOWS_SYMLINKS,
                                                                            MuPreferences.DEFAULT_CD_FOLLOWS_SYMLINKS));
        northPanel.add(followSymlinksCheckBox);

        showTabHeaderCheckBox = new PrefCheckBox(Translator.get("prefs_dialog.show_tab_header")) {
      public boolean hasChanged() {
        return isSelected() != MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_TAB_HEADER, MuPreferences.DEFAULT_SHOW_TAB_HEADER);
      }
        };
        showTabHeaderCheckBox.setSelected(MuConfigurations.getPreferences().getVariable(MuPreference.SHOW_TAB_HEADER,
                                                                            MuPreferences.DEFAULT_SHOW_TAB_HEADER));
        northPanel.add(showTabHeaderCheckBox);
       
        add(northPanel, BorderLayout.NORTH);
       
        lastFoldersRadioButton.addDialogListener(parent);
        customFoldersRadioButton.addDialogListener(parent);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.