/** * Displays the resource infos panel.<p> * * @param resources the resources */ public void displayResourceInfo(List<CmsResource> resources) { m_infoResources = Lists.newArrayList(resources); if (m_infoComponent != null) { m_mainPanel.removeComponent(m_infoComponent); m_infoComponent = null; } if ((resources != null) && !resources.isEmpty()) { if (resources.size() == 1) { m_infoComponent = new CmsResourceInfo(resources.get(0)); m_mainPanel.addComponent(m_infoComponent, 0); } else { m_infoComponent = createResourceListPanel( Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.GUI_RESOURCE_INFO_0), resources); m_mainPanel.addComponent(m_infoComponent, 0); m_mainPanel.setExpandRatio(m_infoComponent, 1); // reset expand ratio of the content panel m_contentPanel.setSizeUndefined(); m_contentPanel.setWidth("100%"); m_mainPanel.setExpandRatio(m_contentPanel, 0); } } }
protected void initAddSubTaskPanel(HorizontalLayout headerLayout) { // The add button is placed in a panel, so we can catch 'enter' and 'escape' events addSubTaskPanel = new Panel(); addSubTaskPanel.setContent(new VerticalLayout()); addSubTaskPanel.setSizeUndefined(); addSubTaskPanel.addStyleName(Reindeer.PANEL_LIGHT); addSubTaskPanel.addStyleName("no-border"); headerLayout.addComponent(addSubTaskPanel); initAddSubTaskPanelKeyboardActions(); initAddButton(); }
@Override public void doBuild(ViewChangeBusMessage event) { super.doBuild(event); centrePanel = new Panel(); centrePanel.addStyleName(ChameleonTheme.PANEL_BUBBLE); centrePanel.setSizeUndefined(); VerticalLayout vl = new VerticalLayout(); centrePanel.setContent(vl); vl.setSpacing(true); vl.setSizeUndefined(); label = new Label(); usernameBox = new TextField(); passwordBox = new PasswordField(); Label demoInfoLabel = new Label("for this demo, enter any user name, and a password of 'password'"); Label demoInfoLabel2 = new Label("In a real application your Shiro Realm implementation defines how to authenticate"); submitButton = new Button(); submitButton.addClickListener(this); statusMsgLabel = new Label("Please enter your username and password"); vl.addComponent(label); vl.addComponent(demoInfoLabel); vl.addComponent(demoInfoLabel2); vl.addComponent(usernameBox); vl.addComponent(passwordBox); vl.addComponent(submitButton); vl.addComponent(statusMsgLabel); setMiddleCentre(centrePanel); }