List of usage examples for com.vaadin.ui VerticalSplitPanel VerticalSplitPanel
public VerticalSplitPanel()
From source file:com.bsb.common.vaadin.embed.component.ComponentWrapper.java
License:Apache License
/** * Wraps a {@link Layout} into a Vaadin application. * * @param layout the layout to wrap/*from w w w . j av a2 s .c om*/ * @return an application displaying that layout */ public Application wrapLayout(Layout layout) { // TODO: add a header to switch the style, etc // TODO: add bookmark to set the style final Window mainWindow = new Window("Dev"); if (server.getConfig().isDevelopmentHeader()) { final VerticalSplitPanel mainLayout = new VerticalSplitPanel(); mainLayout.setSizeFull(); mainLayout.setSplitPosition(SPLIT_POSITION, Sizeable.UNITS_PIXELS); mainLayout.setLocked(true); final DevApplicationHeader header = new DevApplicationHeader(server); header.setSpacing(true); mainLayout.setFirstComponent(header); mainLayout.setSecondComponent(layout); mainWindow.setContent(mainLayout); } else { mainWindow.setContent(layout); } return new DevApplication(server, mainWindow); }
From source file:com.cavisson.gui.dashboard.components.calender.BeanItemContainerTestUI.java
License:Apache License
@SuppressWarnings("deprecation") @Override/*from ww w .ja v a 2 s . c om*/ protected void init(VaadinRequest request) { VerticalSplitPanel content = new VerticalSplitPanel(); content.setSizeFull(); setContent(content); // Create Calendar calendar = new Calendar(); calendar.setImmediate(true); calendar.setSizeFull(); calendar.setContainerDataSource(events); calendar.setStartDate(new Date(100, 1, 1)); calendar.setEndDate(new Date(100, 2, 1)); content.addComponent(calendar); // Add event table connected to same data source table = createTable(); table.setContainerDataSource(events); table.setVisibleColumns(new Object[] { "caption", "description", "start", "end" }); content.addComponent(table); }
From source file:com.cavisson.gui.dashboard.components.charts.Impl.ResizeInsideVaadinComponent.java
@Override protected Component getChart() { VerticalSplitPanel verticalSplitPanel = new VerticalSplitPanel(); HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setSecondComponent(verticalSplitPanel); verticalSplitPanel.setFirstComponent(createChart()); VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.setMargin(true);/* www.j a v a 2 s .com*/ verticalLayout.setSpacing(true); verticalLayout.addComponent( new Label("Relatively sized components resize themselves automatically when in Vaadin component.")); Button button = new Button("Open in a window"); button.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { Window window = new Window("Chart windodw"); window.setContent(createChart()); window.setWidth("50%"); window.setHeight("50%"); getUI().addWindow(window); } }); verticalLayout.addComponent(button); horizontalSplitPanel.setFirstComponent(verticalLayout); return horizontalSplitPanel; }
From source file:com.cavisson.gui.dashboard.components.controls.SplitPanels.java
License:Apache License
public SplitPanels() { setMargin(true);//from w w w. ja va 2 s . c om Label h1 = new Label("Split Panels"); h1.addStyleName("h1"); addComponent(h1); addComponent(new Label( "Outlines are just to show the areas of the SplitPanels. They are not part of the actual component style.")); HorizontalLayout row = new HorizontalLayout(); row.addStyleName("wrapping"); row.setSpacing(true); row.setMargin(new MarginInfo(true, false, false, false)); addComponent(row); HorizontalSplitPanel sp = new HorizontalSplitPanel(); sp.setCaption("Default style"); sp.setWidth("400px"); sp.setHeight(null); sp.setFirstComponent(getContent()); sp.setSecondComponent(getContent()); row.addComponent(sp); VerticalSplitPanel sp2 = new VerticalSplitPanel(); sp2.setCaption("Default style"); sp2.setWidth("300px"); sp2.setHeight("200px"); sp2.setFirstComponent(getContent()); sp2.setSecondComponent(getContent()); row.addComponent(sp2); sp = new HorizontalSplitPanel(); sp.setCaption("Large style"); sp.setWidth("300px"); sp.setHeight("200px"); sp.addStyleName("large"); sp.setFirstComponent(getContent()); sp.setSecondComponent(getContent()); row.addComponent(sp); sp2 = new VerticalSplitPanel(); sp2.setCaption("Large style"); sp2.setWidth("300px"); sp2.setHeight("200px"); sp2.addStyleName("large"); sp2.setFirstComponent(getContent()); sp2.setSecondComponent(getContent()); row.addComponent(sp2); }
From source file:com.coatl.pruebas.datastore.DataStoreUI.java
@Override protected void init(VaadinRequest vaadinRequest) { this.principal = new VerticalLayout(); {// w ww .jav a 2 s.c om principal.addComponent(new Label("Pruebas de DataStore")); HorizontalLayout superior = new HorizontalLayout(); principal.addComponent(superior); this.forma = new FormLayout(); superior.addComponent(forma); { this.tabla = new TextField("Tabla"); tabla.setValue("iq3_usuarios"); forma.addComponents(tabla); this.nombre = new TextField("Nombre"); forma.addComponents(nombre); this.ap1 = new TextField("Apellido Paterno"); forma.addComponents(ap1); this.ap2 = new TextField("Apellido Materno"); forma.addComponents(ap2); this.renglones = new Label("Renglones"); forma.addComponents(renglones); } FormLayout botones = new FormLayout(); /* botones.addComponent(new Label(" ")); botones.addComponent(new Label("Acciones:")); */ superior.addComponent(botones); Button recargar = new Button("Recargar"); botones.addComponent(recargar); recargar.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { listarObjetos(); } }); Button guardar = new Button("Guardar"); botones.addComponent(guardar); guardar.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { Map m = new HashMap(); m.put("nombre", nombre.getValue()); m.put("ap1", ap1.getValue()); m.put("ap2", ap2.getValue()); m.put("id", nombre.getValue()); IU7.ds.guardar(tabla.getValue(), m); System.out.println("Objeto guardado"); listarObjetos(); } }); Button borrar = new Button("Borrar"); botones.addComponent(borrar); borrar.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { borrar(); } }); Button mil = new Button("Hacer 1,000"); botones.addComponent(mil); mil.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { for (int i = 0; i < 1000; i++) { Map m = new HashMap(); String id = "ID_" + i + "_" + Math.random(); m.put("id", id); m.put("nombre", "Nombre_" + id + "_" + Math.random()); m.put("ap1", "Ap1_" + id + "_" + Math.random()); m.put("ap2", "Ap2_" + id + "_" + Math.random()); IU7.ds.guardar(tabla.getValue(), m); System.out.println(" >" + id); } } }); } VerticalSplitPanel vsl = new VerticalSplitPanel(); setContent(vsl); vsl.setFirstComponent(principal); grid.setSizeFull(); grid.setComponenteSuperior(new Label("primer panel")); //grid.setComponenteMedio(new Label("segundo panel")); //grid.setComponenteInferior(new Label("tercer panel")); grid.setNombreTabla(tabla.getValue()); grid.setColumnas("id,nombre,ap1,ap2"); grid.setColumnasVisibles("nombre,ap1,ap2"); vsl.setSecondComponent(grid); //grid.setComponenteMedio(grid); this.listarObjetos(); }
From source file:com.coatl.vaadin.layouts.ixPanelTripleVertical.java
public ixPanelTripleVertical() { this.setSizeFull(); this.setSplitPosition(52, Sizeable.Unit.PIXELS, false); interior = new VerticalSplitPanel(); interior.setSplitPosition(45, Sizeable.Unit.PIXELS, true); interior.setSizeFull();// ww w. j a va 2 s .c o m this.setSecondComponent(interior); //System.out.println("Armando panel triple vertical"); /* this.setComponenteSuperior(new Label("primer panel")); this.setComponenteMedio(new Label("segundo panel")); this.setComponenteInferior(new Label("tercer panel")); */ }
From source file:com.esspl.datagen.ui.ExecutorView.java
License:Open Source License
public ExecutorView(DataGenApplication application) { log.debug("ExecutorView - constructor start"); dataGenApplication = application;/* w w w . j a va 2 s. c om*/ setSizeFull(); VerticalLayout vl = new VerticalLayout(); vl.setSizeFull(); setCompositionRoot(vl); splitPanel = new VerticalSplitPanel(); splitPanel.setSizeFull(); //Script TextArea sqlScript = new TextArea(); sqlScript.setSizeFull(); sqlScript.setWordwrap(false); sqlScript.setStyleName("noResizeTextArea"); HorizontalLayout queryOptions = new HorizontalLayout(); queryOptions.setMargin(false, false, false, true); queryOptions.setSpacing(true); queryOptions.setWidth("100%"); queryOptions.setHeight("40px"); Button executeButton = new Button("Execute", new ClickListener() { @Override public void buttonClick(ClickEvent event) { log.info("ExecutorView - Execute Button clicked"); executeScript(sqlScript.getValue().toString()); } }); executeButton.addStyleName("small"); executeButton.setIcon(DataGenConstant.EXECUTOR_ICON); executeButton.setDescription("Press Ctrl+Enter to execute the query"); Button clearQueryButton = new Button("Clear SQL", new ClickListener() { @Override public void buttonClick(ClickEvent event) { log.info("ExecutorView - Clear SQL Button clicked"); sqlScript.setValue(""); } }); clearQueryButton.addStyleName("small"); clearQueryButton.setIcon(DataGenConstant.CLEAR_SMALL); clearQueryButton.setDescription("Clears the Sql"); Button clearConsoleButton = new Button("Clear Console", new ClickListener() { @Override public void buttonClick(ClickEvent event) { log.info("ExecutorView - Clear Console Button clicked"); logText.setValue(""); } }); clearConsoleButton.addStyleName("small"); clearConsoleButton.setIcon(DataGenConstant.CLEAR_SMALL); clearConsoleButton.setDescription("Clears the Console"); maxRowsBox = new ComboBox(null, Arrays.asList(10, 100, 500, 1000, 5000, 10000)); maxRowsBox.setDescription("Max number of rows to retrieve"); maxRowsBox.setWidth(100, UNITS_PIXELS); maxRowsBox.setNewItemsAllowed(false); maxRowsBox.setNullSelectionAllowed(false); maxRowsBox.setValue(100); //Bottom section components resultSheet = new TabSheet(); resultSheet.setSizeFull(); resultSheet.addStyleName(Runo.TABSHEET_SMALL); logText = new Label(); logText.setContentMode(Label.CONTENT_XHTML); logText.setSizeFull(); //Panel to add refresher logPanel = new Panel(); logPanel.setSizeFull(); logPanel.setScrollable(true); logPanel.setStyleName(Runo.PANEL_LIGHT); logPanel.addComponent(logText); //Refresher added to show instant log messages refresher = new Refresher(); logPanel.addComponent(refresher); //Loading image loadingImg = new Embedded("", DataGenConstant.LOADING_ICON); loadingImg.setVisible(false); logPanel.addComponent(loadingImg); resultSheet.addTab(logPanel, "Console"); resultTab = resultSheet.addTab(new Label(), "Results"); queryOptions.addComponent(executeButton); queryOptions.setComponentAlignment(executeButton, Alignment.MIDDLE_LEFT); queryOptions.addComponent(clearQueryButton); queryOptions.setComponentAlignment(clearQueryButton, Alignment.MIDDLE_LEFT); queryOptions.addComponent(clearConsoleButton); queryOptions.setComponentAlignment(clearConsoleButton, Alignment.MIDDLE_LEFT); queryOptions.setExpandRatio(clearConsoleButton, 1); queryOptions.addComponent(maxRowsBox); queryOptions.setComponentAlignment(maxRowsBox, Alignment.MIDDLE_RIGHT); splitPanel.setFirstComponent(sqlScript); splitPanel.setSecondComponent(resultSheet); vl.addComponent(queryOptions); vl.addComponent(splitPanel); vl.setExpandRatio(splitPanel, 1); sqlScript.addShortcutListener(new ShortcutListener("Execute Script", null, ShortcutAction.KeyCode.ENTER, ShortcutAction.ModifierKey.CTRL) { @Override public void handleAction(Object sender, Object target) { executeScript(sqlScript.getValue().toString()); } }); log.debug("ExecutorView - constructor end"); }
From source file:com.github.mjvesa.herd.HerdIDE.java
License:Apache License
private VerticalSplitPanel constructEditorAndLayoutPanel() { VerticalSplitPanel vsp = new VerticalSplitPanel(); vsp.setSizeFull();/* w ww. j a v a 2 s . c o m*/ vsp.addComponent(constructEditorAndLayout()); vsp.setSplitPosition(80); console = createConsole(); vsp.addComponent(console); return vsp; }
From source file:com.haulmont.cuba.web.app.folders.CubaFoldersPane.java
License:Apache License
protected void createFoldersPaneLayout(Component appFoldersPane, Component searchFoldersPane) { if (appFoldersPane != null && searchFoldersPane != null) { vertSplit = new VerticalSplitPanel(); vertSplit.setSplitPosition(verticalSplitPos); VerticalLayout afLayout = new VerticalLayout(); afLayout.setSpacing(true);//from w w w.j a v a 2s.com afLayout.setSizeFull(); if (appFoldersLabel != null) addFoldersLabel(afLayout, appFoldersLabel); afLayout.addComponent(appFoldersPane); afLayout.setExpandRatio(appFoldersPane, 1); vertSplit.setFirstComponent(afLayout); VerticalLayout sfLayout = new VerticalLayout(); sfLayout.setSpacing(true); sfLayout.setSizeFull(); if (searchFoldersLabel != null) addFoldersLabel(sfLayout, searchFoldersLabel); sfLayout.addComponent(searchFoldersPane); sfLayout.setExpandRatio(searchFoldersPane, 1); vertSplit.setSecondComponent(sfLayout); addComponent(vertSplit); } else { if (appFoldersPane != null) { if (appFoldersLabel != null) addFoldersLabel(this, appFoldersLabel); addComponent(appFoldersPane); setExpandRatio(appFoldersPane, 1); } if (searchFoldersPane != null) { if (searchFoldersLabel != null) addFoldersLabel(this, searchFoldersLabel); addComponent(searchFoldersPane); setExpandRatio(searchFoldersPane, 1); } } }
From source file:com.haulmont.cuba.web.gui.components.WebSplitPanel.java
License:Apache License
protected void createComponentImpl() { if (orientation == SplitPanel.ORIENTATION_HORIZONTAL) { component = new CubaHorizontalSplitPanel() { @Override//ww w .j ava2s .c o m public void setSplitPosition(float pos, Unit unit, boolean reverse) { currentPosition = this.getSplitPosition(); inverse = this.isSplitPositionReversed(); super.setSplitPosition(pos, unit, reverse); } }; } else { component = new VerticalSplitPanel() { @Override public void setSplitPosition(float pos, Unit unit, boolean reverse) { currentPosition = this.getSplitPosition(); super.setSplitPosition(pos, unit, reverse); } }; } component.addSplitPositionChangeListener(this::fireSplitPositionChangeListener); }