Example usage for javax.swing BorderFactory createEmptyBorder

List of usage examples for javax.swing BorderFactory createEmptyBorder

Introduction

In this page you can find the example usage for javax.swing BorderFactory createEmptyBorder.

Prototype

public static Border createEmptyBorder() 

Source Link

Document

Creates an empty border that takes up no space.

Usage

From source file:gr.teicm.pm.smartfilemanager.smartfilemanagerui.SmartFileManager.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from   w  w  w  .ja va 2s .  c  om
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    navigationPanel = new javax.swing.JPanel();
    forwardButton = new javax.swing.JButton();
    backButton = new javax.swing.JButton();
    UpButton = new javax.swing.JButton();
    webPathField1 = new com.alee.extended.filechooser.WebPathField();
    jComboBox1 = new javax.swing.JComboBox();
    mainPane = new javax.swing.JSplitPane();
    actionsSideBar = new org.jdesktop.swingx.JXTaskPaneContainer();
    placesPane = new org.jdesktop.swingx.JXTaskPane();
    PlacesPanel = new javax.swing.JPanel();
    jXHyperlink1 = new org.jdesktop.swingx.JXHyperlink();
    FilePane = new javax.swing.JPanel();
    computer = new org.jdesktop.swingx.JXTitledPanel();
    computerPanel = new javax.swing.JPanel();
    computerScrollPane = new javax.swing.JScrollPane();
    computerScrollablePane = new javax.swing.JPanel();
    jXTaskPaneContainer2 = new org.jdesktop.swingx.JXTaskPaneContainer();
    userHomePane = new org.jdesktop.swingx.JXTaskPane();
    jPanel1 = new javax.swing.JPanel();
    menuBar = new javax.swing.JMenuBar();
    fileMenu = new javax.swing.JMenu();
    openMenuItem = new javax.swing.JMenuItem();
    saveMenuItem = new javax.swing.JMenuItem();
    saveAsMenuItem = new javax.swing.JMenuItem();
    exitMenuItem = new javax.swing.JMenuItem();
    editMenu = new javax.swing.JMenu();
    cutMenuItem = new javax.swing.JMenuItem();
    copyMenuItem = new javax.swing.JMenuItem();
    pasteMenuItem = new javax.swing.JMenuItem();
    deleteMenuItem = new javax.swing.JMenuItem();
    viewMenu = new javax.swing.JMenu();
    showHideNavigationBar = new javax.swing.JMenuItem();
    helpMenu = new javax.swing.JMenu();
    contentsMenuItem = new javax.swing.JMenuItem();
    aboutMenuItem = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

    navigationPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
        public void componentShown(java.awt.event.ComponentEvent evt) {
            navigationPanelComponentShown(evt);
        }
    });

    forwardButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/navigation/go-next.png"))); // NOI18N
    forwardButton.setFocusable(false);
    forwardButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    forwardButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

    backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/navigation/go-previous.png"))); // NOI18N

    UpButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/navigation/go-up.png"))); // NOI18N

    jComboBox1.setModel(
            new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    javax.swing.GroupLayout navigationPanelLayout = new javax.swing.GroupLayout(navigationPanel);
    navigationPanel.setLayout(navigationPanelLayout);
    navigationPanelLayout.setHorizontalGroup(navigationPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(navigationPanelLayout.createSequentialGroup().addContainerGap().addComponent(backButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(UpButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(forwardButton)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(webPathField1, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 98,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(6, 6, 6)));
    navigationPanelLayout.setVerticalGroup(
            navigationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(navigationPanelLayout.createSequentialGroup()
                            .addGroup(navigationPanelLayout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(backButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jComboBox1, javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(UpButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(forwardButton, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(webPathField1, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(346, 346, 346)));

    mainPane.setResizeWeight(0.1);

    actionsSideBar.setBackground(new java.awt.Color(117, 150, 227));

    placesPane.setToolTipText("");
    placesPane.setTitle("Places");

    PlacesPanel.setOpaque(false);

    jXHyperlink1
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/navigation/go-previous.png"))); // NOI18N
    jXHyperlink1.setText("Computer");
    jXHyperlink1.setToolTipText("");

    javax.swing.GroupLayout PlacesPanelLayout = new javax.swing.GroupLayout(PlacesPanel);
    PlacesPanel.setLayout(PlacesPanelLayout);
    PlacesPanelLayout.setHorizontalGroup(PlacesPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PlacesPanelLayout.createSequentialGroup()
                    .addComponent(jXHyperlink1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 60, Short.MAX_VALUE)));
    PlacesPanelLayout.setVerticalGroup(PlacesPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(PlacesPanelLayout.createSequentialGroup()
                    .addComponent(jXHyperlink1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 55, Short.MAX_VALUE)));

    placesPane.getContentPane().add(PlacesPanel);

    actionsSideBar.add(placesPane);

    mainPane.setLeftComponent(actionsSideBar);

    computer.setTitle("Computer");
    WebFileList wb = new WebFileList();

    computerPanel
            .setBorder(javax.swing.BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Test"));

    userHomePane.setTitle(User.getUsername());

    jPanel1.setOpaque(false);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 671, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE));

    userHomePane.getContentPane().add(jPanel1);

    jXTaskPaneContainer2.add(userHomePane);

    javax.swing.GroupLayout computerScrollablePaneLayout = new javax.swing.GroupLayout(computerScrollablePane);
    computerScrollablePane.setLayout(computerScrollablePaneLayout);
    computerScrollablePaneLayout.setHorizontalGroup(computerScrollablePaneLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(computerScrollablePaneLayout.createSequentialGroup().addComponent(jXTaskPaneContainer2,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));
    computerScrollablePaneLayout
            .setVerticalGroup(
                    computerScrollablePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(computerScrollablePaneLayout.createSequentialGroup()
                                    .addComponent(jXTaskPaneContainer2, javax.swing.GroupLayout.PREFERRED_SIZE,
                                            330, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 20, Short.MAX_VALUE)));

    computerScrollPane.setViewportView(computerScrollablePane);

    javax.swing.GroupLayout computerPanelLayout = new javax.swing.GroupLayout(computerPanel);
    computerPanel.setLayout(computerPanelLayout);
    computerPanelLayout.setHorizontalGroup(computerPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(computerScrollPane));
    computerPanelLayout.setVerticalGroup(
            computerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(
                    computerScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE));

    javax.swing.GroupLayout computerLayout = new javax.swing.GroupLayout(computer.getContentContainer());
    computer.getContentContainer().setLayout(computerLayout);
    computerLayout
            .setHorizontalGroup(computerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(computerPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    computerLayout.setVerticalGroup(computerLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(computerPanel,
                    javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));

    javax.swing.GroupLayout FilePaneLayout = new javax.swing.GroupLayout(FilePane);
    FilePane.setLayout(FilePaneLayout);
    FilePaneLayout.setHorizontalGroup(
            FilePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(computer,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE));
    FilePaneLayout.setVerticalGroup(
            FilePaneLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(computer,
                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE));

    mainPane.setRightComponent(FilePane);

    fileMenu.setMnemonic('f');
    fileMenu.setText("File");

    openMenuItem.setMnemonic('o');
    openMenuItem.setText("Open");
    fileMenu.add(openMenuItem);

    saveMenuItem.setMnemonic('s');
    saveMenuItem.setText("Save");
    fileMenu.add(saveMenuItem);

    saveAsMenuItem.setMnemonic('a');
    saveAsMenuItem.setText("Save As ...");
    saveAsMenuItem.setDisplayedMnemonicIndex(5);
    fileMenu.add(saveAsMenuItem);

    exitMenuItem.setMnemonic('x');
    exitMenuItem.setText("Exit");
    exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitMenuItemActionPerformed(evt);
        }
    });
    fileMenu.add(exitMenuItem);

    menuBar.add(fileMenu);

    editMenu.setMnemonic('e');
    editMenu.setText("Edit");

    cutMenuItem.setMnemonic('t');
    cutMenuItem.setText("Cut");
    editMenu.add(cutMenuItem);

    copyMenuItem.setMnemonic('y');
    copyMenuItem.setText("Copy");
    editMenu.add(copyMenuItem);

    pasteMenuItem.setMnemonic('p');
    pasteMenuItem.setText("Paste");
    editMenu.add(pasteMenuItem);

    deleteMenuItem.setMnemonic('d');
    deleteMenuItem.setText("Delete");
    editMenu.add(deleteMenuItem);

    menuBar.add(editMenu);

    viewMenu.setText("View");

    showHideNavigationBar.setText("Hide navigation bar");
    showHideNavigationBar.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mousePressed(java.awt.event.MouseEvent evt) {
            showHideNavigationBarMousePressed(evt);
        }

        public void mouseClicked(java.awt.event.MouseEvent evt) {
            showHideNavigationBarMouseClicked(evt);
        }
    });
    showHideNavigationBar.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            showHideNavigationBarActionPerformed(evt);
        }
    });
    viewMenu.add(showHideNavigationBar);

    menuBar.add(viewMenu);

    helpMenu.setMnemonic('h');
    helpMenu.setText("Help");

    contentsMenuItem.setMnemonic('c');
    contentsMenuItem.setText("Contents");
    helpMenu.add(contentsMenuItem);

    aboutMenuItem.setMnemonic('a');
    aboutMenuItem.setText("About");
    helpMenu.add(aboutMenuItem);

    menuBar.add(helpMenu);

    setJMenuBar(menuBar);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addGap(9, 9, 9).addComponent(navigationPanel,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE))
            .addComponent(mainPane));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(navigationPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 35,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(mainPane)));

    pack();
}

From source file:com.mirth.connect.client.ui.editors.transformer.TransformerPane.java

/**
 * load( Transformer t ) now that the components have been initialized...
 *//*www .  j a  v  a2 s  .c  om*/
public boolean load(Connector c, Transformer t, boolean channelHasBeenChanged, boolean isResponse) {
    if (alertUnsupportedStepTypes(t)) {
        return false;
    }

    switchTab = false;
    lastSelectedIndex = 0;
    tabbedPane.setSelectedIndex(0);

    this.isResponse = isResponse;
    prevSelRow = -1;
    connector = c;
    transformer = t;
    channel = PlatformUI.MIRTH_FRAME.channelEditPanel.currentChannel;

    makeTransformerTable();

    // add any existing steps to the model
    List<Step> list = transformer.getSteps();
    ListIterator<Step> li = list.listIterator();
    while (li.hasNext()) {
        Step s = li.next();
        setRowData(s, s.getSequenceNumber(), false);
    }

    parent.setCurrentContentPage((JPanel) this);
    parent.setFocus(new JXTaskPane[] { viewTasks, transformerTasks }, false, true);

    tabTemplatePanel.setTransformerView();

    // select the first row if there is one
    int rowCount = transformerTableModel.getRowCount();
    if (rowCount > 0) {
        transformerTable.setRowSelectionInterval(0, 0);
        prevSelRow = 0;
    } else {
        transformerTable.getSelectionModel().clearSelection();
        stepPanel.showCard(BLANK_TYPE);

        for (TransformerStepPlugin plugin : LoadedExtensions.getInstance().getTransformerStepPlugins()
                .values()) {
            plugin.getPanel().setData(null);
        }
        loadData(-1);
    }

    if (connector.getMode() == Connector.Mode.SOURCE) {
        tabTemplatePanel.setSourceView();
    } else if (connector.getMode() == Connector.Mode.DESTINATION) {
        tabTemplatePanel.setDestinationView(isResponse);
    }

    tabTemplatePanel.setDefaultComponent();

    tabTemplatePanel.setIncomingDataType(
            (String) PlatformUI.MIRTH_FRAME.dataTypeToDisplayName.get(transformer.getInboundDataType()));
    tabTemplatePanel.setOutgoingDataType(
            ((String) PlatformUI.MIRTH_FRAME.dataTypeToDisplayName.get(transformer.getOutboundDataType())));

    tabTemplatePanel.setIncomingDataProperties(transformer.getInboundProperties());
    tabTemplatePanel.setOutgoingDataProperties(transformer.getOutboundProperties());

    tabTemplatePanel.setIncomingMessage(transformer.getInboundTemplate());
    tabTemplatePanel.setOutgoingMessage(transformer.getOutboundTemplate());

    transformerTable.setBorder(BorderFactory.createEmptyBorder());

    updateStepNumbers();
    if (transformerTableModel.getRowCount() > 0) {
        updateTaskPane((String) transformerTableModel.getValueAt(0, STEP_TYPE_COL));
    }

    if (channelHasBeenChanged) {
        modified = true;
    } else {
        modified = false;
    }

    updateCodePanel(null);

    return true;
}

From source file:krasa.formatter.plugin.ProjectSettingsForm.java

public ProjectSettingsForm(final Project project) {
    DONATEButton.setBorder(BorderFactory.createEmptyBorder());
    DONATEButton.setContentAreaFilled(false);
    this.project = project;
    JToggleButton[] modifiableButtons = new JToggleButton[] { useDefaultFormatter, useEclipseFormatter,
            optimizeImportsCheckBox, enableJavaFormatting, doNotFormatOtherFilesRadioButton,
            formatOtherFilesWithExceptionsRadioButton, formatSelectedTextInAllFileTypes, enableJSFormatting,
            enableCppFormatting, importOrderConfigurationManualRadioButton,
            importOrderConfigurationFromFileRadioButton, enableGWTNativeMethodsCheckBox };
    for (JToggleButton button : modifiableButtons) {
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                updateComponents();//from w w w . j  a v  a 2  s .co  m
            }
        });
    }

    JTextField[] modifiableFields = new JTextField[] { pathToEclipsePreferenceFileJava,
            pathToEclipsePreferenceFileJS, pathToEclipsePreferenceFileCpp, disabledFileTypes, importOrder,
            pathToImportOrderPreferenceFile };
    for (JTextField field : modifiableFields) {
        field.getDocument().addDocumentListener(new DocumentAdapter() {
            protected void textChanged(DocumentEvent e) {
                updateComponents();
            }
        });
    }

    eclipsePreferenceFilePathJavaBrowse.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            browseForFile(pathToEclipsePreferenceFileJava);
        }
    });
    pathToImportOrderPreferenceFileBrowse.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            browseForFile(pathToImportOrderPreferenceFile);
        }
    });
    eclipsePreferenceFilePathJSBrowse.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            browseForFile(pathToEclipsePreferenceFileJS);
        }
    });
    eclipsePreferenceFilePathCppBrowse.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            browseForFile(pathToEclipsePreferenceFileCpp);
        }
    });

    rootComponent.addAncestorListener(new AncestorListener() {
        public void ancestorAdded(AncestorEvent event) {
            // Called when component becomes visible, to ensure that the
            // popups
            // are visible when the form is shown for the first time.
            updateComponents();
        }

        public void ancestorRemoved(AncestorEvent event) {
        }

        public void ancestorMoved(AncestorEvent event) {
        }
    });

    pathToEclipsePreferenceFileJava.getDocument().addDocumentListener(new DocumentAdapter() {
        @Override
        protected void textChanged(DocumentEvent e) {
            setJavaFormatterProfileModel();
        }
    });

    pathToEclipsePreferenceFileJS.getDocument().addDocumentListener(new DocumentAdapter() {
        @Override
        protected void textChanged(DocumentEvent e) {
            setJavaScriptFormatterProfileModel();
        }
    });

    pathToEclipsePreferenceFileCpp.getDocument().addDocumentListener(new DocumentAdapter() {
        @Override
        protected void textChanged(DocumentEvent e) {
            setCppFormatterProfileModel();
        }
    });

    newProfile.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            if (isModified(displayedSettings)) {
                createConfirmation("Profile was modified, save changes to current profile?", "Yes", "No",
                        new Runnable() {
                            @Override
                            public void run() {
                                apply();
                                createProfile();
                            }
                        }, new Runnable() {
                            @Override
                            public void run() {
                                importFrom(displayedSettings);
                                createProfile();
                            }
                        }, 0).showInFocusCenter();
            } else {
                createProfile();
            }
        }

        private void createProfile() {
            Settings settings = GlobalSettings.getInstance().newSettings();
            refreshProfilesModel();
            profiles.setSelectedItem(settings);
        }
    });
    copyProfile.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            if (isModified(displayedSettings)) {
                ListPopup confirmation = createConfirmation(
                        "Profile was modified, save changes to current profile?", "Yes", "No", new Runnable() {
                            @Override
                            public void run() {
                                apply();
                                copyProfile();
                            }
                        }, new Runnable() {
                            @Override
                            public void run() {
                                importFrom(displayedSettings);
                                copyProfile();
                            }
                        }, 0);

                confirmation.showInFocusCenter();
            } else {
                copyProfile();
            }
        }

        private void copyProfile() {
            Settings settings = GlobalSettings.getInstance().copySettings(displayedSettings);
            refreshProfilesModel();
            profiles.setSelectedItem(settings);

        }
    });
    setJavaFormatterProfileModel();
    setJavaScriptFormatterProfileModel();
    setCppFormatterProfileModel();

    profilesModel = createProfilesModel();
    profiles.setModel(profilesModel);
    profiles.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            // && isSameId()
            if (displayedSettings != null && getSelectedItem() != null && isModified(displayedSettings)) {
                showConfirmationDialogOnProfileChange();
            } else if (displayedSettings != null && getSelectedItem() != null) {
                importFromInternal(getSelectedItem());
            }
        }

    });

    profiles.setRenderer(new ListCellRendererWrapper() {
        @Override
        public void customize(JList jList, Object value, int i, boolean b, boolean b1) {
            if (value != null) {
                setText(((Settings) value).getName());
            }
        }
    });
    rename.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            final JTextField content = new JTextField();
            content.setText(displayedSettings.getName());
            JBPopup balloon = PopupFactoryImpl.getInstance().createComponentPopupBuilder(content, content)
                    .createPopup();
            balloon.setMinimumSize(new Dimension(200, 20));
            balloon.addListener(new JBPopupListener() {
                @Override
                public void beforeShown(LightweightWindowEvent event) {
                }

                @Override
                public void onClosed(LightweightWindowEvent event) {
                    displayedSettings.setName(content.getText());
                }
            });
            balloon.showUnderneathOf(rename);
        }
    });
    delete.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            int selectedIndex = profiles.getSelectedIndex();
            GlobalSettings.getInstance().delete(getSelectedItem(), getProject());
            profiles.setModel(profilesModel = createProfilesModel());
            int itemCount = profiles.getItemCount();
            if (selectedIndex < itemCount && selectedIndex >= 0) {
                Object itemAt = profiles.getItemAt(selectedIndex);
                importFromInternal((Settings) itemAt);
                profiles.setSelectedIndex(selectedIndex);
            }
            if (selectedIndex == itemCount && selectedIndex - 1 >= 0) {
                Object itemAt = profiles.getItemAt(selectedIndex - 1);
                importFromInternal((Settings) itemAt);
                profiles.setSelectedIndex(selectedIndex - 1);
            } else {
                Settings defaultSettings = GlobalSettings.getInstance().getDefaultSettings();
                importFromInternal(defaultSettings);
                profiles.setSelectedItem(defaultSettings);
            }

        }
    });
    DONATEButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            BareBonesBrowserLaunch.openURL(
                    "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=75YN7U7H7D7XU&lc=CZ&item_name=Eclipse%20code%20formatter%20%2d%20IntelliJ%20plugin%20%2d%20Donation&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest");
        }
    });
    helpButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            BareBonesBrowserLaunch
                    .openURL("http://code.google.com/p/eclipse-code-formatter-intellij-plugin/wiki/HowTo");
        }
    });
    ;
    homepage.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            BareBonesBrowserLaunch.openURL("http://plugins.intellij.net/plugin/?idea&id=6546");
        }
    });
}

From source file:cloud.gui.CloudGUI.java

private void createDistributionPanel() {
    JPanel distributionPanel = new JPanel();
    distributionPanel.setBorder(BorderFactory.createTitledBorder("Distribution"));
    distributionPanel.setLayout(new GridLayout(3, 1));

    // ------------------- //      
    distributionPanelSelector = new JPanel();
    distributionPanelSelector.setBorder(BorderFactory.createEmptyBorder());
    distributionPanelSelector.setLayout(new FlowLayout());

    disLbl = new JLabel("Distribution: ");
    distributionPanelSelector.add(disLbl);

    distributions = new JComboBox(distributionRepository.getDistributions());
    distributionPanelSelector.add(distributions);
    distributions.addActionListener(distributionSelectionActionListener);
    // ------------------- //
    parametersPanel = new JPanel();
    parametersPanel.setBorder(BorderFactory.createEmptyBorder());
    parametersPanel.setLayout(new FlowLayout());

    parameter1 = new IntegerTextField(7);
    parameter2 = new IntegerTextField(7);
    parameter3 = new IntegerTextField(7);

    parameter1Lbl = new JLabel("P1: ");
    parameter2Lbl = new JLabel("P2: ");
    parameter3Lbl = new JLabel("P3: ");

    // ------------------- //      
    JPanel buttonPanel = new JPanel();
    buttonPanel.setBorder(BorderFactory.createEmptyBorder());
    buttonPanel.setLayout(new FlowLayout());

    startDistributionRequestButton = new JButton("Start");
    startDistributionRequestButton.addActionListener(startDistributionRequestActionListener);
    JButton stopDistributionRequest = new JButton("Stop");
    stopDistributionRequest.addActionListener(stopDistributionRequestActionListener);

    buttonPanel.add(startDistributionRequestButton);
    buttonPanel.add(stopDistributionRequest);

    distributionPanel.add(distributionPanelSelector);
    distributionPanel.add(parametersPanel);
    distributionPanel.add(buttonPanel);/*from  ww  w  .  j a  v  a 2s  .  co  m*/
    requestEnginePanel.add(distributionPanel);
    decorateForUniformDistribution();
}

From source file:edu.ku.brc.specify.config.init.secwiz.DatabasePanel.java

/**
 * @param bgColor//from  w ww.  ja  v a 2 s .  c om
 * @param htmlFileName
 * @return
 */
public static JComponent createHelpPanel(final Color bgColor, final String htmlFileName) {
    Locale currLocale = Locale.getDefault();

    String helpMasterPath = (new File(".")).getAbsolutePath() + File.separator + "../" + "help/securitywiz/"
            + htmlFileName;
    String fullHelpMasterPath = UIHelper.createLocaleName(currLocale, helpMasterPath, "html");

    JEditorPane htmlPane = null;
    try {
        File file = new File(fullHelpMasterPath);
        if (!file.exists()) // for testing
        {
            helpMasterPath = (new File(".")).getAbsolutePath() + File.separator + "help/securitywiz/"
                    + htmlFileName;
            fullHelpMasterPath = UIHelper.createLocaleName(currLocale, helpMasterPath, "html");
            file = new File(fullHelpMasterPath);
            System.out.println(file.getCanonicalPath());
        }
        URI url = file.toURI();

        htmlPane = new JEditorPane(url.toURL()); //$NON-NLS-1$
        htmlPane.setEditable(false);
        htmlPane.setBackground(bgColor);

    } catch (IOException ex) {
        File file = new File(fullHelpMasterPath);
        String htmlDesc = "";
        try {
            htmlDesc = "Error loading help: " + file.getCanonicalPath();
        } catch (IOException e) {
            e.printStackTrace();
        }
        htmlPane = new JEditorPane("text/plain", htmlDesc); //$NON-NLS-1$
    }

    JScrollPane scrollPane = UIHelper.createScrollPane(htmlPane, true);
    scrollPane.setBorder(BorderFactory.createEmptyBorder());
    scrollPane.getViewport().setPreferredSize(new Dimension(400, 400));

    return scrollPane;
}

From source file:net.pms.newgui.StatusTab.java

public JComponent build() {
    // Apply the orientation for the locale
    ComponentOrientation orientation = ComponentOrientation.getOrientation(PMS.getLocale());

    String colSpec = FormLayoutUtil.getColSpec("pref, 30dlu, fill:pref:grow, 30dlu, pref", orientation);
    //                                             1     2          3           4     5

    FormLayout layout = new FormLayout(colSpec,
            //                          1     2          3            4     5
            //                   //////////////////////////////////////////////////
            "p," // Detected Media Renderers --------------------//  1
                    + "9dlu," //                                              //
                    + "fill:p:grow," //                 <renderers>                  //  3
                    + "3dlu," //                                              //
                    + "p," // ---------------------------------------------//  5
                    + "3dlu," //           |                       |          //
                    + "p," // Connected |  Memory Usage         |<bitrate> //  7
                    + "3dlu," //           |                       |          //
                    + "p," //  <icon>   |  <statusbar>          |          //  9
                           //////////////////////////////////////////////////
    );//from  ww w  .  j a  v  a 2 s .c om

    PanelBuilder builder = new PanelBuilder(layout);
    builder.border(Borders.DIALOG);
    builder.opaque(true);
    CellConstraints cc = new CellConstraints();

    // Renderers
    JComponent cmp = builder.addSeparator(Messages.getString("StatusTab.9"),
            FormLayoutUtil.flip(cc.xyw(1, 1, 5), colSpec, orientation));
    cmp = (JComponent) cmp.getComponent(0);
    Font bold = cmp.getFont().deriveFont(Font.BOLD);
    Color fgColor = new Color(68, 68, 68);
    cmp.setFont(bold);

    renderers = new JPanel(new GuiUtil.WrapLayout(FlowLayout.CENTER, 20, 10));
    JScrollPane rsp = new JScrollPane(renderers, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    rsp.setBorder(BorderFactory.createEmptyBorder());
    rsp.setPreferredSize(new Dimension(0, 260));
    rsp.getHorizontalScrollBar().setLocation(0, 250);

    builder.add(rsp, cc.xyw(1, 3, 5));

    cmp = builder.addSeparator(null, FormLayoutUtil.flip(cc.xyw(1, 5, 5), colSpec, orientation));

    // Connected
    jl = new JLabel(Messages.getString("StatusTab.3"));
    builder.add(jl, FormLayoutUtil.flip(cc.xy(1, 7, "center, top"), colSpec, orientation));
    jl.setFont(bold);
    jl.setForeground(fgColor);

    imagePanel = buildImagePanel("/resources/images/icon-status-connecting.png");
    builder.add(imagePanel, FormLayoutUtil.flip(cc.xy(1, 9), colSpec, orientation));

    // Memory
    memBarUI = new GuiUtil.SegmentedProgressBarUI(Color.white, Color.gray);
    memBarUI.setActiveLabel("{}", Color.white, 0);
    memBarUI.setActiveLabel("{}", Color.red, 90);
    memBarUI.addSegment("", memColor);
    memBarUI.addSegment("", bufColor);
    memBarUI.setTickMarks(getTickMarks(), "{}");
    memoryProgressBar = new GuiUtil.CustomUIProgressBar(0, 100, memBarUI);
    memoryProgressBar.setStringPainted(true);
    memoryProgressBar.setForeground(new Color(75, 140, 181));
    memoryProgressBar.setString(Messages.getString("StatusTab.5"));

    JLabel mem = builder
            .addLabel(
                    "<html><b>" + Messages.getString("StatusTab.6") + "</b> ("
                            + Messages.getString("StatusTab.12") + ")</html>",
                    FormLayoutUtil.flip(cc.xy(3, 7), colSpec, orientation));
    mem.setForeground(fgColor);
    builder.add(memoryProgressBar, FormLayoutUtil.flip(cc.xyw(3, 9, 1), colSpec, orientation));

    // Bitrate
    String bitColSpec = "left:pref, 3dlu, right:pref:grow";
    PanelBuilder bitrateBuilder = new PanelBuilder(new FormLayout(bitColSpec, "p, 1dlu, p, 1dlu, p"));

    bitrateLabel = new JLabel("<html><b>" + Messages.getString("StatusTab.13") + "</b> ("
            + Messages.getString("StatusTab.11") + ")</html>");
    bitrateLabel.setForeground(fgColor);
    bitrateBuilder.add(bitrateLabel, FormLayoutUtil.flip(cc.xy(1, 1), bitColSpec, orientation));

    currentBitrateLabel = new JLabel(Messages.getString("StatusTab.14"));
    currentBitrateLabel.setForeground(fgColor);
    bitrateBuilder.add(currentBitrateLabel, FormLayoutUtil.flip(cc.xy(1, 3), bitColSpec, orientation));

    currentBitrate = new JLabel("0");
    currentBitrate.setForeground(fgColor);
    bitrateBuilder.add(currentBitrate, FormLayoutUtil.flip(cc.xy(3, 3), bitColSpec, orientation));

    peakBitrateLabel = new JLabel(Messages.getString("StatusTab.15"));
    peakBitrateLabel.setForeground(fgColor);
    bitrateBuilder.add(peakBitrateLabel, FormLayoutUtil.flip(cc.xy(1, 5), bitColSpec, orientation));

    peakBitrate = new JLabel("0");
    peakBitrate.setForeground(fgColor);
    bitrateBuilder.add(peakBitrate, FormLayoutUtil.flip(cc.xy(3, 5), bitColSpec, orientation));

    builder.add(bitrateBuilder.getPanel(),
            FormLayoutUtil.flip(cc.xywh(5, 7, 1, 3, "left, top"), colSpec, orientation));

    JPanel panel = builder.getPanel();

    // Apply the orientation to the panel and all components in it
    panel.applyComponentOrientation(orientation);

    JScrollPane scrollPane = new JScrollPane(panel, JScrollPane.VERTICAL_SCROLLBAR_NEVER,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrollPane.setBorder(BorderFactory.createEmptyBorder());
    startMemoryUpdater();
    return scrollPane;
}