List of usage examples for com.vaadin.ui Window setCaption
@Override public void setCaption(String caption)
From source file:com.expressui.core.view.util.CodePopup.java
License:Open Source License
/** * Opens popup for given classes./*from w ww. j a v a 2 s . c o m*/ * * @param classes classes for displaying related source code and Javadoc. If * class is within com.expressui.core or com.expressui.domain, * then Javadoc is displayed, otherwise source code. */ public void open(Class... classes) { Window codeWindow = new Window(); codeWindow.addStyleName("code-popup"); codeWindow.setPositionX(20); codeWindow.setPositionY(40); codeWindow.setWidth("90%"); codeWindow.setHeight("90%"); TabSheet codePopupTabSheet = new TabSheet(); String id = StringUtil.generateDebugId("e", this, codePopupTabSheet, "codePopupTabSheet"); codePopupTabSheet.setDebugId(id); codePopupTabSheet.setSizeFull(); codeWindow.addComponent(codePopupTabSheet); String windowCaption = ""; Set<String> shownUrls = new HashSet<String>(); for (Class clazz : classes) { String tabCaption; String url; if (clazz.getName().startsWith("com.expressui.core") || clazz.getName().startsWith("com.expressui.domain")) { url = applicationProperties.getDocUrl(clazz); if (shownUrls.contains(url)) continue; tabCaption = clazz.getSimpleName() + " API"; Embedded embedded = getEmbeddedDoc(url); codePopupTabSheet.addTab(embedded, tabCaption); } else { url = applicationProperties.getCodeUrl(clazz); if (shownUrls.contains(url)) continue; tabCaption = clazz.getSimpleName() + ".java"; String code = getCodeContents(url); Label label = new CodeLabel(code); codePopupTabSheet.addTab(label, tabCaption); } shownUrls.add(url); if (windowCaption.length() > 0) windowCaption += ", "; windowCaption += tabCaption; } codeWindow.setCaption(windowCaption); MainApplication.getInstance().getMainWindow().addWindow(codeWindow); }
From source file:com.foc.vaadin.gui.components.FVTreeDropHandler_ObjectTree.java
License:Apache License
@Override public void drop(DragAndDropEvent dropEvent) { if (dropEvent.getTransferable() instanceof DataBoundTransferable) { DataBoundTransferable t = (DataBoundTransferable) dropEvent.getTransferable(); if (t.getSourceContainer() instanceof ContainerOrderedWrapper) { ContainerOrderedWrapper source = (ContainerOrderedWrapper) t.getSourceContainer(); Object sourceItemId = t.getItemId(); FocObject objDroped = (FocObject) source.getItem(sourceItemId); AbstractSelectTargetDetails dropData = ((AbstractSelectTargetDetails) dropEvent.getTargetDetails()); Object targetItemId = dropData.getItemIdOver(); if (focData != null && focData instanceof FocDataMap) { FocDataMap focDataMap = (FocDataMap) focData; focData = focDataMap.getMainFocData(); }/*from w w w . ja v a 2s . c o m*/ if (focData != null && focData instanceof FObjectTree) { FObjectTree objectTree = (FObjectTree) focData; setObjectTree(objectTree); if (objectTree != null) { targetNode = (FObjectNode) objectTree.findNode(((Long) targetItemId).longValue()); sourceNode = (FObjectNode) objectTree.findNode(objDroped.getReference().getLong()); if (targetNode != null && sourceNode != null && focXMLLayout != null) { XMLViewKey xmlViewKey = new XMLViewKey(AdminWebModule.OPTION_WINDOW_STORAGE, XMLViewKey.TYPE_FORM); OptionDialog_Form optionDialogForm = (OptionDialog_Form) XMLViewDictionary.getInstance() .newCentralPanel(focXMLLayout.getMainWindow(), xmlViewKey, null); setOptionDialog_Form(optionDialogForm); ClickListener clickListener = new ClickListener() { @Override public void buttonClick(ClickEvent event) { FocObject targetObject = (FocObject) targetNode.getObject(); FocObject sourceObject = (FocObject) sourceNode.getObject(); boolean shouldExecute = (sourceObject != null && sourceObject != targetObject) && (!sourceNode.isAncestorOf(targetNode)); if (shouldExecute && getObjectTree() != null) { sourceObject.setPropertyObject(getObjectTree().getFatherNodeId(), targetObject); sourceNode.moveTo(targetNode); FVTableWrapperLayout bkdnTreeWrapper = (FVTableWrapperLayout) focXMLLayout .getComponentByName(treeName); if (bkdnTreeWrapper != null) { FVTreeTable treeTable = ((FVTreeTable) bkdnTreeWrapper .getTableOrTree()); if (treeTable != null && treeTable instanceof FVTreeTable) { getOptionDialog_Form().goBack(null); treeTable.markAsDirty(); treeTable.refreshRowCache_Foc(); focXMLLayout.refresh(); } } } } }; optionDialogForm.addButton("Confirm node move", clickListener); clickListener = new ClickListener() { @Override public void buttonClick(ClickEvent event) { getOptionDialog_Form().goBack(null); } }; optionDialogForm.addButton("Cancel", clickListener); FocCentralPanel centralPanel = new FocCentralPanel(); centralPanel.fill(); centralPanel.changeCentralPanelContent(getOptionDialog_Form(), false); Window optionWindow = centralPanel.newWrapperWindow(); optionWindow.setCaption("Node Move Confirmation"); optionWindow.setWidth("400px"); optionWindow.setHeight("200px"); focXMLLayout.getUI().addWindow(optionWindow); } } } } } }
From source file:com.foc.vaadin.gui.components.menuBar.FVUploadMenuBarCommand.java
License:Apache License
@Override public void menuSelected(MenuItem selectedItem) { FocCentralPanel centralWindow = new FocCentralPanel(); centralWindow.fill();// w ww. j av a 2 s. c o m XMLViewKey key = new XMLViewKey(BusinessEssentialsWebModule.STORAGE_UPLOAD_LAYOUT, XMLViewKey.TYPE_FORM); FVUploadLayout_Form uploadLayout = (FVUploadLayout_Form) XMLViewDictionary.getInstance() .newCentralPanel(centralWindow, key, null); uploadLayout.setUploadReader(uploadReader); String text = uploadReader.getExplanation() != null ? uploadReader.getExplanation() : ""; uploadLayout.setExplanationText(text); CSVFileFormat format = uploadReader.getFileFormat(); if (format != null && format.getColumnCount() > 0) { uploadLayout.fillFormattingIfSupported(format); } uploadLayout.setExplanationText(text); centralWindow.changeCentralPanelContent(uploadLayout, true); Window window = centralWindow.newWrapperWindow(); window.setCaption("Upload"); FocWebApplication.getInstanceForThread().addWindow(window); }
From source file:com.foc.vaadin.gui.xmlForm.FocXMLLayout.java
License:Apache License
public static void popupInDialog(ICentralPanel contentPanel, String title, String width, String height) { FocCentralPanel centralPanel = new FocCentralPanel(); centralPanel.fill();//from w w w . j a v a2 s . com centralPanel.changeCentralPanelContent(contentPanel, false); Window optionWindow = centralPanel.newWrapperWindow(); optionWindow.setResizable(true); optionWindow.setCaption(title); optionWindow.setWidth(width); optionWindow.setHeight(height); //ATTENTION-MAN // optionWindow.getContent().setWidth(width); // optionWindow.getContent().setHeight(width); //ATTENTION-MAN FocWebApplication.getInstanceForThread().addWindow(optionWindow); }
From source file:com.foc.web.modules.admin.FocUser_HomePage_Form.java
License:Apache License
public static Window popupUserCredintionals(INavigationWindow iNavigationWindow) { XMLViewKey key = new XMLViewKey(FocUserDesc.getInstance().getStorageName(), XMLViewKey.TYPE_FORM, AdminWebModule.CONTEXT_COMPANY_SELECTION, XMLViewKey.VIEW_DEFAULT); if (ConfigInfo.isArabic()) { key.setContext(AdminWebModule.CONTEXT_COMPANY_SELECTION_AR); }//from ww w. ja v a2s . c o m ICentralPanel centralPanel = XMLViewDictionary.getInstance().newCentralPanel(iNavigationWindow, key, FocWebApplication.getFocUser()); Window window = null; if (FocWebApplication.getInstanceForThread().isMobile()) { iNavigationWindow.changeCentralPanelContent(centralPanel, true); } else { FocCentralPanel centralWindow = new FocCentralPanel(); centralWindow.fill(); centralWindow.changeCentralPanelContent(centralPanel, false); window = centralWindow.newWrapperWindow(); window.setCaption("User Account"); window.setPositionX(300); window.setPositionY(100); FocWebApplication.getInstanceForThread().addWindow(window); } return window; }
From source file:com.foc.web.modules.admin.OptionDialog_Form.java
License:Apache License
public Window popup() { Window optionWindow = null; fillMessage();// w w w. j ava 2s.c o m addButtons(); if (FocWebApplication.getInstanceForThread().isMobile()) { getMainWindow().changeCentralPanelContent(OptionDialog_Form.this, true); } else { FocCentralPanel centralPanel = new FocCentralPanel(); centralPanel.fill(); centralPanel.changeCentralPanelContent(OptionDialog_Form.this, false); optionWindow = centralPanel.newWrapperWindow(); optionWindow.setCaption(optionDialog.getTitle()); optionWindow.setWidth(optionDialog.getWidth()); optionWindow.setHeight(optionDialog.getHeight()); FocWebApplication.getInstanceForThread().addWindow(optionWindow); } return optionWindow; }
From source file:com.haulmont.cuba.web.exception.NoUserSessionHandler.java
License:Apache License
protected void showNoUserSessionDialog(App app) { Messages messages = AppBeans.get(Messages.NAME); Window dialog = new NoUserSessionExceptionDialog(); dialog.setStyleName("c-nousersession-dialog"); dialog.setCaption(messages.getMainMessage("dialogs.Information", locale)); dialog.setClosable(false);/*from ww w. ja v a2 s. co m*/ dialog.setResizable(false); dialog.setModal(true); AppUI ui = app.getAppUI(); if (ui.isTestMode()) { dialog.setCubaId("optionDialog"); dialog.setId(ui.getTestIdManager().getTestId("optionDialog")); } Label messageLab = new CubaLabel(); messageLab.setWidthUndefined(); messageLab.setValue(messages.getMainMessage("noUserSession.message", locale)); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setWidthUndefined(); layout.setStyleName("c-nousersession-dialog-layout"); layout.setSpacing(true); dialog.setContent(layout); Button reloginBtn = new Button(); if (ui.isTestMode()) { reloginBtn.setCubaId("reloginBtn"); reloginBtn.setId(ui.getTestIdManager().getTestId("reloginBtn")); } reloginBtn.addStyleName(WebButton.ICON_STYLE); reloginBtn.addStyleName("c-primary-action"); reloginBtn.addClickListener(event -> relogin()); reloginBtn.setCaption(messages.getMainMessage(Type.OK.getMsgKey())); String iconName = AppBeans.get(Icons.class).get(Type.OK.getIconKey()); reloginBtn.setIcon(WebComponentsHelper.getIcon(iconName)); ClientConfig clientConfig = AppBeans.get(Configuration.class).getConfig(ClientConfig.class); setClickShortcut(reloginBtn, clientConfig.getCommitShortcut()); reloginBtn.focus(); layout.addComponent(messageLab); layout.addComponent(reloginBtn); layout.setComponentAlignment(reloginBtn, Alignment.BOTTOM_RIGHT); ui.addWindow(dialog); dialog.center(); }
From source file:com.mechanicshop.components.TableLayout.java
public void createCustomMessage() { final TextArea textArea = new TextArea(); textArea.setImmediate(true);/*from w w w . j ava 2 s . c om*/ textArea.setColumns(30); textArea.setRows(10); textArea.addStyleName(ValoTheme.TEXTAREA_SMALL); textArea.setRequired(true); final Window subWindow = new Window(); subWindow.setModal(true); subWindow.setHeight("350px"); subWindow.setWidth("500px"); subWindow.setCaption("Insert Message"); subWindow.setStyleName(ValoTheme.WINDOW_TOP_TOOLBAR); subWindow.setClosable(false); subWindow.setResizable(false); HorizontalLayout layoutButtons = new HorizontalLayout(); layoutButtons.setMargin(false); Button sendBtn = new Button("Send"); sendBtn.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { try { textArea.validate(); String message = textArea.getValue(); smsSenderService.sendMessageMassive(message); subWindow.close(); Notification.show("Message Sent"); } catch (Exception e) { } } }); sendBtn.setImmediate(true); sendBtn.setStyleName(ValoTheme.BUTTON_TINY); sendBtn.addStyleName(ValoTheme.BUTTON_FRIENDLY); Button cancelBtn = new Button("Cancel"); cancelBtn.setStyleName(ValoTheme.BUTTON_TINY); cancelBtn.addStyleName(ValoTheme.BUTTON_DANGER); cancelBtn.setImmediate(true); cancelBtn.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { subWindow.close(); } }); layoutButtons.setSizeUndefined(); layoutButtons.setSpacing(true); layoutButtons.addComponents(cancelBtn, sendBtn); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); layout.addComponent(textArea); layout.addComponent(layoutButtons); layout.setComponentAlignment(textArea, Alignment.MIDDLE_CENTER); layout.setComponentAlignment(layoutButtons, Alignment.MIDDLE_RIGHT); layout.setExpandRatio(textArea, 3); layout.setSizeFull(); subWindow.setContent(layout); subWindow.center(); getUI().addWindow(subWindow); }
From source file:com.save.employee.maintenance.MRDataGridProperties.java
Window deletConfirmationWindow(int mrId, Object itemId) { Window sub = new Window(); sub.setCaption("CONFIRM DELETE"); sub.setWidth("250px"); sub.setModal(true);/*from ww w.java2 s .c om*/ VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setMargin(true); Button deleteBtn = new Button("DELETE?"); deleteBtn.setWidth("100%"); deleteBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); deleteBtn.addClickListener((Button.ClickEvent event) -> { boolean result = mrs.removeMaintenanceReimbursement(mrId); if (result) { getContainerDataSource().removeItem(itemId); sub.close(); } }); v.addComponent(deleteBtn); sub.setContent(v); sub.getContent().setHeightUndefined(); return sub; }
From source file:com.save.employee.request.RLDataGridProperties.java
Window deletConfirmationWindow(int rlId, Object itemId) { Window sub = new Window(); sub.setCaption("CONFIRM DELETE"); sub.setWidth("250px"); sub.setModal(true);//from w w w . j a va 2 s. c o m VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setMargin(true); Button deleteBtn = new Button("DELETE?"); deleteBtn.setWidth("100%"); deleteBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); deleteBtn.addClickListener((Button.ClickEvent event) -> { boolean result = rls.deleteRequestById(rlId); if (result) { getContainerDataSource().removeItem(itemId); sub.close(); } }); v.addComponent(deleteBtn); sub.setContent(v); sub.getContent().setHeightUndefined(); return sub; }