Package com.mucommander.ui.layout

Examples of com.mucommander.ui.layout.YBoxPanel


        contentPane.add(label, BorderLayout.NORTH);

        // Checkboxes

        YBoxPanel yPanel = new YBoxPanel();

        checkboxes = new Vector<JCheckBox>();
        JCheckBox checkbox;
        for(String enc : Charset.availableCharsets().keySet()) {
            checkbox = new JCheckBox(enc);
            // Mac OS X: component size
            if(OsFamily.MAC_OS_X.isCurrent())
                checkbox.putClientProperty("JComponent.sizeVariant", "small");

            checkboxes.add(checkbox);
            yPanel.add(checkbox);
        }

        selectCheckboxes(EncodingPreferences.getPreferredEncodings());

        JScrollPane scrollPane = new JScrollPane(yPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
View Full Code Here


        // Sets minimum and maximum dimensions for this dialog
        setMinimumSize(MINIMUM_DIALOG_DIMENSION);
        setMaximumSize(MAXIMUM_DIALOG_DIMENSION);

        mainPanel = new YBoxPanel();

        if(comp!=null) {
            mainPanel.addSpace(5);
            mainPanel.add(comp);
            mainPanel.addSpace(10);
View Full Code Here

            dialog = new FocusDialog((Dialog)owner, title, parentComponent);

        dialog.setMinimumSize(MIN_DIALOG_SIZE);
        dialog.setMaximumSize(MAX_DIALOG_SIZE);

        YBoxPanel mainPanel = new YBoxPanel();

        InformationPane informationPane = new InformationPane(message, captionMessage, captionMessage==null?Font.PLAIN:Font.BOLD, getInformationPaneIconId(dialogType));
        mainPanel.add(informationPane);
        mainPanel.addSpace(10);

        JButton okButton = new JButton(Translator.get("ok"));
        JPanel okPanel = DialogToolkit.createOKPanel(okButton, dialog.getRootPane(), new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dialog.dispose();
            }
        });

        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));

        mainPanel.add(buttonPanel);

        // Show the exception's stack trace in an expandable/collapsible panel
        if(throwable !=null) {
            JTextArea detailsArea = new JTextArea();
            detailsArea.setEditable(false);

            // Get the stack trace as a string
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw, true);
            throwable.printStackTrace(pw);
            pw.close();
            // Fill the area with the stack trace.
            // Tabs by space characters to reduce the text's width
            detailsArea.setText(sw.toString().replace('\t', ' '));

            FontUtils.makeMini(detailsArea);

            JScrollPane scrollPane = new JScrollPane(detailsArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
            buttonPanel.add(new CollapseExpandButton(Translator.get("details"), scrollPane, false));
            mainPanel.add(scrollPane);
        }

        buttonPanel.add(Box.createVerticalGlue());
        buttonPanel.add(okPanel);
       
View Full Code Here

        // Listen to tab change events
        tabbedPane.addChangeListener(this);
        contentPane.add(tabbedPane, BorderLayout.CENTER);
   
        YBoxPanel yPanel = new YBoxPanel();
        XBoxPanel xPanel = new XBoxPanel();
        xPanel.add(new JLabel(Translator.get("server_connect_dialog.server_url")+":"));
        xPanel.addSpace(5);
        urlLabel = new JLabel("");
        updateURLLabel();
        xPanel.add(urlLabel);
        yPanel.add(xPanel);

        yPanel.addSpace(10);

        this.saveCredentialsCheckBox = new JCheckBox(Translator.get("auth_dialog.store_credentials"), false);
        // Enables 'save credentials' checkbox only if server panel/protocol uses credentials
        saveCredentialsCheckBox.setEnabled(currentServerPanel.usesCredentials());
        yPanel.add(saveCredentialsCheckBox);

        JButton okButton = new JButton(Translator.get("server_connect_dialog.connect"));
        cancelButton = new JButton(Translator.get("cancel"));
        yPanel.add(DialogToolkit.createOKCancelPanel(okButton, cancelButton, getRootPane(), this));

        contentPane.add(yPanel, BorderLayout.SOUTH);
   
        // initial focus
        setInitialFocusComponent(currentServerPanel);   
View Full Code Here

        // Create a path field with auto-completion capabilities
        this.locationField = new FilePathField();
        locationField.getDocument().addDocumentListener(this);
        compPanel.addRow(Translator.get("location")+":", locationField, 10);

        YBoxPanel yPanel = new YBoxPanel(10);
        yPanel.add(compPanel);

        // Add buttons: 'remove', 'move up' and 'move down' buttons are enabled
        // only if there is at least one bookmark in the table
        XBoxPanel buttonsPanel = new XBoxPanel();
        JPanel buttonGroupPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));

        MnemonicHelper mnemonicHelper = new MnemonicHelper();

        // New bookmark button
        newButton = new JButton(Translator.get("edit_bookmarks_dialog.new"));
        newButton.setMnemonic(mnemonicHelper.getMnemonic(newButton));
        newButton.addActionListener(this);
        buttonGroupPanel.add(newButton);

        // Duplicate bookmark button
        duplicateButton = new JButton(Translator.get("duplicate"));
        duplicateButton.setMnemonic(mnemonicHelper.getMnemonic(duplicateButton));
        duplicateButton.addActionListener(this);
        buttonGroupPanel.add(duplicateButton);

        // Remove bookmark button
        removeButton = new JButton(bookmarkList.getRemoveAction());
        removeButton.setMnemonic(mnemonicHelper.getMnemonic(removeButton));
        buttonGroupPanel.add(removeButton);

        // Go to bookmark button
        goToButton = new JButton(Translator.get("go_to"));
        goToButton.setMnemonic(mnemonicHelper.getMnemonic(goToButton));
        goToButton.addActionListener(this);
        buttonGroupPanel.add(goToButton);

        buttonsPanel.add(buttonGroupPanel);

        // Button that closes the window
        closeButton = new JButton(Translator.get("close"));
        closeButton.setMnemonic(mnemonicHelper.getMnemonic(closeButton));
        closeButton.addActionListener(this);

        buttonsPanel.add(Box.createHorizontalGlue());
        buttonsPanel.add(closeButton);

        yPanel.add(buttonsPanel);

        contentPane.add(yPanel, BorderLayout.SOUTH);

        // Set initial text components and buttons' enabled state
        updateComponents();
View Full Code Here

    public AddBookmarkDialog(MainFrame mainFrame) {
        super(mainFrame, ActionProperties.getActionLabel(AddBookmarkAction.Descriptor.ACTION_ID), mainFrame);

        Container contentPane = getContentPane();
        YBoxPanel mainPanel = new YBoxPanel(5);

        AbstractFile currentFolder = mainFrame.getActivePanel().getCurrentFolder();

        // Text fields panel
        XAlignedComponentPanel compPanel = new XAlignedComponentPanel();

        // Add name field, editable
        this.nameField = new JTextField(currentFolder.getName());
        nameField.setEditable(true);
        // Monitors text changes to disable 'Add' button if name field is empty
        nameField.getDocument().addDocumentListener(this);
        compPanel.addRow(Translator.get("name")+":", nameField, 10);
   
        // Add URL field, non editable
        this.locationField = new JTextField(currentFolder.getCanonicalPath());
        compPanel.addRow(Translator.get("location")+":", locationField, 10);

        mainPanel.add(compPanel);

        contentPane.add(mainPanel, BorderLayout.NORTH);
       
        addButton = new JButton(Translator.get("add_bookmark_dialog.add"));
        cancelButton = new JButton(Translator.get("cancel"));
View Full Code Here

    /**
     * Initialises the dialog's UI.
     */
    private void init(String name) {
        YBoxPanel panel;

        setMaximumSize(MAXIMUM_DIALOG_DIMENSION);

        // Creates the name panel.
        panel = new YBoxPanel();
        panel.add(createNamePanel(name));

        // Creates the button panel.
        panel.add(new ButtonChoicePanel(new JButton[] {okButton = new JButton(Translator.get("ok")), cancelButton = new JButton(Translator.get("cancel"))},
                                        2, getRootPane()));
        okButton.addActionListener(this);
        cancelButton.addActionListener(this);
        getContentPane().add(panel, BorderLayout.NORTH);
        pack();
View Full Code Here

    /**
     * Creates the shell input part of the dialog.
     * @return the shell input part of the dialog.
     */
    private YBoxPanel createInputArea() {
        YBoxPanel mainPanel;
        JPanel    labelPanel;

        mainPanel = new YBoxPanel();

        // Adds a textual description:
        // - if we're working in a local directory, 'run in current folder'.
        // - if we're working on a non-standard FS, 'run in home folder'.
        mainPanel.add(new JLabel(mainFrame.getActivePanel().getCurrentFolder().getURL().getScheme().equals(FileProtocols.FILE)?
                                 Translator.get("run_dialog.run_command_description")+":" : Translator.get("run_dialog.run_in_home_description")+":"));

        // Adds the shell input combo box.
        mainPanel.add(inputCombo = new ShellComboBox(this));
        inputCombo.setEnabled(true);

        // Adds a textual description of the shell output area.
        mainPanel.addSpace(10);

        labelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        labelPanel.add(new JLabel(Translator.get("run_dialog.command_output")+":"));
        labelPanel.add(new JLabel(dial = new SpinningDial()));
        mainPanel.add(labelPanel);

        return mainPanel;
    }
View Full Code Here

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

    private JPanel createGeneralPanel(FontChooser chooser, ColorButton foreground) {
        YBoxPanel mainPanel;
        JPanel    colorPanel;
        JPanel    flowPanel;

        // Initialises the color panel.
        colorPanel = new ProportionalGridPanel(2);
        colorPanel.add(createCaptionLabel("theme_editor.text"));
        colorPanel.add(foreground);

        // Wraps the color panel in a flow layout.
        flowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        flowPanel.add(colorPanel);
        flowPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("theme_editor.colors")));

        // Creates the general panel.
        mainPanel = new YBoxPanel();
        mainPanel.add(chooser);
        mainPanel.addSpace(10);
        mainPanel.add(flowPanel);

        return mainPanel;
    }
View Full Code Here

        addFontChooserListener(chooser, preview);
    }

    private JPanel createPreviewPanel(FontChooser fontChooser) {
        YBoxPanel previewPanel;
        Insets    insets;

        previewPanel = new YBoxPanel();

        addPreviewLabel(previewPanel, normalPreview = new JLabel(Translator.get("status_bar.selected_files", "3", "14")), "theme_editor.normal", fontChooser);
        normalPreview.setForeground(themeData.getColor(ThemeData.STATUS_BAR_FOREGROUND_COLOR));

        addPreviewLabel(previewPanel, okPreview       = new Preview(OK),       "theme_editor.free_space.ok", fontChooser);
        addPreviewLabel(previewPanel, warningPreview  = new Preview(WARNING)"theme_editor.free_space.warning", fontChooser);
        addPreviewLabel(previewPanel, criticalPreview = new Preview(CRITICAL), "theme_editor.free_space.critical", fontChooser);

        previewPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("preview")));

        insets = previewPanel.getInsets();
        previewPanel.setInsets(new Insets(insets.top, insets.left + 8, insets.bottom, insets.right + 6));

        return previewPanel;
    }
View Full Code Here

TOP

Related Classes of com.mucommander.ui.layout.YBoxPanel

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.