Example usage for javax.swing JToolBar addSeparator

List of usage examples for javax.swing JToolBar addSeparator

Introduction

In this page you can find the example usage for javax.swing JToolBar addSeparator.

Prototype

public void addSeparator() 

Source Link

Document

Appends a separator of default size to the end of the tool bar.

Usage

From source file:com.intuit.tank.proxy.ProxyApp.java

private JToolBar createToolBar() {
    JToolBar ret = new JToolBar();
    // ret.setBackground(new Color(111,167,209));

    ret.add(Box.createHorizontalStrut(5));
    ret.add(createButton(openAction));//  w w w .  ja v  a2s . c  om
    ret.add(Box.createHorizontalStrut(5));
    ret.add(createButton(saveAction));

    ret.addSeparator();

    ret.add(Box.createHorizontalStrut(5));
    ret.add(createButton(startAction));
    ret.add(Box.createHorizontalStrut(5));
    ret.add(createButton(stopAction));
    ret.add(Box.createHorizontalStrut(5));
    ret.add(createButton(pauseAction));
    ret.add(Box.createHorizontalStrut(5));

    ret.addSeparator();

    ret.add(Box.createHorizontalStrut(5));
    ret.add(createButton(filterAction));
    ret.add(createButton(settingsAction));
    ret.addSeparator();

    ret.add(Box.createHorizontalStrut(5));
    ret.add(createButton(showHostsAction));

    ret.add(Box.createHorizontalGlue());

    return ret;
}

From source file:cl.almejo.vsim.gui.SimWindow.java

private void addMainToolbar() {
    JToolBar toolBar = new JToolBar();
    toolBar.add(newToolbarButton(NEW_ACTION));
    toolBar.add(newToolbarButton(OPEN_ACTION));
    toolBar.add(newToolbarButton(SAVE_ACTION));

    toolBar.addSeparator();

    toolBar.add(newToolbarButton(UNDO_ACTION));
    toolBar.add(newToolbarButton(REDO_ACTION));
    toolBar.add(newToolbarButton(CUT_ACTION));
    toolBar.add(newToolbarButton(COPY_ACTION));
    toolBar.add(newToolbarButton(PASTE_ACTION));

    toolBar.addSeparator();//from   ww w .  j a  va  2 s  . c  o m
    ButtonGroup group = new ButtonGroup();

    toolBar.add(newGrouppedButton(START_ACTION, group));
    toolBar.add(newGrouppedButton(PAUSE_ACTION, group));

    getContentPane().add(toolBar, BorderLayout.NORTH);
}

From source file:com.eviware.soapui.impl.wsdl.panels.request.AbstractWsdlRequestDesktopPanel.java

protected JComponent buildToolbar() {
    endpointCombo = new JComboBox(endpointsModel);
    endpointCombo.setToolTipText(endpointsModel.getSelectedItem().toString());

    endpointCombo.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            Object item = endpointCombo.getSelectedItem();
            if (item == null) {
                endpointCombo.setToolTipText("- no endpoint set for request -");
            } else {
                String selectedItem = item.toString();
                endpointCombo.setToolTipText(selectedItem);
            }//  w w  w  .j  av  a  2  s  .  c  om

            submitButton.setEnabled(submit == null && request.getEndpoint() != null
                    && request.getEndpoint().trim().length() > 0);
        }
    });

    JToolBar toolbar = UISupport.createToolbar();

    toolbar.add(submitButton);
    insertButtons(toolbar);
    toolbar.add(recreateButton);
    toolbar.add(createEmptyButton);
    toolbar.add(cloneButton);
    toolbar.add(cancelButton);
    toolbar.addSeparator();
    toolbar.add(endpointCombo);

    toolbar.add(Box.createHorizontalGlue());
    toolbar.add(tabsButton);
    toolbar.add(splitButton);
    toolbar.add(UISupport.createToolbarButton(new ShowOnlineHelpAction(getHelpUrl())));

    return toolbar;
}

From source file:com.mightypocket.ashot.Mediator.java

private JToolBar createToolBar() {
    ApplicationActionMap actionMap = getActionMap();
    JToolBar bar = new JToolBar();
    bar.setRollover(true);/*from  www .j a v  a2  s  . c o m*/
    toolBarMap.clear();
    final boolean hideText = !p.getBoolean(PREF_GUI_SHOW_TEXT_IN_TOOLBAR, true);
    for (String actionName : TOOLBAR) {
        if (TOOLBAR_SEPARATOR.equals(actionName)) {
            bar.addSeparator();
        } else {
            AbstractButton bt;
            if (actionName.startsWith(TOOLBAR_TOGGLE_BUTTON)) {
                actionName = StringUtils.substring(actionName, TOOLBAR_TOGGLE_BUTTON.length());
                bt = new JToggleButton(actionMap.get(actionName));
            } else {
                bt = new JButton(actionMap.get(actionName));
            }
            bt.setFocusable(false);
            bt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
            bt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
            bt.setHideActionText(hideText);
            bar.add(bt);
            toolBarMap.put(actionName, bt);
        }
    }

    return bar;
}

From source file:net.sf.nmedit.nomad.core.Nomad.java

private JToolBar createQuickActionToolbar() {
    JToolBar toolbar = new JToolBar();
    toolbar.setBorderPainted(false);/*w  w w.  j  a  v  a  2 s  .c o  m*/
    toolbar.setFloatable(false);
    toolbar.add(Factory.createToolBarButton(menuLayout.getEntry(MENU_FILE_OPEN)));
    toolbar.addSeparator();
    toolbar.add(Factory.createToolBarButton(menuLayout.getEntry(MENU_FILE_SAVE)));
    toolbar.addSeparator();

    JPopupMenu pop = new JPopupMenu();
    Iterator<FileService> iter = ServiceRegistry.getServices(FileService.class);

    JRadioButtonMenuItem rfirst = null;
    SelectedAction sa = new SelectedAction();

    sa.putValue(AbstractAction.SMALL_ICON, getImage("/icons/tango/16x16/actions/document-new.png"));

    while (iter.hasNext()) {
        FileService fs = iter.next();
        if (fs.isNewFileOperationSupported()) {
            JRadioButtonMenuItem rb = new JRadioButtonMenuItem(
                    new AHAction(fs.getName(), fs.getIcon(), fs, "newFile"));
            sa.add(rb);
            pop.add(rb);
            if (rfirst == null)
                rfirst = rb;
        }
    }

    JButton btn = Factory.createToolBarButton(sa);
    toolbar.add(btn);

    new JDropDownButtonControl(btn, pop);
    return toolbar;
}

From source file:livecanvas.mesheditor.MeshEditor.java

private JToolBar createToolBar() {
    JToolBar toolbar = new JToolBar();
    JButton button;//from  w ww.  j  a v  a2  s. c o m
    toolbar.add(Utils.createToolBarButton("New mesh", new ImageIcon(clazz.getResource("res/new.png")),
            ButtonType.ICON_ONLY, NEW, "New", this));
    toolbar.add(Utils.createToolBarButton("Open", new ImageIcon(clazz.getResource("res/open.png")),
            ButtonType.ICON_ONLY, OPEN, "Open a saved mesh", this));
    toolbar.add(Utils.createToolBarButton("Save", new ImageIcon(clazz.getResource("res/save.png")),
            ButtonType.ICON_ONLY, SAVE, "Save mesh", this));
    toolbar.addSeparator();
    toolbar.add(Utils.createToolBarButton("Cut", new ImageIcon(clazz.getResource("res/cut.png")),
            ButtonType.ICON_ONLY, CUT, "Cut selection to clipboard", this));
    toolbar.add(Utils.createToolBarButton("Copy", new ImageIcon(clazz.getResource("res/copy.png")),
            ButtonType.ICON_ONLY, COPY, "Copy selection to clipboard", this));
    toolbar.add(Utils.createToolBarButton("Paste", new ImageIcon(clazz.getResource("res/paste.png")),
            ButtonType.ICON_ONLY, PASTE, "Paste content from clipboard", this));
    toolbar.addSeparator();
    toolbar.add(Utils.createToolBarButton("Undo", new ImageIcon(clazz.getResource("res/undo.png")),
            ButtonType.ICON_ONLY, UNDO, "Undo last action", this));
    toolbar.add(Utils.createToolBarButton("Redo", new ImageIcon(clazz.getResource("res/redo.png")),
            ButtonType.ICON_ONLY, REDO, "Redo last undone action", this));
    toolbar.addSeparator();
    JPanel rendererSelectContainer = new JPanel();
    rendererSelectContainer.setOpaque(false);
    rendererSelectContainer.setMaximumSize(new Dimension(150, 40));
    rendererSelectContainer.add(rendererSelect = new JComboBox(Style.Styles));
    rendererSelect.setSelectedIndex(Style.Styles.length - 1);
    toolbar.add(rendererSelectContainer);
    toolbar.add(Utils.createToolBarButton("Render Settings",
            new ImageIcon(clazz.getResource("res/render_settings.png")), ButtonType.ICON_ONLY, RENDER_SETTINGS,
            "Render Settings", this));
    toolbar.add(Utils.createToolBarButton("Render", new ImageIcon(clazz.getResource("res/render.png")),
            ButtonType.ICON_ONLY, RENDER, "Render mesh using current style", this));
    return toolbar;
}

From source file:org.eurocarbdb.application.glycoworkbench.plugin.PeakListChartPanel.java

private JToolBar createToolBar() {
    JToolBar toolbar = new JToolBar();
    toolbar.setFloatable(false);/*from  w w  w .ja va2 s  .c  om*/

    toolbar.add(theActionManager.get("new"));
    toolbar.add(theActionManager.get("open"));

    toolbar.addSeparator();

    toolbar.add(theActionManager.get("print"));

    toolbar.addSeparator();

    toolbar.add(theActionManager.get("arrow"));
    toolbar.add(theActionManager.get("hand"));

    toolbar.addSeparator();

    toolbar.add(theActionManager.get("zoomnone"));
    toolbar.add(theActionManager.get("zoomin"));
    toolbar.add(theActionManager.get("zoomout"));

    toolbar.addSeparator();

    toolbar.add(mslevel_button = new JButton(theActionManager.get("mslevel=msms")));
    mslevel_button.setText(null);
    toolbar.add(theActionManager.get("annotatepeaks"));

    toolbar.addSeparator();

    toolbar.add(isotopes_button = new JButton(theActionManager.get("updateisotopecurves=true")));
    isotopes_button.setText(null);
    toolbar.add(ftmode_button = new JButton(theActionManager.get("showallisotopes=true")));
    ftmode_button.setText(null);

    return toolbar;
}

From source file:com.employee.scheduler.common.swingui.SolverAndPersistenceFrame.java

private JComponent createToolBar() {
    JToolBar toolBar = new JToolBar("File operations");
    toolBar.setFloatable(false);/*  w  w w .  j av  a  2  s  .c o m*/

    importAction = new ImportAction();
    importAction.setEnabled(solutionBusiness.hasImporter());
    toolBar.add(new JButton(importAction));
    openAction = new OpenAction();
    openAction.setEnabled(true);
    toolBar.add(new JButton(openAction));
    saveAction = new SaveAction();
    saveAction.setEnabled(false);
    toolBar.add(new JButton(saveAction));
    exportAction = new ExportAction();
    exportAction.setEnabled(false);
    toolBar.add(new JButton(exportAction));
    toolBar.addSeparator();

    progressBar = new JProgressBar(0, 100);
    progressBar.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    toolBar.add(progressBar);
    toolBar.addSeparator();

    solveAction = new SolveAction();
    solveAction.setEnabled(false);
    solveButton = new JButton(solveAction);
    terminateSolvingEarlyAction = new TerminateSolvingEarlyAction();
    terminateSolvingEarlyAction.setEnabled(false);
    terminateSolvingEarlyButton = new JButton(terminateSolvingEarlyAction);
    terminateSolvingEarlyButton.setVisible(false);
    toolBar.add(solveButton, "solveAction");
    toolBar.add(terminateSolvingEarlyButton, "terminateSolvingEarlyAction");
    solveButton.setMinimumSize(terminateSolvingEarlyButton.getMinimumSize());
    solveButton.setPreferredSize(terminateSolvingEarlyButton.getPreferredSize());
    return toolBar;
}

From source file:de.ailis.xadrian.frames.MainFrame.java

/**
 * Creates the tool bar.//from www .  j a  v a2 s.c  o m
 */
private void createToolBar() {
    final JToolBar toolBar = new JToolBar(SwingConstants.HORIZONTAL);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.add(this.exitAction);
    toolBar.addSeparator();
    toolBar.add(this.newAction);
    toolBar.add(this.openAction);
    toolBar.add(this.closeAction);
    toolBar.add(this.saveAction);
    toolBar.add(this.printAction);
    toolBar.addSeparator();
    toolBar.add(this.addFactoryAction);
    toolBar.add(this.changeSectorAction);
    toolBar.add(this.changeSunsAction);
    toolBar.add(this.changePricesAction);
    final JToggleButton btn = new JToggleButton(this.toggleBaseComplexAction);
    btn.setHideActionText(true);
    toolBar.add(btn);
    add(toolBar, BorderLayout.NORTH);

    installStatusHandler(toolBar);
}

From source file:fll.scheduler.SchedulerUI.java

private JToolBar createScheduleToolbar() {
    final JToolBar toolbar = new JToolBar("Schedule Toolbar");
    toolbar.setFloatable(false);//from  www.j a v a  2  s . co m

    toolbar.add(mScheduleFilename);
    toolbar.addSeparator();
    toolbar.add(mOpenScheduleAction);
    toolbar.add(mReloadFileAction);
    toolbar.add(mWriteSchedulesAction);
    toolbar.add(mDisplayGeneralScheduleAction);

    return toolbar;
}