Examples of IndexedRegion


Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

   
    List results = new ArrayList(0);
    if(isValidContext(context)) {
      ITextViewer viewer = context.getViewer();
      int documentPosition = context.getInvocationOffset();
      IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
     
      // get results from JSP completion processor
      results = computeJavaCompletionProposals(viewer, documentPosition, 0);

      IDOMNode xNode = null;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

  }

  abstract protected IndexedRegion getCursorIndexedRegion();

  protected IndexedRegion getIndexedRegion(int offset) {
    IndexedRegion indexedRegion = null;

    int lastOffset = offset;
    IDocument document = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
    IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
    if (model != null) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

  public void run() {
    Region currentRegion = new Region(fViewer.getSelectedRange().x, fViewer.getSelectedRange().y);
    if (currentRegion.getLength() == fViewer.getDocument().getLength())
      return;

    IndexedRegion cursorIndexedRegion = getCursorIndexedRegion();
    if (cursorIndexedRegion instanceof Node) {
      Node cursorNode = (Node) cursorIndexedRegion;

      // use parent node for empty text node
      if (cursorNode.getNodeType() == Node.TEXT_NODE && cursorNode.getNodeValue().trim().length() == 0) {
        cursorNode = cursorNode.getParentNode();

        if (cursorNode instanceof IndexedRegion)
          cursorIndexedRegion = (IndexedRegion) cursorNode;
      }

      Region cursorNodeRegion = new Region(cursorIndexedRegion.getStartOffset(), cursorIndexedRegion.getEndOffset() - cursorIndexedRegion.getStartOffset());

      Region newRegion = null;
      if (cursorNodeRegion.getOffset() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() <= currentRegion.getOffset() + currentRegion.getLength() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() >= currentRegion.getOffset() && cursorNodeRegion.getOffset() + cursorNodeRegion.getLength() <= currentRegion.getOffset() + currentRegion.getLength())
        newRegion = getNewSelectionRegion(cursorNode, currentRegion);
      else
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

  public static IndexedRegion getNodeAt(ITextViewer viewer, int documentOffset) {

    if (viewer == null)
      return null;

    IndexedRegion node = null;
    IModelManager mm = StructuredModelManager.getModelManager();
    IStructuredModel model = null;
    if (mm != null)
      model = mm.getExistingModelForRead(viewer.getDocument());
    try {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

      if (selection instanceof ITextSelection && document != null) {
        ITextSelection textSelection = (ITextSelection) selection;

        if (textSelection.getLength() < document.getLength()) {
          // get current indexed region
          IndexedRegion cursorIndexedRegion = getCursorIndexedRegion(document, textSelection);

          // determine new selection based on current indexed region
          Region newSelectionRegion = getNewSelectionRegion(cursorIndexedRegion, textSelection);

          // select new selection
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

   * @param document
   * @param offset
   * @return
   */
  protected IndexedRegion getIndexedRegion(IDocument document, int offset) {
    IndexedRegion indexedRegion = null;

    int lastOffset = offset;
    IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(document);
    if (model != null) {
      try {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

      int start = textSelection.getOffset();
      int end = start + textSelection.getLength();
      IStructuredModel model = StructuredModelManager.getModelManager().getExistingModelForRead(fDocument);
      if (model != null) {
        for (int i = start; i <= end; i++) {
          IndexedRegion r = model.getIndexedRegion(i);
          if (r != null) {
            overlappingIndexedRegions.add(r);
          }
        }
        model.releaseFromRead();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

   *            a location within the document
   * @return an array of code-assist items
   */
  public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int documentPosition) {

    IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);

    // get results from JSP completion processor
    fJspCompletionProcessor = getJspCompletionProcessor();
    ICompletionProposal[] results = fJspCompletionProcessor.computeCompletionProposals(viewer, documentPosition);
    fErrorMessage = fJspCompletionProcessor.getErrorMessage();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

   
    List results = new ArrayList(0);
    if(isValidContext(context)) {
      ITextViewer viewer = context.getViewer();
      int documentPosition = context.getInvocationOffset();
      IndexedRegion treeNode = ContentAssistUtils.getNodeAt(viewer, documentPosition);
     
      // get results from JSP completion processor
      results = computeJavaCompletionProposals(viewer, documentPosition, 0);

      IDOMNode xNode = null;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.IndexedRegion

          markInvalidAnnotationsForDeletion(dirtyRegion, deletions);
         
          //reconcile each effected indexed region
          Iterator indexedRegionsIter = indexedRegions.iterator();
          while(indexedRegionsIter.hasNext() && fProjectionAnnotationModel != null) {
            IndexedRegion indexedRegion = (IndexedRegion)indexedRegionsIter.next();
         
            //only try to create an annotation if the index region is a valid type
            if(indexedRegionValidType(indexedRegion)) {
              FoldingAnnotation annotation = new FoldingAnnotation(indexedRegion, false);
             
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.