public Widget[] getWidgets() { Widget[] widgets = new Widget[flowPanel.getWidgetCount()]; for (int k = 0; k < flowPanel.getWidgetCount(); k++) { widgets[k] = flowPanel.getWidget(k); } return widgets; }
public Widget[] getWidgets() { Widget[] widgets = new Widget[flow.getWidgetCount()]; for (int k = 0; k < flow.getWidgetCount(); k++) { widgets[k] = flow.getWidget(k); } return widgets; }
@Override public void onClick(ClickEvent event) { presenter.onLoadMoreHistory(history.getWidgetCount()); } });
/** Adapts menu's height depending on the amount of the child widgets. */ private void adaptMenuHeight() { final int visibleRowsCount = Math.min(MAX_VISIBLE_WIDGETS, contentPanel.getWidgetCount()); final int dropdownPanelHeight = CHILD_WIDGET_HEIGHT * visibleRowsCount; setHeight(dropdownPanelHeight + "px"); } }
/** * Removes the last cell */ public void removeLast() { flow.remove(flow.getWidgetCount() - 1); }
/** * This method gets an actual number of items displayed in the drop down. * * @return an item count. */ public int getItemCount() { return getList().getWidgetCount(); }
public Widget getContent(int index) { int cnt = 0; for (int i = 0; i < flow.getWidgetCount(); i++) { Widget w = flow.getWidget(i); if (isFlowWidgetInternal(w)) continue; if (cnt == index) return w; cnt++; } return null; }
/** * Hide all keyboard panels. */ public void hideTabs() { for (int i = 0; i < tabs.getWidgetCount(); i++) { tabs.getWidget(i).setVisible(false); } }
private void updateCellPercents() { for (int k = 0; k < flow.getWidgetCount(); k++) { Widget widget = flow.getWidget(k); prepareCellPercentStyle(k, widget); } }
public Widget getLastVisibleCell() { for (int i = flow.getWidgetCount() - 1; i >= 0; i--) { Widget w = flow.getWidget(i); String disp = w.getElement().getStyle().getDisplay(); if (disp == null || disp.isEmpty()) return w; if (Display.NONE.getCssName().equals(disp)) continue; return w; } return null; } }
public List<Widget> getAllVisibleCells() { List<Widget> rslt = null; for (int i = 0; i < flow.getWidgetCount(); i++) { Widget w = flow.getWidget(i); String disp = w.getElement().getStyle().getDisplay(); if (!Empty.is(disp) && Display.NONE.getCssName().equals(disp)) continue; if (rslt == null) rslt = new ArrayList<>(); rslt.add(w); } return rslt; }
public List<Widget> getAllVisibleCells() { List<Widget> rslt = null; for (int i = 0; i < flow.getWidgetCount(); i++) { Widget w = flow.getWidget(i); String disp = w.getElement().getStyle().getDisplay(); if (!Empty.is(disp) && Display.NONE.getCssName().equals(disp)) continue; if (rslt == null) rslt = new ArrayList<>(); rslt.add(w); } return rslt; }
@Override public int getTabIndex() { for (int i = 0; i < panel.getWidgetCount(); i++) { if (panel.getWidget(i) instanceof RadioButton) { return ((RadioButton) panel.getWidget(i)).getTabIndex(); } } return -1; }
@Override public void setAccessKey(final char pkey) { for (int i = 0; i < panel.getWidgetCount(); i++) { if (panel.getWidget(i) instanceof RadioButton) { ((RadioButton) panel.getWidget(i)).setAccessKey(pkey); return; } } }
@Override public void setFocus(final boolean pfocused) { if (this.flowPanel.getWidgetCount() > 0 && this.flowPanel.getWidget(0) instanceof Focusable) { ((Focusable) this.flowPanel.getWidget(0)).setFocus(pfocused); } }
public void setEnabled( Object obj, boolean fEnabled ) { for( int i = 0; i < panel.getWidgetCount(); i++ ) { Button b = (Button) panel.getWidget( i ); if( b.getElement().getPropertyObject( "object" ) == obj ) b.setEnabled( fEnabled ); } }
/** {@inheritDoc} */ @Override public void onClose(Notification notification) { for (int i = 0; i < notificationContainer.getWidgetCount(); i++) { Widget child = notificationContainer.getWidget(i); if (child instanceof NotificationPopup && notification.equals(((NotificationPopup) child).getNotification())) { child.removeFromParent(); } } }
@Test public void testGetItemByUuidChildren() { final TreeItem item = mock(TreeItem.class); when(item.getItemByUuid(ITEM_VALUE)).thenReturn(item); when(content.getWidgetCount()).thenReturn(1); when(content.getWidget(eq(0))).thenReturn(item); final TreeItem treeItemTest = testedRoot.getItemByUuid(ITEM_VALUE); assertEquals(treeItemTest, item); } }
@Test public void testGetItem() { final TreeItem item1 = mock(TreeItem.class); when(container.getWidgetCount()).thenReturn(1); when(container.getWidget(eq(0))).thenReturn(item1); testedTree.addItem(item1); verify(container, times(1)).add(eq(item1)); assertEquals(testedTree.getItem(0), item1); }
public void selectButton( Object obj ) { for( int i = 0; i < panel.getWidgetCount(); i++ ) { Button b = (Button) panel.getWidget( i ); if( b.getElement().getPropertyObject( "object" ) == obj ) b.addStyleName( "Ribbon-selected" ); else b.removeStyleName( "Ribbon-selected" ); } }