List of usage examples for com.google.gwt.dom.client Element getPropertyBoolean
@Override
public boolean getPropertyBoolean(String name)
From source file:com.sencha.gxt.fx.client.Draggable.java
License:sencha.com license
protected void onMouseDown(MouseDownEvent e) { if (!enabled || e.getNativeEvent().getButton() != Event.BUTTON_LEFT) { return;// w ww .j ava 2s . co m } Element target = e.getNativeEvent().getEventTarget().cast(); if (hasClassName(target, CommonStyles.get().nodrag())) { return; } // still allow text selection, prevent drag of other elements if ((!"input".equalsIgnoreCase(target.getTagName()) && !"textarea".equalsIgnoreCase(target.getTagName())) || target.getPropertyBoolean("disabled")) { e.getNativeEvent().preventDefault(); } handleStart(e.getClientX(), e.getClientY(), e.getNativeEvent().<Event>cast(), target); }
From source file:com.tractionsoftware.gwt.user.client.util.DomUtils.java
License:Apache License
/** * Returns true if the element has the disabled attribute. *///from w ww . java 2 s . c o m public static boolean isEnabled(Element element) { return element.getPropertyBoolean("disabled"); }
From source file:org.waveprotocol.wave.client.editor.impl.NodeManager.java
License:Apache License
/** * We usually ignore deep nodes completely when it comes to the selection - if * the selection is in a deep node, we usually report there is no selection. * * If this method returns true, we should make an exception, and report the * selection as just outside this node (perhaps recursing as necessary). *//*from www .ja va 2 s .c o m*/ public static boolean mayContainSelectionEvenWhenDeep(Element e) { return e.getPropertyBoolean(MAY_CONTAIN_SELECTION); }
From source file:org.waveprotocol.wave.client.editor.selection.content.SelectionUtil.java
License:Apache License
/** * Takes an html selection and returns it, or null if it's not related to editor content. * * @param htmlSelection Selection range to filter. * @return htmlSelection or null if there's no related content. *//*from ww w. jav a2s . c o m*/ public static FocusedPointRange<Node> filterNonContentSelection(FocusedPointRange<Node> htmlSelection) { if (htmlSelection == null) { return null; // quick exit } // get just the focus point, finding the element it is inside. Point<Node> htmlFocus = htmlSelection.getFocus(); Element el; if (htmlFocus.isInTextNode()) { el = htmlFocus.getContainer().getParentElement(); } else { el = htmlFocus.getContainer().cast(); } // Assume given range is always in the editor, the htmlHelper should guarantee that. while (!NodeManager.hasBackReference(el)) { if (NodeManager.getTransparency(el) == Skip.DEEP || el.getPropertyBoolean(ContentElement.COMPLEX_IMPLEMENTATION_MARKER)) { // Exception: when we explicitly want the selection still to be reported if (!NodeManager.mayContainSelectionEvenWhenDeep(el)) { htmlSelection = null; break; } } el = el.getParentElement(); } return htmlSelection; }
From source file:org.xwiki.gwt.user.client.ui.internal.TextBoxImplIEOld.java
License:Open Source License
@Override public void setSelectionRange(Element element, int pos, int length) { if (!element.getPropertyBoolean(SELECTION_PRESERVED)) { element.setPropertyBoolean(SELECTION_PRESERVED, true); ensureSelectionIsPreserved(element); }//ww w. j ava 2 s. c om if (isFocused(element)) { super.setSelectionRange(element, pos, length); } else { element.setPropertyInt(CURSOR_POS, pos); element.setPropertyInt(SELECTION_LENGTH, length); } }