private HorizontalSplitPanel buildHorizontalSplitPanel() { // common part: create layout horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setImmediate(false); horizontalSplitPanel.setWidth("100.0%"); horizontalSplitPanel.setHeight("100.0%"); horizontalSplitPanel.setMargin(false); // gridLayout_1 gridLayoutCalendar = new GridLayout(); gridLayoutCalendar.setImmediate(true); gridLayoutCalendar.setWidth("100.0%"); gridLayoutCalendar.setHeight("100.0%"); gridLayoutCalendar.setMargin(false); gridLayoutCalendar.setColumns(4); gridLayoutCalendar.setRows(3); horizontalSplitPanel.setSecondComponent(gridLayoutCalendar); return horizontalSplitPanel; }
@Override protected Component createContent() { VerticalLayout layout = new VerticalLayout(); layout.addComponent(spellSound); title = new Label(); classe = new LabelField<>("Classe : "); classLevel = new LabelField<>("Niveau de classe : "); layout.addComponents(title); tabs = new TabSheet(); panel = new HorizontalSplitPanel(); panel.setSizeFull(); panel.setCaption(Messages.getInstance().getMessage("spellStep.spell.label")); panel.setFirstComponent(tabs); layout.addComponent(panel); return layout; }
/** * Diese Methode setzt die obere und die zwei unteren Views in der Prozessansicht. * * @author: Mirko Göpfrich */ @Override public void showView(View topView, View bottomLeftView, View bottomRigthView) { verticalSplitPanel.setFirstComponent((Component) topView); //Teilt das Panel horizontal un zwei gleiche Bereiche auf und ertstellt eine vertiakel Trennlinie (nicht verstellbar.) horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setSizeFull(); horizontalSplitPanel.setSplitPosition(50, UNITS_PERCENTAGE); horizontalSplitPanel.setLocked(true); horizontalSplitPanel.setStyleName("small"); horizontalSplitPanel.setFirstComponent((Component) bottomLeftView); horizontalSplitPanel.setSecondComponent((Component) bottomRigthView); //fügt dem unteren vertikalen Panel ein horizontales SplitPanel hinzu. verticalSplitPanel.setSecondComponent(horizontalSplitPanel); logger.debug("Horizontales SplitPanel für Prozessschritte und Infos erstellt und an das untere vertikale Panel übergeben"); }
@AutoGenerated private HorizontalSplitPanel buildHorizontalSplitPanel() { // common part: create layout horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setImmediate(false); horizontalSplitPanel.setWidth("100.0%"); horizontalSplitPanel.setHeight("100.0%"); // verticalLayoutLeftPanel verticalLayoutLeftPanel = buildVerticalLayoutLeftPanel(); horizontalSplitPanel.addComponent(verticalLayoutLeftPanel); // verticalLayoutRightPanel verticalLayoutRightPanel = buildVerticalLayoutRightPanel(); horizontalSplitPanel.addComponent(verticalLayoutRightPanel); return horizontalSplitPanel; }
@PostConstruct protected void init() { setSizeFull(); tabbedPanel = new TabbedPanel(); HorizontalSplitPanel leftSplit = new HorizontalSplitPanel(); leftSplit.setSizeFull(); leftSplit.setSplitPosition(UIConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS); deployNavigator = new DeployNavigator(context, tabbedPanel); leftSplit.setFirstComponent(deployNavigator); VerticalLayout container = new VerticalLayout(); container.setSizeFull(); container.addComponent(tabbedPanel); leftSplit.setSecondComponent(container); addComponent(leftSplit); }
@PostConstruct protected void init() { setSizeFull(); tabbedPanel = new TabbedPanel(); HorizontalSplitPanel leftSplit = new HorizontalSplitPanel(); leftSplit.setSizeFull(); leftSplit.setSplitPosition(UIConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS); projectNavigator = new DesignNavigator(context, tabbedPanel); leftSplit.setFirstComponent(projectNavigator); VerticalLayout container = new VerticalLayout(); container.setSizeFull(); container.addComponent(tabbedPanel); leftSplit.setSecondComponent(container); addComponent(leftSplit); }
private void createMainComponent() { VerticalLayout main = new VerticalLayout(); main.setMargin(false); main.setSizeFull(); main.addComponent(createToolbar()); mainSplitPanel = new HorizontalSplitPanel(); mainSplitPanel.setMargin(false); mainSplitPanel.setMaxSplitPosition(80f, HorizontalSplitPanel.UNITS_PERCENTAGE); mainSplitPanel.setMinSplitPosition(20f, HorizontalSplitPanel.UNITS_PERCENTAGE); mainSplitPanel.setSizeFull(); mainSplitPanel.setSplitPosition(30f, HorizontalSplitPanel.UNITS_PERCENTAGE); taskTable = createTable(); mainSplitPanel.setFirstComponent(taskTable); displayEmptyTask(); main.addComponent(mainSplitPanel); main.setExpandRatio(mainSplitPanel, 1.0f); mainComponent = main; }
@Override protected void init(VaadinRequest request) { setPollInterval(1000); hl = new HorizontalSplitPanel(); hl.setSizeFull(); setContent(hl); buttonsOnTheLeft = new VerticalLayout(); buttonsOnTheLeft.setSizeUndefined(); hl.setFirstComponent(buttonsOnTheLeft); hl.setSplitPosition(25, Unit.PERCENTAGE); ServiceTracker<FragmentFactory, FragmentFactory> tracker = new ServiceTracker<FragmentFactory, FragmentFactory>( VaadinActivator.context, FragmentFactory.class, this); tracker.open(); addDetachListener(new DetachListener() { @Override public void detach(DetachEvent event) { tracker.close(); } }); }
@AutoGenerated private HorizontalSplitPanel buildHorizontalSplitPanel_2() { // common part: create layout horizontalSplitPanel_2 = new HorizontalSplitPanel(); horizontalSplitPanel_2.setImmediate(false); horizontalSplitPanel_2.setWidth("100.0%"); horizontalSplitPanel_2.setHeight("100.0%"); // filterTable filterTable = new FilterTable(); filterTable.setImmediate(false); filterTable.setWidth("100.0%"); filterTable.setHeight("100.0%"); horizontalSplitPanel_2.addComponent(filterTable); // verticalLayout_1 verticalLayout_1 = buildVerticalLayout_1(); horizontalSplitPanel_2.addComponent(verticalLayout_1); return horizontalSplitPanel_2; }
@AutoGenerated private HorizontalSplitPanel buildHorizontalSplitPanel_1() { // common part: create layout horizontalSplitPanel_1 = new HorizontalSplitPanel(); horizontalSplitPanel_1.setImmediate(false); horizontalSplitPanel_1.setWidth("100.0%"); horizontalSplitPanel_1.setHeight("100.0%"); // verticalLayout_1 verticalLayout_1 = buildVerticalLayout_1(); horizontalSplitPanel_1.addComponent(verticalLayout_1); // verticalLayout_2 verticalLayout_2 = buildVerticalLayout_2(); horizontalSplitPanel_1.addComponent(verticalLayout_2); return horizontalSplitPanel_1; }
@Test public void testAddComponentToParentWithExpandRatio() throws Exception { Button btn1 = new Button(); Button btn2 = new Button(); HorizontalSplitPanel panel = new HorizontalSplitPanel(); VisualTreeNode splitPanelVisualTreeNode = new VisualTreeNodeImpl(panel); splitPanelVisualTreeNode.setAdditionalParameter("splitPosition", "0.65"); factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn1)); factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn2)); assertThat(panel.getComponentCount()).isEqualTo(2); assertThat(panel.getFirstComponent()).isSameAs(btn1); assertThat(panel.getSecondComponent()).isSameAs(btn2); assertThat(panel.getSplitPositionUnit()).isEqualTo(Sizeable.Unit.PERCENTAGE); assertThat(panel.getSplitPosition()).isEqualTo(0.65f * 100.f, Offset.offset(0.01f)); }
@Override public void init() { if (eventProxy == null) throw new RuntimeException("eventProxy cannot be null."); if (eventConfDao == null) throw new RuntimeException("eventConfDao cannot be null."); if (dataCollectionDao == null) throw new RuntimeException("dataCollectionDao cannot be null."); setTheme(Runo.THEME_NAME); final HorizontalSplitPanel mainPanel = new HorizontalSplitPanel(); final MibConsolePanel mibConsole = new MibConsolePanel(); final MibCompilerPanel mibPanel = new MibCompilerPanel(dataCollectionDao, eventConfDao, eventProxy, mibParser, mibConsole); mainPanel.setSizeFull(); mainPanel.setSplitPosition(25, Sizeable.UNITS_PERCENTAGE); mainPanel.addComponent(mibPanel); mainPanel.addComponent(mibConsole); final Window mainWindow = new Window("MIB Compiler Application", mainPanel); setMainWindow(mainWindow); }
@AutoGenerated private HorizontalSplitPanel buildMapSplitPanel() { // common part: create layout mapSplitPanel = new HorizontalSplitPanel(); mapSplitPanel.setImmediate(false); mapSplitPanel.setWidth("100.0%"); mapSplitPanel.setHeight("100.0%"); mapSplitPanel.setMargin(false); // locationsLayersMap locationsLayersMap = new OpenLayersMap(); locationsLayersMap.setImmediate(false); locationsLayersMap.setWidth("-1px"); locationsLayersMap.setHeight("100.0%"); mapSplitPanel.addComponent(locationsLayersMap); // locationDataLayout locationDataLayout = buildLocationDataLayout(); mapSplitPanel.addComponent(locationDataLayout); return mapSplitPanel; }
@AutoGenerated private HorizontalSplitPanel buildHorizontalSplitPanelOrganization() { // common part: create layout horizontalSplitPanelOrganization = new HorizontalSplitPanel(); horizontalSplitPanelOrganization.setSplitPosition(25, Sizeable.UNITS_PERCENTAGE); horizontalSplitPanelOrganization.setImmediate(false); horizontalSplitPanelOrganization.setWidth("100.0%"); horizontalSplitPanelOrganization.setHeight("100.0%"); horizontalSplitPanelOrganization.setMargin(false); // tabSheetOrganization tabSheetOrganization = new TabSheet(); tabSheetOrganization.setImmediate(true); tabSheetOrganization.setWidth("100.0%"); tabSheetOrganization.setHeight("100.0%"); horizontalSplitPanelOrganization.addComponent(tabSheetOrganization); return horizontalSplitPanelOrganization; }
public SubSetSelectorDraggable(String caption, List<ET> options) { availableLayout = new VerticalLayout(); availableLayout.setMargin(false); availableLayout.setSpacing(false); valueLayout = new VerticalLayout(); valueLayout.setMargin(false); valueLayout.setSpacing(false); splitPanel = new HorizontalSplitPanel(availableLayout, valueLayout); splitPanel.setMinSplitPosition(20, Unit.PERCENTAGE); splitPanel.setMaxSplitPosition(80, Unit.PERCENTAGE); splitPanel.setCaption(caption); verticalLayout = new VerticalLayout(); verticalLayout.setHeight(100, Unit.PERCENTAGE); verticalLayout.addComponentsAndExpand(splitPanel); availableDragSource = new ArrayList<>(); buttonStyles = new ArrayList<>(); addDropTarget(valueLayout, false); addDropTarget(availableLayout, true); setHeight(500, Unit.PIXELS); setDraggableHeight(45); valueLayout.setHeight(getDraggableAreaHeight(), Unit.PIXELS); setStyle(); setItems(options); }
private void initContent2() { VerticalLayout content = new VerticalLayout(); content.setWidth("100%"); setContent(content); Label envLbl = createEnvLabel(); HorizontalLayout topMenu = new HorizontalLayout(); middle = new HorizontalSplitPanel(); bottom = new HorizontalLayout(); VerticalLayout leftMenu = new VerticalLayout(); main = new VerticalLayout(); leftMenu.addComponents(mainBtn,filtersBtn); int buttonSize = 100; mainBtn.setWidth(buttonSize,Unit.PIXELS); filtersBtn.setWidth(buttonSize,Unit.PIXELS); mainBtn.setEnabled(false); filtersBtn.setEnabled(false); filtersBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); leftMenu.setVisible(false); topMenu.addComponents(envLbl,processBtn,loadHistoricalQuotesBtn); leftMenu.setWidth(buttonSize,Unit.PIXELS); middle.setFirstComponent(leftMenu); middle.setSecondComponent(main); middle.setSplitPosition(buttonSize, Sizeable.Unit.PIXELS); content.addComponents(topMenu,middle,bottom); }
private void initWindow(Object selectedItem) { Panel exportPanel = new Panel("Export and Dependencies"); exportPanel.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR); exportPanel.setSizeFull(); VerticalLayout exportLayout = new VerticalLayout(); exportLayout.setMargin(true); addSelectedAndDependentObjects(exportLayout, selectedItem); exportPanel.setContent(exportLayout); Panel affectedPanel = new Panel("Possible Affected Flows"); affectedPanel.setSizeFull(); exportPanel.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR); affectedLayout = new VerticalLayout(); affectedLayout.setMargin(true); updateAffectedObjects(); affectedPanel.setContent(affectedLayout); // Split panel for Export and Affected HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.setWidth(100, Unit.PERCENTAGE); splitPanel.setFirstComponent(exportPanel); splitPanel.setSecondComponent(affectedPanel); addComponent(splitPanel, 1); Button selectAllLink = new Button("Select All"); selectAllLink.addStyleName(ValoTheme.BUTTON_LINK); selectAllLink.addClickListener((event) -> selectAll()); Button selectNoneLink = new Button("Select None"); selectNoneLink.addStyleName(ValoTheme.BUTTON_LINK); selectNoneLink.addClickListener((event) -> selectNone()); addComponent(buildButtonFooter(new Button[] {selectAllLink, selectNoneLink}, new Button("Export", new ExportClickListener()), buildCloseButton())); setWidth(700, Unit.PIXELS); setHeight(500, Unit.PIXELS); }
@Test public void testAddComponentToParent() throws Exception { Button btn1 = new Button(); Button btn2 = new Button(); HorizontalSplitPanel panel = new HorizontalSplitPanel(); VisualTreeNode splitPanelVisualTreeNode = new VisualTreeNodeImpl(panel); factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn1)); factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn2)); assertThat(panel.getComponentCount()).isEqualTo(2); assertThat(panel.getFirstComponent()).isSameAs(btn1); assertThat(panel.getSecondComponent()).isSameAs(btn2); }
@Test(expected = ElementFactoryException.class) public void testAddComponentToParentMoreThanTwoComponents() throws Exception { Button btn1 = new Button(); Button btn2 = new Button(); Button btn3 = new Button(); HorizontalSplitPanel panel = new HorizontalSplitPanel(); VisualTreeNode splitPanelVisualTreeNode = new VisualTreeNodeImpl(panel); factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn1)); factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn2)); factory.addComponentToParent(splitPanelVisualTreeNode, new VisualTreeNodeImpl(btn3)); }
@Override protected void init(VaadinRequest request) { treeToolEditor = new TreeToolEditor(this); toolEditor = new ToolEditor(this); textEditor = new TextEditor(this); final Panel vLayout = new Panel(); vSplitPanel = new VerticalSplitPanel(); vSplitPanel.setSplitPosition(50, Unit.PERCENTAGE); vSplitPanel.setImmediate(true); vSplitPanel.setLocked(false); vSplitPanel.setWidth("100%"); vLayout.setContent(vSplitPanel); setContent(vSplitPanel); VerticalLayout vvLayout = new VerticalLayout(); vvLayout.setSizeFull(); Label title = new Label("<h2><b> Tool Editor</b></h2>", ContentMode.HTML); vvLayout.addComponent(title); vvLayout.setComponentAlignment(title, Alignment.TOP_LEFT); HorizontalSplitPanel hSplitpPanel = new HorizontalSplitPanel(); hSplitpPanel.setSizeFull(); vvLayout.addComponent(hSplitpPanel); HorizontalLayout buttonPanel = getButtonPanel(); vvLayout.addComponent(buttonPanel); vvLayout.setComponentAlignment(buttonPanel, Alignment.MIDDLE_CENTER); vvLayout.setExpandRatio(hSplitpPanel, 5); vvLayout.setComponentAlignment(hSplitpPanel, Alignment.TOP_LEFT); vvLayout.setMargin(false); vvLayout.setSpacing(false); hSplitpPanel.setFirstComponent(treeToolEditor); hSplitpPanel.setSecondComponent(toolEditor); vSplitPanel.setFirstComponent(vvLayout); vSplitPanel.setSecondComponent(textEditor); hSplitpPanel.setStyleName("topborder"); }
@Override protected void init(VaadinRequest request) { HorizontalSplitPanel split = new HorizontalSplitPanel(); setContent(split); split.setSplitPosition(50, Unit.PERCENTAGE); split.setMinSplitPosition(100, Unit.PIXELS); split.setMaxSplitPosition(1200, Unit.PIXELS); CssLayout grid = new CssLayout(); grid.setWidth("100%"); grid.addStyleName("grid"); split.addComponent(grid); for (int i = 1; i < 10; i++) { Label l = new Label("" + i); l.setSizeUndefined(); grid.addComponent(l); } Label description = new Label( "<h3>This application demonstrates the Responsive add-on for Vaadin.</h3>" + "<p>Drag the splitter to see how the boxes on the left side adapt to " + "different widths. They maintain a width of 100-200px, and always " + "span the entire width of the container.</p><p>This label will " + "adapt its font size and line height for different widths.</p>" + "<p><a href=\"http://vaadin.com/addon/vaadin-responsive\">Download the " + "Responsive add-on</a></p>", ContentMode.HTML); description.addStyleName("description"); split.addComponent(description); // Add the responsive capabilities to the components new Responsive(grid); new Responsive(description); }
/** * Im Konstruktor wird das Layout erstellt. * * @author Marco Glaser * */ public InitialLayout(){ mainLayout.setSizeFull(); mainLayout.setStyleName("mainLayout"); leftLayout.setSizeFull(); leftLayout.setStyleName("leftContainer"); rightLayout.setSizeFull(); bottomLayout.setSizeFull(); bottomLeftLayout.setSizeFull(); horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setSplitPosition(30, com.vaadin.terminal.Sizeable.UNITS_PERCENTAGE); horizontalSplitPanel.setLocked(true); horizontalSplitPanel.setStyleName("horizontalMain"); verticalSplitPanel = new VerticalSplitPanel(); verticalSplitPanel.setSplitPosition(15, com.vaadin.terminal.Sizeable.UNITS_PERCENTAGE); verticalSplitPanel.setLocked(true); verticalSplitPanel.setWidth(90, com.vaadin.terminal.Sizeable.UNITS_PERCENTAGE); verticalSplitPanel.setHeight(100, com.vaadin.terminal.Sizeable.UNITS_PERCENTAGE); horizontalSplitPanelRight = new HorizontalSplitPanel(); horizontalSplitPanelRight.setSplitPosition(30, com.vaadin.terminal.Sizeable.UNITS_PERCENTAGE); horizontalSplitPanelRight.setLocked(true); horizontalSplitPanelRight.addStyleName("horizontalBottom"); horizontalSplitPanelRight.setHeight(90, com.vaadin.terminal.Sizeable.UNITS_PERCENTAGE); horizontalSplitPanelRight.setWidth(100, com.vaadin.terminal.Sizeable.UNITS_PERCENTAGE); leftL = new Label("links"); rightTopL = new Label("rechts Oben"); rightBottomL = new Label("rechts Unten"); leftBottomL = new Label("links Unten"); leftLayout.addComponent(leftL); rightLayout.addComponent(verticalSplitPanel); topRightLayout.addComponent(rightTopL); bottomRightLayout.addComponent(rightBottomL); // bottomLeftLayout.addComponent(leftBottomL); bottomLayout.addComponent(horizontalSplitPanelRight); horizontalSplitPanel.addComponent(leftLayout); horizontalSplitPanel.addComponent(rightLayout); verticalSplitPanel.addComponent(topRightLayout); verticalSplitPanel.addComponent(bottomLayout); horizontalSplitPanelRight.addComponent(bottomLeftLayout); horizontalSplitPanelRight.addComponent(bottomRightLayout); rightLayout.setComponentAlignment(verticalSplitPanel, Alignment.MIDDLE_CENTER); bottomLayout.setComponentAlignment(horizontalSplitPanelRight, Alignment.MIDDLE_CENTER); mainLayout.addComponent(horizontalSplitPanel); }
/** * Erstelle das GUI zum Prozessschritt "Perioden" * * @author Daniel Dengler */ private void generateUi() { setSizeFull(); setSplitPosition(60, UNITS_PERCENTAGE); setSizeFull(); setLocked(true); setStyleName("small"); setMargin(true); horizontalPanel = new HorizontalSplitPanel(); horizontalPanel.setSplitPosition(35, UNITS_PERCENTAGE); horizontalPanel.setSizeFull(); horizontalPanel.setLocked(true); horizontalPanel.setStyleName("small"); setFirstComponent(horizontalPanel); VerticalLayout infoBox = new VerticalLayout(); infoBox.setMargin(true); Label infoText1 = new Label ("<h3>Eingabe der Perioden</h3>"); infoText1.setContentMode(Label.CONTENT_XHTML); Label infoText2 = new Label("Der Zeitstrahl ist gemäß Ihren getätigten Eingaben vorgegeben. Mit einem Klick auf den „Jahresbutton“ können Sie die entsprechenden Werte eintragen."); Label infoText3 = new Label ("<h3>Direkte Eingabe der Cashflows:</h3>"); infoText3.setContentMode(Label.CONTENT_XHTML); Label infoText4 = new Label ("Wählen Sie nun bitte die links angezeigten Perioden aus und geben Sie für jede Periode sowohl den Cashflow als auch das Fremdkapital der jeweiligen Periode an."); Label infoText5 = new Label ("<h3>Gesamtkostenverfahren:</h3>"); infoText5.setContentMode(Label.CONTENT_XHTML); Label infoText6 = new Label ("Wählen Sie nun bitte die links angezeigten Perioden aus und geben Sie für jede Periode die abgefragten Daten zur Berechnung des Cashflows an. Die benötigten Datensätze entnehmen Sie bitte Ihrer Gewinn- und Verlustrechnung, erstellt nach dem Gesamtkostenverfahren."); Label infoText7 = new Label ("<h3>Umsatzkostenverfahren:</h3>"); infoText7.setContentMode(Label.CONTENT_XHTML); Label infoText8 = new Label ("Wählen Sie nun bitte die links angezeigten Perioden aus und geben Sie für jede Periode die abgefragten Daten zur Berechnung des Cashflows an. Die benötigten Datensätze entnehmen Sie bitte Ihrer Gewinn- und Verlustrechnung, erstellt nach dem Umsatzkostenverfahren."); infoBox.addComponent(infoText1); infoBox.addComponent(infoText2); infoBox.addComponent(infoText3); infoBox.addComponent(infoText4); infoBox.addComponent(infoText5); infoBox.addComponent(infoText6); infoBox.addComponent(infoText7); infoBox.addComponent(infoText8); setSecondComponent(infoBox); }
@Override protected void init(VaadinRequest request) { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); layout.setSizeFull(); setContent(layout); HorizontalSplitPanel hPanel = new HorizontalSplitPanel(); VerticalSplitPanel vPanel = new VerticalSplitPanel(); Panel playerPanel = new Panel("Player"); Panel roundsPanel = new Panel("Rounds"); Panel matchesPanel = new Panel("Matches"); Table playersTable = new Table("PlayersTable"); playersTable.addContainerProperty("Id", Integer.class, null); playersTable.addContainerProperty("Name", String.class, null); playersTable.addContainerProperty("Score", Integer.class, null); playersTable.addContainerProperty("Handicap", Integer.class,null); Table roundsTable = new Table("RoundsTable"); Table matchesTable = new Table("MatchesTable"); playerPanel.setContent(playersTable); HorizontalLayout newPlayerLayout = new HorizontalLayout(); TextField newPlayer = new TextField(null,"newPlayer"); Button addPlayerButton = new Button("addPlayer"); newPlayerLayout.addComponent(newPlayer); newPlayerLayout.addComponent(addPlayerButton); hPanel.addComponent(newPlayerLayout); roundsPanel.setContent(roundsTable); matchesPanel.setContent(matchesTable); VerticalLayout playerLayout = new VerticalLayout(); playerLayout.addComponent(playerPanel); playerLayout.addComponent(newPlayerLayout); VerticalLayout roundsLayout = new VerticalLayout(); roundsLayout.addComponent(roundsPanel); Button addRoundButton = new Button("addRound"); roundsLayout.addComponent(roundsPanel); roundsLayout.addComponent(addRoundButton); layout.addComponent(hPanel); hPanel.setFirstComponent(playerLayout); hPanel.setSecondComponent(vPanel); vPanel.setFirstComponent(roundsLayout); vPanel.setSecondComponent(matchesPanel); }
@PostConstruct protected void init() { setSizeFull(); tabbedPanel = new TabbedPanel(); HorizontalSplitPanel leftSplit = new HorizontalSplitPanel(); leftSplit.setSizeFull(); leftSplit.setSplitPosition(UIConstants.DEFAULT_LEFT_SPLIT, Unit.PIXELS); VerticalLayout container = new VerticalLayout(); container.setSizeFull(); container.addComponent(tabbedPanel); leftSplit.setSecondComponent(container); table = new TreeTable(); table.addStyleName(ValoTheme.TREETABLE_NO_HORIZONTAL_LINES); table.addStyleName(ValoTheme.TREETABLE_NO_STRIPES); table.addStyleName(ValoTheme.TREETABLE_NO_VERTICAL_LINES); table.addStyleName(ValoTheme.TREETABLE_BORDERLESS); table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN); table.setSizeFull(); table.setCacheRate(100); table.setPageLength(100); table.setImmediate(true); table.setSelectable(true); table.addItemClickListener(this); table.addStyleName("noselect"); table.addContainerProperty("id", String.class, null); table.setVisibleColumns(new Object[] { "id" }); table.setColumnExpandRatio("id", 1); addItem("Users", Icons.USER); addItem("Groups", Icons.GROUP); addItem("REST", Icons.REST); addItem("General Settings", Icons.SETTINGS); addItem("Plugin Repositories", Icons.DATABASE); addItem("Plugins", Icons.COMPONENT); addItem("Mail Server", Icons.EMAIL); addItem("Notifications", Icons.NOTIFICATION); addItem("Active Users", FontAwesome.USERS); addItem("Audit Events", FontAwesome.BARS); addItem("Logging", Icons.LOGGING); addItem("About", FontAwesome.QUESTION); VerticalLayout navigator = new VerticalLayout(); navigator.addStyleName(ValoTheme.MENU_ROOT); navigator.setSizeFull(); leftSplit.setFirstComponent(navigator); MenuBar leftMenuBar = new MenuBar(); leftMenuBar.addStyleName(ValoTheme.MENUBAR_BORDERLESS); leftMenuBar.setWidth(100, Unit.PERCENTAGE); navigator.addComponent(leftMenuBar); navigator.addComponent(table); navigator.setExpandRatio(table, 1); addComponent(leftSplit); }
public EditFlowPanel(ApplicationContext context, String flowId, DesignNavigator designNavigator, TabbedPanel tabs) { this.configurationService = context.getConfigurationService(); this.flow = configurationService.findFlow(flowId); this.readOnly = context.isReadOnly(configurationService.findProjectVersion(flow.getProjectVersionId()), Privilege.DESIGN); this.context = context; this.tabs = tabs; this.designNavigator = designNavigator; this.propertySheet = new PropertySheet(context, tabs, readOnly); this.propertySheet.setListener((components) -> { List<FlowStep> steps = new ArrayList<FlowStep>(); for (Component c : components) { steps.add(EditFlowPanel.this.flow.findFlowStepWithComponentId(c.getId())); } refreshStepOnDiagram(steps); }); propertySheet.setCaption("Property Sheet"); componentPalette = new EditFlowPalette(this, context, flow.getProjectVersionId()); addComponent(componentPalette); rightLayout = new VerticalLayout(); rightLayout.setSizeFull(); rightLayout.addComponent(buildButtonBar()); // Create two different layouts for the user to toggle between. vSplit = new VerticalSplitPanel(); vSplit.setSizeFull(); vSplit.setSplitPosition(MAX_PANEL_POSITION, Unit.PERCENTAGE); hSplit = new HorizontalSplitPanel(); hSplit.setSizeFull(); hSplit.setSplitPosition(MAX_PANEL_POSITION, Unit.PERCENTAGE); diagramLayout = new VerticalLayout(); diagramLayout.setWidth(10000, Unit.PIXELS); diagramLayout.setHeight(10000, Unit.PIXELS); DragAndDropWrapper wrapper = new DragAndDropWrapper(diagramLayout); wrapper.setSizeUndefined(); wrapper.setDropHandler(new DropHandler()); flowPanel = new Panel(); flowPanel.setSizeFull(); flowPanel.addStyleName(ValoTheme.PANEL_WELL); flowPanel.setContent(wrapper); if (isVerticalView()) { vSplit.addComponent(flowPanel); vSplit.addComponent(propertySheet); rightLayout.addComponent(vSplit); rightLayout.setExpandRatio(vSplit, 1); } else { hSplit.addComponent(flowPanel); hSplit.addComponent(propertySheet); rightLayout.addComponent(hSplit); rightLayout.setExpandRatio(hSplit, 1); } addComponent(rightLayout); setExpandRatio(rightLayout, 1); redrawFlow(); }
protected void buildUI() { ButtonBar buttonBar = new ButtonBar(); addComponent(buttonBar); if (!readOnly) { Button testButton = buttonBar.addButton("Test", FontAwesome.FILE_CODE_O); testButton.addClickListener(new TestClickListener()); } filterField = buttonBar.addFilter(); filterField.addTextChangeListener(this); HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); splitPanel.setSizeFull(); splitPanel.setSplitPosition(50, Unit.PERCENTAGE); VerticalLayout leftLayout = new VerticalLayout(); editor = new AceEditor(); editor.setMode(AceMode.xml); editor.setSizeFull(); editor.setHighlightActiveLine(true); editor.setShowPrintMargin(false); editor.addTextChangeListener(new StylesheetChangeListener()); editor.setValue(component.findSetting(XsltProcessor.XSLT_PROCESSOR_STYLESHEET).getValue()); leftLayout.addComponent(new Label("XSLT Stylesheet")); leftLayout.addComponent(editor); leftLayout.setExpandRatio(editor, 1.0f); leftLayout.setSizeFull(); splitPanel.setFirstComponent(leftLayout); VerticalLayout rightLayout = new VerticalLayout(); rightLayout.setSizeFull(); rightLayout.addComponent(new Label("Sample Input XML")); textArea = new TextArea(); textArea.setEnabled(false); textArea.setSizeFull(); textArea.setValue(getSampleXml()); rightLayout.addComponent(textArea); rightLayout.setExpandRatio(textArea, 1.0f); splitPanel.setSecondComponent(rightLayout); addComponent(splitPanel); setExpandRatio(splitPanel, 1.0f); textArea.setReadOnly(readOnly); editor.setReadOnly(readOnly); }
@Override public boolean isClassSupportedForElementFactory(String classname) { return classname.equals(HorizontalSplitPanel.class.getName()) || classname.equals(VerticalSplitPanel.class.getName()); }
@Test public void testIsClassSupportedForElementFactory() throws Exception { assertThat(factory.isClassSupportedForElementFactory(HorizontalSplitPanel.class.getName())); assertThat(factory.isClassSupportedForElementFactory(VerticalSplitPanel.class.getName())); }
@Override public void attach() { super.attach(); // Setup the map in the findLayers pane splDivider = new HorizontalSplitPanel(); mainLayout = new VerticalLayout(); left = new VerticalLayout(); right = new VerticalLayout(); exportProps = new ExportProps(); mapModel = new MapModel(); // Views findLayers = new FindLayersViewComponent(); modifyLayers = new SetupMapViewComponent(); exportOptions = new ExportOptionsViewComponent(exportProps); mapToolbar = new MapToolbarViewComponent(); mapComponent = new OpenLayersMapViewComponent(); // Models setupMapModel = new SetupMapModel(this); // Presenters findLayersPresenter = new FindLayersPresenter(findLayers, mapComponent, mapModel); setupMapPresenter = new SetupMapPresenter(getSetupMapModel(), modifyLayers, mapComponent, mapModel); exportOptionsPresenter = new ExportOptionsPresenter(exportOptions); exportOptions.addListener(setupMapPresenter); refresher = new Refresher(); addComponent(refresher); setCaption("ExpressZip"); setSizeFull(); splDivider.setSplitPosition(351, UNITS_PIXELS); mainLayout.setSizeFull(); mainLayout.addComponent(mapToolbar); mainLayout.addComponent(splDivider); mainLayout.setExpandRatio(splDivider, 1f); splDivider.setSizeFull(); splDivider.addComponent(left); splDivider.addComponent(right); setContent(mainLayout); right.setSpacing(true); right.setSizeFull(); left.setSizeFull(); left.addComponent(findLayers); setTheme("ExpressZip"); // http://docs.geotools.org/latest/userguide/library/referencing/order.html System.setProperty("org.geotools.referencing.forceXY", "true"); right.addComponent(mapComponent); right.setExpandRatio(mapComponent, 1f); try { findLayersPresenter.paneEntered(); } catch (Exception e) { logger.error("Failed setting up map", e); showNotification("Setting Up Map Failed", "Check logs on server", Notification.TYPE_ERROR_MESSAGE); } }
public FilesViewerComponent(String directoryPath, boolean showDeleteButton, boolean showDownloadButton) { File directory = new File(directoryPath); if(!directory.exists()) { directory.mkdirs(); } fileContainer = new FilesystemContainer(directory); filesTable = new Table(); filesTable.setSizeFull(); filesTable.setImmediate(true); filesTable.setSelectable(true); filesTable.setColumnReorderingAllowed(true); filesTable.setColumnCollapsingAllowed(true); filesTable.addListener((ValueChangeListener) this); updateTable(); contentTable = new Table(); contentTable.setSizeFull(); contentTable.setSelectable(true); contentTable.setMultiSelect(true); VerticalLayout tableLayout = new VerticalLayout(); tableLayout.setSizeFull(); tableLayout.addComponent(contentTable); tableLayout.setExpandRatio(contentTable, 1f); deleteButton = new Button(Constants.uiDelete); deleteButton.setWidth("100%"); deleteButton.setEnabled(false); deleteButton.addListener((ClickListener) this); downloadButton = new Button(Constants.uiDownloadFile); downloadButton.setWidth("100%"); downloadButton.setEnabled(false); downloadButton.addListener((ClickListener) this); VerticalLayout buttonsLayout = new VerticalLayout(); buttonsLayout.setWidth("100px"); buttonsLayout.setSpacing(true); if(showDeleteButton) { buttonsLayout.addComponent(deleteButton); } if(showDownloadButton) { buttonsLayout.addComponent(downloadButton); } VerticalLayout firstLayout = new VerticalLayout(); firstLayout.setSizeFull(); firstLayout.setMargin(true); firstLayout.addComponent(filesTable); firstLayout.setExpandRatio(filesTable, 1f); HorizontalLayout secondLayout = new HorizontalLayout(); secondLayout.setSizeFull(); secondLayout.setMargin(true); secondLayout.setSpacing(true); secondLayout.addComponent(tableLayout); secondLayout.addComponent(buttonsLayout); secondLayout.setExpandRatio(tableLayout, 1f); HorizontalSplitPanel panel = new HorizontalSplitPanel(); panel.setSplitPosition(40); panel.setFirstComponent(firstLayout); panel.setSecondComponent(secondLayout); setCompositionRoot(panel); }
private void initLayout() { HorizontalSplitPanel splitPanel = new HorizontalSplitPanel(); VerticalLayout rulesOverview = new VerticalLayout(); splitPanel.addComponent(rulesOverview); splitPanel.addComponent(ruleEditor); rulesOverview.addComponent(rulesTable); rulesOverview.addComponent(addButton); rulesOverview.setSizeFull(); rulesOverview.setExpandRatio(rulesTable, 1); rulesTable.setSizeFull(); addButton.setWidth("100%"); ruleEditor.setMargin(true); ruleEditor.setVisible(false); splitPanel.setHeight("100%"); splitPanel.setMargin(true); splitPanel.setWidth("100%"); splitPanel.setSizeFull(); logPathField.addValidator(new AbstractStringValidator(null) { @Override protected boolean isValidString(String value) { try { if (value == null) { setErrorMessage("Invalid path: can not be null"); return false; } File file = new File(value); if (!file.exists()) { setErrorMessage("Invalid path"); return false; } File parent = new File(file.getParent()); return parent.canWrite() || file.canWrite(); } catch (Exception ex) { setErrorMessage("Invalid path: " + ex.getMessage()); return false; } } }); logPathField.setImmediate(true); logPathField.setWidth("100%"); logPathField.setValue(config.getLogFilePath()); VerticalLayout confLayout = new VerticalLayout(); confLayout.setMargin(true); confLayout.addComponent(logPathField); confLayout.addComponent(splitPanel); addComponent(confLayout); }
private void createLayout() { setSizeFull(); buildComponent = new BuildComponent(builder, user, settings); initMenuBar(); layout.addComponent(menu); menu.setWidth("100%"); split = new HorizontalSplitPanel(); split.setSizeFull(); layout.addComponent(split); layout.setExpandRatio(split, 1); sideBar = new VerticalLayout(); sideBar.setMargin(true); split.setFirstComponent(sideBar); sideBar.addComponent(componentTree); sideBar.addComponent(buildComponent); //adds delpoy component to view if (settings.paasDeployTurnedOn){ sideBar.addComponent(new DeployComponent(project, settings,user)); } sideBar.addComponent(new JettyComponent(project, user)); ChatBox cb = new ChatBox(project.getChat()); cb.setUser(new ChatUser(user.getUserId(), user.getName(), "user1")); cb.setWidth("100%"); cb.setShowSendButton(false); sideBar.addComponent(new Panel("Chat", cb)); split.setSplitPosition(20.0f); setActiveFile((ProjectFile) project.getProjectItem("App.java")); //adds new menuitem (that does not do anything) /*if (settings.easiCloudsFeaturesTurnedOn){ MenuItem root = this.menu.addItem("Deploy to...",null); MenuItem item = root.addItem("Jetty", null); item.setCheckable(true); item.setChecked(true); item = root.addItem("Gae", null); item.setCheckable(true); item.setChecked(false); }*/ }
private void initLayout() { // main container VerticalLayout container = new VerticalLayout(); container.setSizeFull(); setContent(container); container.setMargin(true); // header container.addComponent(header); initHeader(); // main content which contains photolist and image panel content.setSizeFull(); container.addComponent(content); // split panel in main content for photolist and image panel HorizontalSplitPanel split = new HorizontalSplitPanel(); content.addComponent(split); // header is 1:10 of the full container // container.setExpandRatio(header, 1); container.setExpandRatio(content, 1); content.setExpandRatio(split, 1); // Adding panels to split container split.addComponent(left); split.addComponent(right); left.addComponent(photoList); left.setSizeFull(); left.setExpandRatio(photoList, 1); // photolist expands photoList.setSizeFull(); split.setSplitPosition(33f); split.setSizeFull(); // setting footer for version info initFooter(); // set container for gallery data images.setBeanIdProperty("id"); // creating right side's image panel initImagePanel(); // show credits try { credits.setValue(service.getCredits()); } catch (Exception e) { Notification.show(e.getMessage(), "", Notification.Type.ERROR_MESSAGE); } }