Package org.eclipse.jst.pagedesigner.viewer

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


    int position = -1;
    int length = -1;
    ISelection selection = getViewer().getSelection();
    if (selection != null) {
      if (getViewer().isInRangeMode()) {
        DesignRange range = (DesignRange) selection;
        if (range.isValid()) {
          IDOMPosition domPos = DOMPositionHelper.toDOMPosition(range
              .getStartPosition());
          IDOMPosition domEnd = DOMPositionHelper.toDOMPosition(range
              .getEndPosition());
          if (EditValidateUtil.validPosition(domPos)
              && EditValidateUtil.validPosition(domEnd)) {
            position = EditModelQuery
                .getIndexedRegionLocation(domPos);
View Full Code Here


        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
                .toDesignPosition(endPos));
    } catch (Exception e) {
      // "Selection error"
      _log.error("Error.RangeModeCommand.SetSelection"); //$NON-NLS-1$
      return null;
View Full Code Here

   /**
    * Update the state
    */
  protected void updateState()
    {
       DesignRange range = _viewer.getRangeSelection();
       updateStatus(RangeUtil.normalize(range));
    }
View Full Code Here

            // XXX: later we may support in range mode.
            this.setChecked(false);
            this.setEnabled(false);
            return false;
        }
        DesignRange range = _viewer.getRangeSelection();
        if (range == null || !range.isValid()) {
            this.setChecked(false);
            this.setEnabled(false);
            return false;
        }
        return true;
View Full Code Here

   */
  public void run() {
    if (_viewer == null || !_viewer.isInRangeMode()) {
      return;
    }
    DesignRange range = _viewer.getRangeSelection();
    if (range == null || !range.isValid()) {
      return;
    }
    if (range.isEmpty())
      return; // nothing to do to empty range.

    // if currently checked, means unapply the style. If current not
    // checked, means apply the style
    boolean apply = !this.isChecked();
View Full Code Here

TOP

Related Classes of org.eclipse.jst.pagedesigner.viewer.DesignRange

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.