Package org.richfaces.event

Examples of org.richfaces.event.DragEvent


      this.dragType = draggable.getDragType();
      this.dragValue = draggable.getDragValue();
     
      if (validateAcceptTypes(dragType, acceptedTypes)) {

        DragEvent dragEvent = new DragEvent((UIComponent) draggable);
        dragEvent.setDropTarget(dropzone);
        dragEvent.setAcceptedTypes(acceptedTypes);
        dragEvent.setDropValue(dropValue);

        dragEvent.queue();
      } else {
        //invalidate
        this.valid = false;
        //store label for message output
        this.draggableLabel = MessageUtil.getLabel(context, (UIComponent) draggable);
View Full Code Here


  }

  public void broadcast(FacesEvent event) throws AbortProcessingException {
    super.broadcast(event);
    if (event instanceof DragEvent) {
      DragEvent dragEvent = (DragEvent) event;
      if (dragEvent.isValid()) {
        MethodBinding binding = getDragListener();
        if (binding != null) {
          binding.invoke(getFacesContext(), new Object[] {event});
        }
View Full Code Here

      }

      Draggable draggable = (Draggable) component;
     
      eventsExchanger.mailEvent(dropTargetId, component,
          context, new DragEvent(component), dragEventsCallback, draggable.getDragType(),
          draggable.getDragValue(), true);
    }
  } 
View Full Code Here

   */
  public final void testQueueEventFacesEvent() {
    NodeExpandedEvent nodeExpandedEvent = new NodeExpandedEvent(tree);
    NodeSelectedEvent nodeSelectedEvent = new NodeSelectedEvent(tree, null);
    ExpandAllCommandEvent expandAllCommandEvent = new ExpandAllCommandEvent(tree);
    DragEvent dragEvent = new DragEvent(treeNode);
    DropEvent dropEvent = new DropEvent(treeNode);

    tree.queueEvent(nodeExpandedEvent);
    tree.queueEvent(nodeSelectedEvent);
    tree.queueEvent(expandAllCommandEvent);
    treeNode.queueEvent(dragEvent);
    treeNode.queueEvent(dropEvent);

    assertEquals(PhaseId.INVOKE_APPLICATION, nodeExpandedEvent.getPhaseId());
    assertEquals(PhaseId.UPDATE_MODEL_VALUES, nodeSelectedEvent.getPhaseId());
    assertEquals(PhaseId.INVOKE_APPLICATION, expandAllCommandEvent.getPhaseId());
    assertEquals(PhaseId.INVOKE_APPLICATION, dragEvent.getPhaseId());
    assertEquals(PhaseId.INVOKE_APPLICATION, dropEvent.getPhaseId());
  }
View Full Code Here

    tree.setImmediate(true);

    NodeExpandedEvent nodeExpandedEvent = new NodeExpandedEvent(tree);
    NodeSelectedEvent nodeSelectedEvent = new NodeSelectedEvent(tree, null);
    ExpandAllCommandEvent expandAllCommandEvent = new ExpandAllCommandEvent(tree);
    DragEvent dragEvent = new DragEvent(treeNode);
    DropEvent dropEvent = new DropEvent(treeNode);

    tree.queueEvent(nodeExpandedEvent);
    tree.queueEvent(nodeSelectedEvent);
    tree.queueEvent(expandAllCommandEvent);
    treeNode.queueEvent(dragEvent);
    treeNode.queueEvent(dropEvent);

    assertEquals(PhaseId.APPLY_REQUEST_VALUES, nodeExpandedEvent.getPhaseId());
    assertEquals(PhaseId.APPLY_REQUEST_VALUES, nodeSelectedEvent.getPhaseId());
    assertEquals(PhaseId.APPLY_REQUEST_VALUES, expandAllCommandEvent.getPhaseId());
    assertEquals(PhaseId.APPLY_REQUEST_VALUES, dragEvent.getPhaseId());
    assertEquals(PhaseId.APPLY_REQUEST_VALUES, dropEvent.getPhaseId());
  }
View Full Code Here

    // ------------ Invoke listeners --------------------
    NodeExpandedEvent nodeExpandedEvent = new NodeExpandedEvent(tree);
    NodeSelectedEvent nodeSelectedEvent = new NodeSelectedEvent(tree, null);
    ExpandAllCommandEvent expandAllCommandEvent = new ExpandAllCommandEvent(tree);
    DragEvent dragEvent = new DragEvent(tree);
    DropEvent dropEvent = new DropEvent(tree);

    tree.queueEvent(nodeExpandedEvent);
    tree.queueEvent(dropEvent);
    tree.queueEvent(nodeSelectedEvent);
View Full Code Here

 
  public void testDragEvent() {
    MockMethodBinding binding = new MockMethodBinding();
    treeNode.setDragListener(binding);
 
    DragEvent event = new DragEvent(treeNode);
    TreeEvents.invokeListenerBindings(treeNode, event, facesContext);

    Object[][] args = binding.getInvocationArgs();
    assertEquals(1, args.length);
    assertEquals(1, args[0].length);
View Full Code Here

  }

  public void broadcast(FacesEvent event) throws AbortProcessingException {
    super.broadcast(event);
    if (event instanceof DragEvent) {
      DragEvent dragEvent = (DragEvent) event;
      MethodBinding binding = getDragListener();
      if (binding != null) {
        binding.invoke(getFacesContext(), new Object[] {event});
      }
View Full Code Here

      this.dragType = draggable.getDragType();
      this.dragValue = draggable.getDragValue();
     
      if (validateAcceptTypes(dragType, acceptedTypes)) {

        DragEvent dragEvent = new DragEvent((UIComponent) draggable);
        dragEvent.setDropTarget(dropzone);
        dragEvent.setAcceptedTypes(acceptedTypes);
        dragEvent.setDropValue(dropValue);

        dragEvent.queue();
      } else {
        //invalidate
        this.valid = false;
        //store label for message output
        this.draggableLabel = MessageUtil.getLabel(context, (UIComponent) draggable);
View Full Code Here

      }

      Draggable draggable = (Draggable) component;
     
      eventsExchanger.mailEvent(dropTargetId, component,
          context, new DragEvent(component), dragEventsCallback, draggable.getDragType(),
          draggable.getDragValue(), true);
    }
  } 
View Full Code Here

TOP

Related Classes of org.richfaces.event.DragEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.