Exemplo n.º 1
0
 /** @return True to propagate further, false if consumed. */
 public boolean onDoubleClick(ModelNode node) {
   if (logger.isLoggable(Level.INFO)) {
     logger.info("onDoubleClick(): node=" + node + ",class=" + node.getClass().getName());
   }
   if (node instanceof HTMLAbstractUIElement) {
     HTMLAbstractUIElement uiElement = (HTMLAbstractUIElement) node;
     Function f = uiElement.getOndblclick();
     if (f != null) {
       if (!Executor.executeFunction(uiElement, f)) {
         return false;
       }
     }
   }
   ModelNode parent = node.getParentModelNode();
   if (parent == null) {
     return true;
   }
   return this.onDoubleClick(parent);
 }
Exemplo n.º 2
0
 /** @return True to propagate further and false if the event was consumed. */
 public boolean onMouseClick(ModelNode node) {
   if (logger.isLoggable(Level.INFO)) {
     logger.info("onMouseClick(): node=" + node + ",class=" + node.getClass().getName());
   }
   if (node instanceof HTMLAbstractUIElement) {
     HTMLAbstractUIElement uiElement = (HTMLAbstractUIElement) node;
     Function f = uiElement.getOnclick();
     if (f != null) {
       if (!Executor.executeFunction(uiElement, f)) {
         return false;
       }
     }
   }
   if (node instanceof HTMLLinkElementImpl) {
     ((HTMLLinkElementImpl) node).navigate();
     return false;
   } else if (node instanceof HTMLButtonElementImpl) {
     HTMLButtonElementImpl button = (HTMLButtonElementImpl) node;
     String rawType = button.getAttribute("type");
     String type;
     if (rawType == null) {
       type = "submit";
     } else {
       type = rawType.trim().toLowerCase();
     }
     if ("submit".equals(type)) {
       FormInput[] formInputs =
           new FormInput[] {new FormInput(button.getName(), button.getValue())};
       button.submitForm(formInputs);
     } else if ("reset".equals(type)) {
       button.resetForm();
     } else {
       // NOP for "button"!
     }
     return false;
   }
   ModelNode parent = node.getParentModelNode();
   if (parent == null) {
     return true;
   }
   return this.onMouseClick(parent);
 }
Exemplo n.º 3
0
 /** @return True to propagate further, false if consumed. */
 public boolean onMouseDisarmed(ModelNode node) {
   if (node instanceof HTMLLinkElementImpl) {
     ((HTMLLinkElementImpl) node).getCurrentStyle().setOverlayColor(null);
     return false;
   }
   ModelNode parent = node.getParentModelNode();
   if (parent == null) {
     return true;
   }
   return this.onMouseUp(parent);
 }
Exemplo n.º 4
0
 /** @return True to propagate further, false if consumed. */
 public boolean onMouseUp(ModelNode node) {
   boolean pass = true;
   if (node instanceof HTMLAbstractUIElement) {
     HTMLAbstractUIElement uiElement = (HTMLAbstractUIElement) node;
     Function f = uiElement.getOnmouseup();
     if (f != null) {
       pass = Executor.executeFunction(uiElement, f);
     }
   }
   if (node instanceof HTMLLinkElementImpl) {
     ((HTMLLinkElementImpl) node).getCurrentStyle().setOverlayColor(null);
     return false;
   }
   if (!pass) {
     return false;
   }
   ModelNode parent = node.getParentModelNode();
   if (parent == null) {
     return true;
   }
   return this.onMouseUp(parent);
 }