List of usage examples for com.vaadin.ui VerticalLayout setMargin
@Override public void setMargin(boolean enabled)
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);/*from w w w . ja v a 2s . c o m*/ mainLayout.setMargin(true); 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 w ww .j ava 2 s. c o m*/ */ 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); }
From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java
/** * ??/*from w ww. j a v a2s . c om*/ */ private void createPriorityConfirmWindow() { globalPriorityConfirmWindow = new Window("?"); globalPriorityConfirmWindow.center(); globalPriorityConfirmWindow.setWidth("300px"); globalPriorityConfirmWindow.setModal(true); globalPriorityConfirmWindow.setResizable(false); VerticalLayout windowContent = new VerticalLayout(); windowContent.setSizeFull(); windowContent.setMargin(true); windowContent.setSpacing(true); globalPriorityConfirmWindow.setContent(windowContent); noticeInPriorityWindow = new Label("", Label.CONTENT_XHTML); windowContent.addComponent(noticeInPriorityWindow); HorizontalLayout buttonsHLayout = new HorizontalLayout(); buttonsHLayout.setSpacing(true); windowContent.addComponent(buttonsHLayout); submit = new Button(" ", this); abolish = new Button("? ", this); abolish.setStyleName("default"); buttonsHLayout.addComponent(submit); buttonsHLayout.addComponent(abolish); }
From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.MgrPhone2PhoneSettingView.java
public MgrPhone2PhoneSettingView() { this.setMargin(true); this.setWidth("100%"); this.setSpacing(true); domain = SpringContextHolder.getDomain(); loginUser = SpringContextHolder.getLoginUser(); userService = SpringContextHolder.getBean("userService"); queueService = SpringContextHolder.getBean("queueService"); userQueueService = SpringContextHolder.getBean("userQueueService"); queueMemberRelationService = SpringContextHolder.getBean("queueMemberRelationService"); phone2PhoneSettingService = SpringContextHolder.getBean("phone2PhoneSettingService"); staticQueueMemberService = SpringContextHolder.getBean("staticQueueMemberService"); notification = new Notification(""); notification.setDelayMsec(1000);/*from w ww .java2 s .c om*/ notification.setHtmlContentAllowed(true); VerticalLayout panelContent = new VerticalLayout(); panelContent.setSpacing(true); panelContent.setMargin(true); panelContent.setWidth("100%"); panel = new Panel("?"); panel.setContent(panelContent); panel.setStyleName("light"); this.addComponent(panel); // ? createStartSetting(panelContent); // ?CSR ? createLicensed2Csr(panelContent); // createDaysOfWeekType(panelContent); // createDayOfWeek(panelContent); // createRunRedirectTime(panelContent); // createRedirectType(panelContent); // ?? createNoanwserTimeout(panelContent); // ?? createSpecifiedPhone(panelContent); // ?? createPhoneArea(panelContent); // ???? createCsrSelectTables(panelContent); // ? makeTableDragAble(new SourceIs(rightTable), leftTable, true); makeTableDragAble(new SourceIs(leftTable), rightTable, false); // ? HorizontalLayout operators = createOperatorButtons(); this.addComponent(operators); }
From source file:com.klwork.explorer.project.MyCalendarView.java
License:Apache License
private void createCalendarEventPopup() { VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.setSpacing(true);/* ww w . java 2 s. co m*/ scheduleEventPopup = new Window(null, layout); scheduleEventPopup.setWidth("400px"); scheduleEventPopup.setModal(true); scheduleEventPopup.center(); layout.addComponent(scheduleEventFieldLayout); applyEventButton = new Button("?", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { try { commitCalendarEvent(); } catch (CommitException e) { e.printStackTrace(); } } }); Button cancel = new Button("?", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { discardCalendarEvent(); } }); deleteEventButton = new Button("", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { deleteCalendarEvent(); } }); scheduleEventPopup.addCloseListener(new Window.CloseListener() { private static final long serialVersionUID = 1L; @Override public void windowClose(Window.CloseEvent e) { discardCalendarEvent(); } }); HorizontalLayout buttons = new HorizontalLayout(); buttons.setSpacing(true); buttons.addComponent(deleteEventButton); buttons.addComponent(applyEventButton); buttons.addComponent(cancel); layout.addComponent(buttons); layout.setComponentAlignment(buttons, Alignment.BOTTOM_RIGHT); }
From source file:com.klwork.explorer.ui.base.AbstractMainGridPage.java
License:Apache License
protected void addSelectComponent() { VerticalLayout vLayout = new VerticalLayout(); vLayout.addStyleName("sidebar"); vLayout.addStyleName("menu"); vLayout.addStyleName("tasks"); vLayout.setMargin(new MarginInfo(true, false, false, false)); vLayout.setSizeFull();//from w w w.j a va 2 s.c o m HorizontalLayout tableHeadLayout = createSelectHead(); vLayout.addComponent(tableHeadLayout); vLayout.setComponentAlignment(tableHeadLayout, Alignment.MIDDLE_LEFT); AbstractSelect select = createSelectComponent(); vLayout.addComponent(select); vLayout.setExpandRatio(select, 1.0f); if (select != null) { grid.addComponent(vLayout, 1, 0); } }
From source file:com.klwork.explorer.ui.business.project.MyCalendarView.java
License:Apache License
private void createCalendarEventPopup() { VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.setSpacing(true);//w w w . ja v a2s .c o m layout.addStyleName("social"); scheduleEventPopup = new Window(null, layout); scheduleEventPopup.setWidth("400px"); scheduleEventPopup.setModal(true); scheduleEventPopup.center(); layout.addComponent(scheduleEventFieldLayout); applyEventButton = new Button("?", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { try { commitCalendarEvent(); } catch (CommitException e) { e.printStackTrace(); } } }); Button cancel = new Button("?", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { discardCalendarEvent(); } }); deleteEventButton = new Button("", new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { deleteCalendarEvent(); } }); scheduleEventPopup.addCloseListener(new Window.CloseListener() { private static final long serialVersionUID = 1L; @Override public void windowClose(Window.CloseEvent e) { discardCalendarEvent(); } }); HorizontalLayout buttons = new HorizontalLayout(); buttons.setSpacing(true); buttons.addComponent(deleteEventButton); buttons.addComponent(applyEventButton); buttons.addComponent(cancel); layout.addComponent(buttons); layout.setComponentAlignment(buttons, Alignment.BOTTOM_RIGHT); }
From source file:com.klwork.explorer.ui.content.file.ImageAttachmentRenderer.java
License:Apache License
@Override public Component getDetailComponent(Attachment attachment) { VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSizeUndefined();//from ww w. ja v a 2 s.co m verticalLayout.setSpacing(true); verticalLayout.setMargin(true); Label description = new Label(attachment.getDescription()); description.setSizeUndefined(); verticalLayout.addComponent(description); // Image TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService(); String mimeType = extractMineType(attachment.getType()); InputStream imageStream = ImageUtil.resizeImage(taskService.getAttachmentContent(attachment.getId()), mimeType, 900, 550); Resource resource = new StreamResource(new InputStreamStreamSource(imageStream), attachment.getName() + extractExtention(attachment.getType())); Embedded image = new Embedded(null, resource); verticalLayout.addComponent(image); // Linke HorizontalLayout LinkLayout = new HorizontalLayout(); LinkLayout.setSpacing(true); verticalLayout.addComponent(LinkLayout); verticalLayout.setComponentAlignment(LinkLayout, Alignment.MIDDLE_CENTER); Label fullSizeLabel = new Label( ViewToolManager.getI18nManager().getMessage(Messages.RELATED_CONTENT_SHOW_FULL_SIZE)); LinkLayout.addComponent(fullSizeLabel); Link link = null; if (attachment.getUrl() != null) { link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl())); } else { taskService = ProcessEngines.getDefaultProcessEngine().getTaskService(); Resource res = new StreamResource( new InputStreamStreamSource(taskService.getAttachmentContent(attachment.getId())), attachment.getName() + extractExtention(attachment.getType())); link = new Link(attachment.getName(), res); } link.setIcon(Images.RELATED_CONTENT_PICTURE); link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK); LinkLayout.addComponent(link); return verticalLayout; }
From source file:com.klwork.explorer.ui.content.GenericAttachmentRenderer.java
License:Apache License
public Component getDetailComponent(Attachment attachment) { VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSizeUndefined();//w w w . ja va 2 s. co m verticalLayout.setSpacing(true); verticalLayout.setMargin(true); Label description = new Label(attachment.getDescription()); description.setSizeUndefined(); verticalLayout.addComponent(description); HorizontalLayout linkLayout = new HorizontalLayout(); linkLayout.setSpacing(true); verticalLayout.addComponent(linkLayout); // Image linkLayout.addComponent(new Embedded(null, getImage(attachment))); // Link Link link = null; if (attachment.getUrl() != null) { link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl())); } else { TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService(); Resource res = new StreamResource( new InputStreamStreamSource(taskService.getAttachmentContent(attachment.getId())), attachment.getName() + extractExtention(attachment.getType())); link = new Link(attachment.getName(), res); } // Set generic image and external window link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK); linkLayout.addComponent(link); return verticalLayout; }
From source file:com.klwork.explorer.ui.content.url.UrlAttachmentRenderer.java
License:Apache License
public Component getDetailComponent(Attachment attachment) { VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setSpacing(true);/*from ww w . jav a 2s .com*/ verticalLayout.setMargin(true); verticalLayout.addComponent(new Label(attachment.getDescription())); HorizontalLayout linkLayout = new HorizontalLayout(); linkLayout.setSpacing(true); verticalLayout.addComponent(linkLayout); // Icon linkLayout.addComponent(new Embedded(null, Images.RELATED_CONTENT_URL)); // Link Link link = new Link(attachment.getUrl(), new ExternalResource(attachment.getUrl())); link.setTargetName(ExplorerLayout.LINK_TARGET_BLANK); linkLayout.addComponent(link); return verticalLayout; }