List of usage examples for com.vaadin.ui VerticalLayout setSpacing
@Override public void setSpacing(boolean spacing)
From source file:com.hrms.main.AboutHRIS.java
public AboutHRIS() { setCaption("About HRIS"); setWidth("300px"); VerticalLayout vlayout = new VerticalLayout(); vlayout.setSpacing(true); vlayout.setMargin(true);/* w w w .j a va 2 s . c o m*/ Label version = new Label("Version: <b>1.5</b>"); version.setContentMode(Label.CONTENT_XHTML); vlayout.addComponent(version); Label title = new Label("Title: <b>Human Resource Information System</b>"); title.setContentMode(Label.CONTENT_XHTML); vlayout.addComponent(title); Label developer = new Label("Developed By: <b>Engr. Godfrey D. Beray</b>"); developer.setContentMode(Label.CONTENT_XHTML); vlayout.addComponent(developer); Label framework = new Label("Framework: <b>VAADIN - Sept2012</b>"); framework.setContentMode(Label.CONTENT_XHTML); vlayout.addComponent(framework); addComponent(vlayout); }
From source file:com.jain.addon.action.confirm.ConfirmWindow.java
License:Apache License
@JNIComponentInit public void init() { setModal(true);/*from w w w.j ava 2 s. c o m*/ setWidth("25%"); VerticalLayout layout = new VerticalLayout(); setContent(layout); layout.setWidth("100%"); layout.setMargin(true); layout.setSpacing(true); layout.setStyleName(JNStyleConstants.J_ALTERNATE_VIEW); JNConfirm confirm = action.getConfirm(); HorizontalLayout hLayout = new HorizontalLayout(); hLayout.setSpacing(true); hLayout.setWidth("100%"); findNAddIcon(confirm, hLayout); Label label = new Label(confirm.message()); label.setContentMode(confirm.mode()); hLayout.addComponent(label); hLayout.setExpandRatio(label, 2); layout.addComponent(hLayout); layout.setComponentAlignment(hLayout, Alignment.MIDDLE_CENTER); ActionMenuBar<ConfirmWindow> menuBar = new ActionMenuBar<ConfirmWindow>(null, this); layout.addComponent(menuBar); layout.setExpandRatio(menuBar, 2); layout.setComponentAlignment(menuBar, Alignment.MIDDLE_CENTER); }
From source file:com.jain.addon.web.layout.JainGroupLayout.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 w w w . ja v a2 s. c om if (parentLayout != null) { JainLayout layout = new JainLayout(spacing, margin, group.getParent() == null ? group.getColumns() : group.getParent().getColumns()); if (StringHelper.isNotEmptyWithTrim(alternateStyleName)) layout.setStyleName(alternateStyleName); VerticalLayout groupLayout = new VerticalLayout(); if (StringHelper.isNotEmptyWithTrim(styleName)) groupLayout.setStyleName(styleName); if (StringHelper.isNotEmptyWithTrim(group.getDisplayName())) { groupLayout.setCaption(group.getDisplayName()); } groupLayout.setSpacing(true); groupLayout.setMargin(true); groupLayout.setWidth("100%"); groupLayout.addComponent(layout); parentLayout.addComponent(groupLayout, group.getColSpan()); groupLayoutMap.put(groupName, layout); return layout; } } String groupDisplayName = group == null ? "" : group.getDisplayName(); JainLayout layout = new JainLayout(spacing, margin, group == null ? columns : group.getColumns()); if (StringHelper.isNotEmptyWithTrim(alternateStyleName)) layout.setStyleName(alternateStyleName); VerticalLayout groupLayout = new VerticalLayout(); if (StringHelper.isNotEmptyWithTrim(styleName)) groupLayout.setStyleName(styleName); if (StringHelper.isNotEmptyWithTrim(groupDisplayName)) { groupLayout.setCaption(group.getDisplayName()); } groupLayout.setSpacing(true); groupLayout.setMargin(true); groupLayout.setWidth("100%"); groupLayout.addComponent(layout); super.addComponent(groupLayout); groupLayoutMap.put(groupName, layout); return layout; }
From source file:com.jain.common.approot.ApplicationUI.java
License:Apache License
public void initialize(Locale locale) { user.setLocale(locale);/*from ww w . j a v a2 s . c om*/ addApplicationTitle(); VerticalLayout view = new VerticalLayout(); setContent(view); view.setStyleName(ApplicationTheme.VIEW); view.setWidth("100%"); view.setHeight("100%"); view.setSpacing(false); view.setMargin(false); createWelcomebar(view); Header header = CDIComponent.getInstance(Header.class); view.addComponent(header); header.addDefaultTab(); }
From source file:com.jain.common.authenticate.LoginAction.java
License:Apache License
@JNIComponentInit public void init() { setModal(true);// w ww. j a v a 2 s . co m setWidth("30%"); VerticalLayout layout = new VerticalLayout(); setContent(layout); layout.setWidth("100%"); layout.setMargin(true); layout.setSpacing(true); layout.setStyleName(ApplicationTheme.ALTERNATE_VIEW); createFieldGroup(layout); createActions(layout); }
From source file:com.jain.common.authenticate.LoginAction.java
License:Apache License
private void createFieldGroup(VerticalLayout layout) { I18NProvider provider = DefaultI18NResourceProvider.instance(); userName = new TextField("user.name"); userName.setCursorPosition(0);// www.j av a 2s.c o m userName.setRequired(true); userName.setRequiredError(provider.getMessage(getLocale(), "common.something.required", "user.name.title", JAction.LOGIN.getDisplayName())); userName.setDescription("user.name"); userName.setSizeFull(); userName.setStyleName(JNStyleConstants.J_FIELD); password = new PasswordField("password"); password.setRequired(true); password.setRequiredError(provider.getMessage(getLocale(), "common.something.required", "password.title", JAction.LOGIN.getDisplayName())); password.setDescription("password"); password.setSizeFull(); password.setStyleName(JNStyleConstants.J_FIELD); VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setStyleName(ApplicationTheme.VIEW); verticalLayout.setSpacing(true); verticalLayout.setMargin(true); verticalLayout.setWidth("100%"); FormLayout formLayout = new FormLayout(); formLayout.setStyleName(ApplicationTheme.ALTERNATE_VIEW); formLayout.setSpacing(true); formLayout.setMargin(true); formLayout.setWidth("100%"); formLayout.addComponent(userName); formLayout.addComponent(password); verticalLayout.addComponent(formLayout); layout.addComponent(verticalLayout); }
From source file:com.jain.common.header.Header.java
License:Apache License
public void addDefaultTab() { findNCreateCurrentComponent();/*from ww w . j a v a2 s . c om*/ VerticalLayout contentLayout = (VerticalLayout) getUI().getContent(); contentLayout.setSpacing(false); contentLayout.setMargin(false); contentLayout.addComponent(currentComponent); contentLayout.setExpandRatio(currentComponent, 3); }
From source file:com.jain.common.header.Header.java
License:Apache License
public void buttonClick(ClickEvent event) { Button selected = event.getButton(); if (selected != current) { current.removeStyleName(ApplicationTheme.SELECTED); current = event.getButton();//from ww w. java2 s . c o m current.addStyleName(ApplicationTheme.SELECTED); VerticalLayout layout = (VerticalLayout) getUI().getContent(); if (currentComponent != null) layout.removeComponent(currentComponent); findNCreateCurrentComponent(); if (currentComponent != null) { layout.setSpacing(false); layout.setMargin(false); layout.addComponent(currentComponent); layout.setExpandRatio(currentComponent, 3); } } }
From source file:com.jiangyifen.ec2.ui.csr.toolbar.CsrPhone2PhoneSettingWindow.java
public CsrPhone2PhoneSettingWindow() { this.setWidth("413px"); this.setHeight("220px"); this.setResizable(false); VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setWidth("100%"); mainLayout.setSpacing(true); mainLayout.setMargin(true);/*from ww w. j av a2 s.c om*/ this.setContent(mainLayout); domain = SpringContextHolder.getDomain(); loginUser = SpringContextHolder.getLoginUser(); phone2PhoneSettingService = SpringContextHolder.getBean("phone2PhoneSettingService"); notification = new Notification(""); notification.setDelayMsec(1000); notification.setHtmlContentAllowed(true); // ??????? String notice = "<font color='red'><B>??????</B></font>"; noticeLabel = new Label(notice, Label.CONTENT_XHTML); noticeLabel.setVisible(false); mainLayout.addComponent(noticeLabel); // ??? this.customP2PSetting = initializeCustomP2PSetting(); // ? createlStartSetting(mainLayout); // createlDaysOfWeekType(mainLayout); // createlDayOfWeek(mainLayout); // createRunRedirectTime(mainLayout); // createlRedirectType(mainLayout); // ?? createNoanwserTimeout(mainLayout); // ? createOperatorButtons(mainLayout); }
From source file:com.jiangyifen.ec2.ui.LoginLayout.java
/** * ??? (?, ?)/*from ww w . j a v a 2 s. com*/ */ private void createConflictManageWindow() { conflictManageWindow = new Window("?"); conflictManageWindow.setModal(true); conflictManageWindow.setResizable(false); VerticalLayout mainLayout = new VerticalLayout(); mainLayout.setSpacing(true); mainLayout.setMargin(true); mainLayout.setSizeUndefined(); mainLayout.setWidth("400px"); conflictManageWindow.setContent(mainLayout); Label captionLabel = new Label("<font color='blue'><B>??</B></font>", Label.CONTENT_XHTML); captionLabel.setWidth("-1px"); mainLayout.addComponent(captionLabel); conflictNotice = new RichTextArea(); conflictNotice.setReadOnly(true); conflictNotice.setWriteThrough(false); conflictNotice.setWidth("-1px"); mainLayout.addComponent(conflictNotice); String placeholder = "         "; Label noticeLabel = new Label( "<font color='red'><B>" + placeholder + "?</B></font>", Label.CONTENT_XHTML); noticeLabel.setWidth("-1px"); mainLayout.addComponent(noticeLabel); Label confirmLabel = new Label("<B>" + placeholder + "??</B>", Label.CONTENT_XHTML); confirmLabel.setWidth("-1px"); mainLayout.addComponent(confirmLabel); // ??? HorizontalLayout operatorHLayout = new HorizontalLayout(); operatorHLayout.setSpacing(true); mainLayout.addComponent(operatorHLayout); confirm = new Button("", this); confirm.setImmediate(true); cancel = new Button("?", this); cancel.setStyleName("default"); cancel.setImmediate(true); operatorHLayout.addComponent(confirm); operatorHLayout.addComponent(cancel); }