Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.Region


  public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
    return null;
  }

  public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
    return new Region(offset, 0);
  }
View Full Code Here


          // check if design db attribute is missing
          // we can only lookup references in local sources
          if (!tmlInfo.hasAttribute("designdb") && !tmlInfo.isDynamicAttributeValue("medium")) {
            int offset = tmlInfo.getDocumentRegion().getOffset() + "<tml:[".length();
            int length = tmlInfo.getTagName().length() - 2;
            IRegion referenceRegion = new Region(offset, length);
            link = new TMLModuleReferenceHyperlink(textViewer, referenceRegion, tmlInfo);
          }
        }

       
View Full Code Here

    FindReplaceDocumentAdapter findReplaceAdapter = new FindReplaceDocumentAdapter(_document);
   
    IRegion region = findReplaceAdapter.find(_documentRegion.getOffset(), attributeName + "=\"" + getAttributeValue(attributeName) + "\"", true, true, false, false);
    if (region != null) {
      String tmp = attributeName + "=\"";
      return new Region(region.getOffset() + tmp.length(), region.getLength() - tmp.length() - 1);
    } else {
      return null;
    }
    /*
    IRegion end = findReplaceAdapter.find(start.getOffset() + start.getLength(), "\"", true, true, false, false);
View Full Code Here

                }
                previousOffset = prevPartition.getOffset() - 1;
            }
           
            if (prevPartition != null) {
                region = new Region(previousOffset+1, region.getOffset() - previousOffset + region.getLength() - 1);
            }
           
            VersionCompliance versionCompliance = WGADesignStructureHelper.getWGAVersionCompliance(Plugin.getDefault().getActiveFile());
            TMLScriptRegion tmlScriptRegion = TMLScriptRegion.parse(region, document, offset, versionCompliance);
            System.out.println(tmlScriptRegion.toString());
View Full Code Here

  }

  public IRegion getSubject(ITextViewer textViewer, int offset) {
    if (textViewer.getSelectionProvider().getSelection() instanceof ITextSelection) {
      ITextSelection selection = (ITextSelection)textViewer.getSelectionProvider().getSelection();
      return new Region(selection.getOffset(),0);
    }
    return new Region(offset, 0);
  }
View Full Code Here

    IEditorPart editorPart = Plugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (editorPart != null && editorPart instanceof ITextEditor) {
      _editor = (ITextEditor) editorPart;
    }
    ITextSelection selection = ((ITextSelection) _editor.getEditorSite().getSelectionProvider().getSelection());
    _currentSelection = new Region(selection.getOffset(), selection.getLength());
   
   
   
  }
View Full Code Here

        end =
          Math.min(
            partition.getOffset() + partition.getLength(),
            end);
        return new Region(start, end - start);

      } catch (BadLocationException x) {
      }
    }
View Full Code Here

        end =
          Math.min(
            partition.getOffset() + partition.getLength(),
            end);
        return new Region(start, end - start);

      } catch (BadLocationException x) {
      }
    }
View Full Code Here

     * @param parent expected parent class file
     * @return The region in the inner class (if inner class could be found), or an empty
     * zero-based region.
     */
    public static IRegion checkForInnerClass(int sourceLine, IClassFile parent) {
        IRegion region = new Region(0, 0);

        // get the editor with given class file, if any
        BytecodeClassFileEditor editor = getBytecodeEditor(parent);
        if (editor == null) {
            return region;
View Full Code Here

        end =
          Math.min(
            partition.getOffset() + partition.getLength(),
            end);
        return new Region(start, end - start);

      } catch (BadLocationException x) {
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.Region

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.