Example usage for com.jgoodies.looks HeaderStyle SINGLE

List of usage examples for com.jgoodies.looks HeaderStyle SINGLE

Introduction

In this page you can find the example usage for com.jgoodies.looks HeaderStyle SINGLE.

Prototype

HeaderStyle SINGLE

To view the source code for com.jgoodies.looks HeaderStyle SINGLE.

Click Source Link

Usage

From source file:com.eviware.soapui.support.action.swing.JXSoapUIActionListToolBar.java

License:EUPL

@SuppressWarnings("unchecked")
public JXSoapUIActionListToolBar(ActionList actions, ModelItem modelItem) {
    addSpace(1);/*  ww  w . j av  a 2 s  . c  o  m*/
    setRollover(true);
    putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
    setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));

    for (int i = 0; i < actions.getActionCount(); i++) {
        Action action = actions.getActionAt(i);

        if (action instanceof MarkerAction) {
            continue;
        }

        if (action == ActionSupport.SEPARATOR_ACTION) {
            addSeparator();
        } else if (action instanceof ActionSupport.ActionListAction) {
            // JMenu subMenu = buildMenu(
            // ((ActionListAction)action).getActionList() );
            // if( subMenu == null )
            // subMenu = new JMenu(
            // ((ActionListAction)action).getActionList().getLabel() );
            // menu.add( subMenu);
        } else if (action != null) {
            JComponent component = null;

            if (action instanceof SoapUIActionMarker) {
                SoapUIAction soapUIAction = ((SoapUIActionMarker) action).getSoapUIAction();
                component = ActionComponentRegistry.buildActionComponent(soapUIAction, modelItem);
                actionMap.put(soapUIAction.getId(), action);
            }

            if (component != null) {
                add(component);
            } else {
                add(action);
            }
        }
    }
}

From source file:com.eviware.soapui.support.components.JInspectorPanelImpl.java

License:EUPL

private JXToolBar createInspectButtons() {
    inspectToolbar = new JXToolBar() {
        @Override/* w w  w . j  a  va 2s.  c  om*/
        public Dimension getMinimumSize() {
            return new Dimension(10, 10);
        }
    };

    inspectToolbar.setFloatable(false);
    inspectToolbar.setRollover(true);
    inspectToolbar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
    inspectToolbar.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));

    if (orientation == SwingConstants.TOP || orientation == SwingConstants.BOTTOM) {
        inspectToolbar.addSpace(10);
    }
    inspectToolbar.setBackground(Color.WHITE);
    inspectToolbar.setOpaque(true);
    return inspectToolbar;
}

From source file:com.eviware.soapui.support.UISupport.java

License:EUPL

public static JXToolBar createToolbar() {
    JXToolBar toolbar = new JXToolBar();
    toolbar.setFloatable(false);/*from w w  w.ja v a 2 s .c  om*/
    toolbar.addSpace(1);
    toolbar.setRollover(true);
    toolbar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
    toolbar.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
    toolbar.setMinimumSize(new Dimension(20, 20));
    return toolbar;
}

From source file:com.eviware.soapui.support.UISupport.java

License:EUPL

public static JXToolBar createSmallToolbar() {
    JXToolBar toolbar = new JXToolBar();
    toolbar.setFloatable(false);//from  www .ja  v a 2s  .c  o  m
    toolbar.addSpace(1);
    toolbar.setRollover(true);
    toolbar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
    toolbar.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    toolbar.setMinimumSize(new Dimension(20, 20));
    return toolbar;
}

From source file:com.salas.bb.views.mainframe.BBToolBarBuilder.java

License:Open Source License

/**
 * JGoodies specific setup.//w  w  w .  j ava  2  s .c  o  m
 *
 * @param bldr builder.
 */
private void setToolBarJGoodiesSettings(ToolBarBuilder bldr) {
    JToolBar toolBar = bldr.getToolBar();

    toolBar.putClientProperty("JToolBar.isRollover", Boolean.TRUE);
    toolBar.putClientProperty(PlasticLookAndFeel.IS_3D_KEY, Boolean.TRUE);
    toolBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);

    // Set a hint so that JGoodies Looks will detect it as being in the header.
    //        toolBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.BOTH);

    // Unlike the default, use a separator border.
    toolBar.putClientProperty(WindowsLookAndFeel.BORDER_STYLE_KEY, BorderStyle.EMPTY);
    toolBar.putClientProperty(PlasticLookAndFeel.BORDER_STYLE_KEY, BorderStyle.EMPTY);
}

From source file:de.xplib.xdbm.ui.ApplicationMenuBar.java

License:Open Source License

/**
 * @param appIn The main frame.// w w w  .j  a  v  a 2s .com
 */
public ApplicationMenuBar(final Application appIn) {
    this.app = appIn;

    this.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
    this.putClientProperty(PlasticLookAndFeel.IS_3D_KEY, Boolean.TRUE);

    this.app.setJMenuBar(this);

    this.add(this.jmFile);
    this.jmFile.add(this.jmFileNew);
    this.jmFileNew.setIcon(Application.createIcon("icon/menu.new.png"));
    this.jmFileNew.add(new JMenuItem(NewCollectionAction.INSTANCE));
    this.jmFileNew.add(new JMenuItem(NewVirtualCollectionAction.INSTANCE));
    this.jmFileNew.add(new JMenuItem(NewXMLResourceAction.INSTANCE));

    this.jmFile.addSeparator();
    this.jmFile.add(this.jmiFileConnect);
    this.jmFile.add(this.jmiFileDisconnect);
    this.jmFile.addSeparator();
    this.jmFile.addSeparator();
    this.jmFile.add(this.jmiExit);

    this.add(this.jmEdit);
    this.jmEdit.add(new JMenuItem(CutResourceAction.INSTANCE));
    this.jmEdit.add(new JMenuItem(CopyResourceAction.INSTANCE));
    this.jmEdit.add(new JMenuItem(PasteResourceAction.INSTANCE));
    this.jmEdit.add(new JMenuItem(new FlippingAction(
            new Action[] { DeleteResourceAction.INSTANCE, DeleteCollectionAction.INSTANCE })));

    this.add(this.jmView);
    this.jmView.add(this.jmViewPlugins);

    this.initPlugins();
    /*
    Map map  = this.app.getConfig().getPluginFiles();
    Iterator it = map.keySet().iterator();
    while (it.hasNext()) {
    try {
        Plugin p = ((PluginFile) map.get(it.next())).createPlugin();
        this.jmViewPlugins.add(new JMenuItem(p.getTitle()));
    } catch (Exception e) {
        e.printStackTrace();
    }
    }
    */
    this.jmView.addSeparator();

    this.jmView.add(new JMenuItem(ShowXMLAction.INSTANCE));
    this.jmView.add(new JMenuItem(ShowPCVResourceAction.INSTANCE));

    this.add(this.jmQuery);
    this.jmQuery.add(new JMenuItem(QueryCollectionAction.INSTANCE));
    this.jmQuery.add(new JMenuItem(QueryXMLResourceAction.INSTANCE));

    // we have build the system menu, now we setup the plugin menus.
    for (int i = 0; i < this.plugins.length; i++) {
        this.plugins[i].setUpMenu(this);
    }

    I18N i18n = I18N.getInstance();
    i18n.addObserver(this);
    this.updateI18N(i18n);

    Config cfg = this.app.getConfig();
    cfg.addObserver(this);
    this.update(cfg);
}

From source file:phex.gui.common.MainFrame.java

License:Open Source License

private void setupComponents(DGuiSettings guiSettings) {
    tabbedPane = new JTabbedPane();
    tabbedPane.setMinimumSize(new Dimension(50, 50));
    tabbedPane.addChangeListener(new ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent e) {
            Component comp = tabbedPane.getSelectedComponent();
            if (comp instanceof FWTab) {
                ((FWTab) comp).tabSelectedNotify();
            }// w w w. ja v a  2  s . com
        }
    });

    Servent servent = GUIRegistry.getInstance().getServent();

    // Net Tab
    networkTab = new NetworkTab();
    networkTab.initComponent(guiSettings);
    initializeTab(networkTab, NETWORK_TAB_ID, guiSettings);

    // Search Tab
    QueryManager queryService = servent.getQueryService();
    searchTab = new SearchTab(queryService.getSearchContainer(), queryService.getSearchFilterRules(),
            servent.getDownloadService());
    searchTab.initComponent(guiSettings);
    initializeTab(searchTab, SEARCH_TAB_ID, guiSettings);

    //  SWDownload Tab
    swDownloadTab = new SWDownloadTab(servent.getDownloadService());
    swDownloadTab.initComponent(guiSettings);
    initializeTab(swDownloadTab, DOWNLOAD_TAB_ID, guiSettings);

    //  Upload Tab
    uploadTab = new UploadTab();
    uploadTab.initComponent(guiSettings);
    initializeTab(uploadTab, UPLOAD_TAB_ID, guiSettings);

    //  Library Tab
    libraryTab = new LibraryTab();
    libraryTab.initComponent(guiSettings);
    initializeTab(libraryTab, LIBRARY_TAB_ID, guiSettings);

    //  Security Tab
    securityTab = new SecurityTab();
    securityTab.initComponent(guiSettings);
    initializeTab(securityTab, SECURITY_TAB_ID, guiSettings);

    //  Statistics Tab
    statisticsTab = new StatisticsTab();
    statisticsTab.initComponent(guiSettings);
    initializeTab(statisticsTab, STATISTICS_TAB_ID, guiSettings);

    //  Search Monitor Tab
    QueryHistoryMonitor queryHistoryMonitor = new QueryHistoryMonitor();
    servent.getMessageService().addMessageSubscriber(QueryMsg.class, queryHistoryMonitor);
    searchMonitorTab = new SearchMonitorTab(queryHistoryMonitor);
    searchMonitorTab.initComponent(guiSettings);
    initializeTab(searchMonitorTab, SEARCH_MONITOR_TAB_ID, guiSettings);

    //  Result Monitor Tab
    resultMonitorTab = new ResultMonitorTab(servent.getDownloadService());
    resultMonitorTab.initComponent(guiSettings);
    initializeTab(resultMonitorTab, RESULT_MONITOR_TAB_ID, guiSettings);

    if (tabbedPane.getTabCount() == 0) {
        getContentPane().add(BorderLayout.CENTER, getLogoPanel());
    } else {
        tabbedPane.setSelectedIndex(0);
        getContentPane().add(BorderLayout.CENTER, tabbedPane);
    }

    // menu bar
    JMenuBar menubar = new MainMenuBar(this, guiSettings);
    setJMenuBar(menubar);
    // property changed to HeaderStyle.BOTH in case a toolbar is activated.
    menubar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);

    // toolbar
    boolean isToolbarVisible = true;
    if (guiSettings != null && guiSettings.isSetToolbarVisible()) {
        isToolbarVisible = guiSettings.isToolbarVisible();
    }
    if (isToolbarVisible) {
        setToolbarVisible(true);
    }

    // Status Bar
    boolean isStatusbarVisible = true;
    if (guiSettings != null && guiSettings.isSetStatusbarVisible()) {
        isStatusbarVisible = guiSettings.isStatusbarVisible();
    }
    if (isStatusbarVisible) {
        setStatusbarVisible(true);
    }
}

From source file:xapps.browser.gsea.GseaFijiTabsApplicationFrame.java

License:Open Source License

/**
 * @return//from   w  ww .j  a  v a  2  s  . c  om
 * @note Placing this here rather in ActionFactory as a developing aid
 * - > quicker launch of XReg isnt initialized at startup
 * The applications menu bar is defined here.
 * @maint if new actions are added -> need to review to see if they should also
 * be added to the menu bar.
 */

private JMenuBar createMenuBar() {

    JMenuBar menuBar = new JMenuBar();

    // @note JGOODIES SUGGESTIONS
    menuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);

    if (!SystemUtils.IS_OS_MAC_OSX) {
        menuBar.add(createJMenu("File", new Object[] { new MyExitAction() }));
    }

    menuBar.add(createJMenu("Help", new Object[] {
            new GseaHelpAction("GSEA web site", "Open the GSEA website in a web browser",
                    GseaWebResources.getGseaBaseURL()),
            new GseaHelpAction(),
            new BrowserAction("GSEA & MSigDB License Terms", "GSEA & MSigDB License Terms",
                    GuiHelper.ICON_HELP16, GseaWebResources.getGseaBaseURL() + "/" + "license_terms_list.jsp"),
            null, new ShowAppRuntimeHomeDirAction("Show GSEA home folder"),
            new ShowDefaultOutputDirAction("Show GSEA output folder (default location)"), null,
            new ContactAction(), null, formatBuildInfoForHelp(), formatBuildTimestampForHelp() }));

    return menuBar;
}