List of usage examples for com.vaadin.ui AbsoluteLayout AbsoluteLayout
public AbsoluteLayout()
From source file:com.mycollab.vaadin.web.ui.AttachmentDisplayComponent.java
License:Open Source License
private void addAttachmentRow(final Content attachment) { String docName = attachment.getPath(); int lastIndex = docName.lastIndexOf("/"); if (lastIndex != -1) { docName = docName.substring(lastIndex + 1, docName.length()); }// w w w . j a v a2 s .co m final AbsoluteLayout attachmentLayout = new AbsoluteLayout(); attachmentLayout.setWidth(WebUIConstants.DEFAULT_ATTACHMENT_THUMBNAIL_WIDTH); attachmentLayout.setHeight(WebUIConstants.DEFAULT_ATTACHMENT_THUMBNAIL_HEIGHT); attachmentLayout.setStyleName("attachment-block"); CssLayout thumbnailWrap = new CssLayout(); thumbnailWrap.setSizeFull(); thumbnailWrap.setStyleName("thumbnail-wrap"); Link thumbnail = new Link(); if (StringUtils.isBlank(attachment.getThumbnail())) { thumbnail.setIcon(FileAssetsUtil.getFileIconResource(attachment.getName())); } else { thumbnail.setIcon(VaadinResourceFactory.getResource(attachment.getThumbnail())); } if (MimeTypesUtil.isImageType(docName)) { thumbnail.setResource(VaadinResourceFactory.getResource(attachment.getPath())); new Fancybox(thumbnail).setPadding(0).setVersion("2.1.5").setEnabled(true).setDebug(true); } Div contentTooltip = new Div().appendChild(new Span().appendText(docName).setStyle("font-weight:bold")); Ul ul = new Ul().appendChild(new Li().appendText(UserUIContext.getMessage(FileI18nEnum.OPT_SIZE_VALUE, FileUtils.getVolumeDisplay(attachment.getSize())))).setStyle("line-height:1.5em"); ul.appendChild(new Li().appendText(UserUIContext.getMessage(GenericI18Enum.OPT_LAST_MODIFIED, UserUIContext.formatPrettyTime(attachment.getLastModified().getTime())))); contentTooltip.appendChild(ul); thumbnail.setDescription(contentTooltip.write()); thumbnail.setWidth(WebUIConstants.DEFAULT_ATTACHMENT_THUMBNAIL_WIDTH); thumbnailWrap.addComponent(thumbnail); attachmentLayout.addComponent(thumbnailWrap, "top: 0px; left: 0px; bottom: 0px; right: 0px; z-index: 0;"); MCssLayout attachmentNameWrap = new MCssLayout() .withWidth(WebUIConstants.DEFAULT_ATTACHMENT_THUMBNAIL_WIDTH).withStyleName("attachment-name-wrap"); Label attachmentName = new ELabel(docName).withStyleName(UIConstants.TEXT_ELLIPSIS); attachmentNameWrap.addComponent(attachmentName); attachmentLayout.addComponent(attachmentNameWrap, "bottom: 0px; left: 0px; right: 0px; z-index: 1;"); MButton trashBtn = new MButton("", clickEvent -> { ConfirmDialogExt.show(UI.getCurrent(), UserUIContext.getMessage(GenericI18Enum.DIALOG_DELETE_TITLE, MyCollabUI.getSiteName()), UserUIContext.getMessage(GenericI18Enum.CONFIRM_DELETE_ATTACHMENT), UserUIContext.getMessage(GenericI18Enum.BUTTON_YES), UserUIContext.getMessage(GenericI18Enum.BUTTON_NO), confirmDialog -> { if (confirmDialog.isConfirmed()) { ResourceService attachmentService = AppContextUtil.getSpringBean(ResourceService.class); attachmentService.removeResource(attachment.getPath(), UserUIContext.getUsername(), true, MyCollabUI.getAccountId()); ((ComponentContainer) attachmentLayout.getParent()).removeComponent(attachmentLayout); } }); }).withIcon(FontAwesome.TRASH_O).withStyleName("attachment-control"); attachmentLayout.addComponent(trashBtn, "top: 9px; left: 9px; z-index: 1;"); MButton downloadBtn = new MButton().withIcon(FontAwesome.DOWNLOAD).withStyleName("attachment-control"); FileDownloader fileDownloader = new FileDownloader( VaadinResourceFactory.getInstance().getStreamResource(attachment.getPath())); fileDownloader.extend(downloadBtn); attachmentLayout.addComponent(downloadBtn, "right: 9px; top: 9px; z-index: 1;"); this.addComponent(attachmentLayout); }
From source file:com.parship.roperty.ui.ErrorUI.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);//from www . j av a 2s . c o m mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // label_1 label_1 = new Label(); label_1.setImmediate(false); label_1.setWidth("-1px"); label_1.setHeight("-1px"); label_1.setValue("ERROR"); mainLayout.addComponent(label_1, "top:20.0px;left:20.0px;"); return mainLayout; }
From source file:com.parship.roperty.ui.LoginUI.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);// w w w .java2 s . c o m mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // menuBar menuBar = new MenuBar(); menuBar.setImmediate(false); menuBar.setWidth("100.0%"); menuBar.setHeight("-1px"); mainLayout.addComponent(menuBar, "top:0.0px;right:0.0px;left:0.0px;"); // screenLayout screenLayout = buildScreenLayout(); mainLayout.addComponent(screenLayout, "top:22.0px;right:0.0px;bottom:0.0px;left:0.0px;"); return mainLayout; }
From source file:com.parship.roperty.ui.NavigationViewUI.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);//from w ww .j a va 2s . c o m mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // mainMenuBar mainMenuBar = new MenuBar(); mainMenuBar.setImmediate(false); mainMenuBar.setWidth("100.0%"); mainMenuBar.setHeight("-1px"); mainLayout.addComponent(mainMenuBar, "top:0.0px;right:0.0px;left:0.0px;"); // workBenchSplitViewUI workBenchSplitViewUI = new WorkBenchSplitViewUI(); workBenchSplitViewUI.setImmediate(false); workBenchSplitViewUI.setWidth("100.0%"); workBenchSplitViewUI.setHeight("100.0%"); mainLayout.addComponent(workBenchSplitViewUI, "top:40.0px;right:20.0px;bottom:20.0px;left:20.0px;"); return mainLayout; }
From source file:com.parship.roperty.ui.WorkBenchSplitViewUI.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);/* www . j a v a 2s. c o m*/ mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // splitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.setImmediate(false); splitPanel.setWidth("100.0%"); splitPanel.setHeight("100.0%"); mainLayout.addComponent(splitPanel, "top:0.0px;right:0.0px;bottom:0.0px;left:0.0px;"); Roperty r = new Roperty(); r.set("/key1", "value_1", "desc"); r.set("/key1/subkey1", "value_1_1", "desc"); r.set("/key1/subkey2", "value_1_2", "desc"); r.set("/key1/subkey2/subsub1", "value_1_2_1", "desc"); r.set("/key1/subkey2/subsub2", "value_1_2_2", "desc"); r.set("/key1/subkey2/subsub2/subsubsub1", "value_1_2_2_1", "desc"); r.set("/key2", "value_2", "desc"); r.set("/key2/subkey1", "value_1_1", "desc"); r.set("/key2/subkey2", "value_1_2", "desc"); r.set("plain", "plainValue", "desc"); r.set("plain/plainsub1", "plainValue_1", "desc"); r.set("plain/plainsub2", "plainValue_2", "desc"); r.set("plain/plainsub3", "plainValue_3", "desc"); Tree tree = new Tree("Properties", new RopertyPropertyTreeContainer(r)); splitPanel.setFirstComponent(tree); return mainLayout; }
From source file:com.vaushell.treetasker.application.actionbar.TTWActionBar.java
License:Open Source License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);/*w w w . j a v a2 s .c om*/ mainLayout.setWidth("100%"); mainLayout.setHeight("70px"); mainLayout.setMargin(false); // top-level component properties setWidth("100.0%"); setHeight("70px"); // vBGactionbar vBGactionbar = new Embedded(); vBGactionbar.setImmediate(false); vBGactionbar.setWidth("100.0%"); vBGactionbar.setHeight("100.0%"); vBGactionbar.setSource(new ThemeResource("icons/toolbar-bg.png")); vBGactionbar.setType(1); vBGactionbar.setMimeType("image/png"); mainLayout.addComponent(vBGactionbar, "top:0.0px;left:0.0px;"); // contentLayout contentLayout = buildContentLayout(); mainLayout.addComponent(contentLayout, "top:0.0px;left:0.0px;"); return mainLayout; }
From source file:com.zklogtool.web.components.MainLayout.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);/*from w w w .j a v a 2s.c om*/ mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // verticalLayout_4 verticalLayout_4 = buildVerticalLayout_4(); mainLayout.addComponent(verticalLayout_4, "top:0.0px;right:0.0px;bottom:6.0px;left:0.0px;"); return mainLayout; }
From source file:com.zklogtool.web.components.OpenSnapshotFileDialog.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);/*from www . ja va 2 s .co m*/ mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // verticalLayout_1 verticalLayout_1 = buildVerticalLayout_1(); mainLayout.addComponent(verticalLayout_1, "top:0.0px;left:0.0px;"); return mainLayout; }
From source file:com.zklogtool.web.components.SnapshotView.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);//from ww w . ja v a2 s . c om mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // horizontalSplitPanel_1 horizontalSplitPanel_1 = buildHorizontalSplitPanel_1(); mainLayout.addComponent(horizontalSplitPanel_1, "top:0.0px;right:0.0px;bottom:8.0px;left:0.0px;"); return mainLayout; }
From source file:com.zklogtool.web.components.TransactionLogView.java
License:Apache License
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false);/*from w ww.ja v a 2 s . c om*/ mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // horizontalSplitPanel_2 horizontalSplitPanel_2 = buildHorizontalSplitPanel_2(); mainLayout.addComponent(horizontalSplitPanel_2, "top:0.0px;right:1.0px;bottom:3.0px;left:0.0px;"); return mainLayout; }