/** * Creates a new layout container. * * @param layout the layout */ public LayoutContainer(Layout layout) { this(); setLayout(layout); }
/** * Creates a new portal container. * * @param numColumns the number of columns */ public Portal(int numColumns) { this.numColumns = numColumns; cl = new ColumnLayout(); cl.setAdjustForScroll(true); setLayout(cl); setScrollMode(Scroll.AUTO); baseStyle = "x-portal"; enableLayout = true; for (int i = 0; i < numColumns; i++) { LayoutContainer l = new LayoutContainer(); l.addStyleName("x-portal x-portal-column"); l.setStyleAttribute("minHeight", "20px"); l.setStyleAttribute("padding", spacing + "px 0 0 " + spacing + "px"); l.setLayout(new RowLayout()); l.setLayoutOnChange(true); add(l); } listener = createDragListener(); }
public VSplitFrameSet(PageId pageId, NavigationPanel navPanel) { this.pageId = pageId; this.container = new LayoutContainer(); this.navPanel = navPanel; container.setLayout(new BorderLayout()); addNavigationPanel(); }
private void createGridContainer() { center = new LayoutContainer(); center.setLayout(new BorderLayout()); add(center, new BorderLayoutData(Style.LayoutRegion.CENTER)); gridPanel = new PivotGridPanel(service); gridPanel.setHeaderVisible(true); gridPanel.setHeadingText(I18N.CONSTANTS.preview()); center.add(gridPanel, new BorderLayoutData(Style.LayoutRegion.CENTER)); viewBinder = new PivotTableBinder(eventBus, service, gridPanel); }
@Override protected void addSourceField(final LayoutContainer lc, LayoutContainer rc) { lc.setLayout(new ColumnLayout()); // a void label for the suggest box. Text label = new Text(getFieldLabel()); label.addStyleName("generic-label"); label.setWidth(getLabelWidth()); lc.add(label); // the suggest box. suggestBox = new SuggestBox(suggestList); suggestBox.addStyleName("x-form-field"); suggestBox.addStyleName("x-form-text"); suggestBox.addStyleName("x-form-item"); lc.add(suggestBox); }
private void addGalley() { linkButton = new ToggleButton("", IconImageBundle.ICONS.link()); linkButton.disable(); linkButton.setWidth(28); linkButton.setHeight(40); linkButton.addSelectionListener(new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { onToggleLink(); } }); linkButtonTip = new ToolTip(linkButton); LayoutContainer container = new LayoutContainer(); container.setWidth(35); container.add(linkButton); container.setLayout(new BoxLayout() { @Override protected void onLayout(Container<?> container, El target) { super.onLayout(container, target); Size size = target.getStyleSize(); innerCt.setSize(size.width, size.height, true); Component c = container.getItem(0); int ch = c.getOffsetHeight(); setPosition(c, 5, ((int) (size.height * 0.65)) - (ch / 2)); } }); add(container); }
private void addNewLocationButtons() { int buttonWidth = (FIELD_WIDTH - BUTTON_SPACE) / 2; Button saveButton = new Button(I18N.CONSTANTS.useNewLocation(), IconImageBundle.ICONS.save(), new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { saveNewLocation(); } }); saveButton.setWidth(buttonWidth); Button cancelButton = new Button(I18N.CONSTANTS.cancel(), new SelectionListener<ButtonEvent>() { @Override public void componentSelected(ButtonEvent ce) { newLocationPresenter.setActive(false, true); } }); cancelButton.setWidth(buttonWidth); newFormButtonContainer = new LayoutContainer(); newFormButtonContainer.setWidth(FIELD_WIDTH); newFormButtonContainer.setLayout(new HBoxLayout()); newFormButtonContainer.add(saveButton); newFormButtonContainer.add(cancelButton, new HBoxLayoutData(0, 0, 0, BUTTON_SPACE)); add(newFormButtonContainer, buttonLayout()); setNewFormActive(false); }
private void addMixedGroup(IndicatorGroup group) { // Layout in two rows // Field Label // Field Widget for (IndicatorDTO indicator : group.getIndicators()) { if(!indicator.isCalculated() && indicator.isVisible()) { Text fieldLabel = createLabel(indicator); fieldLabel.setStyleAttribute("marginTop", "8px"); fieldLabel.setStyleAttribute("marginBottom", "3px"); add(fieldLabel); TextField field = createField(indicator); if(indicator.getType() == FieldTypeClass.QUANTITY) { HBoxLayout rowLayout = new HBoxLayout(); rowLayout.setHBoxLayoutAlign(HBoxLayout.HBoxLayoutAlign.MIDDLE); Text unitsLabel = new Text(indicator.getUnits()); unitsLabel.setStyleAttribute("paddingLeft", "5px"); LayoutContainer row = new LayoutContainer(); row.setLayout(rowLayout); row.add(field); row.add(unitsLabel); add(row); } else { field.setWidth(TEXT_FIELD_WIDTH); add(field); } } } }
table.setLayout(layout); table.setAutoHeight(true);
center.setLayout(new BorderLayout());
layout.setVBoxLayoutAlign(VBoxLayoutAlign.CENTER); layout.setPack(BoxLayoutPack.CENTER); c.setLayout(layout);
private void addSearchPanel(LocationTypeDTO locationType) { container.setLayout(new FlowLayout()); container.setScrollMode(Scroll.AUTOY); container.addStyleName(SiteFormResources.INSTANCE.style().locationDialogPane());
sectionContainer.setLayout(sectionLayout);