/** * Get the input element in edit mode. */ private InputElement getInputElement(Element parent) { return parent.getFirstChild().<InputElement> cast(); }
protected void doAllWidths(List<Integer> ws, int tw) { if (!enableGrouping) return; NodeList<Element> gs = getGroups(); for (int i = 0, len = gs.getLength(); i < len; i++) { Element s = gs.getItem(i).getChildNodes().getItem(2).cast(); El.fly(s).setWidth(tw); if (s.getFirstChild() == null) return; El.fly(s.getFirstChildElement()).setWidth(tw); TableSectionElement tse = s.getFirstChildElement().cast(); NodeList<Element> cells = tse.getRows().getItem(0).getChildNodes().cast(); for (int j = 0, wlen = ws.size(); j < wlen; j++) { El.fly(cells.getItem(j)).setWidth(ws.get(j)); } } }
/** * Update the view data based on the current value. * * @param parent the parent element * @param viewData the {@link ViewData} object to update * @param isEditing true if in edit mode * @return the new value */ private String updateViewData(Element parent, ViewData viewData, boolean isEditing) { InputElement input = (InputElement) parent.getFirstChild(); String value = input.getValue(); viewData.setText(value); viewData.setEditing(isEditing); return value; } }
public void onElementChanged(NodeDescriptor node, Element element) { Element el = getRootContainer(node).getFirstChildElement(); if (el == null) { return; } el.removeFromParent(); getRootContainer(node).insertFirst(element.getFirstChild()); node.setNodeContainerElement(null); node.setJointContainerElement(null); onSelectChange(node.getNode(), tree.getSelectionModel().isSelected(node.getNode())); }
/** * Creates an HTML IFRAME element with a name. * * @param name the name of the frame, which must contain at least one * non-whitespace character and must not contain reserved HTML markup * characters such as '<code><</code>', '<code>></code>', * or '<code>&</code>' * @return the newly-created element * @throws IllegalArgumentException if the supplied name is not allowed */ private static IFrameElement createIFrame(String name) { if (name == null || !isValidName(name.trim())) { throw new IllegalArgumentException( "expecting one or more non-whitespace chars with no '<', '>', or '&'"); } // Use innerHTML to implicitly create the <iframe>. This is necessary // because most browsers will not respect a dynamically-set iframe name. Element div = DOM.createDiv(); div.setInnerSafeHtml(IFrameTemplate.INSTANCE.get(name)); return div.getFirstChild().cast(); }
@Override public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) { super.onBrowserEvent(context, parent, value, event, valueUpdater); String type = event.getType(); if (BrowserEvents.CHANGE.equals(type)) { Object key = context.getKey(); SelectElement select = parent.getFirstChild().cast(); String newValue = options.get(select.getSelectedIndex()); setViewData(key, newValue); finishEditing(parent, newValue, key, valueUpdater); if (valueUpdater != null) { valueUpdater.update(newValue); } } }
&& event.getKeyCode() == KeyCodes.KEY_ENTER; if (BrowserEvents.CHANGE.equals(type) || enterPressed) { InputElement input = parent.getFirstChild().cast(); Boolean isChecked = input.isChecked();
/** * Get the input element in edit mode. */ private InputElement getInputElement(Element parent) { return parent.getFirstChild().<InputElement> cast(); }
/** * Get the input element in edit mode. */ private InputElement getInputElement(Element parent) { return parent.getFirstChild().<InputElement> cast(); }
/** * Get the input element in edit mode. */ private InputElement getInputElement(Element parent) { return parent.getFirstChild().<InputElement> cast(); }
private boolean isRowRendered(int i, List<Node> visible) { Element e = view.getRootContainer(getNodeDescriptor(visible.get(i))); return e != null && e.getFirstChild().hasChildNodes(); }
/** * Need to do some additional clean up to really clear the list */ public void clear() { super.clear(); // remove the option group elements Element elm = getElement(); while (elm.hasChildNodes()) { elm.removeChild(elm.getFirstChild()); } groupMap.clear(); }
/** * Update the view data based on the current value. * * @param parent the parent element * @param viewData the {@link ViewData} object to update * @param isEditing true if in edit mode * @return the new value */ private String updateViewData(Element parent, ViewData viewData, boolean isEditing) { InputElement input = (InputElement) parent.getFirstChild(); String value = input.getValue(); viewData.setText(value); viewData.setEditing(isEditing); return value; } }
@Override public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) { super.onBrowserEvent(context, parent, value, event, valueUpdater); String type = event.getType(); if (BrowserEvents.CHANGE.equals(type)) { Object key = context.getKey(); SelectElement select = parent.getFirstChild().cast(); String newValue = options.get(select.getSelectedIndex()); setViewData(key, newValue); finishEditing(parent, newValue, key, valueUpdater); if (valueUpdater != null) { valueUpdater.update(newValue); } } }
@Override public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) { super.onBrowserEvent(context, parent, value, event, valueUpdater); String type = event.getType(); if (BrowserEvents.CHANGE.equals(type)) { Object key = context.getKey(); SelectElement select = parent.getFirstChild().cast(); String newValue = options.get(select.getSelectedIndex()); setViewData(key, newValue); finishEditing(parent, newValue, key, valueUpdater); if (valueUpdater != null) { valueUpdater.update(newValue); } } }
/** * Returns the grid's <TD> HtmlElement at the specified coordinates. * * @param row the row index in which to find the cell * @param col the column index of the cell * @return the <TD> at the specified coordinates */ public Element getCell(int row, int col) { // ROW DIV TABLE TR TD Element rowEl = getRow(row); return (Element) ((rowEl != null && rowEl.hasChildNodes()) ? rowEl.getFirstChild().getFirstChild().getFirstChild().getChildNodes().getItem(col) : null); }
private void updateGroupWidths() { if (!enableGrouping || ds.getCount() < 1) { return; } String tw = Math.max(cm.getTotalWidth(), el.dom.getOffsetWidth() - getScrollAdjust()) + "px"; NodeList<Element> gs = getGroups(); for (int i = 0, len = gs.getLength(); i < len; i++) { Element e = gs.getItem(i).getFirstChild().cast(); e.getStyle().setProperty("width", tw); } }
public static void continueStartup() { // init handlers before throwing events SosDataManager.getDataManager(); new SOSController(); if (ClientUtils.isSesEnabled()) { new SesController(); } View.getView(); Element element = Document.get().getElementById("loadingWrapper"); while (element.hasChildNodes()) { element.removeChild(element.getFirstChild()); } Application.finishStartup(); }
protected void assertStructure(ContentElement e, ContentElement parent, ContentNode prev, ContentNode next, ContentNode first, ContentNode last) { assertStructure(e, parent, prev, next); assertSame(first, c.getFirstChild(e)); assertSame(last, c.getLastChild(e)); assertSame(first == null ? null : first.getImplNodelet(), e.getImplNodelet().getFirstChild()); assertSame(last == null ? null : last.getImplNodelet(), e.getImplNodelet().getLastChild()); }
protected void assertStructure(ContentElement e, ContentElement parent, ContentNode prev, ContentNode next, ContentNode first, ContentNode last) { assertStructure(e, parent, prev, next); assertSame(first, c.getFirstChild(e)); assertSame(last, c.getLastChild(e)); assertSame(first == null ? null : first.getImplNodelet(), e.getImplNodelet().getFirstChild()); assertSame(last == null ? null : last.getImplNodelet(), e.getImplNodelet().getLastChild()); }