Java 类com.vaadin.ui.MenuBar 实例源码

项目:crawling-framework    文件:BaseView.java   
public BaseView(String title) {
    UI.getCurrent().getPage().setTitle(String.format("Analysis | %s", title));
    setWidth(100, PERCENTAGE);
    setSpacing(true);
    setMargin(true);

    HorizontalLayout actionBarLayout = new HorizontalLayout();
    actionBarLayout.setWidth(100, PERCENTAGE);

    MenuBar menu = new MenuBar();

    menu.addItem("Search", (item) -> UI.getCurrent().setContent(new SearchView()));
    menu.addItem("Context Cloud", (item) -> UI.getCurrent().setContent(new ContextCloudView()));

    actionBarLayout.addComponent(menu);

    addComponent(actionBarLayout);
}
项目:crawling-framework    文件:BaseView.java   
public BaseView(String title) {
    UI.getCurrent().getPage().setTitle(String.format("Crawler Admin | %s", title));
    setWidth(100, PERCENTAGE);
    setSpacing(true);
    setMargin(true);

    HorizontalLayout actionBarLayout = new HorizontalLayout();
    actionBarLayout.setWidth(100, PERCENTAGE);

    MenuBar menu = new MenuBar();

    MenuBar.MenuItem dataItem = menu.addItem("Configuration", null);
    dataItem.addItem("HTTP Sources", (item) -> UI.getCurrent().setContent(new HttpSourcesView()));
    dataItem.addItem("HTTP Source Tests", (item) -> UI.getCurrent().setContent(new HttpSourceTestsView()));
    dataItem.addItem("Named Queries", (item) -> UI.getCurrent().setContent(new NamedQueriesView()));
    dataItem.addItem("Import / Export", (item) -> UI.getCurrent().setContent(new ImportExportView()));

    menu.addItem("Page Analysis", (item) -> UI.getCurrent().setContent(new PageAnalysisView()));

    actionBarLayout.addComponent(menu);

    addComponent(actionBarLayout);
}
项目:vaadin-router    文件:RoutedMenu.java   
public void setActiveItem(MenuItem item) {
    if (item != null && item instanceof RoutedMenuItem) {
        MenuBar.MenuItem selectedItem = null;

        for (MenuItem el : this.getItems()) {
            el.setChecked(false);
            if (item.equals(el)) {
                selectedItem = el;
            }
        }

        while (selectedItem != null && !selectedItem.isChecked()) {
            selectedItem.setChecked(true);
            selectedItem = selectedItem.getParent();
        }
    }
}
项目:cuba    文件:WebAppMenu.java   
@Override
public MenuItem createMenuItem(String id, String caption,
                               @Nullable String icon, @Nullable Consumer<MenuItem> command) {
    checkNotNullArgument(id);
    checkItemIdDuplicate(id);

    MenuItem menuItem = new MenuItemImpl(this, id);
    MenuBar.MenuItem delegateItem = component.createMenuItem(caption, WebComponentsHelper.getIcon(icon), null);
    if (command != null) {
        delegateItem.setCommand(selectedItem ->
                command.accept(menuItem));
    }
    ((MenuItemImpl) menuItem).setDelegateItem(delegateItem);

    menuItem.setCaption(caption);
    menuItem.setIcon(icon);
    menuItem.setCommand(command);

    return menuItem;
}
项目:cuba    文件:WebAppMenu.java   
@Override
public void addChildItem(MenuItem menuItem) {
    MenuBar.MenuItem childItem = ((MenuItemImpl) menuItem).getDelegateItem();
    if (childItem.getText() == null) {
        throw new IllegalArgumentException("Caption cannot be null");
    }

    MenuBar.MenuItem delegateItem = this.getDelegateItem();

    // The only place where the parent is set
    childItem.setParent(delegateItem);
    delegateItem.getChildren().add(childItem);
    menu.registerMenuItem(menuItem);

    menu.getComponent().markAsDirty();
}
项目:cuba    文件:WebAppMenu.java   
@Override
public void addChildItem(MenuItem menuItem, int index) {
    MenuBar.MenuItem childItem = ((MenuItemImpl) menuItem).getDelegateItem();
    if (childItem.getText() == null) {
        throw new IllegalArgumentException("Caption cannot be null");
    }

    MenuBar.MenuItem delegateItem = this.getDelegateItem();

    // The only place where the parent is set
    childItem.setParent(delegateItem);
    delegateItem.getChildren().add(index, childItem);
    menu.registerMenuItem(menuItem);

    menu.getComponent().markAsDirty();
}
项目:dungeonstory-java    文件:MainScreen.java   
private void initLayout() {
    navBar = new NavBar();

    viewContainer = new VerticalLayout();
    viewContainer.addStyleName(DSTheme.VALO_CONTENT);
    viewContainer.addStyleName(DSTheme.CRUD_VIEW);
    //        viewContainer.setSizeFull();

    // DMenu menu = new DMenu();
    // menu.setCenteredTabs(true);
    // menu.setFloatingMenu(true);
    // menu.setFloatingMenuItemAutoShow(true);
    // menu.setMenuItemsSameHeight(true);
    // menu.setMenuItemElementsSameHeight(true);
    // org.dussan.vaadin.dmenu.menuitem.MenuItem item1 = new
    // org.dussan.vaadin.dmenu.menuitem.MenuItem( "TAB 1" );
    // MenuItemElement itemElement1 = new MenuItemElement( "ELEMENT 1", new
    // Label( "LABEL 1" ) );
    // item1.addMenuItemElement( itemElement1 );
    // menu.addMenuItem( item1 );

    menuBar = new MenuBar();
    menuItems = new HashMap<>();

    VerticalLayout rightLayout = new VerticalLayout();
    // rightLayout.addComponent(menu);
    rightLayout.addComponent(menuBar);
    rightLayout.addComponent(viewContainer);

    rightLayout.setSizeFull();
    rightLayout.setExpandRatio(viewContainer, 1);
    rightLayout.addStyleName(DSTheme.SCROLLABLE);

    // Panel panel = new Panel(rightLayout);

    addComponents(navBar, rightLayout);
    setExpandRatio(rightLayout, 1);
}
项目:vaadin-router    文件:Router.java   
public void registerPath(Class<? extends AccessLevelView> viewClass,
                         Resource icon,
                         String title, String desc, String path, String cssClass,
                         BooleanSupplier visibleCondition) {
    MenuBar.MenuItem item =  menu.addItem(icon, title, desc, path, cssClass, selectedItem -> {
        if (selectedItem instanceof RoutedMenu.RoutedMenuItem) {
            selectedItem.setChecked(false);
            navigator.navigateTo(((RoutedMenu.RoutedMenuItem) selectedItem).getPath());
        } else {
            menu.setActiveItem(selectedItem);
        }
    });
    item.setVisible((visibleCondition == null || visibleCondition.getAsBoolean()) &&
            (viewClass == null || AccessLevelView.hasAccessLevel(viewClass, accessLevelProvider.getCurrentAccessLevel())));
}
项目:vaadin-router    文件:RoutedMenu.java   
public MenuItem addItem(Resource icon, String title, String description,
                        String path, String styleName, MenuBar.Command command) {

    MenuBar.MenuItem item = addItem(title == null ? "" : title, icon, command, path);

    if (styleName != null) {
        item.setStyleName(styleName);
    }

    item.setDescription(description == null ? "" : description);
    item.setCheckable(true);

    return item;
}
项目:vaadin-router    文件:RoutedMenu.java   
public MenuBar.MenuItem getItemByPath(@NotNull String path) {
    for (MenuItem el : this.getItems()) {
        if (el instanceof RoutedMenuItem && path.equals(((RoutedMenuItem) el).getPath())) {
            return el;
        }
    }
    return null;
}
项目:vaadin-router    文件:RoutedMenu.java   
private MenuBar.MenuItem addItem(String caption, Resource icon, MenuBar.Command command, String path) {
    if (caption == null) {
        throw new IllegalArgumentException("caption cannot be null");
    } else {
        MenuBar.MenuItem newItem = new RoutedMenuItem(caption, icon, command, path);
        getItems().add(newItem);
        this.markAsDirty();
        return newItem;
    }
}
项目:cuba    文件:WebAppMenu.java   
protected void assignTestIds(MenuItem menuItem, String id) {
    AppUI ui = (AppUI) component.getUI();
    if (ui == null || !ui.isTestMode())
        return;

    MenuBar.MenuItem delegateItem = ((MenuItemImpl) menuItem).getDelegateItem();
    component.setCubaId(delegateItem, id);

    TestIdManager testIdManager = ui.getTestIdManager();
    String testId = component.getId() + "_" + id;

    component.setTestId(delegateItem, testIdManager.reserveId(testId));
}
项目:cuba    文件:WebAppMenu.java   
@Override
public MenuItem createSeparator() {
    MenuItemImpl menuItem = new MenuItemImpl(this, null);
    menuItem.setSeparator(true);

    MenuBar.MenuItem separator = component.createSeparator();
    menuItem.setDelegateItem(separator);

    return menuItem;
}
项目:cuba    文件:WebAppMenu.java   
@Override
public void removeChildItem(MenuItem menuItem) {
    MenuBar.MenuItem childItem = ((MenuItemImpl) menuItem).getDelegateItem();

    getDelegateItem().getChildren().remove(childItem);
    menu.unregisterItem(menuItem);
}
项目:hybridbpm    文件:TaskLayout.java   
@Override
public void menuSelected(MenuBar.MenuItem selectedItem) {
    TaskModel.TASK_PRIORITY priority = TaskModel.TASK_PRIORITY.valueOf(selectedItem.getText());
    if (!Objects.equals(task.getTaskPriority(), priority)) {
        HybridbpmUI.getBpmAPI().setTaskPriority(taskId, priority);
        loadForm();
    }
}
项目:hybridbpm    文件:DashboardPanel.java   
@Override
public void menuSelected(MenuBar.MenuItem selectedItem) {
    if (selectedItem.equals(max)) {
        selectedItem.setIcon(dashboardPanel.isMaximized() ? FontAwesome.EXPAND : FontAwesome.COMPRESS);
        dashboardTab.toggleMaximized(dashboardPanel, !dashboardPanel.isMaximized());
        dashboardPanel.setMaximized(!dashboardPanel.isMaximized());
    } else if (selectedItem.equals(configure)) {
        openPanelConfigurationWindow();
    } else if (selectedItem.equals(deletePanel)) {
        deletePanel();
    }
}
项目:KrishnasSpace    文件:HomeView.java   
/**
 * Init Various View Buttons
 * 
 * @param viewNames
 */
private void initViewButtons(Set<String> viewNames) {

    MenuBar menubar = new MenuBar();
    menubar.setAutoOpen(false);
    MenuItem parent = menubar.addItem("Themes", null);
    addVariousThemes(parent);
    addComponent(menubar);

    for (String viewName : viewNames) {
        Button button = getViewButton(viewName);
        addComponent(button);
    }

}
项目:cherry-web    文件:HelpNavigation.java   
public HelpNavigation(Map<String, Command> commands, String helpUrl) {

    if (commands != null && !commands.isEmpty()) {
        MenuBar menuBar = new MenuBar();
        MenuItem menu = menuBar.addItem("Menü", null);
        menu.setIcon(FontAwesome.NAVICON);
        for (Entry<String, Command> entry : commands.entrySet()) {
            menu.addItem(entry.getKey(), entry.getValue());
        }
        addComponent(menuBar);
        setComponentAlignment(menuBar, Alignment.MIDDLE_CENTER);
    }

    if (MString.isSetTrim(helpUrl)) {
        Button helpBtn = new Button("Hilfe");
        helpBtn.setIcon(FontAwesome.QUESTION);
        helpBtn.setDescription("Hier klicken, um Hilfe zu erhalten");
        helpBtn.addClickListener(new Button.ClickListener() {
            private static final long serialVersionUID = 1L;
            @Override
            public void buttonClick(ClickEvent event) {
                getUI().getPage().open(helpUrl, "_blank", false);
            }
        });
        addComponent(helpBtn);
        setComponentAlignment(helpBtn, Alignment.MIDDLE_CENTER);
    }

    setHeight(100, Unit.PERCENTAGE);
    setSpacing(true);
}
项目:cia    文件:CountryMenuItemFactoryImpl.java   
@Override
public void createOverviewPage(final VerticalLayout panelContent) {
    final MenuBar menuBar = new MenuBar();
    panelContent.addComponent(menuBar);
    panelContent.setComponentAlignment(menuBar, Alignment.TOP_LEFT);
    panelContent.setExpandRatio(menuBar, ContentRatio.LARGE);

    addSourcesAndIndicatorsToMenu(menuBar.addItem("By Topic",VaadinIcons.LINE_CHART, null), getTopicIndicatorMap());
    menuBar.setAutoOpen(true);
}
项目:cia    文件:PoliticianRankingMenuItemFactoryImpl.java   
@Override
public void createPoliticianRankingMenuBar(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);

    applicationMenuItemFactory.addRankingMenu(menuBar);

    createPoliticianRankingTopics(menuBar.addItem(POLITICIAN_RANKING, VaadinIcons.BUG, null));
}
项目:cia    文件:DocumentMenuItemFactoryImpl.java   
@Override
public void createDocumentsMenuBar(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);

    applicationMenuItemFactory.addRankingMenu(menuBar);
    final MenuItem documentsItem = menuBar.addItem(DOCUMENTS, VaadinIcons.FILE, null);
    documentsItem.addItem("List all",VaadinIcons.GROUP, COMMAND_DOCUMENTS);
    documentsItem.addItem("Search Documents",VaadinIcons.GROUP, COMMAND_SEARCH_DOCUMENT);

}
项目:cia    文件:PartyLeaderHistoryPageModContentFactoryImpl.java   
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);


    final DataContainer<ViewRiksdagenParty, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenParty.class);

    final ViewRiksdagenParty viewRiksdagenParty = dataContainer
            .load(pageId);

    if (viewRiksdagenParty != null) {

        getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent,LEADER_HISTORY);

        final DataContainer<ViewRiksdagenPartyRoleMember, String> partyRoleMemberDataContainer = getApplicationManager()
                .getDataContainer(ViewRiksdagenPartyRoleMember.class);

        getGridFactory().createBasicBeanItemGrid(
                panelContent, ViewRiksdagenPartyRoleMember.class, partyRoleMemberDataContainer
                .getAllBy(ViewRiksdagenPartyRoleMember_.party, viewRiksdagenParty.getPartyId()),
                LEADER_HISTORY2,
                COLUMN_ORDER, HIDE_COLUMNS,
                LISTENER, null, null);

        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;

}
项目:cia    文件:CommitteeRankingMenuItemFactoryImpl.java   
/**
 * Creates the committeee ranking menu bar.
 *
 * @param menuBar
 *            the menu bar
 */
@Override
public void createCommitteeeRankingMenuBar(final MenuBar menuBar) {
    initApplicationMenuBar(menuBar);

    applicationMenuItemFactory.addRankingMenu(menuBar);

    createCommitteeRankingTopics(menuBar.addItem(COMMITTEE_RANKING_TEXT, null, null));
}
项目:cia    文件:PartyVoteHistoryPageModContentFactoryImpl.java   
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<ViewRiksdagenParty, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenParty.class);

    final ViewRiksdagenParty viewRiksdagenParty = dataContainer.load(pageId);

    if (viewRiksdagenParty != null) {

        getPartyMenuItemFactory().createPartyMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, VOTE_HISTORY);

        getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenVoteDataBallotPartySummary.class, viewRiksdagenVoteDataBallotPartySummaryChartDataManager.findByValue(pageId), BALLOTS,
                NESTED_PROPERTIES,
                COLUMN_ORDER,
                HIDE_COLUMNS,
                LISTENER,
                EMBEDDED_ID_BALLOT_ID, null);

        pageCompleted(parameters, panel, pageId, viewRiksdagenParty);
    }
    return panelContent;

}
项目:SecureBPMN    文件:TaskListHeader.java   
protected void initSortMenu() {
  MenuBar menuBar = new MenuBar();
  menuBar.addStyleName(ExplorerLayout.STYLE_SEARCHBOX_SORTMENU);

  //TODO: Adding types of sorting manually and listener/events
  MenuItem rootItem = menuBar.addItem("Sort by", null);
  rootItem.addItem("Id", null);
  rootItem.addItem("Name", null);
  rootItem.addItem("Due date", null);
  rootItem.addItem("Creation date", null);

  layout.addComponent(menuBar);
  layout.setComponentAlignment(menuBar, Alignment.MIDDLE_RIGHT);
}
项目:cia    文件:CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java   
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenCommittee.class);

    final ViewRiksdagenCommittee viewRiksdagenCommittee = dataContainer.load(pageId);

    if (viewRiksdagenCommittee != null) {

        getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, BALLOT_DECISION_SUMMARY);

        final DataContainer<ViewRiksdagenCommitteeBallotDecisionSummary, ViewRiksdagenCommitteeBallotDecisionPartyEmbeddedId> committeeBallotDecisionPartyDataContainer = getApplicationManager()
                .getDataContainer(ViewRiksdagenCommitteeBallotDecisionSummary.class);

        final List<ViewRiksdagenCommitteeBallotDecisionSummary> decisionPartySummaryList = committeeBallotDecisionPartyDataContainer
                .findOrderedListByProperty(ViewRiksdagenCommitteeBallotDecisionSummary_.org,
                        pageId.toUpperCase(Locale.ENGLISH),
                        ViewRiksdagenCommitteeBallotDecisionSummary_.createdDate);

        getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenCommitteeBallotDecisionSummary.class,
                decisionPartySummaryList, COMMITTEE_BALLOT_DECISION_SUMMARY,
                NESTED_PROPERTIES,
                COLUMN_ORDER,
                HIDE_COLUMNS,
                LISTENER, BALLOT_ID, null);

        panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }
    return panelContent;

}
项目:cia    文件:CommitteeDecisionSummaryPageModContentFactoryImpl.java   
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenCommittee.class);

    final ViewRiksdagenCommittee viewRiksdagenCommittee = dataContainer.load(pageId);

    if (viewRiksdagenCommittee != null) {

        getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent, DECISION_SUMMARY);

        final DataContainer<ViewRiksdagenCommitteeDecisions, ViewRiksdagenCommitteeDecisionsEmbeddedId> committeeDecisionDataContainer = getApplicationManager()
                .getDataContainer(ViewRiksdagenCommitteeDecisions.class);

        final List<ViewRiksdagenCommitteeDecisions> decisionPartySummaryList = committeeDecisionDataContainer
                .findOrderedListByProperty(ViewRiksdagenCommitteeDecisions_.org, pageId,
                        ViewRiksdagenCommitteeDecisions_.createdDate);

        getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, ViewRiksdagenCommitteeDecisions.class,decisionPartySummaryList,
                DECISION_SUMMARY, NESTED_PROPERTIES,
                COLUMN_ORDER,
                HIDE_COLUMNS,
                LISTENER, BALLOT_ID, null);

        panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }
    return panelContent;

}
项目:cia    文件:CommitteeMemberHistoryPageModContentFactoryImpl.java   
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenCommittee.class);

    final ViewRiksdagenCommittee viewRiksdagenCommittee = dataContainer.load(pageId);

    if (viewRiksdagenCommittee != null) {

        getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent,MEMBER_HISTORY);


        final DataContainer<ViewRiksdagenCommitteeRoleMember, String> committeeRoleMemberDataContainer = getApplicationManager()
                .getDataContainer(ViewRiksdagenCommitteeRoleMember.class);

        getGridFactory().createBasicBeanItemGrid(
                panelContent, ViewRiksdagenCommitteeRoleMember.class, committeeRoleMemberDataContainer.getAllBy(ViewRiksdagenCommitteeRoleMember_.detail,
                        viewRiksdagenCommittee.getEmbeddedId().getDetail()),
                MEMBER_HISTORY,
                COLUMN_ORDER, HIDE_COLUMNS,
                LISTENER, null, null);

        panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }
    return panelContent;

}
项目:cia    文件:CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java   
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout panelContent = createPanelContent();

    final String pageId = getPageId(parameters);

    final DataContainer<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager()
            .getDataContainer(ViewRiksdagenCommittee.class);

    final ViewRiksdagenCommittee viewRiksdagenCommittee = dataContainer.load(pageId);

    if (viewRiksdagenCommittee != null) {

        getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId);

        LabelFactory.createHeader2Label(panelContent,CURRENT_MEMBERS);


        final DataContainer<ViewRiksdagenCommitteeRoleMember, String> committeeRoleMemberDataContainer = getApplicationManager()
                .getDataContainer(ViewRiksdagenCommitteeRoleMember.class);

        getGridFactory().createBasicBeanItemGrid(
                panelContent, ViewRiksdagenCommitteeRoleMember.class,committeeRoleMemberDataContainer.findListByProperty(
                        new Object[] { viewRiksdagenCommittee.getEmbeddedId().getDetail(), Boolean.TRUE },
                        ViewRiksdagenCommitteeRoleMember_.detail, ViewRiksdagenCommitteeRoleMember_.active),
                CURRENT_MEMBERS,
                COLUMN_ORDER, HIDE_COLUMNS,
                LISTENER, null, null);

        panel.setCaption(NAME + "::" + COMMITTEE + viewRiksdagenCommittee.getEmbeddedId().getDetail());
        getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER,
                NAME, parameters, pageId);
    }
    return panelContent;

}
项目:vaadin-excel-exporter    文件:DemoUI.java   
@Override
protected void init(final VaadinRequest request) {

    // Creating the Export Tool Bar
    MenuBar exportToolBar = createToolBar();

    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();

    // Adding the Export Tool Bar to the Layout
    layout.addComponent(exportToolBar);

    /*********
     * Adding Components to the Layout namely Tables, Grids and Tree Table
     *******/
    this.gridDefault = new Grid<>(DataModel.class);
    this.gridDefault.setDataProvider(new ListDataProvider<>(DataModelGenerator.generate(20)));
    this.gridDefault.setSizeFull();
    this.gridDefault.setColumns(this.visibleColumns);

    this.gridMergedCells = new Grid<>(DataModel.class);
    this.gridMergedCells.setDataProvider(new ListDataProvider<>(DataModelGenerator.generate(20)));
    this.gridMergedCells.setColumns(this.visibleColumns);
    this.gridMergedCells.setSizeFull();
    HeaderRow headerRow = this.gridMergedCells.addHeaderRowAt(0);
    HeaderCell joinHeaderColumns1 = headerRow.join("country", "productType");
    joinHeaderColumns1.setText("mergedCell");
    HeaderCell joinHeaderColumns2 = headerRow.join("cheapest", "contractor");
    joinHeaderColumns2.setText("mergedCell");
    FooterRow footerRow1 = this.gridMergedCells.addFooterRowAt(0);
    FooterCell joinFooterColumns1 = footerRow1.join("country", "productType");
    joinFooterColumns1.setText("mergedCell");
    FooterCell joinFooterColumns2 = footerRow1.join("cheapest", "contractor");
    joinFooterColumns2.setText("mergedCell");
    FooterRow footerRow2 = this.gridMergedCells.addFooterRowAt(0);
    for (int i = 0; i < this.visibleColumns.length; i++) {
        footerRow2.getCell(this.visibleColumns[i])
            .setText(this.columnHeaders[i]);
    }

    this.gridFrozenColumns = new Grid<>(DataModel.class);
    this.gridFrozenColumns.setDataProvider(new ListDataProvider<>(DataModelGenerator.generate(20)));
    this.gridFrozenColumns.setColumns(this.visibleColumns);
    this.gridFrozenColumns.getColumn("country")
        .setWidth(300);
    this.gridFrozenColumns.getColumn("productType")
        .setWidth(300);
    this.gridFrozenColumns.getColumn("catalogue")
        .setWidth(300);
    this.gridFrozenColumns.setSizeFull();
    this.gridFrozenColumns.setFrozenColumnCount(3);

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    tabSheet.addTab(this.gridDefault, "Grid (Default)");
    tabSheet.addTab(this.gridMergedCells, "Grid (Merged Cells)");
    tabSheet.addTab(this.gridFrozenColumns, "Grid (Frozen Columns&Rows)");
    layout.addComponent(tabSheet);
    layout.setExpandRatio(tabSheet, 1);

    /*********
     * Adding Components to the Layout namely Tables, Grids and Tree Table
     *******/

    /*********
     * Adding the above data to the containers or components
     *******/

    setContent(layout);
}
项目:cuba    文件:CubaMenuBar.java   
public MenuItem createSeparator() {
    MenuBar.MenuItem menuItem = createMenuItem("", null, null);
    setMenuItemSeparator(menuItem, true);
    return menuItem;
}
项目:cuba    文件:WebAppMenu.java   
@Override
public void removeMenuItem(int index) {
    MenuBar.MenuItem delegateItem = component.getMenuItems().get(index);
    component.removeMenuItem(delegateItem);
    unregisterItem(viewModelMap.get(delegateItem));
}
项目:cuba    文件:WebAppMenu.java   
public MenuBar.MenuItem getDelegateItem() {
    return delegateItem;
}
项目:cuba    文件:WebAppMenu.java   
public void setDelegateItem(MenuBar.MenuItem delegateItem) {
    this.delegateItem = delegateItem;
}
项目:VaadinSpringShiroMongoDB    文件:Menu.java   
public Menu(Navigator navigator) {
    this.navigator = navigator;
    setPrimaryStyleName(ValoTheme.MENU_ROOT);
    menuPart = new CssLayout();
    menuPart.addStyleName(ValoTheme.MENU_PART);

    // header of the menu
    final HorizontalLayout top = new HorizontalLayout();
    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName(ValoTheme.MENU_TITLE);
    top.setSpacing(true);
    Label title = new Label("My CRUD");
    title.addStyleName(ValoTheme.LABEL_H3);
    title.setSizeUndefined();
    Image image = new Image(null, new ThemeResource("img/table-logo.png"));
    image.setStyleName("logo");
    top.addComponent(image);
    top.addComponent(title);
    menuPart.addComponent(top);

    // logout menu item
    MenuBar logoutMenu = new MenuBar();
    logoutMenu.addItem("Logout", FontAwesome.SIGN_OUT, new Command() {

        @Override
        public void menuSelected(MenuItem selectedItem) {
            VaadinSession.getCurrent().getSession().invalidate();
            Page.getCurrent().reload();
        }
    });

    logoutMenu.addStyleName("user-menu");
    menuPart.addComponent(logoutMenu);

    // button for toggling the visibility of the menu when on a small screen
    final Button showMenu = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            if (menuPart.getStyleName().contains(VALO_MENU_VISIBLE)) {
                menuPart.removeStyleName(VALO_MENU_VISIBLE);
            } else {
                menuPart.addStyleName(VALO_MENU_VISIBLE);
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName(VALO_MENU_TOGGLE);
    showMenu.setIcon(FontAwesome.NAVICON);
    menuPart.addComponent(showMenu);

    // container for the navigation buttons, which are added by addView()
    menuItemsLayout = new CssLayout();
    menuItemsLayout.setPrimaryStyleName(VALO_MENUITEMS);
    menuPart.addComponent(menuItemsLayout);

    addComponent(menuPart);
}
项目:VaadHL    文件:FWindow.java   
@Override
protected MenuBar makeMainMenu() {
    return makeDefaultMenu();
}
项目:VaadHL    文件:BaseWindow.java   
public MenuBar getMenuBar() {
    return menuBar;
}
项目:VaadHL    文件:BaseWindow.java   
/**
 * Makes (does not display) the main window menu
 */
protected MenuBar makeMainMenu() {
    return null;
}
项目:VaadHL    文件:LWindow.java   
@Override
protected MenuBar makeMainMenu() {
    return makeDefaultMenu();
}
项目:cia    文件:MainViewLoginPageModContentFactoryImpl.java   
@Secured({ "ROLE_ANONYMOUS" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
    final VerticalLayout content = createPanelContent();
    final String pageId = getPageId(parameters);

    panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);

    getMenuItemFactory().createMainPageMenuBar(menuBar);

    final VerticalLayout loginLayout = new VerticalLayout();
    loginLayout.setSizeFull();

    final Panel formPanel = new Panel();
    formPanel.setSizeFull();

    loginLayout.addComponent(formPanel);

    final FormLayout formContent = new FormLayout();
    formContent.setIcon(VaadinIcons.SIGN_IN);
    formPanel.setContent(formContent);

    final LoginRequest loginRequest = new LoginRequest();
    loginRequest.setOtpCode("");
    loginRequest.setEmail("");
    loginRequest.setUserpassword("");

    loginRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
    final ClickListener loginListener = new ApplicationLoginListener(loginRequest);
    getFormFactory().addRequestInputFormFields(formContent, loginRequest,
            LoginRequest.class,
            AS_LIST, LOGIN,
            loginListener);

    final VerticalLayout overviewLayout = new VerticalLayout();
    overviewLayout.setSizeFull();
    content.addComponent(overviewLayout);
    content.setExpandRatio(overviewLayout, ContentRatio.LARGE);

    final ResponsiveRow grid = createGridLayout(overviewLayout);        
    createRowComponent(grid,loginLayout,REGISTER_A_NEW_USER);

    panel.setCaption(NAME + "::" + CITIZEN_INTELLIGENCE_AGENCY_MAIN);
    getPageActionEventHelper().createPageEvent(ViewAction.VISIT_MAIN_VIEW, ApplicationEventGroup.USER,
            CommonsViews.MAIN_VIEW_NAME, parameters, pageId);


    return content;

}