Examples of JHtmlLabel


Examples of org.jets3t.gui.JHtmlLabel

        this.s3Service = s3Service;
       
        String introductionText = "<html><center>View and modify your bucket logging settings<br>"
            + "Select a bucket in the <b>Log to</b> list to apply changes<br><b>Note</b>: The target "
            + "bucket's ACL permissions are updated if necessary to allow logging<p>&nbsp;</center></html>";
        JHtmlLabel introductionLabel = new JHtmlLabel(introductionText, hyperlinkListener);
        introductionLabel.setHorizontalAlignment(JLabel.CENTER);
        JHtmlLabel loggingStatusLabel = new JHtmlLabel("<html><b>Logging status</b></html>", hyperlinkListener);
        loggingStatusLabel.setHorizontalAlignment(JLabel.CENTER);       
       
        JHtmlLabel loggedBucketLabel = new JHtmlLabel("Bucket:", hyperlinkListener);
        loggedBucketComboBox = new JComboBox(bucketNames);
        loggedBucketComboBox.insertItemAt("-- Choose a bucket --", 0);
        loggedBucketComboBox.addActionListener(this);       
        JHtmlLabel prefixLabel = new JHtmlLabel("Log file prefix:", hyperlinkListener);
        prefixTextField = new JTextField();
        prefixTextField.setToolTipText("Log files for the bucket start with this prefix. The prefix cannot be empty");
        JHtmlLabel loggedToBucketLabel = new JHtmlLabel("Log to:", hyperlinkListener);
        loggedToBucketComboBox = new JComboBox(bucketNames);
        loggedToBucketComboBox.setToolTipText("Where the bucket's log files will be stored");
        loggedToBucketComboBox.insertItemAt("-- Not Logged --", 0);
        loggedToBucketComboBox.addActionListener(this);
               
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

     
    // Overall container.   
    JPanel container = new JPanel(new GridBagLayout());
        int row = 0;
       
    itemsDescription = new JHtmlLabel("", hyperlinkListener);
    container.add(itemsDescription,
      new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));

    JPanel canonicalAddRemovePanel = new JPanel();
    canonicalAddRemovePanel.add(removeCanonical);
    canonicalAddRemovePanel.add(addCanonical);

        container.add(new JHtmlLabel("<html><b>Canonical User Grantees</b></html>", hyperlinkListener),
            new GridBagConstraints(0, ++row, 2, 1, 0, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, insetsZeroAtBottom, 0, 0));
        container.add(new JScrollPane(canonicalGranteeTable)
      new GridBagConstraints(0, ++row, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZeroAtBottom, 0, 0));
       
        container.add(new JHtmlLabel("<html><b>Group Grantees</b></html>", hyperlinkListener),
            new GridBagConstraints(0, ++row, 1, 1, 1, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, insetsZeroAtBottom, 0, 0));
    container.add(canonicalAddRemovePanel,
      new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsZeroAtTop, 0, 0));

    JPanel groupAddRemovePanel = new JPanel();
    groupAddRemovePanel.add(removeGroup);
    groupAddRemovePanel.add(addGroup);
    container.add(new JScrollPane(groupGranteeTable)
      new GridBagConstraints(0, ++row, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZeroAtBottom, 0, 0));

        container.add(new JHtmlLabel("<html><b>Email Address Grantees</b></html>", hyperlinkListener),
            new GridBagConstraints(0, ++row, 1, 1, 1, 0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, insetsZeroAtBottom, 0, 0));
    container.add(groupAddRemovePanel,
      new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsZeroAtTop, 0, 0));
   
    JPanel emailAddRemovePanel = new JPanel();
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

        String footerHtml = uploaderProperties.getStringProperty("gui.footerHtml", null);       
        String footerIconPath = uploaderProperties.getStringProperty("gui.footerIcon", null);       
       
        // Footer for branding       
        boolean includeFooter = false;
        JHtmlLabel footerLabel = skinsFactory.createSkinnedJHtmlLabel("FooterLabel");
        footerLabel.setHyperlinkeActivatedListener(this);
        footerLabel.setHorizontalAlignment(JLabel.CENTER);
        if (footerHtml != null) {
            footerLabel.setText(replaceMessageVariables(footerHtml));
            includeFooter = true;
        }
        if (footerIconPath != null) {
            guiUtils.applyIcon(footerLabel, footerIconPath);
        }
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

        String passwordTooltipText =
            "The password that protects your encrypted file. "
            + "This password may be left empty if you are sure your computer cannot be compromised";

        // Components.
        JHtmlLabel descriptionLabel = new JHtmlLabel(descriptionText, hyperlinkListener);
        descriptionLabel.setHorizontalAlignment(JLabel.CENTER);       
        folderPathTextField = new JTextField(this.cockpitHomeFolder.getAbsolutePath());
        folderPathTextField.setEnabled(false);
        folderPathTextField.setToolTipText(folderTooltipText);
        JButton browseButton = new JButton(browseButtonText);
        browseButton.addActionListener(this);
        JHtmlLabel accountNicknamesLabel = new JHtmlLabel(accountNicknameText, hyperlinkListener);
        nicknamesTableModel = new AWSCredentialsFileTableModel();
        accountNicknameTable = new JTable(nicknamesTableModel);
        accountNicknameTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        accountNicknameTable.setShowHorizontalLines(true);
        accountNicknameTable.getTableHeader().setVisible(false);
        JScrollPane accountNicknamesScrollPane = new JScrollPane(accountNicknameTable);
        accountNicknamesScrollPane.setToolTipText(accountNicknameTooltipText);
        JHtmlLabel passwordLabel = new JHtmlLabel(passwordLabelText, hyperlinkListener);
        passwordPasswordField = new JPasswordField();
        passwordPasswordField.setToolTipText(passwordTooltipText);
       
        int row = 0;
        add(descriptionLabel, new GridBagConstraints(0, row++,
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

    public SignedGetUrlDialog(Frame ownerFrame, HyperlinkActivatedListener hyperlinkListener) {
        super(ownerFrame, "Generate Signed GET URL", true);
       
        String introductionText = "<html><center>Generate a signed GET URL that you can provide to"
            + " anyone<br>who needs to access objects in your bucket for a limited time.</center></html>";
        JHtmlLabel introductionLabel = new JHtmlLabel(introductionText, hyperlinkListener);
        introductionLabel.setHorizontalAlignment(JLabel.CENTER);
        JHtmlLabel virtualHostLabel = new JHtmlLabel("<html><b>Bucket is a virtual Host?</b></html>", hyperlinkListener);
        virtualHostLabel.setHorizontalAlignment(JLabel.CENTER);       
        JHtmlLabel expiryTimeLabel = new JHtmlLabel("<html><b>Expiry Time</b> (Hours)</html>", hyperlinkListener);
        expiryTimeLabel.setHorizontalAlignment(JLabel.CENTER);       
       
        virtualHostCheckBox = new JCheckBox();
        virtualHostCheckBox.setSelected(false);
        virtualHostCheckBox.setToolTipText("Check this box if your bucket is configured as a virtual host.");
        expiryTimeTextField = new JTextField();
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

    private void initGui() {
        this.setResizable(false);
        this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);

        String introductionText = "<html><center>Configure Cockpit's preferences</center></html>";
        JHtmlLabel introductionLabel = new JHtmlLabel(introductionText, hyperlinkListener);
        introductionLabel.setHorizontalAlignment(JLabel.CENTER);

        cancelButton = new JButton("Cancel");
        cancelButton.setActionCommand("Cancel");
        cancelButton.addActionListener(this);
        okButton = new JButton("Apply preferences");
        okButton.setActionCommand("ApplyPreferences");
        okButton.addActionListener(this);
       
        // Set default ENTER and ESCAPE buttons.
        this.getRootPane().setDefaultButton(okButton);       
        this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
            .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE");
        this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() {
            private static final long serialVersionUID = 1478626539912658292L;

            public void actionPerformed(ActionEvent actionEvent) {
                setVisible(false);
            }
        });       

        JPanel buttonsPanel = new JPanel(new GridBagLayout());
        buttonsPanel.add(cancelButton, new GridBagConstraints(0, 0,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        buttonsPanel.add(okButton, new GridBagConstraints(1, 0,
            1, 1, 1, 0, GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));

        // Uploads preferences pane.
        JPanel uploadPrefsPanel = new JPanel(new GridBagLayout());
        int row = 0;
        JHtmlLabel aclPrefsLabel = new JHtmlLabel(
            "ACL Permissions", hyperlinkListener);
        uploadPrefsPanel.add(aclPrefsLabel, new GridBagConstraints(0, row++,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));

        aclButtonGroup = new ButtonGroup();
        JRadioButton aclPrivateButton = new JRadioButton("Private", true);
        aclPrivateButton.setActionCommand(CockpitPreferences.UPLOAD_ACL_PERMISSION_PRIVATE);
        JRadioButton aclPublicReadButton = new JRadioButton("Public read");
        aclPublicReadButton.setActionCommand(CockpitPreferences.UPLOAD_ACL_PERMISSION_PUBLIC_READ);
        JRadioButton aclPublicReadWriteButton = new JRadioButton("Public read and write");
        aclPublicReadWriteButton.setActionCommand(CockpitPreferences.UPLOAD_ACL_PERMISSION_PUBLIC_READ_WRITE);
        aclButtonGroup.add(aclPrivateButton);
        aclButtonGroup.add(aclPublicReadButton);
        aclButtonGroup.add(aclPublicReadWriteButton);
        JPanel aclPrefsRadioPanel = new JPanel(new GridBagLayout());
        aclPrefsRadioPanel.add(aclPrivateButton, new GridBagConstraints(0, 0,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        aclPrefsRadioPanel.add(aclPublicReadButton, new GridBagConstraints(1, 0,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        aclPrefsRadioPanel.add(aclPublicReadWriteButton, new GridBagConstraints(2, 0,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        uploadPrefsPanel.add(aclPrefsRadioPanel, new GridBagConstraints(0, row++,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
       
        JHtmlLabel compressionPrefsLabel = new JHtmlLabel(
            "Compress files with GZip?", hyperlinkListener);
        uploadPrefsPanel.add(compressionPrefsLabel, new GridBagConstraints(0, row++,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));

        compressButtonGroup = new ButtonGroup();
        JRadioButton compressNoButton = new JRadioButton("Don't compress", true);
        compressNoButton.setActionCommand("INACTIVE");
        JRadioButton compressYesButton = new JRadioButton("Compress");
        compressYesButton.setActionCommand("ACTIVE");
        compressButtonGroup.add(compressNoButton);
        compressButtonGroup.add(compressYesButton);
        JPanel compressPrefsRadioPanel = new JPanel(new GridBagLayout());
        compressPrefsRadioPanel.add(compressNoButton, new GridBagConstraints(0, 0,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        compressPrefsRadioPanel.add(compressYesButton, new GridBagConstraints(1, 0,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        uploadPrefsPanel.add(compressPrefsRadioPanel, new GridBagConstraints(0, row++,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
       
        JHtmlLabel encryptionPrefsLabel = new JHtmlLabel(
            "<html>Encrypt Uploaded Files?<br><font size=\"-2\">If encryption is turned on you must " +
            "also set the Encryption password</html>", hyperlinkListener);
        uploadPrefsPanel.add(encryptionPrefsLabel, new GridBagConstraints(0, row++,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
               
        encryptButtonGroup = new ButtonGroup();
        JRadioButton encryptNoButton = new JRadioButton("Don't encrypt", true);
        encryptNoButton.setActionCommand("INACTIVE");
        JRadioButton encryptYesButton = new JRadioButton("Encrypt");
        encryptYesButton.setActionCommand("ACTIVE");
        encryptButtonGroup.add(encryptNoButton);
        encryptButtonGroup.add(encryptYesButton);
        encryptPasswordField = new JPasswordField();
        JPanel encryptPrefsRadioPanel = new JPanel(new GridBagLayout());
        encryptPrefsRadioPanel.add(encryptNoButton, new GridBagConstraints(0, 0,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        encryptPrefsRadioPanel.add(encryptYesButton, new GridBagConstraints(1, 0,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        uploadPrefsPanel.add(encryptPrefsRadioPanel, new GridBagConstraints(0, row++,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));       

        // Determine the default crypto algorithm from jets3t.properties.
        String encryptAlgorithm = Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME)
            .getStringProperty("crypto.algorithm", "PBEWithMD5AndDES");
        // Determine the available PBE algorithms.
        String[] algorithms = EncryptionUtil.listAvailablePbeCiphers(true);
       
        JPanel encryptionPrefsPanel = new JPanel(new GridBagLayout());
        encryptionPrefsPanel.add(new JHtmlLabel("Password", hyperlinkListener), new GridBagConstraints(0, 0,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        encryptionPrefsPanel.add(encryptPasswordField, new GridBagConstraints(0, 1,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        encryptionPrefsPanel.add(new JHtmlLabel("Algorithm for Encrypting Uploads", hyperlinkListener), new GridBagConstraints(0, 2,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));       
        encryptAlgorithmComboBox = new JComboBox(algorithms);
        encryptAlgorithmComboBox.addActionListener(this);
        encryptAlgorithmComboBox.setSelectedItem(encryptAlgorithm.toUpperCase());
        encryptionPrefsPanel.add(encryptAlgorithmComboBox, new GridBagConstraints(0, 3,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        String algorithmExplanation =
            "<html>This algorithm need not be set correctly to download<br>" +
                   "encrypted objects, as Cockpit will detect and apply the<br>" +
                   "appropriate algorithm.<br><br>" +
                   "<font size=\"-2\">" +
                   "The algorithm list only includes the Password-Based (PBE) algorithms<br>" +                  
                   "available to Java programs on your system.</font></html>";
        encryptionPrefsPanel.add(new JHtmlLabel(algorithmExplanation, hyperlinkListener), new GridBagConstraints(0, 4,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));       
        // Padding
        encryptionPrefsPanel.add(new JLabel(), new GridBagConstraints(0, 5
            1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, insetsDefault, 0, 0));
       
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

           public void actionPerformed(ActionEvent e) {
                JButton sourceButton = (JButton) e.getSource();
                bucketActionMenu.show(sourceButton, 0, sourceButton.getHeight());
           }
        });                       
        bucketsPanel.add(new JHtmlLabel("<html><b>Buckets</b></html>", this),
            new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
        bucketsPanel.add(bucketActionButton,
            new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));

        bucketTableModel = new BucketTableModel();
        bucketTableModelSorter = new TableSorter(bucketTableModel);       
        bucketsTable = new JTable(bucketTableModelSorter);
        bucketTableModelSorter.setTableHeader(bucketsTable.getTableHeader());       
        bucketsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        bucketsTable.getSelectionModel().addListSelectionListener(this);
        bucketsTable.setShowHorizontalLines(true);
        bucketsTable.setShowVerticalLines(true);
        bucketsTable.addMouseListener(new ContextMenuListener());
        bucketsPanel.add(new JScrollPane(bucketsTable),
            new GridBagConstraints(0, 1, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0));
        bucketsPanel.add(new JLabel(" "),
            new GridBagConstraints(0, 2, 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
       
        // Filter panel.
        filterObjectsPanel = new JPanel(new GridBagLayout());
        filterObjectsPrefix = new JTextField();
        filterObjectsPrefix.setToolTipText("Only show objects with this prefix");
        filterObjectsPrefix.addActionListener(this);
        filterObjectsPrefix.setActionCommand("RefreshObjects");
        filterObjectsDelimiter = new JComboBox(new String[] {"", "/", "?", "\\"});
        filterObjectsDelimiter.setEditable(true);
        filterObjectsDelimiter.setToolTipText("Object name delimiter");
        filterObjectsDelimiter.addActionListener(this);
        filterObjectsDelimiter.setActionCommand("RefreshObjects");
        filterObjectsPanel.add(new JHtmlLabel("Prefix:", this),
            new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0));
        filterObjectsPanel.add(filterObjectsPrefix,
            new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        filterObjectsPanel.add(new JHtmlLabel("Delimiter:", this),
            new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        filterObjectsPanel.add(filterObjectsDelimiter,
            new GridBagConstraints(3, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsZero, 0, 0));
        filterObjectsPanel.setVisible(false);
       
        // Objects panel.
        JPanel objectsPanel = new JPanel(new GridBagLayout());
        int row = 0;
        filterObjectsCheckBox = new JCheckBox("Filter objects");
        filterObjectsCheckBox.addActionListener(this);
        filterObjectsCheckBox.setToolTipText("Check this option to filter the objects listed");
        objectsPanel.add(new JHtmlLabel("<html><b>Objects</b></html>", this),
            new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
        objectsPanel.add(filterObjectsCheckBox,
            new GridBagConstraints(1, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
                       
        JButton objectActionButton = new JButton();
        objectActionButton.setToolTipText("Object actions menu");
        guiUtils.applyIcon(objectActionButton, "/images/nuvola/16x16/actions/misc.png");
        objectActionButton.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
                JButton sourceButton = (JButton) e.getSource();
                objectActionMenu.show(sourceButton, 0, sourceButton.getHeight());
           }
        });                       
        objectsPanel.add(objectActionButton,
            new GridBagConstraints(2, row, 1, 1, 0, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
       
        objectsPanel.add(filterObjectsPanel,
            new GridBagConstraints(0, ++row, 3, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
               
        objectsTable = new JTable();
        objectTableModel = new ObjectTableModel();
        objectTableModelSorter = new TableSorter(objectTableModel);       
        objectTableModelSorter.setTableHeader(objectsTable.getTableHeader());       
        objectsTable.setModel(objectTableModelSorter);       
        objectsTable.setDefaultRenderer(Long.class, new DefaultTableCellRenderer() {
            private static final long serialVersionUID = 301092191828910402L;

            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                String formattedSize = byteFormatter.formatByteSize(((Long)value).longValue());
                return super.getTableCellRendererComponent(table, formattedSize, isSelected, hasFocus, row, column);
            }
        });
        objectsTable.setDefaultRenderer(Date.class, new DefaultTableCellRenderer() {
            private static final long serialVersionUID = 7285511556343895652L;

            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                Date date = (Date) value;
                return super.getTableCellRendererComponent(table, yearAndTimeSDF.format(date), isSelected, hasFocus, row, column);
            }
        });       
        objectsTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        objectsTable.getSelectionModel().addListSelectionListener(this);
        objectsTable.setShowHorizontalLines(true);
        objectsTable.setShowVerticalLines(true);
        objectsTable.addMouseListener(new ContextMenuListener());
        objectsTableSP = new JScrollPane(objectsTable);
        objectsPanel.add(objectsTableSP,
                new GridBagConstraints(0, ++row, 3, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0));
        objectsSummaryLabel = new JHtmlLabel("Please select a bucket", this);
        objectsSummaryLabel.setHorizontalAlignment(JLabel.CENTER);
        objectsSummaryLabel.setFocusable(false);
        objectsPanel.add(objectsSummaryLabel,
                new GridBagConstraints(0, ++row, 3, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
       
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

     * JHtmlLabel if no skin-specific implementation is available.
     */
    public JHtmlLabel createSkinnedJHtmlLabel(String itemName, HyperlinkActivatedListener hyperlinkListener) {
        Object instance = instantiateClass(buildSkinnedClassName("SkinnedJHtmlLabel"), itemName);       
        if (instance != null) {
            JHtmlLabel label = (JHtmlLabel) instance;
            label.setHyperlinkeActivatedListener(hyperlinkListener);
            return label;
        } else {
            return new JHtmlLabel(hyperlinkListener);
        }               
    }
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

        cancelButton.addActionListener(this);
        okButton = new JButton("Create Bucket");
        okButton.setActionCommand("OK");
        okButton.addActionListener(this);

        JHtmlLabel bucketNameLabel = new JHtmlLabel("<html><b>Bucket name</b></html>", hyperlinkListener);
        bucketNameLabel.setHorizontalAlignment(JLabel.CENTER);       
        JHtmlLabel bucketLocationLabel = new JHtmlLabel("<html><b>Bucket location</b></html>", hyperlinkListener);
        bucketLocationLabel.setHorizontalAlignment(JLabel.CENTER);       
        JHtmlLabel bucketNameIsValidDNSLabel = new JHtmlLabel("<html>DNS compatible?</html>", hyperlinkListener);
        bucketLocationLabel.setHorizontalAlignment(JLabel.CENTER);       
        bucketNameIsValidDNSResultLabel = new JLabel("No");
       
        bucketLocationComboBox = new JComboBox(new String[] {
            "United States",
            "Europe"
        });
        bucketLocationComboBox.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
               okButton.setEnabled(
                   bucketLocationComboBox.getSelectedIndex() == 0
                   || "Yes".equals(bucketNameIsValidDNSResultLabel.getText()));
           }
        });
        bucketLocationComboBox.setToolTipText("The geographical location where the bucket's contents will be stored");
       
        JHtmlLabel bucketNameIsValidDNSExplanationLabel = null;
        if (disableDnsBuckets) {
            bucketNameIsValidDNSExplanationLabel = new JHtmlLabel(
                "<html><font size=\"-2\">Because the 's3service.disable-dns-buckets' property is set, you<br>" +
                "may only create buckets in the U.S. location.</font></html>", hyperlinkListener);
            bucketLocationComboBox.setEnabled(false);
        } else {
            bucketNameIsValidDNSExplanationLabel = new JHtmlLabel(
                "<html><font size=\"-2\">If your bucket name is DNS-compatible, you can choose a storage location<br>" +
                "other than the U.S. and may potentially use the bucket as a virtual host.</font></html>", hyperlinkListener);
            bucketLocationComboBox.setEnabled(true);
        }       
        bucketNameIsValidDNSExplanationLabel.setHorizontalAlignment(JLabel.CENTER);       
       
        bucketNameTextField = new JTextField();
        bucketNameTextField.setToolTipText("A unique bucket name in S3");
        bucketNameTextField.getDocument().addDocumentListener(new DocumentListener() {
            public void insertUpdate(DocumentEvent e) {
                checkBucketName(e.getDocument());               
            }                       
            public void removeUpdate(DocumentEvent e) {
                checkBucketName(e.getDocument());               
            }           
            public void changedUpdate(DocumentEvent e) {
                checkBucketName(e.getDocument());               
            }
            private void checkBucketName(Document doc) {
                String bucketName = "";
                try {
                    bucketName = doc.getText(0, doc.getLength());
                } catch (BadLocationException e) {
                }
                if (S3Service.isBucketNameValidDNSName(bucketName)) {
                    bucketNameIsValidDNSResultLabel.setText("Yes");
                    okButton.setEnabled(true);
                } else {
                    bucketNameIsValidDNSResultLabel.setText("No");                   
                    // OK button should not be enabled for non-US locations
                    okButton.setEnabled(bucketLocationComboBox.getSelectedIndex() == 0);
                }                               
            }           
        });
        bucketNameTextField.setText(suggestedBucketName);
        bucketNameTextField.setSelectionStart(0);
        bucketNameTextField.setSelectionEnd(suggestedBucketName.length());
                               
        // Set default ENTER and ESCAPE buttons.
        this.getRootPane().setDefaultButton(okButton);       
        this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
            .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE");
        this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() {
            private static final long serialVersionUID = -6225706489569112809L;

            public void actionPerformed(ActionEvent actionEvent) {
                setVisible(false);
                okClicked = false;
            }
        });       
       
        JPanel buttonsPanel = new JPanel(new GridBagLayout());
        buttonsPanel.add(cancelButton, new GridBagConstraints(0, 0,
            1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0));
        buttonsPanel.add(okButton, new GridBagConstraints(1, 0,
            1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsDefault, 0, 0));
       
        JPanel panel = new JPanel(new GridBagLayout());
        int row = 0;
        panel.add(bucketNameLabel, new GridBagConstraints(0, row,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));       
        panel.add(bucketNameTextField, new GridBagConstraints(1, row,
            1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
        panel.add(bucketNameIsValidDNSExplanationLabel, new GridBagConstraints(0, ++row,
            2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        if (!disableDnsBuckets) {
            panel.add(bucketNameIsValidDNSLabel, new GridBagConstraints(0, ++row,
                1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));       
            panel.add(bucketNameIsValidDNSResultLabel, new GridBagConstraints(1, row,
                2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        }
        panel.add(bucketLocationLabel, new GridBagConstraints(0, ++row,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        panel.add(bucketLocationComboBox, new GridBagConstraints(1, row,
            1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));
        panel.add(new JHtmlLabel("<html><font size=\"-2\">Choosing a location other than the US may incur additional S3 usage fees.</font></html>", hyperlinkListener),
            new GridBagConstraints(0, ++row, 2, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, insetsDefault, 0, 0));       
        panel.add(buttonsPanel, new GridBagConstraints(0, ++row,
            2, 1, 0, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));           
        this.getContentPane().setLayout(new GridBagLayout());
        this.getContentPane().add(panel, new GridBagConstraints(0, 0,
View Full Code Here

Examples of org.jets3t.gui.JHtmlLabel

        cancelButton.addActionListener(this);
        okButton = new JButton("Update Status");
        okButton.setActionCommand("OK");
        okButton.addActionListener(this);

        JHtmlLabel bucketNameLabel = new JHtmlLabel("<html><b>Bucket name</b></html>", hyperlinkListener);
        bucketNameLabel.setHorizontalAlignment(JLabel.CENTER);
       
        bucketNameTextField = new JTextField(bucket.getName());
        bucketNameTextField.setEditable(false);
       
        JHtmlLabel requesterPaysLabel = new JHtmlLabel("<html><b>Requester Pays?</b></html>", hyperlinkListener);
        requesterPaysCheckBox = new JCheckBox();
        requesterPaysCheckBox.setSelected(bucket.isRequesterPays());
                               
        // Set default ENTER and ESCAPE buttons.
        this.getRootPane().setDefaultButton(okButton);       
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.