List of usage examples for com.vaadin.ui CssLayout setVisible
@Override public void setVisible(boolean visible)
From source file:pl.exsio.frameset.vaadin.navigation.menu.CssButtonsMenu.java
License:Open Source License
private void ensureVisibility(MenuItem item) { CssLayout container = (CssLayout) item.getParam("container"); if (container instanceof CssLayout) { container.setVisible(true); }/*w w w. j av a 2s . c o m*/ if (item.getParent() instanceof MenuItem) { this.ensureVisibility(item.getParent()); } }
From source file:pl.exsio.frameset.vaadin.navigation.menu.CssButtonsMenu.java
License:Open Source License
private void build(MenuItem menu, final int level, ComponentContainer container) { for (final MenuItem item : menu.getChildren()) { Button b = new NativeButton(t(item.getLabel())); b.addStyleName("menu-item-" + item.getFrame().getKey()); b.setIcon(((VaadinFrame) item.getFrame()).getIcon()); b.addClickListener(new Button.ClickListener() { @Override//from w ww . ja va2 s.co m public void buttonClick(Button.ClickEvent event) { ((FramesetUI) getUI()).getFramesetNavigator().navigateTo(item.getFrame()); if (item.getChildren().size() > 0) { CssLayout submenu = (CssLayout) item.getParam("submenu"); submenu.setVisible(!submenu.isVisible()); } } }); this.buttons.add(b); container.addComponent(b); item.addParam("button", b); item.addParam("container", container); if (item.getChildren().size() > 0) { CssLayout subContainer = new CssLayout() { { addStyleName("sub-menu"); addStyleName("menu-level-" + level); setVisible(false); } }; this.build(item, level + 1, subContainer); container.addComponent(subContainer); item.addParam("submenu", subContainer); } } }
From source file:ro.zg.netcell.vaadin.action.application.OpenSelectedEntityHandler.java
License:Apache License
private Button getButtonForInactiveAction(final UserAction ha, final Entity entity, final OpenGroupsApplication app, final ActionContext ac) { String actionState = ha.getActionName() + ".off"; String caption = OpenGroupsResources.getMessage(actionState); Button actButton = new Button(); actButton.setDescription(caption);/*from w w w .jav a2s . c om*/ actButton.setIcon(OpenGroupsResources.getIcon(actionState, OpenGroupsIconsSet.MEDIUM)); actButton.addStyleName(BaseTheme.BUTTON_LINK); actButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { // ha.executeHandler(entity,app,app.getTemporaryTab(entity).getContainer()); CssLayout hac = (CssLayout) entity.getHeaderActionContainer(ha.getActionName()); hac.setVisible(true); ha.executeHandler(entity, app, hac, ac); // app.refreshEntity(entity); refreshHeaderActionLinks(entity, app, ac); } }); return actButton; }
From source file:ro.zg.netcell.vaadin.action.application.OpenSelectedEntityHandler.java
License:Apache License
private Button getButtonForActiveAction(final UserAction ha, final Entity entity, final OpenGroupsApplication app, final ActionContext ac) { String actionState = ha.getActionName() + ".on"; String caption = OpenGroupsResources.getMessage(actionState); Button actButton = new Button(); actButton.setDescription(caption);/*from www . j a v a 2s . c om*/ actButton.setIcon(OpenGroupsResources.getIcon(actionState, OpenGroupsIconsSet.MEDIUM)); actButton.addStyleName(BaseTheme.BUTTON_LINK); actButton.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { entity.getState().setActionInactive(ha.getActionName()); // app.getTemporaryTab(entity).setRefreshOn(true); // getActionsManager().executeAction(ActionsManager.OPEN_ENTITY_IN_TAB, // entity,app,null, false); CssLayout hac = (CssLayout) entity.getHeaderActionContainer(ha.getActionName()); hac.setVisible(false); // app.refreshEntity(entity); refreshHeaderActionLinks(entity, app, ac); } }); return actButton; }
From source file:ro.zg.netcell.vaadin.action.application.OpenSelectedEntityWithHeaderActions.java
License:Apache License
private ComponentContainer createHeaderContainer() { CssLayout hac = new CssLayout(); // hac.setWidth("100%"); hac.addStyleName(OpenGroupsStyles.ENTITY_HEADER_ACTION_PANE); hac.setVisible(false); return hac;/*from w ww .j ava2s . c o m*/ }