private void addColumn(Object columnHeading) { Widget widget = createCellWidget(columnHeading); int cell = flexTable.getCellCount(HEADER_ROW_INDEX); widget.setWidth("100%"); widget.addStyleName("FlexTable-ColumnLabel"); flexTable.setWidget(HEADER_ROW_INDEX, cell, widget); flexTable.getCellFormatter().addStyleName(HEADER_ROW_INDEX, cell, "FlexTable-ColumnLabelCell"); }
protected Widget addRemoveButton(Widget w, ClickHandler listener) { DirtyableHorizontalPane horiz = new DirtyableHorizontalPane(); final Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall(); remove.setAltText(Constants.INSTANCE.RemoveThisBlockOfData()); remove.setTitle(Constants.INSTANCE.RemoveThisBlockOfData()); remove.addClickHandler(listener); horiz.setWidth("100%"); w.setWidth("100%"); horiz.add(w); if (!this.readOnly) { horiz.add(remove); } return horiz; }
protected void layoutButtons(String distribution) { navButtonsBottom.clear(); navButtonsTop.clear(); DockPanel[] panels = { topButtonsRow0, topButtonsRow1, topButtonsRow2, bottomButtonsRow0, bottomButtonsRow1, bottomButtonsRow2, leftButtons, rightButtons }; String s[] = distribution.split("[;:,]"); Widget w = null, m = null; for (int i = 0; i < panels.length && i < s.length; i++) { DockPanel p = panels[i]; p.clear(); if (s[i].length() == 0) continue; for (int j = 0; j < s[i].length(); j++) { if ((w = getButton(s[i], j)) != null) { p.add(w, p != rightButtons ? DockPanel.WEST : DockPanel.EAST); } if (j == s[i].length() / 2) m = w; } if (!p.iterator().hasNext()) continue; p.setWidth("100%"); if (p != leftButtons && p != rightButtons) { if (m != null) { p.setCellWidth(m, "100%"); m.setWidth("100%"); } } if (i < 3) navButtonsTop.add(p, DockPanel.NORTH); else if (i < 6) navButtonsBottom.add(p, DockPanel.NORTH); if (i < 6) p.addStyleName(StyleCButtonsRow + (i % 3)); } }
public ProgressIndicatorWidget(Widget widget) { managedObject = widget; buttonPanel = new DeckPanel(); buttonPanel.add(managedObject); buttonPanel.setWidth("100%"); buttonPanel.setHeight("100%"); managedObject.setWidth("auto"); managedObject.setStylePrimaryName("pentaho-button"); Image image = new Image(GWT.getModuleBaseURL() + "images/progress_spinner.gif"); // $NON-NLS-1$ image.setStylePrimaryName("progress-image"); image.setWidth("auto"); image.setHeight("auto"); buttonPanel.add(image); buttonPanel.setStylePrimaryName("progress-indicator-button"); this.setWidget(buttonPanel); this.setHeight("100%"); this.setWidth("auto"); buttonPanel.showWidget(UNPRESSED_DECK); }
/** * We control size by setting our child widget's size. However, if we don't currently have a * child, we record the size the user wanted so that when we do get a child, we can set it * correctly. Until size is explicitly cleared, any child put into the popup will be given that * size. */ void maybeUpdateSize() { // For subclasses of PopupPanel, we want the default behavior of setWidth // and setHeight to change the dimensions of PopupPanel's child widget. // We do this because PopupPanel's child widget is the first widget in // the hierarchy which provides structure to the panel. DialogBox is // an example of this. We want to set the dimensions on DialogBox's // FlexTable, which is PopupPanel's child widget. However, it is not // DialogBox's child widget. To make sure that we are actually getting // PopupPanel's child widget, we have to use super.getWidget(). Widget w = super.getWidget(); if (w != null) { if (desiredHeight != null) { w.setHeight(desiredHeight); } if (desiredWidth != null) { w.setWidth(desiredWidth); } } }