Examples of DesignPosition


Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

        getLocation(), Collections.EMPTY_LIST);
    IPositionMediator positionMediator = new InlineEditingPositionMediator(
        new ActionData(ActionData.INLINE_EDIT, null));
    ExposeHelper exposeHelper = new ExposeHelper(graphicalViewer);
    exposeHelper.adjustVertical(getCurrentInput().getMouseLocation());
    DesignPosition position = EditPartPositionHelper.findEditPartPosition(
        editPart, getCurrentInput().getMouseLocation(),
        positionMediator);
    if (b) {
      graphicalViewer.setRangeEndPosition(position);
    } else {
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

    super(COMMAND_LABEL, viewer);
  }

  protected void preExecute() {
    _prevRange = _viewer.getRangeSelection();
    DesignPosition position = findObjectModePosition();
    _prevRange = new DesignRange(position, position);
    super.preExecute();
  }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

    _prevRange = new DesignRange(position, position);
    super.preExecute();
  }

  private DesignPosition findObjectModePosition() {
    DesignPosition result = null;
    IMovementMediator validator = new InlineEditingNavigationMediator(
        new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
    DesignPosition position = getCurrentObjectPosition();
    if (position != null) {
      if (!validator.isValidPosition(position)) {
        result = null;
      } else {
        result = position;
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

    } else {
      List parts = _viewer.getSelectedEditParts();
      if (parts.size() > 0) {
        EditPart selection = (EditPart) parts.get(0);
        if (selection instanceof SubNodeEditPart) {
          DesignPosition position = new DesignRefPosition(selection,
              false);
          position = DOMPositionHelper.toDesignPosition(EditHelper
              .ensureDOMPosition(DOMPositionHelper
                  .toDOMPosition(position)));
          result = new DesignRange(position, position);
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

   
    public void showTargetFeedback(Request request)
    {
        if (request instanceof DropRequest)
        {
            DesignPosition position = findPosition((DropRequest)request);
            if (position != null) {
                // erase any prior feedback
                eraseTargetFeedback(request);
                // add figures to feedback layer and save them in _feedbackFigures
                // for later.
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

    if (DOMUtil.isAncester(draggedNode, hostNode)) {
      return UnexecutableCommand.INSTANCE;
    }

    DesignPosition position = findPosition(r);
    if (position == null || !position.isValid()) {
      return null;
    }

    // can't move/copy into self.
    Node node = position.getContainerNode();
    if (DOMUtil.isAncester(draggedNode, node)) {
      return UnexecutableCommand.INSTANCE;
    }

    // ok, we are about to move/copy into the specified position.
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

        if (mediator == null)
        {
            return null;
        }
        final IDropLocationStrategy dropStrategy = createDropLocationStrategy(r);
    final DesignPosition position =
            dropStrategy.calculateDesignPosition(getHost(), r.getLocation(), mediator);
       
        // verify that the drop strategy has honoured it's contract that our
        // mediator be respected
        if (position != null)
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

        public DesignPosition calculateDesignPosition(EditPart host,
                Point p, IPositionMediator validator) {
          Node node = (Node) host.getModel();
          if (host != null && IHTMLConstants.TAG_HEAD.equalsIgnoreCase(node.getLocalName())) {
            return new DesignPosition(host, 0);
          }
          return super.calculateDesignPosition(host, p, validator);
        }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

  public void execute() {
    if (_viewer.isInRangeMode()) {
      ISelection selection = _viewer.getSelection();
      if (selection instanceof DesignRange) {
        DesignPosition posStart = ((DesignRange) selection)
            .getStartPosition();
        DesignPosition posEnd = ((DesignRange) selection)
            .getEndPosition();
        if (EditValidateUtil.validPosition(posStart)
            && EditValidateUtil.validPosition(posEnd)) {
          Node ancestor = EditModelQuery.getInstance()
              .getCommonAncestor(posStart.getContainerNode(),
                  posEnd.getContainerNode());
          if (ancestor instanceof Text) {
            ancestor = ancestor.getParentNode();
          }
          if (ancestor instanceof Element) {
            EditPart part = Target.resolvePart(ancestor);
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.viewer.DesignPosition

    try {
      if (range == null) {
        return null;
      }
      IDOMPosition startPos = range.getStartPosition();
      DesignPosition start = DOMPositionHelper.toDesignPosition(startPos);
      if (range.isEmpty()) {
        return new DesignRange(start, start);
      }
            IDOMPosition endPos = range.getEndPosition();
            return new DesignRange(start, DOMPositionHelper
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.