/** * Sets the amount of padding to be added around all cells. * * @param padding the cell padding, in pixels */ public void setCellPadding(int padding) { tableElem.setPropertyInt("cellPadding", padding); }
/** * Sets the amount of spacing between this panel's cells. * * @param spacing the inter-cell spacing, in pixels */ public void setSpacing(int spacing) { this.spacing = spacing; table.setPropertyInt("cellSpacing", spacing); }
/** * Sets the amount of spacing to be added around all cells. * * @param spacing the cell spacing, in pixels */ public void setCellSpacing(int spacing) { tableElem.setPropertyInt("cellSpacing", spacing); }
/** * Sets an int property on the given element. * * @param elem the element whose property is to be set * @param prop the name of the property to be set * @param value the new property value as an int * @deprecated Use {@link Element#setPropertyInt(String, int)} instead. */ @Deprecated public static void setElementPropertyInt(Element elem, String prop, int value) { elem.setPropertyInt(prop, value); }
/** * Sets an integer property on the given element. * * @param elem the element whose property is to be set * @param attr the name of the property to be set * @param value the property's new integer value * @deprecated Use the more appropriately named * {@link Element#setPropertyInt(String, int)} instead. */ @Deprecated public static void setIntAttribute(Element elem, String attr, int value) { elem.setPropertyInt(attr, value); }
/** * Creates an empty stack panel. */ public StackPanel() { Element table = DOM.createTable(); setElement(table); body = DOM.createTBody(); DOM.appendChild(table, body); table.setPropertyInt("cellSpacing", 0); table.setPropertyInt("cellPadding", 0); DOM.sinkEvents(table, Event.ONCLICK); setStyleName(DEFAULT_STYLENAME); }
@Override Element createHeaderElem() { // Create the table Element table = DOM.createTable(); Element tbody = DOM.createTBody(); DOM.appendChild(table, tbody); table.getStyle().setProperty("width", "100%"); table.setPropertyInt("cellSpacing", 0); table.setPropertyInt("cellPadding", 0); // Add the decorated rows for (int i = 0; i < DEFAULT_ROW_STYLENAMES.length; i++) { DOM.appendChild(tbody, DecoratorPanel.createTR(DEFAULT_ROW_STYLENAMES[i])); } // Return the table return table; }
private void updateIndicesFrom(int beforeIndex) { for (int i = beforeIndex, c = getWidgetCount(); i < c; ++i) { Element childTR = DOM.getChild(body, i * 2); Element childTD = DOM.getFirstChild(childTR); childTD.setPropertyInt("__index", i); // Update the special style on the first element if (beforeIndex == 0) { setStyleName(childTD, DEFAULT_ITEM_STYLENAME + "-first", true); } else { setStyleName(childTD, DEFAULT_ITEM_STYLENAME + "-first", false); } } }
/** * Creates a new panel using the specified style names to apply to each row. * Each row will contain three cells (Left, Center, and Right). The Center * cell in the containerIndex row will contain the {@link Widget}. * * @param rowStyles an array of style names to apply to each row * @param containerIndex the index of the container row */ DecoratorPanel(String[] rowStyles, int containerIndex) { super(DOM.createTable()); // Add a tbody Element table = getElement(); tbody = DOM.createTBody(); DOM.appendChild(table, tbody); table.setPropertyInt("cellSpacing", 0); table.setPropertyInt("cellPadding", 0); // Add each row for (int i = 0; i < rowStyles.length; i++) { Element row = createTR(rowStyles[i]); DOM.appendChild(tbody, row); if (i == containerIndex) { containerElem = DOM.getFirstChild(DOM.getChild(row, 1)); } } // Set the overall style name setStyleName(DEFAULT_STYLENAME); }
/** * Sets the amount of spacing to be added around all cells. * * @param spacing the cell spacing, in pixels */ public void setCellSpacing(int spacing) { tableElem.setPropertyInt("cellSpacing", spacing); }
/** * Sets the amount of padding to be added around all cells. * * @param padding the cell padding, in pixels */ public void setCellPadding(int padding) { tableElem.setPropertyInt("cellPadding", padding); }
/** * Sets the amount of spacing between this panel's cells. * * @param spacing the inter-cell spacing, in pixels */ public void setSpacing(int spacing) { this.spacing = spacing; table.setPropertyInt("cellSpacing", spacing); }
/** * Sets the amount of spacing to be added around all cells. * * @param spacing the cell spacing, in pixels */ public void setCellSpacing(int spacing) { tableElem.setPropertyInt("cellSpacing", spacing); }
/** * Sets the amount of spacing between this panel's cells. * * @param spacing the inter-cell spacing, in pixels */ public void setSpacing(int spacing) { this.spacing = spacing; table.setPropertyInt("cellSpacing", spacing); }
/** * Sets an int property on the given element. * * @param elem the element whose property is to be set * @param prop the name of the property to be set * @param value the new property value as an int * @deprecated Use {@link Element#setPropertyInt(String, int)} instead. */ @Deprecated public static void setElementPropertyInt(Element elem, String prop, int value) { elem.setPropertyInt(prop, value); }
/** * Sets an int property on the given element. * * @param elem the element whose property is to be set * @param prop the name of the property to be set * @param value the new property value as an int * @deprecated Use {@link Element#setPropertyInt(String, int)} instead. */ @Deprecated public static void setElementPropertyInt(Element elem, String prop, int value) { elem.setPropertyInt(prop, value); }
DOM.insertChild(rows[northRow].tr, td, rows[northRow].center); DOM.appendChild(td, child.getElement()); td.setPropertyInt("colSpan", logicalRightCol - logicalLeftCol + 1); ++northRow; } else if (layout.direction == SOUTH) { DOM.insertChild(rows[southRow].tr, td, rows[southRow].center); DOM.appendChild(td, child.getElement()); td.setPropertyInt("colSpan", logicalRightCol - logicalLeftCol + 1); --southRow; } else if (layout.direction == CENTER) { DOM.insertChild(row.tr, td, row.center++); DOM.appendChild(td, child.getElement()); td.setPropertyInt("rowSpan", southRow - northRow + 1); ++logicalLeftCol; } else if (shouldAddToLogicalRightOfTable(layout.direction)) { DOM.insertChild(row.tr, td, row.center); DOM.appendChild(td, child.getElement()); td.setPropertyInt("rowSpan", southRow - northRow + 1); --logicalRightCol;
tdh.setPropertyInt("__owner", hashCode()); tdh.setPropertyString("height", "1px");
/** * Set the given Integer value to the attribute of the range element. */ protected void setIntToRangeElement(String attribute, Integer val) { Element ele = $(rangeInputElement).asElement(); if (ele != null) { ele.setPropertyInt(attribute, val); } }
/** * Set the given Integer value to the attribute of the range element. */ protected void setIntToRangeElement(String attribute, Integer val) { Element ele = $(rangeInputElement).asElement(); if (ele != null) { ele.setPropertyInt(attribute, val); } }