protected void prependButton(Button button) { buttonsPanel.insert(button, 0); }
public void insert(IsWidget w, int beforeIndex) { insert(asWidgetOrNull(w), beforeIndex); }
public void insert(Widget w, int beforeIndex) { checkIndexBoundsForInsertion(beforeIndex); /* * The case where we reinsert an already existing child is tricky. * * For the WIDGET, it ultimately removes first and inserts second, so we * have to adjust the index within ComplexPanel.insert(). But for the DOM, * we insert first and remove second, which means we DON'T need to adjust * the index. */ Element td = createAlignedTd(); DOM.insertChild(tableRow, td, beforeIndex); insert(w, td, beforeIndex, false); }
/** * Inserts a new tab at the specified index. * * @param widget widget to be used in the new tab * @param beforeIndex the index before which this tab will be inserted */ protected void insertTabWidget(Widget widget, int beforeIndex) { checkInsertBeforeTabIndex(beforeIndex); ClickDelegatePanel delWidget = new ClickDelegatePanel(widget); delWidget.setStyleName(STYLENAME_DEFAULT); // Add a11y role "tab" SimplePanel focusablePanel = delWidget.getFocusablePanel(); Roles.getTabRole().set(focusablePanel.getElement()); panel.insert(delWidget, beforeIndex + 1); setStyleName(DOM.getParent(delWidget.getElement()), STYLENAME_DEFAULT + "-wrapper", true); }
@Override public void setWidget( Widget widget ) { if( this.widget != null ) panel.remove( 0 ); if( widget != null ) panel.insert( widget, 0 ); this.widget = widget; } }
@Override protected void insert(Widget widget, int beforeIndex) { if (dropTarget instanceof HorizontalPanel) { ((HorizontalPanel) dropTarget).insert(widget, beforeIndex); } else { ((VerticalPanel) dropTarget).insert(widget, beforeIndex); } }
@Override public void setWidget( Widget widget ) { if( this.widget != null ) panel.remove( 0 ); if( widget != null ) panel.insert( widget, 0 ); this.widget = widget; } }
public void insert(IsWidget w, int beforeIndex) { insert(asWidgetOrNull(w), beforeIndex); }
public void insert(IsWidget w, int beforeIndex) { insert(asWidgetOrNull(w), beforeIndex); }
protected void setupToolbar() { HasWidgets rightToolbar = table.getRightToolbar(); if (rightToolbar instanceof HorizontalPanel) { ((HorizontalPanel) rightToolbar).insert(exportToCsvButton, 0); ((HorizontalPanel) rightToolbar).insert(exportToXlsButton, 1); } else { rightToolbar.add(exportToCsvButton); rightToolbar.add(exportToXlsButton); } }
protected void setupToolbar() { HasWidgets rightToolbar = table.getRightToolbar(); if (rightToolbar instanceof HorizontalPanel) { ((HorizontalPanel) rightToolbar).insert(exportToCsvButton, 0); ((HorizontalPanel) rightToolbar).insert(exportToXlsButton, 1); } else { rightToolbar.add(exportToCsvButton); rightToolbar.add(exportToXlsButton); } }
public void insert(Widget w, int beforeIndex) { checkIndexBoundsForInsertion(beforeIndex); /* * The case where we reinsert an already existing child is tricky. * * For the WIDGET, it ultimately removes first and inserts second, so we * have to adjust the index within ComplexPanel.insert(). But for the DOM, * we insert first and remove second, which means we DON'T need to adjust * the index. */ Element td = createAlignedTd(); DOM.insertChild(tableRow, td, beforeIndex); insert(w, td, beforeIndex, false); }
public void insert(Widget w, int beforeIndex) { checkIndexBoundsForInsertion(beforeIndex); /* * The case where we reinsert an already existing child is tricky. * * For the WIDGET, it ultimately removes first and inserts second, so we * have to adjust the index within ComplexPanel.insert(). But for the DOM, * we insert first and remove second, which means we DON'T need to adjust * the index. */ Element td = createAlignedTd(); DOM.insertChild(tableRow, td, beforeIndex); insert(w, td, beforeIndex, false); }
public void initialise(String title, Image image, MenuImageLocation imgLoc) { titleLayout.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); titleLabel.setText(title); titleImage = image; titleLayout.add(titleLabel); if (imgLoc == MenuImageLocation.RIGHT) { titleLayout.add(titleImage); } else { titleLayout.insert(titleImage, 0); } menu.setImageLocation(imgLoc); init(); }
public StylishDropDown(String title, Image image, MenuImageLocation imgLoc){ titleLayout.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); titleLabel.setText(title); titleImage = image; titleLayout.add(titleLabel); if(imgLoc == MenuImageLocation.RIGHT){ titleLayout.add(titleImage); } else{ titleLayout.insert(titleImage, 0); } menu.setImageLocation(imgLoc); init(); }
/** * Inserts a new tab at the specified index. * * @param widget widget to be used in the new tab * @param beforeIndex the index before which this tab will be inserted */ protected void insertTabWidget(Widget widget, int beforeIndex) { checkInsertBeforeTabIndex(beforeIndex); ClickDelegatePanel delWidget = new ClickDelegatePanel(widget); delWidget.setStyleName(STYLENAME_DEFAULT); // Add a11y role "tab" SimplePanel focusablePanel = delWidget.getFocusablePanel(); Roles.getTabRole().set(focusablePanel.getElement()); panel.insert(delWidget, beforeIndex + 1); setStyleName(DOM.getParent(delWidget.getElement()), STYLENAME_DEFAULT + "-wrapper", true); }
public void onClick(ClickEvent clickEvent) { setExpanded(!isExpanded()); HorizontalPanel panel = getPanel(); panel.remove(getImage()); createImage(); panel.insert(getImage(), 0); panel.setCellWidth(getImage(), "1%"); if (!isLeaf()) ((ExpandCellEventProducer)getGrid()).fireExpandCell(cell); } });
protected void indent(HorizontalPanel widget, TreeTableItem item) { boolean first = true; while (item.getParent() != null) { Widget spacer = createSpacer(item); if (first) { spacer.setStylePrimaryName(treeTable.getResources().getStyle().css().treeTableIndent()); first = false; } else { spacer.setStylePrimaryName(treeTable.getResources().getStyle().css().treeTableIndentUp()); } widget.insert(spacer, 0); item = item.getParent(); } } }