List of usage examples for com.vaadin.ui Panel setWidth
@Override public void setWidth(String width)
From source file:com.etest.view.systemadministration.syllabus.SyllabusMainUI.java
Panel dataGridPanel() { Panel panel = new Panel("List of All Syllabus"); panel.setWidth("1000px"); // panel.setHeight("500px"); populateDataTable();/*from w w w.j av a2s . c om*/ panel.setContent(table); return panel; }
From source file:com.etest.view.testbank.CellCaseMainUI.java
Panel getCellCasePanel() { Panel panel = new Panel(); panel.setWidth("100%"); populateDataTable();/*from w ww .ja va 2 s.c o m*/ panel.setContent(table); return panel; }
From source file:com.etest.view.testbank.cellitem.CellCaseItemWindow.java
FormLayout buildForms() { FormLayout form = new FormLayout(); form.setWidth("100%"); form.setMargin(true);/*from ww w . j a va2s . c om*/ form.setSpacing(true); CellCase cc = ccs.getCellCaseById(getCellCaseId()); Panel panel = new Panel(); panel.setWidth("100%"); panel.addStyleName(ValoTheme.PANEL_BORDERLESS); Label caseLabel = new Label(); caseLabel.setCaption("CASE: "); caseLabel.setStyleName("bold-font-style"); caseLabel.setWidth("80px"); Label caseTopic = new Label(); caseTopic.setValue(caseLabel.getCaption() + cc.getCaseTopic()); caseTopic.setContentMode(ContentMode.RAW); caseTopic.addStyleName("wrapline"); panel.setContent(caseTopic); form.addComponent(panel); form.addComponent(table); HorizontalLayout v = new HorizontalLayout(); v.setWidth("100%"); Button create = new Button("CREATE NEW STEM"); create.setWidthUndefined(); create.addStyleName(ValoTheme.BUTTON_LINK); create.addStyleName(ValoTheme.BUTTON_TINY); create.addStyleName(ValoTheme.BUTTON_QUIET); create.addClickListener(modifyBtnClickListener); v.addComponent(create); v.setComponentAlignment(create, Alignment.MIDDLE_RIGHT); form.addComponent(v); return form; }
From source file:com.etest.view.tq.itemanalysis.FileUploadWindow.java
Panel itemAnalysisGridPanel() { grid = new ItemAnalysisDataGridProperties(getTqCoverageId(), getUpperGroupStudentNo(), getLowerGroupStudentNo(), tq.getCellItemIdByTQCoverageId(getTqCoverageId()), getStudentNoAndAnswer(), getGroupTotalForProportion()); Panel panel = new Panel("ITEM ANALYSIS"); panel.setWidth("100%"); panel.setContent(grid);/* w ww . j a va 2s.c o m*/ return panel; }
From source file:com.etest.view.tq.itemanalysis.ProportionDataTable.java
Panel upperGroupStudentPanel() { Panel panel = new Panel("UPPER GROUP"); panel.setWidth("100%"); panel.setContent(upperGroupTable);//w w w .j a v a 2 s. c o m return panel; }
From source file:com.etest.view.tq.itemanalysis.ProportionDataTable.java
Panel lowerGroupStudentPanel() { Panel panel = new Panel("LOWER GROUP"); panel.setWidth("100%"); panel.setContent(lowerGroupTable);/* w ww . java 2 s . c o m*/ return panel; }
From source file:com.github.peholmst.springsecuritydemo.ui.LoginView.java
License:Apache License
@SuppressWarnings("serial") protected void init() { final Panel loginPanel = new Panel(); loginPanel.setCaption(getApplication().getMessage("login.title")); ((VerticalLayout) loginPanel.getContent()).setSpacing(true); final TextField username = new TextField(getApplication().getMessage("login.username")); username.setWidth("100%"); loginPanel.addComponent(username);//from ww w. jav a 2s .c o m final TextField password = new TextField(getApplication().getMessage("login.password")); password.setSecret(true); password.setWidth("100%"); loginPanel.addComponent(password); final Button loginButton = new Button(getApplication().getMessage("login.button")); loginButton.setStyleName("primary"); // TODO Make it possible to submit the form by pressing <Enter> in any // of the text fields loginPanel.addComponent(loginButton); ((VerticalLayout) loginPanel.getContent()).setComponentAlignment(loginButton, Alignment.MIDDLE_RIGHT); loginButton.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { final Authentication auth = new UsernamePasswordAuthenticationToken(username.getValue(), password.getValue()); try { if (logger.isDebugEnabled()) { logger.debug("Attempting authentication for user '" + auth.getName() + "'"); } Authentication returned = getAuthenticationManager().authenticate(auth); if (logger.isDebugEnabled()) { logger.debug("Authentication for user '" + auth.getName() + "' succeeded"); } fireEvent(new LoginEvent(LoginView.this, returned)); } catch (BadCredentialsException e) { if (logger.isDebugEnabled()) { logger.debug("Bad credentials for user '" + auth.getName() + "'", e); } getWindow().showNotification(getApplication().getMessage("login.badCredentials.title"), getApplication().getMessage("login.badCredentials.descr"), Notification.TYPE_WARNING_MESSAGE); } catch (DisabledException e) { if (logger.isDebugEnabled()) { logger.debug("Account disabled for user '" + auth.getName() + "'", e); } getWindow().showNotification(getApplication().getMessage("login.disabled.title"), getApplication().getMessage("login.disabled.descr"), Notification.TYPE_WARNING_MESSAGE); } catch (LockedException e) { if (logger.isDebugEnabled()) { logger.debug("Account locked for user '" + auth.getName() + "'", e); } getWindow().showNotification(getApplication().getMessage("login.locked.title"), getApplication().getMessage("login.locked.descr"), Notification.TYPE_WARNING_MESSAGE); } catch (Exception e) { if (logger.isErrorEnabled()) { logger.error("Error while attempting authentication for user '" + auth.getName() + "'"); } ExceptionUtils.handleException(getWindow(), e); } } }); HorizontalLayout languages = new HorizontalLayout(); languages.setSpacing(true); final Button.ClickListener languageListener = new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { Locale locale = (Locale) event.getButton().getData(); if (logger.isDebugEnabled()) { logger.debug("Changing locale to [" + locale + "] and restarting the application"); } getApplication().setLocale(locale); getApplication().close(); } }; for (Locale locale : getApplication().getSupportedLocales()) { if (!getLocale().equals(locale)) { final Button languageButton = new Button(getApplication().getLocaleDisplayName(locale)); languageButton.setStyleName(Button.STYLE_LINK); languageButton.setData(locale); languageButton.addListener(languageListener); languages.addComponent(languageButton); } } loginPanel.addComponent(languages); loginPanel.setWidth("300px"); final HorizontalLayout viewLayout = new HorizontalLayout(); viewLayout.addComponent(loginPanel); viewLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER); viewLayout.setSizeFull(); viewLayout.setMargin(true); setCompositionRoot(viewLayout); setSizeFull(); }
From source file:com.jain.addon.web.layout.JainPanelLayout.java
License:Apache License
private JainLayout createOrUpdateCurrentLayout(JNIGroup group, String groupName) { if (group != null && group.getParent() != null) { JainLayout parentLayout = groupLayoutMap.get(group.getParent().getName()); if (parentLayout == null) { parentLayout = createOrUpdateCurrentLayout(group.getParent(), group.getParent().getName()); }/*from www . j a v a 2 s .co m*/ if (parentLayout != null) { Panel panel = new Panel(group.getDisplayName()); panel.setWidth("100%"); JainLayout layout = new JainLayout(spacing, margin, group.getParent() == null ? group.getColumns() : group.getParent().getColumns()); panel.setContent(layout); parentLayout.addComponent(panel, group.getColSpan()); groupLayoutMap.put(groupName, layout); return layout; } } Panel panel = new Panel(group == null ? "" : group.getDisplayName()); panel.setWidth("100%"); JainLayout layout = new JainLayout(spacing, margin, group == null ? columns : group.getColumns()); panel.setContent(layout); super.addComponent(panel); groupLayoutMap.put(groupName, layout); return layout; }
From source file:com.jiangyifen.ec2.ui.LoginLayout.java
/** * ?/*from w w w .j a va2 s . com*/ * * @param roleType ? */ public LoginLayout(RoleType roleType, Ec2LoginLayout ec2LoginLayout) { // ?? this.setSpacing(true); this.setMargin(true); this.roleType = roleType; this.ec2LoginLayout = ec2LoginLayout; userLoginService = SpringContextHolder.getBean("userLoginService"); userService = SpringContextHolder.getBean("userService"); // ?Cookie this.getCookies(); Panel loginPanel = new Panel(roleType.name().toUpperCase() + " LOGIN INTERFACE"); loginPanel.setWidth("380px"); loginPanel.setHeight("260px"); this.addComponent(loginPanel); this.setComponentAlignment(loginPanel, Alignment.BOTTOM_CENTER); // ? VerticalLayout panelContent = (VerticalLayout) loginPanel.getContent(); createLoginMainComponents(panelContent, roleType); // ??? (?, ?) createConflictManageWindow(); }
From source file:com.lizardtech.expresszip.vaadin.MapToolbarViewComponent.java
License:Apache License
@Override public void buttonClick(ClickEvent event) { Button b = event.getButton(); if (b == btnJobQueueStatus) { Window subWindow = new Window("Job Manager"); subWindow.setWidth("500px"); subWindow.center();/*from ww w .j a va 2s. c o m*/ getApplication().getMainWindow().addWindow(subWindow); Panel p = new Panel(new JobsStatusViewComponent(getApplication().getURL())); p.getContent().setWidth("100%"); p.setWidth("100%"); subWindow.addComponent(p); subWindow.setModal(true); } else if (b == help) { String HelpURL = getApplication().getURL().toExternalForm() + "doc"; getApplication().getMainWindow().open(new ExternalResource(HelpURL), "_blank"); } else if (b == restart) { ((ExpressZipWindow) getApplication().getMainWindow()).getApplication().close(); } }