Package org.eclipse.jst.pagedesigner.validation.caret

Examples of org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator


    setRange(position);
  }

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


    DesignRange range = _viewer.getRangeSelection();
    if (range == null || !range.isValid()) {
      _log.error("invalid range"); //$NON-NLS-1$
      return;
    }
    IMovementMediator moveMediator = new InlineEditingNavigationMediator(
        new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
    DesignPosition position = range.getEndPosition();
    Caret caret = _viewer.getCaret();
    Point point = null;
    DesignPosition newPos = position;
View Full Code Here

    _viewer = viewer;
  }

  public void execute() {
    Node document = _viewer.getModel().getDocument();
    IMovementMediator validator = new InlineEditingNavigationMediator(
        new ActionData(ActionData.KEYBOARD_NAVAGATION, null));
    Node htmlRoot = RootContainerPositionRule
        .getBasicContainer((Document) document);
    Node jsfRoot = JSFRootContainerPositionRule
        .getBasicContainer((Document) document, 3);
    Node root;
    if (htmlRoot != null && jsfRoot != null) {
      if (EditModelQuery.isChild(htmlRoot, jsfRoot)) {
        root = htmlRoot;
      } else if (EditModelQuery.isChild(jsfRoot, htmlRoot)) {
        root = jsfRoot;
      } else {
        root = htmlRoot;
      }
    } else {
      if (htmlRoot != null) {
        root = htmlRoot;
      } else if (jsfRoot != null) {
        root = jsfRoot;
      } else {
        root = document;
      }
    }
    IDOMPosition position1, position2;
    // if (root.hasChildNodes())
    // {
    // Node first = root.getFirstChild();
    // position1 = new DOMRefPosition(first, false);
    // Node last = root.getLastChild();
    // position2 = new DOMRefPosition(last, true);
    // }
    // else
    // {
    position1 = new DOMPosition(root, 0);
    position2 = new DOMPosition(root, root.getChildNodes().getLength());
    // }
    if (!validator.isValidPosition(position1)) {
      position1 = EditHelper.moveToNextEditPosition(position1, true,
          validator);
    }
    if (!validator.isValidPosition(position2)) {
      position2 = EditHelper.moveToNextEditPosition(position2, false,
          validator);
    }
    if (EditValidateUtil.validPosition(position1)
        && EditValidateUtil.validPosition(position2)) {
View Full Code Here

    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

TOP

Related Classes of org.eclipse.jst.pagedesigner.validation.caret.IMovementMediator

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.