Package org.eclipse.jface.text.projection

Examples of org.eclipse.jface.text.projection.ProjectionDocument


  /*
   * @see org.eclipse.jface.text.TextViewer#updateSlaveDocument(org.eclipse.jface.text.IDocument, int, int)
   */
  protected boolean updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) throws BadLocationException {
    if (slaveDocument instanceof ProjectionDocument) {
      ProjectionDocument projection= (ProjectionDocument) slaveDocument;

      int offset= modelRangeOffset;
      int length= modelRangeLength;

      if (!isProjectionMode()) {
        // mimic original TextViewer behavior
        IDocument master= projection.getMasterDocument();
        int line= master.getLineOfOffset(modelRangeOffset);
        offset= master.getLineOffset(line);
        length= (modelRangeOffset - offset) + modelRangeLength;

      }

      try {
        fHandleProjectionChanges= false;
        projection.replaceMasterDocumentRanges(offset, length);
      } finally {
        fHandleProjectionChanges= true;
      }
      return true;
    }
View Full Code Here


   * @param length the length of the range to hide
   * @param fireRedraw <code>true</code> if a redraw request should be issued, <code>false</code> otherwise
   * @throws BadLocationException in case the range is invalid
   */
  private void collapse(int offset, int length, boolean fireRedraw) throws BadLocationException {
    ProjectionDocument projection= null;

    IDocument visibleDocument= getVisibleDocument();
    if (visibleDocument instanceof ProjectionDocument)
      projection= (ProjectionDocument) visibleDocument;
    else {
View Full Code Here

   * @throws BadLocationException in case the range is invalid
   */
  private void expand(int offset, int length, boolean fireRedraw) throws BadLocationException {
    IDocument slave= getVisibleDocument();
    if (slave instanceof ProjectionDocument) {
      ProjectionDocument projection= (ProjectionDocument) slave;

      // expand
      addMasterDocumentRange(projection, offset, length);

      // collapse contained regions
View Full Code Here

   *
   * @throws BadLocationException in case something goes wrong during initialization
   */
  public final void reinitializeProjection() throws BadLocationException {

    ProjectionDocument projection= null;

    ISlaveDocumentManager manager= getSlaveDocumentManager();
    if (manager != null) {
      IDocument master= getDocument();
      if (master != null) {
View Full Code Here

  /*
   * @see org.eclipse.jface.text.TextViewer#updateSlaveDocument(org.eclipse.jface.text.IDocument, int, int)
   */
  protected boolean updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) throws BadLocationException {
    if (slaveDocument instanceof ProjectionDocument) {
      ProjectionDocument projection= (ProjectionDocument) slaveDocument;

      int offset= modelRangeOffset;
      int length= modelRangeLength;

      if (!isProjectionMode()) {
        // mimic original TextViewer behavior
        IDocument master= projection.getMasterDocument();
        int line= master.getLineOfOffset(modelRangeOffset);
        offset= master.getLineOffset(line);
        length= (modelRangeOffset - offset) + modelRangeLength;

      }

      try {
        fHandleProjectionChanges= false;
        projection.replaceMasterDocumentRanges(offset, length);
      } finally {
        fHandleProjectionChanges= true;
      }
      return true;
    }
View Full Code Here

   * @param length the length of the range to hide
   * @param fireRedraw <code>true</code> if a redraw request should be issued, <code>false</code> otherwise
   * @throws BadLocationException in case the range is invalid
   */
  private void collapse(int offset, int length, boolean fireRedraw) throws BadLocationException {
    ProjectionDocument projection= null;

    IDocument visibleDocument= getVisibleDocument();
    if (visibleDocument instanceof ProjectionDocument)
      projection= (ProjectionDocument) visibleDocument;
    else {
View Full Code Here

   * @throws BadLocationException in case the range is invalid
   */
  private void expand(int offset, int length, boolean fireRedraw) throws BadLocationException {
    IDocument slave= getVisibleDocument();
    if (slave instanceof ProjectionDocument) {
      ProjectionDocument projection= (ProjectionDocument) slave;

      // expand
      addMasterDocumentRange(projection, offset, length);

      // collapse contained regions
View Full Code Here

   *
   * @throws BadLocationException in case something goes wrong during initialization
   */
  public final void reinitializeProjection() throws BadLocationException {

    ProjectionDocument projection= null;

    ISlaveDocumentManager manager= getSlaveDocumentManager();
    if (manager != null) {
      IDocument master= getDocument();
      if (master != null) {
View Full Code Here

  /*
   * @see org.eclipse.jface.text.TextViewer#updateSlaveDocument(org.eclipse.jface.text.IDocument, int, int)
   */
  protected boolean updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) throws BadLocationException {
    if (slaveDocument instanceof ProjectionDocument) {
      ProjectionDocument projection= (ProjectionDocument) slaveDocument;

      int offset= modelRangeOffset;
      int length= modelRangeLength;

      if (!isProjectionMode()) {
        // mimic original TextViewer behavior
        IDocument master= projection.getMasterDocument();
        int line= master.getLineOfOffset(modelRangeOffset);
        offset= master.getLineOffset(line);
        length= (modelRangeOffset - offset) + modelRangeLength;

      }

      try {
        fHandleProjectionChanges= false;
        projection.replaceMasterDocumentRanges(offset, length);
      } finally {
        fHandleProjectionChanges= true;
      }
      return true;
    }
View Full Code Here

   * @param length the length of the range to hide
   * @param fireRedraw <code>true</code> if a redraw request should be issued, <code>false</code> otherwise
   * @throws BadLocationException in case the range is invalid
   */
  private void collapse(int offset, int length, boolean fireRedraw) throws BadLocationException {
    ProjectionDocument projection= null;

    IDocument visibleDocument= getVisibleDocument();
    if (visibleDocument instanceof ProjectionDocument)
      projection= (ProjectionDocument) visibleDocument;
    else {
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.projection.ProjectionDocument

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.