Java Code Examples for javax.swing.JToolBar#setBorderPainted()

The following examples show how to use javax.swing.JToolBar#setBorderPainted() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DisambiguationWindow.java    From wpcleaner with Apache License 2.0 6 votes vote down vote up
/**
 * @return Page components.
 */
private Component createPageComponents() {
  JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
  addTextPageName(panel);
  JToolBar toolbar = new JToolBar(SwingConstants.HORIZONTAL);
  toolbar.setFloatable(false);
  toolbar.setBorderPainted(false);
  addButtonReload(toolbar, true);
  buttonView = ActionExternalViewer.addButton(
      toolbar, getWikipedia(), getPageName(), false, true, false);
  buttonViewHistory = ActionExternalViewer.addButton(
      toolbar, getWikipedia(), getPageName(), ActionExternalViewer.ACTION_HISTORY, true, true);
  addButtonSend(toolbar, true);
  buttonWatch = ActionWatchPage.addButton(
      getParentComponent(), toolbar, getWikipedia(), getPageName(), true, true);
  addButtonFullAnalysis(toolbar, true);
  panel.add(toolbar);
  return panel;
}
 
Example 2
Source File: ViewComponent.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initComponents() {
    setLayout (new BorderLayout ());
    contentComponent = new javax.swing.JPanel(new BorderLayout ());
    add (contentComponent, BorderLayout.CENTER);  //NOI18N
    JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.setBorderPainted(true);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolBar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    toolBar.setBorder(javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.background")),
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.foreground"))));
    add(toolBar, BorderLayout.WEST);
    JComponent buttonsPane = toolBar;
    viewModelListener = new ViewModelListener (
        name,
        contentComponent,
        buttonsPane,
        propertiesHelpID,
        ImageUtilities.loadImage(icon)
    );
}
 
Example 3
Source File: InfoPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private JToolBar createFilterToolBar() {
    final FiltersDescriptor filtersDesc = FiltersDescriptor.getInstance();
    // configure toolbar
    final JToolBar toolbar = new NoBorderToolBar();
    toolbar.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
    toolbar.setFloatable(false);
    //toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setOpaque(false);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolbar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    createFilterToolBarUI(toolbar, filtersDesc);
    filtersDesc.addPropertyChangeListener(new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    createFilterToolBarUI(toolbar, filtersDesc);
                }
            });
        }
    });
    return toolbar;
}
 
Example 4
Source File: YearChooser.java    From javamoney-examples with Apache License 2.0 6 votes vote down vote up
private
JToolBar
createButton(String command, Icon icon, String tip)
{
  JToolBar toolBar = new JToolBar();
  Link link = new Link();

  // Build link.
  buildButton(link, icon, new ActionHandler(), command, tip);

  // Build tool bar.
  toolBar.add(link);
  toolBar.setBorderPainted(false);
  toolBar.setFloatable(false);
  toolBar.setRollover(true);

  return toolBar;
}
 
Example 5
Source File: HierarchyTopComponent.java    From netbeans with Apache License 2.0 6 votes vote down vote up
MainToolBar(@NonNull final Pair<JComponent,GridBagConstraints>... components) {
    super(BoxLayout.X_AXIS);
    setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 5));
    final JToolBar toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setOpaque(false);
    toolbar.setFocusable(false);
    toolbar.setLayout(new GridBagLayout());
    for (Pair<JComponent,GridBagConstraints> p : components) {
        toolbar.add(p.first(),p.second());
    }
    add (toolbar);
}
 
Example 6
Source File: RConsoleView.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
EditorView(REditorComponent editor) {
            super(new BorderLayout());
            
            editor.clearScrollBorders();
            add(editor, BorderLayout.CENTER);
//            add(new ScrollableContainer(editorContainer), BorderLayout.CENTER);

            JToolBar controls = new JToolBar(JToolBar.VERTICAL);
            controls.setFloatable(false);
            controls.setBorderPainted(false);
            controls.add(runAction);
            controls.add(cancelAction);
            controls.addSeparator();
            controls.add(loadAction).putClientProperty("POPUP_LEFT", Boolean.TRUE); // NOI18N
            controls.add(saveAction).putClientProperty("POPUP_LEFT", Boolean.TRUE); // NOI18N
            controls.add(editAction).putClientProperty("POPUP_LEFT", Boolean.TRUE); // NOI18N
            
            JPanel controlsContainer = new JPanel(new BorderLayout());
            controlsContainer.setOpaque(false);
            controlsContainer.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("Separator.foreground")), // NOI18N
                    BorderFactory.createEmptyBorder(1, 1, 1, 1)));
            controlsContainer.add(controls, BorderLayout.CENTER);
            add(controlsContainer, BorderLayout.WEST);
            
            // size to always show Run and Stop buttons
            int h = controls.getComponent(0).getPreferredSize().height;
            h += controls.getComponent(1).getPreferredSize().height + 2;
            setMinimumSize(new Dimension(0, h));
        }
 
Example 7
Source File: CSVColumnPanel.java    From javamoney-examples with Apache License 2.0 5 votes vote down vote up
private
Panel
createButtonPanel()
{
  ActionHandler handler = new ActionHandler();
  JToolBar toolBar = new JToolBar();
  Panel panel = new Panel();
  Dimension separator = new Dimension(15, 10);

  // Build tool bar.
  toolBar.setBorderPainted(false);
  toolBar.setFloatable(false);
  toolBar.setRollover(true);

  toolBar.add(createButton(ARROW_UP.getIcon(), ACTION_UP, handler,
      getProperty("up_tip")));

  toolBar.addSeparator(separator);

  toolBar.add(createButton(ARROW_DOWN.getIcon(), ACTION_DOWN, handler,
      getProperty("down_tip")));

  // Build panel.
  panel.add(toolBar, 0, 0, 1, 1, 100, 100);

  return panel;
}
 
Example 8
Source File: WikiSelector.java    From wpcleaner with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor.
 * 
 * @param parentComponent Parent component.
 */
public WikiSelector(Component parentComponent) {
  this.parentComponent = parentComponent;
  this.changeListeners = new ArrayList<>();
  
  // Create combo box
  Configuration configuration = Configuration.getConfiguration();
  EnumWikipedia defaultWikipedia = configuration.getWikipedia();
  combo = new JComboBox<>(EnumWikipedia.getList().toArray(new EnumWikipedia[0]));
  combo.setEditable(false);
  combo.setSelectedItem(defaultWikipedia);
  combo.addItemListener(EventHandler.create(
      ItemListener.class, this, "notifyWikiChange"));

  // Create label
  label = Utilities.createJLabel(GT._T("Wiki"));
  label.setLabelFor(combo);
  label.setHorizontalAlignment(SwingConstants.TRAILING);

  // Create button
  toolbar = new JToolBar(SwingConstants.HORIZONTAL);
  toolbar.setFloatable(false);
  toolbar.setBorderPainted(false);
  JButton buttonWikiInfo = Utilities.createJButton(
      "tango-help-browser.png", EnumImageSize.SMALL,
      GT._T("Other Wiki"), false, null);
  buttonWikiInfo.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionOtherWiki"));
  toolbar.add(buttonWikiInfo);
}
 
Example 9
Source File: LanguageSelector.java    From wpcleaner with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor.
 * 
 * @param parentComponent Parent component.
 */
public LanguageSelector(Component parentComponent) {
  this.parentComponent = parentComponent;
  this.changeListeners = new ArrayList<>();

  // Create combo box
  Configuration configuration = Configuration.getConfiguration();
  EnumLanguage defaultLanguage = configuration.getLanguage();
  combo = new JComboBox<>(EnumLanguage.getList().toArray(new EnumLanguage[0]));
  combo.setEditable(false);
  combo.setSelectedItem(defaultLanguage);
  combo.addItemListener(EventHandler.create(
      ItemListener.class, this, "notifyLanguageChange"));

  // Create label
  label = Utilities.createJLabel(GT._T("Language"));
  label.setLabelFor(combo);
  label.setHorizontalAlignment(SwingConstants.TRAILING);

  // Create button
  toolbar = new JToolBar(SwingConstants.HORIZONTAL);
  toolbar.setFloatable(false);
  toolbar.setBorderPainted(false);
  JButton buttonLanguageInfo = Utilities.createJButton(
      "tango-help-browser.png", EnumImageSize.SMALL,
      GT._T("Other Language"), false, null);
  buttonLanguageInfo.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionOtherLanguage"));
  toolbar.add(buttonLanguageInfo);
}
 
Example 10
Source File: InstallerWindow.java    From wpcleaner with Apache License 2.0 5 votes vote down vote up
/**
 * @return Command components.
 */
private Component createCommandComponents() {

  JPanel panel = new JPanel(new BorderLayout());

  // Installation button
  JButton buttonInstall = Utilities.createJButton(
      "commons-nuvola-web-broom.png", EnumImageSize.VERY_BIG,
      GT._T("Install"), true, null);
  buttonInstall.setFont(buttonInstall.getFont().deriveFont((float) 24));
  buttonInstall.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionInstall"));
  panel.add(buttonInstall, BorderLayout.CENTER);

  // Tool bar for buttons
  JToolBar toolbar = new JToolBar(SwingConstants.HORIZONTAL);
  toolbar.setFloatable(false);
  toolbar.setBorderPainted(false);
  panel.add(toolbar, BorderLayout.LINE_END);

  // Help button
  HelpButton help = new HelpButton(getParentComponent(), wikiSelector);
  toolbar.add(help.getButton());

  // Idea button
  IdeaButton idea = new IdeaButton(getParentComponent());
  toolbar.add(idea.getButton());

  return panel;
}
 
Example 11
Source File: ProjectListWindow.java    From tmc-intellij with MIT License 5 votes vote down vote up
/**
 * Method generated by IntelliJ IDEA GUI Designer.
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void setupUi() {
    basePanel = new JPanel();
    basePanel.setLayout(new GridLayoutManager(3, 3, new Insets(0, 0, 0, 0), -1, -1));

    tabbedPaneBase = new JTabbedPane();

    basePanel.add(tabbedPaneBase, new GridConstraints(1, 0, 1, 3,
            GridConstraints.ANCHOR_CENTER,
            GridConstraints.FILL_BOTH,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            null, new Dimension(200, 200), null, 0, false));

    toolbar = new JToolBar();
    toolbar.setBorderPainted(false);
    toolbar.setFloatable(false);
    toolbar.setForeground(new Color(-16777216));

    basePanel.add(toolbar, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_CENTER,
            GridConstraints.FILL_HORIZONTAL,
            GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null,
            new Dimension(-1, 20), null, 0, false));

    final Spacer spacer1 = new Spacer();
    basePanel.add(spacer1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER,
            GridConstraints.FILL_HORIZONTAL,
            GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
}
 
Example 12
Source File: TransparentToolBar.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
private static JToolBar createToolBar(final boolean horizontal) {
    JToolBar tb = new JToolBar(horizontal ? JToolBar.HORIZONTAL : JToolBar.VERTICAL) {
        public void layout() {
            super.layout();
            if (horizontal) {
                if (BUTTON_HEIGHT == -1)
                    BUTTON_HEIGHT = getButtonHeight();
                Insets i = getInsets();
                int height = getHeight() - i.top - i.bottom;
                for (Component comp : getComponents()) {
                    if (comp.isVisible() && (comp instanceof JButton || comp instanceof JToggleButton)) {
                        Rectangle b = comp.getBounds();
                        b.height = BUTTON_HEIGHT;
                        b.y = i.top + (height - b.height) / 2;
                        comp.setBounds(b);
                    }
                }
            }
        }
    };
    if (UISupport.isNimbusLookAndFeel())
        tb.setLayout(new BoxLayout(tb, horizontal ? BoxLayout.X_AXIS :
                                                    BoxLayout.Y_AXIS));
    tb.setBorderPainted(false);
    tb.setFloatable(false);
    tb.setRollover(true);
    tb.setOpaque(false);
    return tb;
}
 
Example 13
Source File: OQLConsoleView.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
EditorView(OQLEditorComponent editor) {
            super(new BorderLayout());
            
            editor.clearScrollBorders();
            add(editor, BorderLayout.CENTER);
//            add(new ScrollableContainer(editorContainer), BorderLayout.CENTER);

            JToolBar controls = new JToolBar(JToolBar.VERTICAL);
            controls.setFloatable(false);
            controls.setBorderPainted(false);
            controls.add(runAction);
            controls.add(cancelAction);
            controls.addSeparator();
            controls.add(loadAction).putClientProperty("POPUP_LEFT", Boolean.TRUE); // NOI18N
            controls.add(saveAction).putClientProperty("POPUP_LEFT", Boolean.TRUE); // NOI18N
            controls.add(editAction).putClientProperty("POPUP_LEFT", Boolean.TRUE); // NOI18N
            
            JPanel controlsContainer = new JPanel(new BorderLayout());
            controlsContainer.setOpaque(false);
            controlsContainer.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createMatteBorder(0, 0, 0, 1, UIManager.getColor("Separator.foreground")), // NOI18N
                    BorderFactory.createEmptyBorder(1, 1, 1, 1)));
            controlsContainer.add(controls, BorderLayout.CENTER);
            add(controlsContainer, BorderLayout.WEST);
            
            // size to always show Run and Stop buttons
            int h = controls.getComponent(0).getPreferredSize().height;
            h += controls.getComponent(1).getPreferredSize().height + 2;
            setMinimumSize(new Dimension(0, h));
        }
 
Example 14
Source File: JSList.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 5 votes vote down vote up
private JToolBar getToolbar() {
    JToolBar tbar = new javax.swing.JToolBar();
    tbar.setFloatable(false);
    tbar.setRollover(true);
    tbar.setBorderPainted(false);
    return tbar;
}
 
Example 15
Source File: ReportDefect.java    From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 5 votes vote down vote up
/**
 *
 * @return - the tool bar object
 */
JToolBar getToolBar() {
    JToolBar p = new JToolBar();
    p.setFloatable(false);
    p.setBorderPainted(false);
    return p;
}
 
Example 16
Source File: FiltersManager.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/** Called only from AWT */
private void initPanel () {
    setBorder(new EmptyBorder(1, 2, 3, 5));

    // configure toolbar
    JToolBar toolbar = new JToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    // create toggle buttons
    int filterCount = filtersDesc.getFilterCount();
    toggles = new ArrayList<JToggleButton>(filterCount);
    JToggleButton toggleButton = null;
    
    Map<String,Boolean> fStates = new HashMap<String, Boolean>(filterCount * 2);

    for (int i = 0; i < filterCount; i++) {
        toggleButton = createToggle(fStates, i);
        toggles.add(toggleButton);
    }
    
    // add toggle buttons
    JToggleButton curToggle;
    Dimension space = new Dimension(3, 0);
    for (int i = 0; i < toggles.size(); i++) {
        curToggle = toggles.get(i);
        curToggle.addActionListener(this);
        toolbar.add(curToggle);
        if (i != toggles.size() - 1) {
            toolbar.addSeparator(space);
        }
    }
    
    add(toolbar);
    
    // initialize member states map
    synchronized (STATES_LOCK) {
        filterStates = fStates;
    }
}
 
Example 17
Source File: OnePageAnalysisWindow.java    From wpcleaner with Apache License 2.0 4 votes vote down vote up
/**
 * @return Links components.
 */
private Component createLinksComponents() {
  JPanel panel = new JPanel(new GridBagLayout());

  listLinks = new JList<Page>(modelLinks);

  // Initialize constraints
  GridBagConstraints constraints = new GridBagConstraints();
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.gridheight = 1;
  constraints.gridwidth = 1;
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.insets = new Insets(0, 0, 0, 0);
  constraints.ipadx = 0;
  constraints.ipady = 0;
  constraints.weightx = 1;
  constraints.weighty = 0;

  // Button toolbar
  JToolBar toolbar = new JToolBar(SwingConstants.HORIZONTAL);
  toolbar.setFloatable(false);
  toolbar.setBorderPainted(false);
  ActionFullAnalysis.addButton(
      getParentComponent(), toolbar, getWikipedia(), listLinks, knownPages, true, true);
  ActionDisambiguationAnalysis.addButton(
      getParentComponent(), toolbar, getWikipedia(), listLinks, true, true);
  buttonRemoveLinks = Utilities.createJButton(
      "wpc-remove-link.png", EnumImageSize.NORMAL,
      GT._T("Remove all links"), false, null);
  buttonRemoveLinks.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionRemoveAllLinks"));
  toolbar.add(buttonRemoveLinks);
  buttonWatchLink = ActionWatchPage.createButton(
      getParentComponent(), getWikipedia(), listLinks, true, true);
  toolbar.add(buttonWatchLink);
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.weightx = 1;
  panel.add(toolbar, constraints);
  constraints.gridy++;

  // Links
  constraints.fill = GridBagConstraints.BOTH;
  constraints.weighty = 1;
  listCellRenderer = new PageListCellRenderer();
  listCellRenderer.showCountOccurrence(true);
  listCellRenderer.showDisambiguation(true);
  listCellRenderer.showMissing(true);
  listCellRenderer.showRedirect(true);
  listLinks.setCellRenderer(listCellRenderer);
  popupListenerLinks = new AnalysisPageListPopupListener(
      getWikipedia(), getTextContents(), listLinks, this);
  listLinks.addMouseListener(popupListenerLinks);
  listLinks.addMouseListener(new PageListAnalyzeListener(getWikipedia(), null));
  listLinks.addListSelectionListener(new AnalysisListSelectionListener());
  JScrollPane scrollLinks = new JScrollPane(listLinks);
  scrollLinks.setMinimumSize(new Dimension(100, 100));
  scrollLinks.setPreferredSize(new Dimension(200, 500));
  scrollLinks.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  panel.add(scrollLinks, constraints);
  constraints.gridy++;

  return panel;
}
 
Example 18
Source File: DisambiguationWindow.java    From wpcleaner with Apache License 2.0 4 votes vote down vote up
/**
 * @return Links components.
 */
private Component createLinksComponents() {
  JPanel panel = new JPanel(new GridBagLayout());
  Configuration configuration = Configuration.getConfiguration();

  listLinks = new JList<Page>(modelLinks);

  // Initialize constraints
  GridBagConstraints constraints = new GridBagConstraints();
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.gridheight = 1;
  constraints.gridwidth = 1;
  constraints.gridx = 0;
  constraints.gridy = 0;
  constraints.insets = new Insets(0, 0, 0, 0);
  constraints.ipadx = 0;
  constraints.ipady = 0;
  constraints.weightx = 1;
  constraints.weighty = 0;

  // Select next links button
  buttonSelectNextLinks = Utilities.createJButton(GT._T("Select &next links"), null);
  buttonSelectNextLinks.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionSelectNextLinks"));
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.weightx = 1;
  panel.add(buttonSelectNextLinks, constraints);
  constraints.gridy++;

  // Automatic fixing
  buttonAutomaticFixing = Utilities.createJButton(GT._T("Automatic fixing"), null);
  buttonAutomaticFixing.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionRunAutomaticFixing"));
  panel.add(buttonAutomaticFixing, constraints);
  constraints.gridy++;

  // Button toolbar
  JToolBar toolbar = new JToolBar(SwingConstants.HORIZONTAL);
  toolbar.setFloatable(false);
  toolbar.setBorderPainted(false);
  buttonFullAnalysisLink = ActionFullAnalysis.addButton(
      getParentComponent(), toolbar, getWikipedia(), listLinks, knownPages, true, true);
  ActionDisambiguationAnalysis.addButton(
      getParentComponent(), toolbar, getWikipedia(), listLinks, true, true);
  buttonMarkNormal = Utilities.createJButton(
      "wpc-mark-normal.png", EnumImageSize.NORMAL,
      GT._T("Mark backlink as normal"), false, null);
  buttonMarkNormal.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionMarkBacklinkNormal"));
  toolbar.add(buttonMarkNormal);
  buttonMarkNeedHelp = Utilities.createJButton(
      "wpc-mark-need-help.png", EnumImageSize.NORMAL,
      GT._T("Mark backlink as needing help"), false, null);
  buttonMarkNeedHelp.addActionListener(EventHandler.create(
      ActionListener.class, this, "actionMarkBacklinkHelpNeeded"));
  toolbar.add(buttonMarkNeedHelp);
  buttonViewLink = ActionExternalViewer.addButton(
      toolbar, getWikipedia(), listLinks, false, true, true);
  toolbar.addSeparator();
  linkCount = new JLabel(GT._T("Link count"));
  toolbar.add(linkCount);
  constraints.fill = GridBagConstraints.HORIZONTAL;
  constraints.weightx = 1;
  constraints.weighty = 0;
  panel.add(toolbar, constraints);
  constraints.gridy++;

  // Links
  listCellRenderer = new PageListCellRenderer();
  listCellRenderer.showRedirect(true);
  listCellRenderer.showRedirectBacklinks(true);
  if (getPage() != null) {
    listCellRenderer.setPageProperties(configuration.getSubProperties(
        getWikipedia(), Configuration.PROPERTIES_BACKLINKS, getPage().getTitle()));
  }
  listLinks.setCellRenderer(listCellRenderer);
  popupListenerLinks = new DisambiguationPageListPopupListener(
      getWikipedia(), getTextContents(), listLinks, this);
  listLinks.addMouseListener(popupListenerLinks);
  listLinks.addMouseListener(new PageListAnalyzeListener(getWikipedia(), this));
  JScrollPane scrollLinks = new JScrollPane(listLinks);
  scrollLinks.setMinimumSize(new Dimension(100, 100));
  scrollLinks.setPreferredSize(new Dimension(200, 500));
  scrollLinks.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
  constraints.fill = GridBagConstraints.BOTH;
  constraints.weighty = 1;
  panel.add(scrollLinks, constraints);
  constraints.gridy++;

  return panel;
}
 
Example 19
Source File: JComponentBuilders.java    From visualvm with GNU General Public License v2.0 3 votes vote down vote up
protected void setupInstance(JToolBar instance) {
    super.setupInstance(instance);
    
    instance.setBorderPainted(paintBorder);
    
    if (margin != null) instance.setMargin(margin.createInstance());
    
    instance.setFloatable(floatable);
    instance.setOrientation(orientation);
}
 
Example 20
Source File: JComponentBuilders.java    From netbeans with Apache License 2.0 3 votes vote down vote up
protected void setupInstance(JToolBar instance) {
    super.setupInstance(instance);
    
    instance.setBorderPainted(paintBorder);
    
    if (margin != null) instance.setMargin(margin.createInstance());
    
    instance.setFloatable(floatable);
    instance.setOrientation(orientation);
}