Package org.eclipse.jface.text.projection

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


  /*
   * @see org.eclipse.jface.text.TextViewer#handleVisibleDocumentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
   */
  protected void handleVisibleDocumentChanged(DocumentEvent event) {
    if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) {
      ProjectionDocumentEvent e= (ProjectionDocumentEvent) event;

      DocumentEvent master= e.getMasterEvent();
      if (master != null)
        fReplaceVisibleDocumentExecutionTrigger= master.getDocument();

      try {

        int replaceLength= e.getText() == null ? 0 : e.getText().length();
        if (ProjectionDocumentEvent.PROJECTION_CHANGE == e.getChangeType()) {
          if (e.getLength() == 0 && replaceLength != 0)
            fProjectionAnnotationModel.expandAll(e.getMasterOffset(), e.getMasterLength());
        } else if (master != null && (replaceLength > 0 || fDeletedLines > 1)) {
          try {
            int numberOfLines= e.getDocument().getNumberOfLines(e.getOffset(), replaceLength);
            if (numberOfLines > 1 || fDeletedLines > 1)
              fProjectionAnnotationModel.expandAll(master.getOffset(), master.getLength());
          } catch (BadLocationException x) {
          }
        }
View Full Code Here


  /*
   * @see org.eclipse.jface.text.TextViewer#handleVisibleDocumentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
   */
  protected void handleVisibleDocumentChanged(DocumentEvent event) {
    if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) {
      ProjectionDocumentEvent e= (ProjectionDocumentEvent) event;

      DocumentEvent master= e.getMasterEvent();
      if (master != null)
        fReplaceVisibleDocumentExecutionTrigger= master.getDocument();

      try {

        int replaceLength= e.getText() == null ? 0 : e.getText().length();
        if (ProjectionDocumentEvent.PROJECTION_CHANGE == e.getChangeType()) {
          if (e.getLength() == 0 && replaceLength != 0)
            fProjectionAnnotationModel.expandAll(e.getMasterOffset(), e.getMasterLength());
        } else if (master != null && (replaceLength > 0 || fDeletedLines > 1)) {
          try {
            int numberOfLines= e.getDocument().getNumberOfLines(e.getOffset(), replaceLength);
            if (numberOfLines > 1 || fDeletedLines > 1)
              fProjectionAnnotationModel.expandAll(master.getOffset(), replaceLength);
          } catch (BadLocationException x) {
          }
        }
View Full Code Here

  /*
   * @see org.eclipse.jface.text.TextViewer#handleVisibleDocumentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
   */
  protected void handleVisibleDocumentChanged(DocumentEvent event) {
    if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) {
      ProjectionDocumentEvent e= (ProjectionDocumentEvent) event;

      DocumentEvent master= e.getMasterEvent();
      if (master != null)
        fReplaceVisibleDocumentExecutionTrigger= master.getDocument();

      try {

        int replaceLength= e.getText() == null ? 0 : e.getText().length();
        if (ProjectionDocumentEvent.PROJECTION_CHANGE == e.getChangeType()) {
          if (e.getLength() == 0 && replaceLength != 0)
            fProjectionAnnotationModel.expandAll(e.getMasterOffset(), e.getMasterLength());
        } else if (master != null && (replaceLength > 0 || fDeletedLines > 1)) {
          try {
            int numberOfLines= e.getDocument().getNumberOfLines(e.getOffset(), replaceLength);
            if (numberOfLines > 1 || fDeletedLines > 1)
              fProjectionAnnotationModel.expandAll(master.getOffset(), replaceLength);
          } catch (BadLocationException x) {
          }
        }
View Full Code Here

TOP

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

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.