List of usage examples for com.vaadin.ui Window setHeight
@Override public void setHeight(float height, Unit unit)
From source file:annis.gui.controlpanel.CorpusListPanel.java
License:Apache License
public void initCorpusBrowser(String topLevelCorpusName, final Button l) { AnnisCorpus c = ui.getQueryState().getAvailableCorpora().getItem(topLevelCorpusName).getBean(); MetaDataPanel meta = new MetaDataPanel(c.getName()); CorpusBrowserPanel browse = new CorpusBrowserPanel(c, ui.getQueryController()); GridLayout infoLayout = new GridLayout(2, 2); infoLayout.setSizeFull();//from ww w . j av a 2 s .com String corpusURL = Helper.generateCorpusLink(Sets.newHashSet(topLevelCorpusName)); Label lblLink = new Label("Link to corpus: <a href=\"" + corpusURL + "\">" + corpusURL + "</a>", ContentMode.HTML); lblLink.setHeight("-1px"); lblLink.setWidth("-1px"); infoLayout.addComponent(meta, 0, 0); infoLayout.addComponent(browse, 1, 0); infoLayout.addComponent(lblLink, 0, 1, 1, 1); infoLayout.setRowExpandRatio(0, 1.0f); infoLayout.setColumnExpandRatio(0, 0.5f); infoLayout.setColumnExpandRatio(1, 0.5f); infoLayout.setComponentAlignment(lblLink, Alignment.MIDDLE_CENTER); Window window = new Window("Corpus information for " + c.getName() + " (ID: " + c.getId() + ")", infoLayout); window.setWidth(70, UNITS_EM); window.setHeight(45, UNITS_EM); window.setResizable(true); window.setModal(false); window.setResizeLazy(true); window.addCloseListener(new Window.CloseListener() { @Override public void windowClose(Window.CloseEvent e) { l.setEnabled(true); } }); UI.getCurrent().addWindow(window); window.center(); }
From source file:annis.gui.docbrowser.DocBrowserTable.java
License:Apache License
public Button generateInfoButtonCell(final String docName) { Button btn = new Button(); btn.setStyleName(ChameleonTheme.BUTTON_BORDERLESS); btn.setIcon(INFO_ICON);//ww w .java 2s. c o m btn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { try { List<Annotation> annos = getDocMetaData(docName); /** * Transforms to a list of key value pairs. The values concates the * namespace and ordinary value. Namespaces "NULL" are ignored. */ // create datasource and bind it to a table BeanItemContainer<Annotation> metaContainer = new BeanItemContainer<>(Annotation.class); metaContainer.addAll(annos); metaContainer.sort(new Object[] { "namespace", "name" }, new boolean[] { true, true }); Table metaTable = new Table(); metaTable.setContainerDataSource(metaContainer); metaTable.addGeneratedColumn("genname", new MetaDataPanel.MetaTableNameGenerator(metaContainer)); metaTable.addGeneratedColumn("genvalue", new MetaDataPanel.MetaTableValueGenerator(metaContainer)); metaTable.setVisibleColumns("genname", "genvalue"); metaTable.setColumnHeaders(new String[] { "Name", "Value" }); metaTable.setSizeFull(); metaTable.setColumnWidth("genname", -1); metaTable.setColumnExpandRatio("genvalue", 1.0f); metaTable.addStyleName(ChameleonTheme.TABLE_STRIPED); // create and style the extra window for the metadata table Window metaWin = new Window(); metaWin.setContent(metaTable); metaWin.setCaption("metadata doc " + docName); metaWin.center(); metaWin.setWidth(400, Unit.PIXELS); metaWin.setHeight(400, Unit.PIXELS); // paint the window docBrowserPanel.getUI().addWindow(metaWin); } catch (UniformInterfaceException ex) { log.error("can not retrieve metadata for document " + docName, ex); } } }); return btn; }
From source file:annis.gui.resultview.SingleResultPanel.java
License:Apache License
private void showShareSingleMatchGenerator() { // select the current match if (ui != null) { ui.getQueryState().getSelectedMatches().getValue().clear(); ui.getQueryState().getSelectedMatches().getValue().add(resultNumber); ui.getSearchView().updateFragment(ui.getQueryController().getSearchQuery()); }//from w ww .j av a 2 s. co m Window window = new ShareSingleMatchGenerator(resolverEntries, match, query, segmentationName, ps); window.setWidth(790, Unit.PIXELS); window.setHeight(580, Unit.PIXELS); window.setResizable(true); window.setModal(true); window.addCloseListener(new Window.CloseListener() { @Override public void windowClose(Window.CloseEvent e) { btLink.setEnabled(true); } }); window.setCaption("Match reference link"); UI.getCurrent().addWindow(window); }
From source file:com.kelt.disk.db.web.DiskDBApplication.java
License:Apache License
@Override public void init() { final Window mainWindow = new Window("Samplevaadin Application"); final Window window = new Window("Some Window"); window.setWidth(800, Sizeable.UNITS_PIXELS); window.setHeight(601, Sizeable.UNITS_PIXELS); window.setClosable(false);//from www . j a v a2 s . c o m window.setDraggable(false); window.setResizable(false); window.center(); setUpWindow(window); mainWindow.addWindow(window); setMainWindow(mainWindow); }
From source file:com.naoset.framework.frontend.component.profile.CustomerEditWindowView.java
private void openWindow() { Window myWindow = new Window("Cliente"); myWindow.addStyleName("profile-window"); myWindow.setId(ID);//from w ww . j a v a 2 s. com Responsive.makeResponsive(this); myWindow.setModal(true); myWindow.setCloseShortcut(ShortcutAction.KeyCode.ESCAPE, null); myWindow.setResizable(false); myWindow.setClosable(false); myWindow.setHeight(90.0f, Unit.PERCENTAGE); VerticalLayout layout = new VerticalLayout(); CustomerPanelView customerPanelView = new CustomerPanelView(); layout.addComponent(customerPanelView.buildCustomerPanel(null)); layout.addComponent(builtButton()); myWindow.setContent(layout); myWindow.setVisible(true); UI.getCurrent().addWindow(myWindow); myWindow.focus(); }
From source file:com.terralcode.gestion.frontend.view.widgets.appointment.AppointmentComplaintsPanel.java
private void openComplaintWindow(Complaint complaint) { WebBrowser webBrowser = Page.getCurrent().getWebBrowser(); Window window = new Window("Registro de Queja"); window.setModal(true);/* w ww .j av a 2s . c o m*/ if (webBrowser.getScreenWidth() < 1024) { window.setSizeFull(); } else { window.setHeight(90.0f, Unit.PERCENTAGE); window.setWidth(90.0f, Unit.PERCENTAGE); } // TextField nameField = new TextField(); // nameField.setInputPrompt("Introduzca el ttulo de la queja"); // nameField.setWidth("100%"); TextArea notesArea = new TextArea(); notesArea.setInputPrompt("Introduzca el contenido de la queja"); notesArea.setSizeFull(); // CheckBox doneField = new CheckBox("Atendido"); HorizontalLayout horizontal = new HorizontalLayout(); horizontal.setSpacing(true); horizontal.addComponent(createDeleteButton(window)); horizontal.addComponent(createOkButton(window)); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setMargin(true); layout.addComponent(complaintType); layout.addComponent(notesArea); // layout.addComponent(doneField); layout.addComponent(horizontal); layout.setComponentAlignment(horizontal, Alignment.MIDDLE_RIGHT); layout.setExpandRatio(complaintType, 1); layout.setExpandRatio(notesArea, 8); // layout.setExpandRatio(doneField, 1); layout.setExpandRatio(horizontal, 1); BeanItem beanItem = new BeanItem<>(complaint); fieldGroup = new BeanFieldGroup<>(Complaint.class); fieldGroup.setItemDataSource(beanItem); fieldGroup.bind(complaintType, "complaintType"); fieldGroup.bind(notesArea, "notes"); // fieldGroup.bind(doneField, "done"); window.setContent(layout); getUI().addWindow(window); // Window windowComplaint = new Window(complaintView); // WidgetActions actions = new WidgetActions(){ // // @Override // public void saveAction() { // refreshBind(); // windowComplaint.close(); // } // // @Override // public void deleteAction() { // appointment.getComplaints().remove(complaint); // refreshBind(); // windowComplaint.close(); // } // // }; // complaintView.bind(complaint); // complaintView.setActions(actions); // getUI().addWindow(windowComplaint); }
From source file:com.zklogtool.web.components.MainLayout.java
License:Apache License
public MainLayout() { buildMainLayout();/*from www . j a v a2 s. c om*/ setCompositionRoot(mainLayout); versionLabel.setValue("zklogtoolwebapp " + projectVersion()); MenuItem fileMenuItem = menuBar_1.addItem("File", null, null); fileMenuItem.addItem("Open transaction log", new MenuBar.Command() { @Override public void menuSelected(MenuItem selectedItem) { final Window window = new Window("Open transaction log file"); window.setModal(true); OpenTransactionLogFileDialog openFileDialog = new OpenTransactionLogFileDialog(tabSheet_1, window); window.setHeight(300, Unit.PIXELS); window.setWidth(600, Unit.PIXELS); window.setContent(openFileDialog); UI.getCurrent().addWindow(window); } }); fileMenuItem.addItem("Open snapshot", new MenuBar.Command() { @Override public void menuSelected(MenuItem selectedItem) { final Window window = new Window("Open snapshot file"); window.setModal(true); OpenSnapshotFileDialog openFileDialog = new OpenSnapshotFileDialog(tabSheet_1, window); window.setHeight(250, Unit.PIXELS); window.setWidth(600, Unit.PIXELS); window.setContent(openFileDialog); UI.getCurrent().addWindow(window); } }); MenuItem helpMenuItem = menuBar_1.addItem("Help", null, null); helpMenuItem.addItem("About", new MenuBar.Command() { @Override public void menuSelected(MenuItem selectedItem) { final Window window = new Window("About"); window.setModal(true); final VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setMargin(true); verticalLayout.addComponent(new Label("This is zklogtool web front end in development")); window.setContent(verticalLayout); UI.getCurrent().addWindow(window); } }); }
From source file:cz.zcu.pia.social.network.frontend.components.posts.ComponentPost.java
/** * Adds click listeners to the buttons/*from w ww. j av a 2 s. co m*/ */ private void addClickListeners() { this.likes.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Post post = componentPostService.updateLikeRating(postId); numberOfLikes = post.getLikeCount(); numberOfDisagrees = post.getHateCount(); updateHateLike(); } }); this.disagrees.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Post post = componentPostService.updateDisagreeRating(postId); numberOfLikes = post.getLikeCount(); numberOfDisagrees = post.getHateCount(); updateHateLike(); } }); this.tags.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Window subWindow = new Window(msgs.getMessage("post.tags")); subWindow.setModal(true); subWindow.center(); subWindow.setWidth(400, Unit.PIXELS); subWindow.setHeight(110, Unit.PIXELS); subWindow.setResizable(false); Panel panel = new Panel(); panel.setSizeFull(); HorizontalLayout tagsWrapper = new HorizontalLayout(); tagsWrapper.setStyleName("margin-left-big"); panel.setContent(tagsWrapper); tagsWrapper.setSpacing(true); tagsWrapper.setMargin(true); tagsWrapper.setSizeUndefined(); for (Tag t : postService.getPostTags(postId)) { CustomLayout tag = new CustomLayout("tag"); Button tagLabel = new Button(t.getTagName()); tag.addComponent(tagLabel, "button"); tagsWrapper.addComponent(tag); } subWindow.setContent(panel); UI.getCurrent().addWindow(subWindow); } }); this.comments.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Window subWindow = new Window(msgs.getMessage("post.comments")); subWindow.setModal(true); subWindow.center(); subWindow.setWidth(400, Unit.PIXELS); subWindow.setHeight(600, Unit.PIXELS); subWindow.setResizable(true); ComponentPostComments componentPostComments = applicationContext .getBean(ComponentPostComments.class, postId); subWindow.setContent(componentPostComments); UI.getCurrent().addWindow(subWindow); } }); this.name.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Window subWindow = new Window(msgs.getMessage("header.profile") + "- " + name.getCaption()); subWindow.setModal(true); subWindow.center(); subWindow.setWidth(400, Unit.PIXELS); subWindow.setHeight(350, Unit.PIXELS); subWindow.setResizable(true); Users user = postService.getPostById(postId).getUser(); ComponentProfilePost profilePost = applicationContext.getBean(ComponentProfilePost.class, user); subWindow.setContent(profilePost); UI.getCurrent().addWindow(subWindow); } }); }
From source file:cz.zcu.pia.social.network.frontend.components.profile.friends.ComponentFriends.java
/** * Function for manage friends requests button *//*w ww .j av a 2 s. c o m*/ private void manageFriendsRequestsButtonFunction() { Window subWindow = new Window(msgs.getMessage("post.comments")); ComponentManageFriendRequest manageFriendRequest = applicationContext .getBean(ComponentManageFriendRequest.class); manageFriendRequest.setParentReference(this); manageFriendRequest.setSizeFull(); subWindow.setModal(true); subWindow.center(); subWindow.setWidth(500, Unit.PIXELS); subWindow.setHeight(400, Unit.PIXELS); subWindow.setResizable(true); subWindow.setContent(manageFriendRequest); UI.getCurrent().addWindow(subWindow); }
From source file:cz.zcu.pia.social.network.frontend.views.ViewHome.java
/** * Add button function//ww w .jav a 2 s .com * @param event click event */ private void addButtonFunction(Button.ClickEvent event) { Window subWindow = new Window(msgs.getMessage("post.add.new")); subWindow.setModal(true); subWindow.center(); subWindow.setWidth(400, Unit.PIXELS); subWindow.setHeight(300, Unit.PIXELS); ComponentPostAdd postAdd = applicationContext.getBean(ComponentPostAdd.class); postAdd.setComponentParent(this); postAdd.setWindow(subWindow); postAdd.setMargin(true); subWindow.setContent(postAdd); UI.getCurrent().addWindow(subWindow); }