List of usage examples for com.google.gwt.user.client DOM removeElementAttribute
@Deprecated public static void removeElementAttribute(Element elem, String attr)
From source file:asquare.gwt.tk.client.ui.CWindow.java
License:Apache License
@Override public void setTitle(String title) { if (title == null || title.length() == 0) { DOM.removeElementAttribute(getContainerElement(), "title"); } else {/*from ww w. j ava 2s.c o m*/ DOM.setElementAttribute(getContainerElement(), "title", title); } }
From source file:com.ait.ext4j.client.core.Component.java
License:Apache License
public void setTitle(final String title) { if (isRendered()) { if (title == null || title.length() == 0) { DOM.removeElementAttribute(getElement(), "title"); } else {//from w w w.ja v a2 s .c om DOM.setElementAttribute(getElement(), "title", title); } } else { addListener("render", new Function() { public void execute() { setTitle(title); } }); } }
From source file:com.google.gwt.sample.feedreader.client.EntryPanel.java
License:Apache License
/** * Force all links to open in a new window so that application state isn't * lost.// w w w .j a va2s. c o m * * @param elt */ protected void retargetLinks(Element elt) { int numChildren = DOM.getChildCount(elt); for (int i = 0; i < numChildren; i++) { Element child = DOM.getChild(elt, i); String href = DOM.getElementProperty(child, "href"); if (href != null) { DOM.setElementAttribute(child, "onclick", "javascript:window.open('" + href + "', '_blank');"); DOM.removeElementAttribute(child, "href"); DOM.setElementAttribute(child, "class", "externalLink"); } retargetLinks(child); } }
From source file:com.gwtext.client.widgets.BaseExtWidget.java
License:Open Source License
public void setTitle(String title) { if (title == null || title.length() == 0) { DOM.removeElementAttribute(getElement(), "title"); } else {/* ww w . j a v a 2 s .c o m*/ DOM.setElementAttribute(getElement(), "title", title); } }
From source file:com.vaadin.addon.calendar.gwt.client.ui.schedule.SimpleDayCell.java
public void setHeightPX(int px, boolean clear) { // measure from DOM if needed if (px < 0) { intHeight = getOffsetHeight() - BORDERPADDINGSIZE; } else {//from w w w. jav a2 s .com intHeight = px - BORDERPADDINGSIZE; } if (clear) { while (getWidgetCount() > 1) { remove(1); } } // How many events can be shown in UI int slots = 0; if (scrollable) { for (int i = 0; i < events.length; i++) { if (events[i] != null) { slots = i + 1; } } setHeight(intHeight + "px"); // Fixed height } else { // Dynamic height by the content DOM.removeElementAttribute(getElement(), "height"); slots = (intHeight - caption.getOffsetHeight() - BOTTOMSPACERHEIGHT) / EVENTHEIGHT; if (slots > 10) { slots = 10; } } updateEvents(slots, clear); }
From source file:com.vaadin.client.ui.calendar.schedule.SimpleDayCell.java
License:Apache License
public void setHeightPX(int px, boolean clear) { // measure from DOM if needed if (px < 0) { intHeight = getOffsetHeight() - BORDERPADDINGSIZE; } else {/*from w ww . ja va2 s. c om*/ intHeight = px - BORDERPADDINGSIZE; } // Couldn't measure height or it ended up negative. Don't bother // continuing if (intHeight == -1) { return; } if (clear) { while (getWidgetCount() > 1) { remove(1); } } // How many events can be shown in UI int slots = 0; if (scrollable) { for (int i = 0; i < events.length; i++) { if (events[i] != null) { slots = i + 1; } } setHeight(intHeight + "px"); // Fixed height } else { // Dynamic height by the content DOM.removeElementAttribute(getElement(), "height"); slots = (intHeight - caption.getOffsetHeight() - BOTTOMSPACERHEIGHT) / EVENTHEIGHT; if (slots > 10) { slots = 10; } } updateEvents(slots, clear); }
From source file:fi.jyu.student.jatahama.onlineinquirytool.client.FileButton.java
License:Open Source License
@Override public void setTitle(String title) { // Override to allow setting title to "" (so FF doesn't show file tooltip) if (title == null) { DOM.removeElementAttribute(getElement(), "title"); } else {/*from w ww. j a va 2 s . c om*/ DOM.setElementAttribute(getElement(), "title", title); } }
From source file:geogebra.web.gui.advanced.client.ui.widget.ListPopupPanel.java
License:Apache License
/** * This method wraps the specified widget into the focus panel and adds necessary listeners. * * @param widget is an item widget to be wraped. * @return a focus panel adopted for displaying. *//*from w ww . j a v a 2 s. c om*/ protected FocusPanel adoptItemWidget(Widget widget) { FocusPanel panel = new FocusPanel(widget); panel.addClickHandler(getItemClickHandler()); panel.addMouseOverHandler(getMouseEventsHandler()); panel.addMouseOutHandler(getMouseEventsHandler()); panel.setStyleName("item"); DOM.removeElementAttribute(panel.getElement(), "tabindex"); return panel; }
From source file:org.gems.ajax.client.connection.RectilinearConnection.java
License:Open Source License
public boolean updateSegment(Point a, Point b, int index, String style) { if (index >= 0 && index < segments_.size()) { Segment seg = (Segment) segments_.get(index); DOM.removeElementAttribute(seg.getElement(), "width"); DOM.removeElementAttribute(seg.getElement(), "height"); DOM.removeElementAttribute(seg.getElement(), "style"); configSegment(a, b, seg, style); return true; }/*from www .j a va 2s . c o m*/ return false; }
From source file:org.openelis.ui.widget.tree.View.java
License:Open Source License
/** * Will put the passed cell into edit mode making sure the the cell is * compeltely visible first/*from w ww . j a v a 2 s. c o m*/ * * @param r * @param c * @param value * @param event */ @SuppressWarnings({ "unchecked", "rawtypes" }) public void startEditing(int r, final int c, Object value, NativeEvent event) { int rc, x1, x2, v1, v2; CellEditor cellEditor; rc = getFlexTableIndex(r); /* * Get X coord of the column in the table */ x1 = tree.getXForColumn(c); x2 = x1 + tree.getColumnAt(c).getWidth(); /* * Get the currently viewed portion of the table */ v1 = scrollView.getHorizontalScrollPosition(); v2 = v1 + tree.getWidthWithoutScrollbar(); /* * Make sure the cell is completely visible */ if (x1 < v1) scrollView.setHorizontalScrollPosition(x1); else if (x2 > v2) scrollView.setHorizontalScrollPosition(x2 - tree.getWidthWithoutScrollbar()); cellEditor = tree.getCellEditor(r, c); container.setWidth((tree.getColumnAt(c).getWidth() - 3)); container.setHeight((tree.getRowHeight() - 3)); flexTable.setWidget(rc, c, container); DOM.removeElementAttribute(flexTable.getCellFormatter().getElement(rc, c), "style"); if (tree.getQueryMode()) cellEditor.startEditingQuery((QueryData) tree.getValueAt(r, c), container, event); else cellEditor.startEditing(tree.getValueAt(r, c), container, event); }