Examples of XAlignedComponentPanel


Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        return categoryToItsActionsWithShortcutsIdsMap;
    }

    private void addTopic(JTabbedPane tabbedPane, String titleKey, Iterator<String> descriptionsIterator) {
        XAlignedComponentPanel compPanel;
        JPanel northPanel;
        JScrollPane scrollPane;

        compPanel = new XAlignedComponentPanel(15);

        // Add all shortcuts and their description
        addShortcutList(compPanel, descriptionsIterator);

        // Panel needs to be vertically aligned to the top
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        tabbedPane.addTab(titleKey, scrollPane);
    }

    private void addTopic(JTabbedPane tabbedPane, String titleKey, Map<String, String> actionsToShortcutsMap) {
        XAlignedComponentPanel compPanel;
        JPanel northPanel;
        JScrollPane scrollPane;

        compPanel = new XAlignedComponentPanel(15);

        // Add all shortcuts and their description
        addShortcutList(compPanel, actionsToShortcutsMap);

        // Panel needs to be vertically aligned to the top
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        this.bookmarkList = listPanel.getDynamicList();

        contentPane.add(listPanel, BorderLayout.CENTER);

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

        // Add bookmark name field
        this.nameField = new JTextField();
        nameField.getDocument().addDocumentListener(this);
        compPanel.addRow(Translator.get("name")+":", nameField, 5);

        // 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
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        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);
       
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

     * Creates the panel in which we'll store the label and name field.
     * @param  name current name.
     * @return      the panel in which we'll store the label and name field.
     */
    private JPanel createNamePanel(String name) {
        XAlignedComponentPanel panel;

        panel = new XAlignedComponentPanel(5);
        nameField = new JTextField();
        nameField.setText(name);
        nameField.setSelectionStart(0);
        nameField.setSelectionEnd(name.length());
        panel.addRow(Translator.get("name"), nameField, 0);

        return panel;
    }
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        if(urlCredentials!=null && guestCredentials!=null && urlCredentials.equals(guestCredentials))
            urlCredentials = null;
        // Retrieve a list of credentials matching the URL from CredentialsManager
        credentialsMappings = CredentialsManager.getMatchingCredentials(fileURL);

        XAlignedComponentPanel compPanel = new XAlignedComponentPanel(10);

        // Connect as Guest/User radio buttons, displayed only if the URL has guest credentials
        if(guestCredentials!=null) {
            guestRadioButton = new JRadioButton(StringUtils.capitalize(guestCredentials.getLogin()));
            guestRadioButton.addActionListener(this);
            compPanel.addRow(Translator.get("auth_dialog.connect_as"), guestRadioButton, 0);

            userRadioButton = new JRadioButton(Translator.get("user"));
            userRadioButton.addActionListener(this);
            compPanel.addRow("", userRadioButton, 15);

            ButtonGroup buttonGroup = new ButtonGroup();
            buttonGroup.add(guestRadioButton);
            buttonGroup.add(userRadioButton);
        }
        // If not, display an introduction label ("please enter a login and password")
        else {
            yPanel.add(new JLabel(Translator.get("auth_dialog.desc")));
            yPanel.addSpace(15);
        }

        // Server URL for which the user has to authenticate
        compPanel.addRow(Translator.get("auth_dialog.server"), new JLabel(fileURL.toString(false)), 10);

        // Login field: create either a text field or an editable combo box, depending on whether
        // CredentialsManager returned matches (-> combo box) or not (-> text field).
        int nbCredentials = credentialsMappings.length;
        JComponent loginComponent;
        if(nbCredentials>0) {
            // Editable combo box
            loginComboBox = new EditableComboBox();
            this.loginField = loginComboBox.getTextField();

            // Add credentials to the combo box's choices
            for(int i=0; i<nbCredentials; i++)
                loginComboBox.addItem(credentialsMappings[i].getCredentials().getLogin());

            loginComboBox.addEditableComboBoxListener(this);

            loginComponent = loginComboBox;
        }
    else {
            // Simple text field
            loginField = new JTextField();
            loginComponent = loginField;
        }

        compPanel.addRow(Translator.get("login"), loginComponent, 5);

        // Create password field
        this.passwordField = new JPasswordField();
        passwordField.addActionListener(this);
        compPanel.addRow(Translator.get("password"), passwordField, 10);

        // Contains the credentials to set in the login and password text fields
        Credentials selectedCredentials = null;
        // Whether the 'save credentials' checkbox should be enabled
        boolean saveCredentialsCheckBoxSelected = false;
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        iconLabel.setVerticalAlignment(JLabel.TOP);
        iconLabel.setBorder(new EmptyBorder(0, 0, 0, 8));

        fileDetailsPanel.add(iconLabel, BorderLayout.WEST);

        XAlignedComponentPanel labelPanel = new XAlignedComponentPanel(10);

        // Contents (set later)
        counterLabel = new JLabel("");
        labelPanel.addRow(Translator.get("properties_dialog.contents")+":", counterLabel, 6);

        // Location (set here)
        labelPanel.addRow(Translator.get("location")+":", new FileLabel(files.getBaseFolder(), true), 6);

        // Combined size (set later)
        JPanel sizePanel;
        sizePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
        sizePanel.add(sizeLabel = new JLabel(""));
        sizePanel.add(new JLabel(dial = new SpinningDial()));
        labelPanel.addRow(Translator.get("size")+":", sizePanel, 6);

        if(OsFamily.MAC_OS_X.isCurrent() && OsVersion.MAC_OS_X_10_4.isCurrentOrHigher()
        && isSingleFile && singleFile.hasAncestor(LocalFile.class)) {
            String comment = OSXFileUtils.getSpotlightComment(singleFile);
            JLabel commentLabel = new JLabel(Translator.get("comment")+":");
            commentLabel.setAlignmentY(JLabel.TOP_ALIGNMENT);
            commentLabel.setVerticalAlignment(SwingConstants.TOP);

            labelPanel.addRow(commentLabel, new MultiLineLabel(comment), 6);
        }

        updateLabels();

        fileDetailsPanel.add(labelPanel, BorderLayout.CENTER);
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        ButtonGroup buttonGroup = new ButtonGroup();
        buttonGroup.add(useDefaultShellRadioButton);
        buttonGroup.add(useCustomShellRadioButton);

        // Shell panel
        XAlignedComponentPanel shellPanel = new XAlignedComponentPanel();
        shellPanel.setLabelLeftAligned(true);
        shellPanel.setBorder(BorderFactory.createTitledBorder(Translator.get("prefs_dialog.shell")));

        // Create a path field with auto-completion capabilities
        customShellField = new PrefFilePathField(MuConfigurations.getPreferences().getVariable(MuPreference.CUSTOM_SHELL, "")) {
      public boolean hasChanged() {
        return isEnabled() && !getText().equals(MuConfigurations.getPreferences().getVariable(MuPreference.CUSTOM_SHELL));
      }
        };
        customShellField.setEnabled(useCustomShellRadioButton.isSelected());

        shellPanel.addRow(useDefaultShellRadioButton, new JLabel(DesktopManager.getDefaultShell()), 5);
        shellPanel.addRow(useCustomShellRadioButton, customShellField, 10);
        shellPanel.addRow(Translator.get("prefs_dialog.shell_encoding"), createShellEncodingPanel(parent), 5);

        northPanel.add(shellPanel, 5);

        northPanel.addSpace(10);
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

        this.lastSelectedItem = (CredentialsMapping) credentialsList.getSelectedValue();

        contentPane.add(listPanel, BorderLayout.CENTER);

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

        // Add login field
        this.loginField = new JTextField();
        compPanel.addRow(Translator.get("login")+":", loginField, 5);

        // Add password field
        this.passwordField = new JPasswordField();
        compPanel.addRow(Translator.get("password")+":", passwordField, 10);

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

        XBoxPanel buttonsPanel = new XBoxPanel();
View Full Code Here

Examples of com.mucommander.ui.layout.XAlignedComponentPanel

     * Initializes the dialog.
     */
    protected void initialize() {
        Container content = getContentPane();
        content.setLayout(new BorderLayout(0, 5));
        XAlignedComponentPanel pnlMain = new XAlignedComponentPanel(10);

        pnlMain.addRow(Translator.get("split_file_dialog.file_to_split") + ":", new JLabel(file.getName()), 0);
        String size = SizeFormat.format(file.getSize(), SizeFormat.DIGITS_FULL | SizeFormat.UNIT_LONG | SizeFormat.INCLUDE_SPACE);
        pnlMain.addRow(Translator.get("size") + ":", new JLabel(size), 10);
       
    edtTargetDirectory = new FilePathField(destFolder.getAbsolutePath(), 40);
        pnlMain.addRow(Translator.get("split_file_dialog.target_directory") + ":", edtTargetDirectory, 5);

        XBoxPanel pnlSize = new XBoxPanel();
    String[] sizes = new String[] {
      MSG_AUTO, 
      "10 " + Translator.get("unit.mb"),
      "100 " + Translator.get("unit.mb"),
      "250 " + Translator.get("unit.mb"),
      "650 " + Translator.get("unit.mb"),
      "700 " + Translator.get("unit.mb")
    };
    edtSize = new JTextField();
    EditableComboBox cbSize = new EditableComboBox(edtSize, sizes);
    cbSize.setComboSelectionUpdatesTextField(true);
    cbSize.setSelectedIndex(1);
    edtSize.addKeyListener(new KeyAdapter() {
      @Override
            public void keyReleased(KeyEvent e) {
        updatePartsNumber();
      }
    });
    cbSize.addComboBoxListener(new ComboBoxListener() {     
      public void comboBoxSelectionChanged(SaneComboBox source) {
        updatePartsNumber();       
      }
    });
    pnlSize.add(cbSize);
    pnlSize.addSpace(10);
    pnlSize.add(new JLabel(Translator.get("split_file_dialog.parts") + ":"));
    pnlSize.addSpace(5);
    spnParts = new JSpinner(new SpinnerNumberModel(1, 1,
                file.getSize(), 1));
    spnParts.addChangeListener(new ChangeListener() {     
      public void stateChanged(ChangeEvent e) {
        if (!edtChange) {
          long parts = ((Number)spnParts.getValue()).longValue();
          long newsize = file.getSize() / parts;
          if (file.getSize() % parts != 0) {
            newsize++;
          }
          if (getBytes() != newsize) {
            edtSize.setText(Long.toString(newsize));
          }
        }
      }
    });  
    pnlSize.add(spnParts);
        pnlMain.addRow(Translator.get("split_file_dialog.part_size") + ":", pnlSize, 0);
       
    cbGenerateCRC = new JCheckBox(Translator.get("split_file_dialog.generate_CRC"));
    cbGenerateCRC.setSelected(true);
    pnlMain.addRow("", cbGenerateCRC, 0);

    content.add(pnlMain, BorderLayout.CENTER);
        content.add(getPnlButtons(), BorderLayout.SOUTH);
        getRootPane().setDefaultButton(btnSplit);
        updatePartsNumber();
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.