Example usage for javax.swing.event ListSelectionEvent getValueIsAdjusting

List of usage examples for javax.swing.event ListSelectionEvent getValueIsAdjusting

Introduction

In this page you can find the example usage for javax.swing.event ListSelectionEvent getValueIsAdjusting.

Prototype

public boolean getValueIsAdjusting() 

Source Link

Document

Returns whether or not this is one in a series of multiple events, where changes are still being made.

Usage

From source file:com.cch.aj.entryrecorder.frame.SettingsJFrame.java

@Override
public void valueChanged(ListSelectionEvent e) {
    if (!e.getValueIsAdjusting() && tblCheck.getSelectedRow() != -1) {
        TableModel model = tblCheck.getModel();
        int checkId = (int) model.getValueAt(tblCheck.getSelectedRow(), 0);
        String desc = model.getValueAt(tblCheck.getSelectedRow(), 1).toString();
        this.settingCheckId = checkId;
        this.txtCheckDesc.setText(desc);
    }//  w  w w .ja v  a2  s  . c o m
}

From source file:op.care.med.structure.PnlMed.java

private void lstPraepValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_lstPraepValueChanged
    if (!evt.getValueIsAdjusting() && lstPraep.getSelectedValue() != null) {
        product = (MedProducts) lstPraep.getSelectedValue();
        createTree();//from   ww  w  . j  a  va  2  s.co  m
    }
}

From source file:op.controlling.DlgQMSPlan.java

private void lstNotifyValueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting())
        return;// ww  w.j a v  a  2  s .c o  m
    notifyList.remove(lstNotify.getSelectedValue());
    lstNotify.setModel(SYSTools.list2dlm(notifyList));
}

From source file:org.accretegb.modules.phenotype.PhenotypeInfoPanel.java

/**
 * populates field table data/*w  ww.j  a v a  2  s .  co m*/
 */
public void populateFieldTable() {

    try {
        List<Object[]> results = FieldDAO.getInstance().findByLocation();
        getFieldTablePanel().getTable().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        if (results.size() > 0) {
            Utils.removeAllRowsFromTable((DefaultTableModel) getFieldTablePanel().getTable().getModel());
        }
        DefaultTableModel model = (DefaultTableModel) getFieldTablePanel().getTable().getModel();
        for (Object[] obj : results) {
            obj[0] = new Boolean(false);
            obj[1] = Integer.toString((Integer) obj[1]);
            model.addRow(obj);

        }
        getFieldTablePanel().getTable().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
        getFieldTablePanel().getTable().setSingleSelection(true);
        getFieldTablePanel().getTable().setModel(model);
        getFieldTablePanel().getTable().getSelectionModel()
                .addListSelectionListener(new ListSelectionListener() {
                    public void valueChanged(ListSelectionEvent e) {
                        if (!e.getValueIsAdjusting()
                                && getFieldTablePanel().getTable().getSelectedRow() != -1) {
                            subsetListComboBox.setSelectedIndex(0);
                            tagname.setText("");
                        }
                    }

                });
    } catch (Exception e) {

    }
}

From source file:org.eclim.installer.step.VimStep.java

/**
 * {@inheritDoc}//from   w  w w .j a  va  2 s .  co  m
 * @see org.formic.wizard.WizardStep#displayed()
 */
public void displayed() {
    if (!rtpAttempted) {
        rtpAttempted = true;

        setBusy(true);
        try {
            runtimePath = (String[]) Worker.post(new Task() {
                public Object run() throws Exception {
                    setGvimProperty();
                    return getVimRuntimePath();
                }
            });

            // filter out dirs the user doesn't have permission write to.
            ArrayList<String> filtered = new ArrayList<String>();
            if (runtimePath != null) {
                for (String path : runtimePath) {
                    if (new File(path).canWrite()) {
                        if (Installer.isUninstall()) {
                            File eclimDir = new File(path + "/eclim");
                            if (eclimDir.exists()) {
                                if (eclimDir.canWrite()) {
                                    filtered.add(path);
                                } else {
                                    logger.warn(path + "/eclim is not writable by the current user");
                                }
                            }
                        } else {
                            filtered.add(path);
                        }
                    }
                }
            }
            String[] rtp = filtered.toArray(new String[filtered.size()]);

            if (rtp == null || rtp.length == 0) {
                if (!Installer.isUninstall()) {
                    if (!homeVimCreatePrompted) {
                        createUserVimFiles("No suitable vim files directory found.");
                    } else {
                        GuiDialogs.showWarning(
                                "Your vim install is still reporting no\n" + "suitable vim files directories.\n"
                                        + "You will need to manually specify one.");
                    }
                }
            } else {
                if (rtp.length == 1) {
                    fileChooser.getTextField().setText(rtp[0]);

                    // try to discourage windows users from installing eclim files in
                    // their vim installation.
                    if (new File(rtp[0] + "/gvim.exe").exists()) {
                        createUserVimFiles("No user vim files directory found.");
                    }
                } else {
                    dirList = new JList(rtp);
                    dirList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
                    JScrollPane scrollPane = new JScrollPane(dirList);
                    panel.add(scrollPane, "span, grow");

                    dirList.addListSelectionListener(new ListSelectionListener() {
                        public void valueChanged(ListSelectionEvent event) {
                            if (!event.getValueIsAdjusting()) {
                                fileChooser.getTextField().setText((String) dirList.getSelectedValue());
                            }
                        }
                    });

                    dirList.setSelectedIndex(0);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        setBusy(false);
        fileChooser.getTextField().grabFocus();
    }
}

From source file:org.feistymeow.dragdrop.dragdrop_list_test.java

public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting() == false) {
        fileName.setText("");
        if (list.getSelectedIndex() != -1) {
            String name = list.getSelectedValue().toString();
            fileName.setText(name);// w ww .  j a v a2  s.c  o m
        }
    }
}

From source file:org.interreg.docexplore.ServerConfigPanel.java

public ServerConfigPanel(final File config, final File serverDir) throws Exception {
    super(new LooseGridLayout(0, 1, 5, 5, true, false, SwingConstants.LEFT, SwingConstants.TOP, true, false));

    this.serverDir = serverDir;
    this.books = new Vector<Book>();
    this.bookList = new JList(new DefaultListModel());

    JPanel listPanel = new JPanel(new BorderLayout());
    listPanel.setBorder(BorderFactory.createTitledBorder(XMLResourceBundle.getBundledString("cfgBooksLabel")));
    bookList.setOpaque(false);//from  www. j  a v a2  s. com
    bookList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    bookList.setCellRenderer(new ListCellRenderer() {
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
                boolean cellHasFocus) {
            Book book = (Book) value;
            JLabel label = new JLabel("<html><b>" + book.name + "</b> - " + book.nPages + " pages</html>");
            label.setOpaque(true);
            if (isSelected) {
                label.setBackground(TextToolbar.styleHighLightedBackground);
                label.setForeground(Color.white);
            }
            if (book.deleted)
                label.setForeground(Color.red);
            else if (!book.used)
                label.setForeground(Color.gray);
            return label;
        }
    });
    bookList.addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting())
                return;
            setFields((Book) bookList.getSelectedValue());
        }
    });
    JScrollPane scrollPane = new JScrollPane(bookList, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setPreferredSize(new Dimension(500, 300));
    scrollPane.getVerticalScrollBar().setUnitIncrement(10);
    listPanel.add(scrollPane, BorderLayout.CENTER);

    JPanel importPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
    importPanel.add(new JButton(new AbstractAction(XMLResourceBundle.getBundledString("cfgImportLabel")) {
        public void actionPerformed(ActionEvent e) {
            final File inFile = DocExploreTool.getFileDialogs().openFile(DocExploreTool.getIBookCategory());
            if (inFile == null)
                return;

            try {
                final File tmpDir = new File(serverDir, "tmp");
                tmpDir.mkdir();

                GuiUtils.blockUntilComplete(new ProgressRunnable() {
                    float[] progress = { 0 };

                    public void run() {
                        try {
                            ZipUtils.unzip(inFile, tmpDir, progress);
                        } catch (Exception ex) {
                            ErrorHandler.defaultHandler.submit(ex);
                        }
                    }

                    public float getProgress() {
                        return (float) progress[0];
                    }
                }, ServerConfigPanel.this);

                File tmpFile = new File(tmpDir, "index.tmp");
                ObjectInputStream input = new ObjectInputStream(new FileInputStream(tmpFile));
                String bookFile = input.readUTF();
                String bookName = input.readUTF();
                String bookDesc = input.readUTF();
                input.close();

                new PresentationImporter().doImport(ServerConfigPanel.this, bookName, bookDesc,
                        new File(tmpDir, bookFile));
                FileUtils.cleanDirectory(tmpDir);
                FileUtils.deleteDirectory(tmpDir);
                updateBooks();
            } catch (Exception ex) {
                ErrorHandler.defaultHandler.submit(ex);
            }
        }
    }));
    listPanel.add(importPanel, BorderLayout.SOUTH);
    add(listPanel);

    JPanel setupPanel = new JPanel(
            new LooseGridLayout(0, 1, 5, 5, true, false, SwingConstants.LEFT, SwingConstants.TOP, true, false));
    setupPanel.setBorder(
            BorderFactory.createTitledBorder(XMLResourceBundle.getBundledString("cfgBookInfoLabel")));
    usedBox = new JCheckBox(XMLResourceBundle.getBundledString("cfgUseLabel"));
    usedBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            Book book = (Book) bookList.getSelectedValue();
            if (book != null) {
                book.used = usedBox.isSelected();
                bookList.repaint();
            }
        }
    });
    setupPanel.add(usedBox);

    JPanel fieldPanel = new JPanel(new LooseGridLayout(0, 2, 5, 5, false, false, SwingConstants.LEFT,
            SwingConstants.TOP, true, false));
    fieldPanel.add(new JLabel(XMLResourceBundle.getBundledString("cfgTitleLabel")));
    nameField = new JTextField(50);
    nameField.getDocument().addDocumentListener(new DocumentListener() {
        public void removeUpdate(DocumentEvent e) {
            changedUpdate(e);
        }

        public void insertUpdate(DocumentEvent e) {
            changedUpdate(e);
        }

        public void changedUpdate(DocumentEvent e) {
            Book book = (Book) bookList.getSelectedValue();
            if (book == null)
                return;
            book.name = nameField.getText();
            bookList.repaint();
        }
    });
    fieldPanel.add(nameField);

    fieldPanel.add(new JLabel(XMLResourceBundle.getBundledString("cfgDescriptionLabel")));
    descField = new JTextPane();
    //descField.setWrapStyleWord(true);
    descField.getDocument().addDocumentListener(new DocumentListener() {
        public void removeUpdate(DocumentEvent e) {
            changedUpdate(e);
        }

        public void insertUpdate(DocumentEvent e) {
            changedUpdate(e);
        }

        public void changedUpdate(DocumentEvent e) {
            Book book = (Book) bookList.getSelectedValue();
            if (book == null)
                return;
            book.desc = descField.getText();
        }
    });
    scrollPane = new JScrollPane(descField, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    scrollPane.setPreferredSize(new Dimension(420, 50));
    scrollPane.getVerticalScrollBar().setUnitIncrement(10);
    fieldPanel.add(scrollPane);

    setupPanel.add(fieldPanel);

    exportButton = new JButton(new AbstractAction(XMLResourceBundle.getBundledString("cfgExportLabel")) {
        public void actionPerformed(ActionEvent e) {
            File file = DocExploreTool.getFileDialogs().saveFile(DocExploreTool.getIBookCategory());
            if (file == null)
                return;
            final Book book = (Book) bookList.getSelectedValue();
            final File indexFile = new File(serverDir, "index.tmp");
            try {
                final File outFile = file;
                ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(indexFile));
                out.writeUTF(book.bookFile.getName());
                out.writeUTF(book.name);
                out.writeUTF(book.desc);
                out.close();

                GuiUtils.blockUntilComplete(new ProgressRunnable() {
                    float[] progress = { 0 };

                    public void run() {
                        try {
                            ZipUtils.zip(serverDir, new File[] { indexFile, book.bookFile, book.bookDir },
                                    outFile, progress, 0, 1, 9);
                        } catch (Exception ex) {
                            ErrorHandler.defaultHandler.submit(ex);
                        }
                    }

                    public float getProgress() {
                        return (float) progress[0];
                    }
                }, ServerConfigPanel.this);
            } catch (Exception ex) {
                ErrorHandler.defaultHandler.submit(ex);
            }
            if (indexFile.exists())
                indexFile.delete();
        }
    });
    deleteButton = new JButton(new AbstractAction(XMLResourceBundle.getBundledString("cfgDeleteRestoreLabel")) {
        public void actionPerformed(ActionEvent e) {
            Book book = (Book) bookList.getSelectedValue();
            if (book == null)
                return;
            book.deleted = !book.deleted;
            bookList.repaint();
        }
    });

    JPanel actionsPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
    actionsPanel.add(exportButton);
    actionsPanel.add(deleteButton);
    setupPanel.add(actionsPanel);

    add(setupPanel);

    JPanel optionsPanel = new JPanel(new LooseGridLayout(0, 2, 5, 5, false, false, SwingConstants.LEFT,
            SwingConstants.TOP, true, false));
    optionsPanel
            .setBorder(BorderFactory.createTitledBorder(XMLResourceBundle.getBundledString("cfgOptionsLabel")));
    JPanel timeoutPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    timeoutField = new JTextField(5);
    timeoutPanel.add(timeoutField);
    timeoutPanel.add(new JLabel(XMLResourceBundle.getBundledString("cfgTimeoutLabel")));
    optionsPanel.add(timeoutPanel);
    add(optionsPanel);

    updateBooks();
    setFields(null);

    final String xml = config.exists() ? StringUtils.readFile(config) : "<config></config>";
    String idle = StringUtils.getTagContent(xml, "idle");
    if (idle != null)
        try {
            timeoutField.setText("" + Integer.parseInt(idle));
        } catch (Throwable e) {
        }
}

From source file:org.javaswift.cloudie.CloudiePanel.java

public void bind() {
    containersList.addListSelectionListener(new ListSelectionListener() {

        @Override/*from   w ww. j a va 2s.c  om*/
        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting()) {
                return;
            } else {
                int idx = containersList.getSelectedIndex();
                if (idx >= 0) {
                    refreshFiles((Container) containers.get(idx));
                }
            }
        }
    });
    //
    Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread t, Throwable ex) {
            if (ex instanceof CommandException) {
                showError((CommandException) ex);
            } else {
                ex.printStackTrace();
            }
        }

    });
    //
    containersList.getInputMap().put(KeyStroke.getKeyStroke("F5"), "refresh");
    containersList.getActionMap().put("refresh", containerRefreshAction);
    //
    storedObjectsList.getInputMap().put(KeyStroke.getKeyStroke("F5"), "refresh");
    storedObjectsList.getActionMap().put("refresh", containerRefreshAction);
    //
}

From source file:org.jets3t.apps.cockpitlite.CockpitLite.java

/**
 * Handles list selection events for this application.
 *//*w w w  . j av a 2s.  c om*/
public void valueChanged(ListSelectionEvent e) {
    if (e.getValueIsAdjusting()) {
        return;
    }

    if (e.getSource().equals(objectsTable.getSelectionModel())) {
        objectSelectedAction();
    }
}

From source file:org.jets3t.gui.ObjectsAttributesDialog.java

/**
 * Initialise the GUI elements to display the given item.
 *///  w  ww .j av a 2 s  .  c o m
private void initGui() {
    this.setResizable(true);
    this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

    JPanel unmodifiableAttributesPanel = skinsFactory.createSkinnedJPanel("ObjectStaticAttributesPanel");
    unmodifiableAttributesPanel.setLayout(new GridBagLayout());
    JPanel metadataContainer = skinsFactory.createSkinnedJPanel("ObjectPropertiesMetadataPanel");
    metadataContainer.setLayout(new GridBagLayout());
    metadataButtonsContainer = skinsFactory.createSkinnedJPanel("ObjectPropertiesMetadataButtonsPanel");
    metadataButtonsContainer.setLayout(new GridBagLayout());

    // Fields to display unmodifiable object details.
    JLabel objectKeyLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectKeyLabel");
    objectKeyLabel.setText("Object key:");
    objectKeyTextField = skinsFactory.createSkinnedJTextField("ObjectKeyTextField");
    objectKeyTextField.setEditable(false);
    JLabel objectContentLengthLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectContentLengthLabel");
    objectContentLengthLabel.setText("Size:");
    objectContentLengthTextField = skinsFactory.createSkinnedJTextField("ObjectContentLengthTextField");
    objectContentLengthTextField.setEditable(false);
    JLabel objectLastModifiedLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectLastModifiedLabel");
    objectLastModifiedLabel.setText("Last modified:");
    objectLastModifiedTextField = skinsFactory.createSkinnedJTextField("ObjectLastModifiedTextField");
    objectLastModifiedTextField.setEditable(false);
    JLabel objectETagLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectETagLabel");
    objectETagLabel.setText("ETag:");
    objectETagTextField = skinsFactory.createSkinnedJTextField("ObjectETagTextField");
    objectETagTextField.setEditable(false);
    JLabel bucketNameLabel = skinsFactory.createSkinnedJHtmlLabel("BucketNameLabel");
    bucketNameLabel.setText("Bucket:");
    bucketLocationTextField = skinsFactory.createSkinnedJTextField("BucketLocationTextField");
    bucketLocationTextField.setEditable(false);
    ownerNameLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerNameLabel");
    ownerNameLabel.setText("Owner name:");
    ownerNameTextField = skinsFactory.createSkinnedJTextField("OwnerNameTextField");
    ownerNameTextField.setEditable(false);
    ownerIdLabel = skinsFactory.createSkinnedJHtmlLabel("OwnerIdLabel");
    ownerIdLabel.setText("Owner ID:");
    ownerIdTextField = skinsFactory.createSkinnedJTextField("OwnerIdTextField");
    ownerIdTextField.setEditable(false);

    int row = 0;

    unmodifiableAttributesPanel.add(objectKeyLabel, new GridBagConstraints(0, row, 1, 1, 0, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
    unmodifiableAttributesPanel.add(objectKeyTextField, new GridBagConstraints(1, row, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    row++;
    unmodifiableAttributesPanel.add(objectContentLengthLabel, new GridBagConstraints(0, row, 1, 1, 0, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
    unmodifiableAttributesPanel.add(objectContentLengthTextField, new GridBagConstraints(1, row, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    row++;
    unmodifiableAttributesPanel.add(objectLastModifiedLabel, new GridBagConstraints(0, row, 1, 1, 0, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
    unmodifiableAttributesPanel.add(objectLastModifiedTextField, new GridBagConstraints(1, row, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    row++;
    unmodifiableAttributesPanel.add(objectETagLabel, new GridBagConstraints(0, row, 1, 1, 0, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
    unmodifiableAttributesPanel.add(objectETagTextField, new GridBagConstraints(1, row, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    row++;
    unmodifiableAttributesPanel.add(ownerNameLabel, new GridBagConstraints(0, row, 1, 1, 0, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
    unmodifiableAttributesPanel.add(ownerNameTextField, new GridBagConstraints(1, row, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    row++;
    unmodifiableAttributesPanel.add(ownerIdLabel, new GridBagConstraints(0, row, 1, 1, 0, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
    unmodifiableAttributesPanel.add(ownerIdTextField, new GridBagConstraints(1, row, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));
    row++;
    unmodifiableAttributesPanel.add(bucketNameLabel, new GridBagConstraints(0, row, 1, 1, 0, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsDefault, 0, 0));
    unmodifiableAttributesPanel.add(bucketLocationTextField, new GridBagConstraints(1, row, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0));

    // Build metadata table.
    objectMetadataTableModel = new DefaultTableModel(new Object[] { "Name", "Value" }, 0) {
        private static final long serialVersionUID = -3762866886166776851L;

        public boolean isCellEditable(int row, int column) {
            return isModifyMode();
        }
    };

    metadataTableSorter = new TableSorter(objectMetadataTableModel);
    metadataTable = skinsFactory.createSkinnedJTable("MetadataTable");
    metadataTable.setModel(metadataTableSorter);
    metadataTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting() && removeMetadataItemButton != null) {
                int row = metadataTable.getSelectedRow();
                removeMetadataItemButton.setEnabled(row >= 0);
            }
        }
    });

    metadataTableSorter.setTableHeader(metadataTable.getTableHeader());
    metadataTableSorter.setSortingStatus(0, TableSorter.ASCENDING);
    metadataContainer.add(new JScrollPane(metadataTable), new GridBagConstraints(0, 0, 1, 1, 1, 1,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsHorizontalSpace, 0, 0));

    // Add/remove buttons for metadata table.
    removeMetadataItemButton = skinsFactory.createSkinnedJButton("ObjectPropertiesAddMetadataButton");
    removeMetadataItemButton.setEnabled(false);
    removeMetadataItemButton.setToolTipText("Remove the selected metadata item(s)");
    guiUtils.applyIcon(removeMetadataItemButton, "/images/nuvola/16x16/actions/viewmag-.png");
    removeMetadataItemButton.addActionListener(this);
    removeMetadataItemButton.setActionCommand("removeMetadataItem");
    addMetadataItemButton = skinsFactory.createSkinnedJButton("ObjectPropertiesAddMetadataButton");
    addMetadataItemButton.setToolTipText("Add a new metadata item");
    guiUtils.applyIcon(addMetadataItemButton, "/images/nuvola/16x16/actions/viewmag+.png");
    addMetadataItemButton.setActionCommand("addMetadataItem");
    addMetadataItemButton.addActionListener(this);
    metadataButtonsContainer.add(removeMetadataItemButton, new GridBagConstraints(0, 0, 1, 1, 0, 0,
            GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsZero, 0, 0));
    metadataButtonsContainer.add(addMetadataItemButton, new GridBagConstraints(1, 0, 1, 1, 0, 0,
            GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsZero, 0, 0));
    metadataContainer.add(metadataButtonsContainer, new GridBagConstraints(0, 1, 1, 1, 1, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsHorizontalSpace, 0, 0));
    metadataButtonsContainer.setVisible(false);

    // OK Button.
    okButton = skinsFactory.createSkinnedJButton("ObjectPropertiesOKButton");
    okButton.setText("OK");
    okButton.setActionCommand("OK");
    okButton.addActionListener(this);

    // Cancel Button.
    cancelButton = null;
    cancelButton = skinsFactory.createSkinnedJButton("ObjectPropertiesCancelButton");
    cancelButton.setText("Cancel");
    cancelButton.setActionCommand("Cancel");
    cancelButton.addActionListener(this);
    cancelButton.setVisible(false);

    // Recognize and handle ENTER, ESCAPE, PAGE_UP, and PAGE_DOWN key presses.
    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 = -7768790936535999307L;

        public void actionPerformed(ActionEvent actionEvent) {
            setVisible(false);
        }
    });
    this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("PAGE_UP"),
            "PAGE_UP");
    this.getRootPane().getActionMap().put("PAGE_UP", new AbstractAction() {
        private static final long serialVersionUID = -6324229423705756219L;

        public void actionPerformed(ActionEvent actionEvent) {
            previousObjectButton.doClick();
        }
    });
    this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("PAGE_DOWN"),
            "PAGE_DOWN");
    this.getRootPane().getActionMap().put("PAGE_DOWN", new AbstractAction() {
        private static final long serialVersionUID = -5808972377672449421L;

        public void actionPerformed(ActionEvent actionEvent) {
            nextObjectButton.doClick();
        }
    });

    // Put it all together.
    row = 0;
    JPanel container = skinsFactory.createSkinnedJPanel("ObjectPropertiesPanel");
    container.setLayout(new GridBagLayout());
    container.add(unmodifiableAttributesPanel, new GridBagConstraints(0, row++, 1, 1, 1, 0,
            GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));

    // Object previous and next buttons, if we have multiple objects.
    previousObjectButton = skinsFactory.createSkinnedJButton("ObjectPropertiesPreviousButton");
    guiUtils.applyIcon(previousObjectButton, "/images/nuvola/16x16/actions/1leftarrow.png");
    previousObjectButton.addActionListener(this);
    previousObjectButton.setEnabled(false);
    nextObjectButton = skinsFactory.createSkinnedJButton("ObjectPropertiesNextButton");
    guiUtils.applyIcon(nextObjectButton, "/images/nuvola/16x16/actions/1rightarrow.png");
    nextObjectButton.addActionListener(this);
    nextObjectButton.setEnabled(false);
    currentObjectLabel = skinsFactory.createSkinnedJHtmlLabel("ObjectPropertiesCurrentObjectLabel");
    currentObjectLabel.setHorizontalAlignment(JLabel.CENTER);

    nextPreviousPanel = skinsFactory.createSkinnedJPanel("ObjectPropertiesNextPreviousPanel");
    nextPreviousPanel.setLayout(new GridBagLayout());
    nextPreviousPanel.add(previousObjectButton, new GridBagConstraints(0, 0, 1, 1, 1, 0,
            GridBagConstraints.EAST, GridBagConstraints.NONE, insetsZero, 0, 0));
    nextPreviousPanel.add(currentObjectLabel, new GridBagConstraints(1, 0, 1, 1, 0, 0,
            GridBagConstraints.CENTER, GridBagConstraints.NONE, insetsHorizontalSpace, 0, 0));
    nextPreviousPanel.add(nextObjectButton, new GridBagConstraints(2, 0, 1, 1, 1, 0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, insetsZero, 0, 0));
    container.add(nextPreviousPanel, new GridBagConstraints(0, row, 1, 1, 1, 0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
    nextPreviousPanel.setVisible(false);
    row++;

    JHtmlLabel metadataLabel = skinsFactory.createSkinnedJHtmlLabel("MetadataLabel");
    metadataLabel.setText("<html><b>Metadata Attributes</b></html>");
    metadataLabel.setHorizontalAlignment(JLabel.CENTER);
    container.add(metadataLabel, new GridBagConstraints(0, row++, 1, 1, 1, 0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insetsVerticalSpace, 0, 0));
    container.add(metadataContainer, new GridBagConstraints(0, row++, 1, 1, 1, 1, GridBagConstraints.CENTER,
            GridBagConstraints.BOTH, insetsZero, 0, 0));

    // Destination Access Control List setting.
    destinationPanel = skinsFactory.createSkinnedJPanel("DestinationPanel");
    destinationPanel.setLayout(new GridBagLayout());

    JPanel actionButtonsPanel = skinsFactory.createSkinnedJPanel("ObjectPropertiesActionButtonsPanel");
    actionButtonsPanel.setLayout(new GridBagLayout());
    actionButtonsPanel.add(cancelButton, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
    actionButtonsPanel.add(okButton, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL, insetsZero, 0, 0));
    cancelButton.setVisible(false);

    container.add(actionButtonsPanel, new GridBagConstraints(0, row++, 3, 1, 0, 0, GridBagConstraints.CENTER,
            GridBagConstraints.NONE, insetsDefault, 0, 0));
    this.getContentPane().add(container);

    this.pack();
    this.setSize(new Dimension(450, 500));
    this.setLocationRelativeTo(this.getOwner());
}