public BalanceSheetMain() { hsp = new HorizontalSplitPanel(); hsp.setSplitPosition(12, Sizeable.UNITS_PERCENTAGE); hsp.setSizeFull(); hsp.setLocked(true); addComponent(hsp); VerticalLayout vl = new VerticalLayout(); vl.setSpacing(true); vl.setStyleName("side-panel"); addNewBalanceSheet = new Button(); addNewBalanceSheet.setStyleName(BaseTheme.BUTTON_LINK); addNewBalanceSheet.setIcon(IconManager.getIcon(IconManager.ADD_NEW_BALANCE_SHEET)); addNewBalanceSheet.addListener( new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { AccountsApplication.getInstance() .getMainWindow() .addWindow(new CreateNewBalanceSheet()); } }); vl.addComponent(addNewBalanceSheet); vl.setComponentAlignment(addNewBalanceSheet, Alignment.MIDDLE_CENTER); closeBalanceSheet = new Button(); closeBalanceSheet.setStyleName(BaseTheme.BUTTON_LINK); closeBalanceSheet.setIcon(IconManager.getIcon(IconManager.CLOSE_BALANCE_SHEET)); closeBalanceSheet.addListener( new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { AccountsApplication.getInstance().getMainWindow().addWindow(new CloseBalanceSheet()); } }); vl.addComponent(closeBalanceSheet); vl.setComponentAlignment(closeBalanceSheet, Alignment.MIDDLE_CENTER); hsp.addComponent(vl); hsp.addComponent(generateMyBalanceSheetContent()); hsp.setSizeFull(); addComponent(hsp); setExpandRatio(hsp, 1); buildStringsFromLocale(); }
@Override public void initUI() { this.setSizeFull(); this.setSpacing(true); HorizontalSplitPanel hl = new HorizontalSplitPanel(); hl.setSplitPosition(20, Unit.PERCENTAGE); hl.setSizeFull(); hl.setLocked(false); hl.addStyleName(Runo.SPLITPANEL_SMALL); getProjectsList().setSizeFull(); VerticalLayout vl = new VerticalLayout(); vl.setSizeFull(); vl.setSpacing(true); vl.setMargin(true); vl.addComponent(getDateSelector()); vl.addComponent(getReportsComponent()); vl.setExpandRatio(getReportsComponent(), 1.0f); hl.addComponent(getProjectsList()); hl.addComponent(vl); this.addComponent(hl); }
private HorizontalSplitPanel createBrowserPanel() { VerticalSplitPanel contentPanel = createContentPanel(); HorizontalSplitPanel browserPanel = new HorizontalSplitPanel(); browserPanel.setSplitPosition(30); browserPanel.addComponent(mTreeView); browserPanel.addComponent(contentPanel); browserPanel.setSizeFull(); return browserPanel; }
/** {@inheritdoc} */ @Override public void init() { // Add a horizontal SplitPanel to the lower area final HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setSplitPosition(150, Sizeable.UNITS_PIXELS); horizontalSplitPanel.setSizeFull(); final Window mainWindow = new Window("NodeGraph Widget Application"); final Button openWindow = new Button("Open diagram"); openWindow.addListener( new Button.ClickListener() { /** */ private static final long serialVersionUID = -1522261898787739587L; /** {@inheritdoc} */ @Override public void buttonClick(ClickEvent event) { final Window subwindow = new Window("Node Graph Widget"); subwindow.setWidth("850px"); subwindow.setHeight("500px"); subwindow.setModal(true); final VerticalLayout layout = (VerticalLayout) subwindow.getContent(); layout.setMargin(true); layout.setSpacing(true); layout.setSizeFull(); final GraphComponent nodeGraphWidget = getNodeGraph(); layout.addComponent(nodeGraphWidget); mainWindow.addWindow(subwindow); } }); final HorizontalLayout hl = new HorizontalLayout(); hl.setSizeFull(); horizontalSplitPanel.setFirstComponent(openWindow); horizontalSplitPanel.setSecondComponent(hl); mainWindow.setContent(horizontalSplitPanel); mainWindow.setSizeFull(); this.setMainWindow(mainWindow); }
@Override public void enter(ViewChangeEvent event) { layout = new HorizontalSplitPanel(); layout.setSizeFull(); layout.setSplitPosition(20); layout.setFirstComponent(getOptionsPanel()); VerticalLayout splash = new VerticalLayout(); splash.setMargin(true); Label label = new Label("<font size='4' > Select filters and click 'Show' to generate a report</font>"); splash.addComponent(label); label.setContentMode(ContentMode.HTML); layout.setSecondComponent(splash); this.addComponent(layout); }
public LookAndFeelLayout(BeanFieldGroup<DiagrammePreference> preferences) { super(preferences); addComponent(splitLayout); chartSplit.addComponent(chartContainer); chartSplit.addComponent(btnPreview); btnPreview.setIcon(FontAwesome.PLAY); chartSplit.setComponentAlignment(chartContainer, Alignment.MIDDLE_CENTER); chartSplit.setExpandRatio(chartContainer, 1f); chartSplit.setSizeFull(); colourContainer.setSizeFull(); splitLayout.setSizeFull(); splitLayout.addComponent(chartSplit); splitLayout.setSplitPosition(70f); splitLayout.addComponent(colourContainer); bindHandlers(); }
public TreeTableOrganization() { setSizeFull(); treetable = new TreeTable(); treetable.setSizeFull(); treetable.setSelectable(true); treetable.setMultiSelect(false); treetable.addListener(this); treetable.setImmediate(true); treetable.setValue(null); setMargin(true); // Add Table columns treetable.addContainerProperty(NAME_PROPERTY, String.class, ""); fillTable(treetable); treetable.addListener( new ExpandListener() { private static final long serialVersionUID = 1L; public void nodeExpand(ExpandEvent event) { Object valuePropertyEvent = event.getItemId(); Organization org = AdminServiceProvider.get().findOrganizationById((Long) valuePropertyEvent); Set<Organization> childs = org.getOrganizations(); if (!(childs.isEmpty())) { treetable.setChildrenAllowed((Long) valuePropertyEvent, true); for (Organization o : childs) { treetable.addItem(new Object[] {o.getName()}, o.getId()); } for (Organization o : childs) { treetable.setParent(o.getId(), (Long) valuePropertyEvent); } for (Organization o : childs) { treetable.setChildrenAllowed(o.getId(), !(o.getOrganizations().isEmpty())); } } } }); treetable.addListener( new CollapseListener() { private static final long serialVersionUID = 1L; public void nodeCollapse(CollapseEvent event) { Set<Object> delete = new HashSet<Object>(); Collection<?> children = treetable.getChildren(event.getItemId()); if (children != null) { for (Object child : children) { removeRecursively(child, delete); } } for (Object o : delete) { treetable.setCollapsed(o, true); treetable.removeItem(o); } } private void removeRecursively(Object object, Set<Object> delete) { Collection<?> children = treetable.getChildren(object); if (children != null) { for (Object child : children) { removeRecursively(child, delete); } } delete.add(object); } }); panel.setStyleName(Reindeer.PANEL_LIGHT); panel.setSizeFull(); panel.addComponent(new ButtonCreateOrganization(treetable)); final HorizontalSplitPanel horiz = new HorizontalSplitPanel(); horiz.setSplitPosition(25); // percent horiz.setSizeFull(); addComponent(horiz); horiz.addComponent(treetable); horiz.addComponent(panel); }