/** * 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(); }
/** * Creates and adds a generic icon button. <br/> * * @param title button title (tooltip) * @param style button style name * @param lc button container * @param listener button listener * @return the configured button */ public IconButton addGenericIconButton(String title, String style, LayoutContainer lc, SelectionListener<IconButtonEvent> listener) { IconButton button = createGenericIconButton(title, style, listener); lc.add(button); return button; }
public static void onFailure(LayoutContainer container, Throwable caught, ClickHandler retryCallback) { LOGGER.log(Level.SEVERE, "Exception while loading reports contents", caught); container.el().unmask(); container.removeAll(); container.add(createRetryPanel(caught, retryCallback)); container.layout(); }
/** * Adds a widget to this Container. Fires the <i>BeforeAdd</i> event before * adding, then fires the <i>Add</i> event after the component has been added. * * @param widget the widget to add. If the widget is not a Component instance * it will be wrapped in a WidgetComponent * @param layoutData the layout data */ public boolean add(Widget widget, LayoutData layoutData) { return insert(widget, getItemCount(), layoutData); }
private void setWidget(Widget widget) { if (activeWidget != null) { container.remove(activeWidget); } container.add(widget, new BorderLayoutData(Style.LayoutRegion.CENTER)); activeWidget = widget; if (container.isRendered()) { container.layout(); } }
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 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); }
private void addSearchPanel(LocationTypeDTO locationType) { LayoutContainer container = new LayoutContainer(); container.setLayout(new FlowLayout()); container.setScrollMode(Scroll.AUTOY); container.addStyleName(SiteFormResources.INSTANCE.style().locationDialogPane()); container.add(newHeader(I18N.CONSTANTS.chooseLocation())); container.add(newExplanation(I18N.CONSTANTS.chooseLocationDescription())); container.add(formHeader = newHeader(I18N.CONSTANTS.searchLocations())); container.add(new LocationForm(dispatcher, locationType, searchPresenter, newLocationPresenter)); container.add(newHeader(I18N.CONSTANTS.searchResults())); container.add(new SearchListView(searchPresenter)); container.add(new SearchStatusView(searchPresenter)); container.add(addLocationHeader); container.add(addLocationHelp); container.add(addLocationButton);
/** * Adds an horizontal panel to the passed parent with: <ol> <li>a panel with FormLayout to the left, for * fields;</li> <li>a panel to the right, for icons.</li> </ol> * @param parent * @param withMarginBottom if <code>true</code>, adds a 10px margin bottom to the horizontal panel. * @return array with left container at index 0 and right container at index 1.<br/> */ public LayoutContainer[] addFieldContainerSkeleton(LayoutContainer parent, boolean withMarginBottom, int fieldWidth) { HorizontalPanel lc = new HorizontalPanel(); lc.setAutoHeight(true); lc.setBorders(false); if (withMarginBottom) { lc.addStyleName(styles.marginBottom10px()); } FormLayout formLayout = getStandardLayout(fieldWidth); LayoutContainer left = new LayoutContainer(formLayout); left.setAutoHeight(true); // make place for the invalid icon: left.setWidth(formLayout.getLabelWidth() + formLayout.getDefaultWidth() + 23); lc.add(left); LayoutContainer right = new HorizontalPanel(); right.setAutoHeight(true); right.addStyleName(styles.paddingLeft4px()); lc.add(right); parent.add(lc); return new LayoutContainer[] {left, right}; }
list.setScrollMode(Scroll.NONE); list.setShim(true); list.setShadow(true); list.setBorders(true); list.setStyleName(style); list.hide(); list.addStyleName("x-ignore"); list.add(listView);
layout.setCellPadding(5); LayoutContainer table = new LayoutContainer(); table.setLayout(layout); table.setAutoHeight(true); unitLabel.setStyleAttribute("fontSize", "9pt"); table.add(fieldLabel); table.add(field, fieldLayout); table.add(unitLabel, unitLayout);
layout.setLabelWidth(labelWidth); layout.setDefaultWidth(getFieldsDefaultWidth()); LayoutContainer lc = new LayoutContainer(layout); lc.setLayoutOnChange(true); LayoutContainer rc = new LayoutContainer(new RowLayout()); rc.setIntStyleAttribute(PADDING_LEFT, PADDING_LEFT_TOP_RIGHT_PANEL); hpTop.add(rc); RowData layoutData = new RowData(); layoutData.setMargins(new Margins(0, 0, MARGIN_BOTTOM, 0)); rc.add(bAdd, layoutData);
@Inject public CompositeEditor2(EventBus eventBus, AddElementPanel addPanel, Provider<ElementWidget> elementWidgetProvider) { this.elementWidgetProvider = elementWidgetProvider; page = new LayoutContainer(); page.addStyleName(ReportResources.INSTANCE.style().page()); add(page); this.addPanel = addPanel; this.addPanel.setCallback(this); page.add(addPanel); ReportResources.INSTANCE.style().ensureInjected(); setLayout(new CompositeEditorLayout()); setScrollMode(Scroll.AUTOY); setMonitorWindowResize(true); this.reportEventBus = new ReportEventBus(eventBus, this); }
public TolaPopup() { setLayoutOnChange(true); setShadow(true); setAutoHide(false); // Zmieniono podczas migracji do gxt 2.0-m1 // setEventPreview(false); innerPanel = new LayoutContainer(); innerPanel.setLayoutOnChange(true); innerPanel.setStyleName("tola-popup"); add(innerPanel); }
public VSplitFrameSet(PageId pageId, NavigationPanel navPanel) { this.pageId = pageId; this.container = new LayoutContainer(); this.navPanel = navPanel; container.setLayout(new BorderLayout()); addNavigationPanel(); }
private void onExpand(ContentPanel panel) { CollapsePanel cp = panel.getData("collapse"); if (cp != null && cp.getParent() == layoutContainer && fireEvent(Events.BeforeExpand, createBorderLaoutEvent(panel))) { boolean layoutOnChange = layoutContainer.isLayoutOnChange(); setLayoutOnChange(layoutContainer, false); cp.setExpanded(false); setCollapsed(panel, false); boolean isVisible = !isComponentHidden(cp); Map<String, Object> st = panel.getState(); st.remove("collapsed"); panel.saveState(); layoutContainer.remove(cp); layoutContainer.add(panel); panel.setVisible(isVisible); layout(); setLayoutOnChange(layoutContainer, layoutOnChange); if (GXT.isFocusManagerEnabled()) { panel.el().focus(); } fireEvent(Events.Expand, createBorderLaoutEvent(panel)); } }
lc.setStyleAttribute("position", "relative"); lc.add(f, data); lc.render(target, index); ComponentHelper.setParent(this, lc); setElement(lc.getElement());
private void switchPanels(ContentPanel panel) { BorderLayoutData data = (BorderLayoutData) getLayoutData(panel); layoutContainer.remove(panel); CollapsePanel cp = (CollapsePanel) panel.getData("collapse"); if (cp == null) { cp = createCollapsePanel(panel, data); } initPanel(panel); setCollapsed(panel, true); boolean layoutOnChange = layoutContainer.isLayoutOnChange(); setLayoutOnChange(layoutContainer, false); layoutContainer.add(cp); renderComponent(cp, 0, layoutContainer.getLayoutTarget()); if (layoutOnChange) { setLayoutOnChange(layoutContainer, true); } }
/** * Creates the details. */ private void createDetails() { details = new LayoutContainer(); details.setBorders(true); details.setStyleAttribute("backgroundColor", "white"); BorderLayoutData eastData = new BorderLayoutData(LayoutRegion.EAST, 150, 150, 250); eastData.setSplit(true); BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER); centerData.setMargins(new Margins(0, 5, 0, 0)); chooser.add(main, centerData); chooser.add(details, eastData); }
@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); }