Example usage for com.vaadin.ui.themes ValoTheme MENUBAR_BORDERLESS

List of usage examples for com.vaadin.ui.themes ValoTheme MENUBAR_BORDERLESS

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme MENUBAR_BORDERLESS.

Prototype

String MENUBAR_BORDERLESS

To view the source code for com.vaadin.ui.themes ValoTheme MENUBAR_BORDERLESS.

Click Source Link

Document

Borderless menu bar.

Usage

From source file:fi.jasoft.draganddrop.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    Panel showcase = new Panel();
    showcase.setSizeUndefined();//  w  w  w  .  java  2s .  c o m

    navigator = new Navigator(this, showcase);

    for (DemoView view : views) {
        navigator.addView(view.getViewPath(), view);
    }

    // default
    openView(views.get(0));

    MenuBar demos = new MenuBar();
    demos.setStyleName(ValoTheme.MENUBAR_BORDERLESS);

    for (final DemoView view : views) {
        demos.addItem(view.getViewCaption(), new Command() {

            @Override
            public void menuSelected(MenuItem selectedItem) {
                openView(view);
            }
        });
    }

    VerticalLayout root = new VerticalLayout(demos, showcase);
    root.setSizeFull();
    root.setExpandRatio(showcase, 1);
    root.setComponentAlignment(showcase, Alignment.MIDDLE_CENTER);
    setContent(root);

    HorizontalLayout sourceWrapperLayout = new HorizontalLayout();
    Label caption = new Label("Source code for example");
    caption.setStyleName("source-caption");
    sourceWrapperLayout.addComponent(caption);

    Panel sourceWrapper = new Panel(codeLabel);
    sourceWrapper.setStyleName(ValoTheme.PANEL_BORDERLESS);
    sourceWrapper.setHeight(getPage().getBrowserWindowHeight() + "px");
    sourceWrapperLayout.addComponent(sourceWrapper);
    sourceWrapperLayout.setExpandRatio(sourceWrapper, 1);

    Toolbox sourceBox = new Toolbox();
    sourceBox.setOrientation(ORIENTATION.RIGHT_CENTER);
    sourceBox.setContent(sourceWrapperLayout);
    sourceBox.setOverflowSize(30);
    root.addComponent(sourceBox);
}

From source file:org.eclipse.hawkbit.ui.components.ConfigMenuBar.java

License:Open Source License

private void init() {
    setId(id);/*from   www . j  av  a2s .c  o  m*/
    if (!createPermission && !updatePermission && !deletePermission) {
        return;
    }
    setStyleName(ValoTheme.MENUBAR_BORDERLESS);
    addStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_POSITION);
    config = addItem("", FontAwesome.COG, null);
    config.setStyleName(SPUIStyleDefinitions.CONFIG_MENU_BAR_ITEMS);
    config.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_CONFIGURE));

    addMenuItems();
}

From source file:org.ikasan.dashboard.ui.framework.panel.LandingViewPanel.java

License:BSD License

private Component createContentWrapper(final Component content) {
    final CssLayout slot = new CssLayout();
    slot.setWidth("100%");
    slot.addStyleName("dashboard-panel-slot");

    CssLayout card = new CssLayout();
    card.setWidth("100%");
    card.addStyleName(ValoTheme.LAYOUT_CARD);

    HorizontalLayout toolbar = new HorizontalLayout();
    toolbar.addStyleName("dashboard-panel-toolbar");
    toolbar.setWidth("100%");

    Label caption = new Label(content.getCaption());
    caption.addStyleName(ValoTheme.LABEL_H4);
    caption.addStyleName(ValoTheme.LABEL_COLORED);
    caption.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    content.setCaption(null);//from  ww w.j  a va 2  s .c  o m

    MenuBar tools = new MenuBar();
    tools.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    MenuItem max = tools.addItem("", VaadinIcons.EXPAND, new Command() {

        @Override
        public void menuSelected(final MenuItem selectedItem) {
            if (!slot.getStyleName().contains("max")) {
                selectedItem.setIcon(FontAwesome.COMPRESS);
                toggleMaximized(slot, true);
            } else {
                slot.removeStyleName("max");
                selectedItem.setIcon(FontAwesome.EXPAND);
                toggleMaximized(slot, false);
            }
        }
    });
    max.setStyleName("icon-only");
    MenuItem root = tools.addItem("", VaadinIcons.COG, null);
    root.addItem("Configure", new Command() {
        @Override
        public void menuSelected(final MenuItem selectedItem) {
            Notification.show("Not implemented in this demo");
        }
    });
    root.addSeparator();
    root.addItem("Close", new Command() {
        @Override
        public void menuSelected(final MenuItem selectedItem) {
            Notification.show("Not implemented in this demo");
        }
    });

    toolbar.addComponents(caption, tools);
    toolbar.setExpandRatio(caption, 1);
    toolbar.setComponentAlignment(caption, Alignment.MIDDLE_LEFT);

    card.addComponents(toolbar, content);
    slot.addComponent(card);
    return slot;
}

From source file:org.ikasan.dashboard.ui.monitor.component.MonitorPanel.java

License:BSD License

protected Component createContentWrapper(final Component small, final Component large) {
    final CssLayout slot = new CssLayout();
    slot.setWidth("100%");
    slot.addStyleName("monitor-panel-slot");

    final CssLayout card1 = new CssLayout();
    card1.setWidth("100%");
    card1.addStyleName(ValoTheme.LAYOUT_CARD);

    final CssLayout card2 = new CssLayout();
    card2.setWidth("100%");
    card2.addStyleName(ValoTheme.LAYOUT_CARD);

    final HorizontalLayout toolbar = new HorizontalLayout();
    toolbar.addStyleName("dashboard-panel-toolbar");
    toolbar.setWidth("100%");

    Label caption = new Label(large.getCaption());
    caption.addStyleName(ValoTheme.LABEL_H4);
    caption.addStyleName(ValoTheme.LABEL_COLORED);
    caption.addStyleName(ValoTheme.LABEL_NO_MARGIN);
    large.setCaption(null);//from   w w  w . j  a  v  a 2 s  .  c  om

    MenuBar tools = new MenuBar();
    tools.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    MenuItem max = tools.addItem("", VaadinIcons.EXPAND, new Command() {

        @Override
        public void menuSelected(final MenuItem selectedItem) {
            if (!slot.getStyleName().contains("max")) {
                selectedItem.setIcon(FontAwesome.COMPRESS);
                slot.removeAllComponents();
                card2.removeAllComponents();
                card2.addComponents(toolbar, large);
                slot.addComponents(card2);
                toggleMaximized(slot, true);
            } else {
                slot.removeStyleName("max");
                selectedItem.setIcon(FontAwesome.EXPAND);
                toggleMaximized(slot, false);
                card1.removeAllComponents();
                card1.addComponents(toolbar, small);
                slot.removeAllComponents();
                slot.addComponents(card1);
            }
        }
    });
    max.setStyleName("icon-only");
    MenuItem root = tools.addItem("", VaadinIcons.COG, null);
    root.addItem("Configure", new Command() {
        @Override
        public void menuSelected(final MenuItem selectedItem) {
            Notification.show("Not implemented in this demo");
        }
    });
    root.addSeparator();
    root.addItem("Close", new Command() {
        @Override
        public void menuSelected(final MenuItem selectedItem) {
            Notification.show("Not implemented in this demo");
        }
    });

    toolbar.addComponents(caption, tools);
    toolbar.setExpandRatio(caption, 1);
    toolbar.setComponentAlignment(caption, Alignment.MIDDLE_LEFT);

    card1.addComponents(toolbar, small);
    //        card2.addComponents(toolbar, large);
    slot.addComponent(card1);
    return slot;
}

From source file:org.jpos.qi.Header.java

License:Open Source License

@SuppressWarnings("unchecked")
private MenuBar createMenu() {
    menuOptions = new LinkedHashMap<>();
    MenuBar mb = new MenuBar();
    mb.addStyleName(ValoTheme.MENUBAR_SMALL);
    mb.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    mb.setHtmlContentAllowed(true);/*from   w ww.  ja  v  a2  s  . com*/
    Element cfg = app.getXmlConfiguration();
    if (cfg != null) {
        Element menubar = cfg.getChild("menubar");
        if (menubar != null) {
            for (Element e : menubar.getChildren()) {
                addMenubarItem(mb, e);
            }
        }
    }
    userMenuItem = mb.addItem(app.getUser().getNick(), null);
    userMenuItem.setIcon(VaadinIcons.USER);
    userMenuItem.addItem("Profile", selectedItem -> {
        removeSelected();
        app.navigateTo("/profile");
    });
    userMenuItem.addItem("Log Out", selectedItem -> app.logout());
    return mb;
}

From source file:org.jumpmind.metl.ui.views.AdminView.java

License:Open Source License

@PostConstruct
protected void init() {
    setSizeFull();/*from w ww.j  a v a 2 s  .  co m*/

    tabbedPanel = new TabbedPanel();

    HorizontalSplitPanel leftSplit = new HorizontalSplitPanel();
    leftSplit.setSizeFull();
    leftSplit.setSplitPosition(AppConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS);

    VerticalLayout container = new VerticalLayout();
    container.setSizeFull();
    container.addComponent(tabbedPanel);
    leftSplit.setSecondComponent(container);

    table = new TreeTable();
    table.addStyleName(ValoTheme.TREETABLE_NO_HORIZONTAL_LINES);
    table.addStyleName(ValoTheme.TREETABLE_NO_STRIPES);
    table.addStyleName(ValoTheme.TREETABLE_NO_VERTICAL_LINES);
    table.addStyleName(ValoTheme.TREETABLE_BORDERLESS);
    table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
    table.setSizeFull();
    table.setCacheRate(100);
    table.setPageLength(100);
    table.setImmediate(true);
    table.setSelectable(true);
    table.addItemClickListener(this);
    table.addStyleName("noselect");
    table.addContainerProperty("id", String.class, null);
    table.setVisibleColumns(new Object[] { "id" });
    table.setColumnExpandRatio("id", 1);
    addItem("Users", Icons.USER);
    addItem("Groups", Icons.GROUP);
    addItem("REST", Icons.REST);
    addItem("General Settings", Icons.SETTINGS);
    addItem("Mail Server", Icons.EMAIL);
    addItem("Notifications", Icons.NOTIFICATION);
    addItem("Logging", Icons.LOGGING);
    addItem("About", FontAwesome.QUESTION);

    VerticalLayout navigator = new VerticalLayout();
    navigator.addStyleName(ValoTheme.MENU_ROOT);
    navigator.setSizeFull();
    leftSplit.setFirstComponent(navigator);

    MenuBar leftMenuBar = new MenuBar();
    leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    leftMenuBar.setWidth(100, Unit.PERCENTAGE);
    navigator.addComponent(leftMenuBar);

    navigator.addComponent(table);
    navigator.setExpandRatio(table, 1);

    addComponent(leftSplit);

}

From source file:org.jumpmind.metl.ui.views.DeployNavigator.java

License:Open Source License

protected HorizontalLayout buildMenuBar() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, Unit.PERCENTAGE);

    MenuBar leftMenuBar = new MenuBar();
    leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    leftMenuBar.setWidth(100, Unit.PERCENTAGE);

    MenuItem newMenu = leftMenuBar.addItem("New", null);

    newFolder = newMenu.addItem("Folder", new Command() {

        @Override/*ww  w. j  a  va 2  s  .c o  m*/
        public void menuSelected(MenuItem selectedItem) {
            addFolder();
        }
    });

    newAgent = newMenu.addItem("Agent", new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            addAgent();
        }
    });

    MenuItem editMenu = leftMenuBar.addItem("Edit", null);

    editMenu.addItem("Open", new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            openItem(treeTable.getValue());
        }
    });

    editMenu.addItem("Rename", new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            startEditingItem((AbstractObject) treeTable.getValue());
        }
    });

    delete = editMenu.addItem("Remove", new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            handleDelete();
        }
    });

    MenuBar rightMenuBar = new MenuBar();
    rightMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);

    search = rightMenuBar.addItem("", Icons.SEARCH, new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            search.setChecked(!search.isChecked());
            searchBarLayout.setVisible(search.isChecked());
        }
    });
    search.setVisible(false);

    layout.addComponent(leftMenuBar);
    layout.addComponent(rightMenuBar);
    layout.setExpandRatio(leftMenuBar, 1);

    return layout;
}

From source file:org.jumpmind.metl.ui.views.DesignNavigator.java

License:Open Source License

protected HorizontalLayout buildMenuBar() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setWidth(100, Unit.PERCENTAGE);

    // left menu bar
    MenuBar leftMenuBar = new MenuBar();
    leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    leftMenuBar.setWidth(100, Unit.PERCENTAGE);

    // file menu/*from  w w  w .  j  a v a  2s  .  com*/
    fileMenu = leftMenuBar.addItem("File", null);

    // file - new
    newMenu = fileMenu.addItem("New", null);
    newFlow = newMenu.addItem("Flow", selectedItem -> addNewFlow());
    newModel = newMenu.addItem("Model", selectedItem -> addNewModel());

    // file - new - resource
    resourceMenu = newMenu.addItem("Resource", null);
    newDataSource = resourceMenu.addItem("Database", selectedItem -> addNewDatabase());
    newFtpResource = resourceMenu.addItem("FTP", selectedItem -> addNewFtpResource());
    newFileResource = resourceMenu.addItem("Local File System", selectedItem -> addNewLocalFileSystem());
    newSSHResource = resourceMenu.addItem("Sftp", selectedItem -> addNewSSHFileSystem());
    newWebResource = resourceMenu.addItem("Web Resource", selectedItem -> addNewHttpResource());
    newJMSResource = resourceMenu.addItem("JMS", selectedItem -> addNewJMSFileSystem());

    // file - export
    exportMenu = fileMenu.addItem("Export...", selectedItem -> export());

    // file - import
    importConfig = fileMenu.addItem("Import...", selecteItem -> importConfig());

    // edit menu
    editMenu = leftMenuBar.addItem("Edit", null);
    editMenu.addItem("Open", selectedItem -> open(treeTable.getValue()));
    editMenu.addItem("Rename", selectedItem -> startEditingItem((AbstractObject) treeTable.getValue()));
    editMenu.addItem("Copy", selectedItem -> copySelected());
    delete = editMenu.addItem("Remove", selectedItem -> handleDelete());

    // project menu
    MenuItem projectMenu = leftMenuBar.addItem("Project", null);
    projectMenu.addItem("Manage", selectedItem -> viewProjects());
    closeProject = projectMenu.addItem("Close", selectedItem -> closeProject());

    // right menu
    MenuBar rightMenuBar = new MenuBar();
    rightMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    search = rightMenuBar.addItem("", Icons.SEARCH, new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            search.setChecked(!search.isChecked());
            searchBarLayout.setVisible(search.isChecked());
        }
    });
    search.setVisible(false);

    layout.addComponent(leftMenuBar);
    layout.addComponent(rightMenuBar);
    layout.setExpandRatio(leftMenuBar, 1);

    return layout;
}

From source file:org.jumpmind.metl.ui.views.ManageNavigator.java

License:Open Source License

public ManageNavigator(FolderType folderType, ApplicationContext context) {
    this.context = context;

    setSizeFull();//from  w  w w . ja va2s  . co  m

    addStyleName(ValoTheme.MENU_ROOT);

    VerticalLayout content = new VerticalLayout();
    content.setSizeFull();
    setContent(content);

    MenuBar leftMenuBar = new MenuBar();
    leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    leftMenuBar.setWidth(100, Unit.PERCENTAGE);
    content.addComponent(leftMenuBar);

    treeTable = buildTreeTable();
    content.addComponent(treeTable);
    content.setExpandRatio(treeTable, 1);

    agentsFolder = new Folder();
    agentsFolder.setName("Agents");

    flowsFolder = new Folder();
    flowsFolder.setName("Flows");
}

From source file:org.jumpmind.vaadin.ui.sqlexplorer.SqlExplorer.java

License:Open Source License

public SqlExplorer(String configDir, IDbProvider databaseProvider, ISettingsProvider settingsProvider,
        String user, float leftSplitSize, IDbMenuItem... additionalMenuItems) {
    this.databaseProvider = databaseProvider;
    this.settingsProvider = settingsProvider;
    this.savedSplitPosition = leftSplitSize;
    this.additionalMenuItems = additionalMenuItems;

    setSizeFull();//from   www.j  a v  a 2 s.c o  m
    addStyleName("sqlexplorer");

    VerticalLayout leftLayout = new VerticalLayout();
    leftLayout.setSizeFull();
    leftLayout.addStyleName(ValoTheme.MENU_ROOT);

    leftLayout.addComponent(buildLeftMenu());

    Panel scrollable = new Panel();
    scrollable.setSizeFull();

    dbTree = buildDbTree();
    scrollable.setContent(dbTree);

    leftLayout.addComponent(scrollable);
    leftLayout.setExpandRatio(scrollable, 1);

    VerticalLayout rightLayout = new VerticalLayout();
    rightLayout.setSizeFull();

    VerticalLayout rightMenuWrapper = new VerticalLayout();
    rightMenuWrapper.setWidth(100, Unit.PERCENTAGE);
    rightMenuWrapper.addStyleName(ValoTheme.MENU_ROOT);
    contentMenuBar = new MenuBar();
    contentMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS);
    contentMenuBar.setWidth(100, Unit.PERCENTAGE);
    addShowButton(contentMenuBar);

    rightMenuWrapper.addComponent(contentMenuBar);
    rightLayout.addComponent(rightMenuWrapper);

    contentTabs = new SqlExplorerTabPanel();
    contentTabs.addSelectedTabChangeListener(new SelectedTabChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            selectContentTab((IContentTab) contentTabs.getSelectedTab());
        }
    });
    rightLayout.addComponent(contentTabs);
    rightLayout.setExpandRatio(contentTabs, 1);

    addComponents(leftLayout, rightLayout);

    setSplitPosition(savedSplitPosition, Unit.PIXELS);
}