Package org.eclipse.jst.pagedesigner.dnd

Examples of org.eclipse.jst.pagedesigner.dnd.LocalDropRequest


   * (non-Javadoc)
   *
   * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#createTargetRequest()
   */
  protected Request createTargetRequest() {
    LocalDropRequest request = new LocalDropRequest();
    request.setLocation(getDropLocation());
    request.setLocalObject(getCurrentLocalObject());
    return request;
  }
View Full Code Here


   * (non-Javadoc)
   *
   * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#updateTargetRequest()
   */
  protected void updateTargetRequest() {
    LocalDropRequest dropRequest = (LocalDropRequest) getTargetRequest();
    dropRequest.setLocation(getDropLocation());
    dropRequest.setLocalObject(getCurrentLocalObject());
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#createTargetRequest()
   */
  protected Request createTargetRequest() {
    LocalDropRequest request = new LocalDropRequest();
    request.setLocation(getDropLocation());
    request.setLocalObject(getCurrentLocalObject());
    return request;
  }
View Full Code Here

   * (non-Javadoc)
   *
   * @see org.eclipse.gef.dnd.AbstractTransferDropTargetListener#updateTargetRequest()
   */
  protected void updateTargetRequest() {
    LocalDropRequest dropRequest = (LocalDropRequest) getTargetRequest();
    dropRequest.setLocation(getDropLocation());
    dropRequest.setLocalObject(getCurrentLocalObject());
  }
View Full Code Here

   *
   * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getTargetEditPart(org.eclipse.gef.Request)
   */
  public EditPart getTargetEditPart(Request request) {
    if (request instanceof LocalDropRequest) {
      LocalDropRequest r = (LocalDropRequest) request;
      EditPart host = getHost();
      if (_checkUpdate && checkUpdateWidget(host, r, new HashMap())) {
        return host;
      }
      EditPart[] hostHolder = new EditPart[] { host };
View Full Code Here

   *
   * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#getCommand(org.eclipse.gef.Request)
   */
  public Command getCommand(Request request) {
    if (request instanceof LocalDropRequest) {
      LocalDropRequest r = (LocalDropRequest) request;
      EditPart host = getHost();

      Map result = new HashMap();
      if (_checkUpdate && checkUpdateWidget(host, r, result)) {
        LocalDropCommand command = new LocalDropCommand(
            getViewer(host), r.getLocalObject(), result);
        command.setWidget(((NodeEditPart) host).getIDOMNode());
        return command;
      }
      result.clear();

      EditPart[] hostHolder = new EditPart[] { host };
      IDOMPosition[] positionHolder = new IDOMPosition[1];
      if (checkInsertElement(r, hostHolder, result,
          new DesignPosition[1], positionHolder)) {
        LocalDropCommand command = new LocalDropCommand(
            getViewer(host), r.getLocalObject(), result);
        command.setDOMPosition(positionHolder[0]);
        return command;
      }
    }
    return null;
View Full Code Here

   *
   * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#showTargetFeedback(org.eclipse.gef.Request)
   */
  public void showTargetFeedback(Request request) {
    if (request instanceof LocalDropRequest) {
      LocalDropRequest r = (LocalDropRequest) request;
      EditPart host = getHost();
      if (_checkUpdate && checkUpdateWidget(host, r, new HashMap())) {
        Rectangle rect = LocationHelper
            .getAbsoluteBounds((GraphicalEditPart) host);
        showFeedbackRect(rect);
        return;
      }
      EditPart[] hostHolder = new EditPart[] { host };
      DesignPosition[] holder = new DesignPosition[1];
      if (checkInsertElement(r, hostHolder, new HashMap(), holder,
          new IDOMPosition[1])) {
        Rectangle rect = EditPartPositionHelper
            .convertToAbsoluteCaretRect(holder[0]);
        showFeedbackRect(rect);
        if (getHost() instanceof GraphicalEditPart) {
          ExposeHelper exposeHelper = new ExposeHelper(
              getViewer(getHost()));
          exposeHelper.adjustVertical(r.getLocation());
        }
        return;
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.dnd.LocalDropRequest

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.