public void chngeNdeWdgtToEnable() { for (int i = 0; i < nodeContainer.getWidgetCount(); i++) { if (((NodeWidget) nodeContainer.getWidget(i)).isSelected) { // ((NodeWidget)nodeContainer.getWidget(i)).enableEndpoint(); ((NodeWidget) nodeContainer.getWidget(i)).isSelected = false; // ((NodeWidget)nodeContainer.getWidget(i)).disableEndpoint(); ((NodeWidget) nodeContainer.getWidget(i)).enableEndpoint(); } } }
@Override public void setActBtn(int i, String text, String actionName, boolean visible) { try { actBar.getWidget(i); } catch (IndexOutOfBoundsException e) { initializeActBtns(i + 1); } ActBtn actBtn = (ActBtn) actBar.getWidget(i); actBtn.setText(text); actBtn.actionName = actionName; actBtn.setVisible(visible); }
public void hide() { int wdgtCnt = priLvlCntnrWdgt.getWidgetCount(); for (int i = 0; i < wdgtCnt; i++) { if (priLvlCntnrWdgt.getWidget(i) instanceof SwitchButton) { if (!((SwitchButton) priLvlCntnrWdgt.getWidget(i)).isEnable()) { ((SwitchButton) priLvlCntnrWdgt.getWidget(i)).enable(); } } } mainPnl.getElement().getStyle().setDisplay(Display.NONE); visible = false; }
private boolean checkPriLvlSlctd() { boolean slctd = false; int wdgtCnt = priLvlCntnrWdgt.getWidgetCount(); for (int i = 0; i < wdgtCnt; i++) { if (priLvlCntnrWdgt.getWidget(0) instanceof SwitchButton) { if (!((SwitchButton) priLvlCntnrWdgt.getWidget(i)).isEnable()) { return true; } } } return slctd; }
private int getIndxOfSlctdWdgt() { int indx = 0; int wdgtCnt = priLvlCntnrWdgt.getWidgetCount(); for (int i = 0; i < wdgtCnt; i++) { if (priLvlCntnrWdgt.getWidget(i) instanceof SwitchButton) { if (!((SwitchButton) priLvlCntnrWdgt.getWidget(i)).isEnable()) { ((SwitchButton) priLvlCntnrWdgt.getWidget(i)).enable(); return i; } } } return indx; }
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"); } }
@Override public void reset() { hLb.setText("Thai SME Accounting"); for (int i = 0; i < actBar.getWidgetCount(); i++) { actBar.getWidget(i).setVisible(false); } }
@Override public void setLoading() { hLb.setText(constants.loading()); for (int i = 0; i < actBar.getWidgetCount(); i++) { actBar.getWidget(i).setVisible(false); } }
/** * Mark the list item with the given ID. * * @param pItemId item ID */ @SuppressWarnings("unchecked") public void setMarked(final String pItemId) { if (LOG.isTraceEnabled()) { LOG.enter( "setMarked", //$NON-NLS-1$ new String[] {"pItemId"}, new Object[] {pItemId}); // $NON-NLS-1$ } boolean clear = pItemId == null || pItemId.equals( getIdFromWidget( ((CbGenericListItem<W>) iGuiList.getWidget(iMarkedIdx)).getDisplayWidget())); clearMarker(); if (pItemId != null && !clear) { int idx = 0; for (Iterator<Widget> iter = iGuiList.iterator(); iter.hasNext(); idx++) { CbGenericListItem<W> gli = (CbGenericListItem<W>) iter.next(); W w = gli.getDisplayWidget(); if (pItemId.equals(getIdFromWidget(w))) { setMarked(idx); break; } } } LOG.exit("setMarked"); // $NON-NLS-1$ }
protected void movePrevious() { Slide to = getSlide(_current); Slide from = (Slide) _panel.getWidget(0); Transition transition = Transition.SLIDE; ValueChangeEvent.fire(this, false); transition.start(from, to, _panel, true); }
public String getValue() { String tagString = ""; for (int loop = 0; loop < tags.getWidgetCount(); loop++) { tagString += ((TagDisplay) tags.getWidget(loop)).getTag() + DELIMITER; } return tagString.substring(0, tagString.length() - 1); }
/** * Select an item. * * @param item the item. */ private void selectItem(final Label item) { if (activeItemIndex != null) { hashTags.getWidget(activeItemIndex).removeStyleName(style.activeHashTag()); } item.addStyleName(style.activeHashTag()); activeItemIndex = hashTags.getWidgetIndex(item); }
public String getButtonText(Object obj) { for (int i = 0; i < panel.getWidgetCount(); i++) { Button b = (Button) panel.getWidget(i); if (b.getElement().getPropertyObject("object") == obj) return b.getText(); } return null; }
@Override public void onTransitionEnd() { for (int i = 0; i < _panel.getWidgetCount(); i++) { Widget w = _panel.getWidget(i); if (Utils.isSubclassOf(w.getClass(), WidgetBase.class)) { ((WidgetBase) w).onTransitionEnd(); } } }
/** * @param index index of row to be selected * @param forceExpand whether the selected row shall be expanded * @return whether the index exists */ protected boolean setSelectedIndex(int index, boolean forceExpand) { try { RowWidget w = (RowWidget) flowPanel.getWidget(index); setSelectedKey(w.getKey(), forceExpand); return true; } catch (Exception e) { return false; } }
/** * Mark the list item at the given position. * * @param pRowIdx item index */ @SuppressWarnings("unchecked") private void setMarked(final int pRowIdx) { boolean clear = pRowIdx < 0 || pRowIdx >= iGuiList.getWidgetCount() || pRowIdx == iMarkedIdx; clearMarker(); if (!clear) { ((CbGenericListItem<W>) iGuiList.getWidget(pRowIdx)).setMarkerVisible(true); iMarkedIdx = pRowIdx; iBtnDeleteItem.setEnabled(true); if (iBtnEditItem != null) { iBtnEditItem.setEnabled(true); } } }
@SuppressWarnings("unchecked") private void clearMarker() { if (iMarkedIdx >= 0) { if (iMarkedIdx < iGuiList.getWidgetCount()) { // (else the widget is already deleted) ((CbGenericListItem<W>) iGuiList.getWidget(iMarkedIdx)).setMarkerVisible(false); } iMarkedIdx = -1; iBtnDeleteItem.setEnabled(false); if (iBtnEditItem != null) { iBtnEditItem.setEnabled(false); } } }
/** * Getter. * * @return the ID of the marked entry */ @SuppressWarnings("unchecked") public String getMarkedID() { LOG.enter("getMarkedID"); // $NON-NLS-1$ if (LOG.isDetailEnabled()) { LOG.detail( "getMarkedID", //$NON-NLS-1$ "iMarkedIdx = " + iMarkedIdx); // $NON-NLS-1$ } String result = null; if (iMarkedIdx >= 0 && iMarkedIdx < iGuiList.getWidgetCount()) { result = getIdFromWidget( ((CbGenericListItem<W>) iGuiList.getWidget(iMarkedIdx)).getDisplayWidget()); } LOG.exit("getMarkedID", result); // $NON-NLS-1$ return result; }
protected void handleTextAreaClick( FlowPanel flowPanel, DoubleClickEvent event, TextArea critReftextArea, ScrollPanel scrollPanel) { int textAreaCount = flowPanel.getWidgetCount(); String idString = critReftextArea.getText(); int idStart = idString.indexOf("<id"); int idEnd = idString.indexOf("/>", idStart); idString = idString.substring(idStart, idEnd + "/>".length()); String extension = idString.substring(idString.indexOf("extension")); extension = extension.substring(0, extension.indexOf("root")); extension = extension.trim(); String root = idString.substring(idString.indexOf("root")); root = root.substring(0, root.indexOf("/>")); root = root.trim(); for (int i = 0; i < textAreaCount; i++) { TextArea textArea = (TextArea) flowPanel.getWidget(i); if (textArea.getStyleName().indexOf("entry_background") == -1) { continue; } String text = textArea.getText(); if (text.indexOf(root) > -1 && text.indexOf(extension) > -1) { DOM.scrollIntoView(textArea.getElement()); break; } } System.out.println("Done."); }
/** * Returns the widget at the given position. * * <p> * * @param index the position * @return the widget at the given position */ public Widget getWidget(int index) { return m_primary.getWidget(index); }
/** * Sets the additional info value label at the given position. * * <p> * * @param index the additional info index * @param label the new value to set */ public void setAdditionalInfoValue(int index, String label) { ((AdditionalInfoItem) m_additionalInfo.getWidget(index)).getValueLabel().setText(label); }
/** * Returns the button at the given position. * * <p> * * @param index the button index * @return the button at the given position */ public Widget getButton(int index) { return m_buttonPanel.getWidget(index); }
@Override public void setActBtnVisible(int i, boolean visible) { ActBtn actBtn = (ActBtn) actBar.getWidget(i); actBtn.setVisible(visible); }
@SuppressWarnings("unchecked") public W getDisplayWidget() { return (W) iDisplayWidgetWrapper.getWidget(0); }
public void setButtonText(Object obj, String text) { for (int i = 0; i < panel.getWidgetCount(); i++) { Button b = (Button) panel.getWidget(i); if (b.getElement().getPropertyObject("object") == obj) b.setText(text); } }
/** * Setter. * * @param pVisible <code>true</code> if the selector (marker) should be visisble */ public void setMarkerVisible(final boolean pVisible) { FlowPanel fp = (FlowPanel) getWidget(); fp.getWidget(COL_SELECTOR).setVisible(pVisible); fp.getWidget(COL_SELECTOR + 1).setVisible(!pVisible); }
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); } }
/** * @param index index * @return {@link RowWidget} by its index */ protected RowWidget getRow(int index) { return (RowWidget) flowPanel.getWidget(index); }
private void clearAnswerOptionsContainer() { int widgetCount = questionContainer.getWidgetCount(); if (widgetCount > 1) { questionContainer.getWidget(widgetCount - 1).removeFromParent(); } }