Mercurial > projects > dwt-addons
comparison dwtx/jface/text/source/SourceViewer.d @ 138:b6bad70d540a
Regex instanceof changes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:26:23 +0200 |
parents | 51e6e63f930e |
children | 893c017bcdc5 |
comparison
equal
deleted
inserted
replaced
137:25170b5a8951 | 138:b6bad70d540a |
---|---|
582 protected void disposeVisualAnnotationModel() { | 582 protected void disposeVisualAnnotationModel() { |
583 if (fVisualAnnotationModel !is null) { | 583 if (fVisualAnnotationModel !is null) { |
584 if (getDocument() !is null) | 584 if (getDocument() !is null) |
585 fVisualAnnotationModel.disconnect(getDocument()); | 585 fVisualAnnotationModel.disconnect(getDocument()); |
586 | 586 |
587 if ( fVisualAnnotationModel instanceof IAnnotationModelExtension) | 587 if ( cast(IAnnotationModelExtension)fVisualAnnotationModel ) |
588 (cast(IAnnotationModelExtension)fVisualAnnotationModel).removeAnnotationModel(MODEL_ANNOTATION_MODEL); | 588 (cast(IAnnotationModelExtension)fVisualAnnotationModel).removeAnnotationModel(MODEL_ANNOTATION_MODEL); |
589 | 589 |
590 fVisualAnnotationModel= null; | 590 fVisualAnnotationModel= null; |
591 } | 591 } |
592 } | 592 } |
616 | 616 |
617 /* | 617 /* |
618 * @see ISourceViewer#getAnnotationModel() | 618 * @see ISourceViewer#getAnnotationModel() |
619 */ | 619 */ |
620 public IAnnotationModel getAnnotationModel() { | 620 public IAnnotationModel getAnnotationModel() { |
621 if (fVisualAnnotationModel instanceof IAnnotationModelExtension) { | 621 if ( cast(IAnnotationModelExtension)fVisualAnnotationModel ) { |
622 IAnnotationModelExtension extension= cast(IAnnotationModelExtension) fVisualAnnotationModel; | 622 IAnnotationModelExtension extension= cast(IAnnotationModelExtension) fVisualAnnotationModel; |
623 return extension.getAnnotationModel(MODEL_ANNOTATION_MODEL); | 623 return extension.getAnnotationModel(MODEL_ANNOTATION_MODEL); |
624 } | 624 } |
625 return null; | 625 return null; |
626 } | 626 } |
888 final IRewriteTarget target= getRewriteTarget(); | 888 final IRewriteTarget target= getRewriteTarget(); |
889 final IDocument document= getDocument(); | 889 final IDocument document= getDocument(); |
890 IFormattingContext context= null; | 890 IFormattingContext context= null; |
891 DocumentRewriteSession rewriteSession= null; | 891 DocumentRewriteSession rewriteSession= null; |
892 | 892 |
893 if (document instanceof IDocumentExtension4) { | 893 if ( cast(IDocumentExtension4)document ) { |
894 IDocumentExtension4 extension= cast(IDocumentExtension4) document; | 894 IDocumentExtension4 extension= cast(IDocumentExtension4) document; |
895 DocumentRewriteSessionType type= selection.y is 0 || selection.y > 1000 ? DocumentRewriteSessionType.SEQUENTIAL : DocumentRewriteSessionType.UNRESTRICTED_SMALL; | 895 DocumentRewriteSessionType type= selection.y is 0 || selection.y > 1000 ? DocumentRewriteSessionType.SEQUENTIAL : DocumentRewriteSessionType.UNRESTRICTED_SMALL; |
896 rewriteSession= extension.startRewriteSession(type); | 896 rewriteSession= extension.startRewriteSession(type); |
897 } else { | 897 } else { |
898 setRedraw(false); | 898 setRedraw(false); |
903 | 903 |
904 final String rememberedContents= document.get(); | 904 final String rememberedContents= document.get(); |
905 | 905 |
906 try { | 906 try { |
907 | 907 |
908 if (fContentFormatter instanceof IContentFormatterExtension) { | 908 if ( cast(IContentFormatterExtension)fContentFormatter ) { |
909 final IContentFormatterExtension extension= cast(IContentFormatterExtension) fContentFormatter; | 909 final IContentFormatterExtension extension= cast(IContentFormatterExtension) fContentFormatter; |
910 context= createFormattingContext(); | 910 context= createFormattingContext(); |
911 if (selection.y is 0) { | 911 if (selection.y is 0) { |
912 context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.TRUE); | 912 context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.TRUE); |
913 } else { | 913 } else { |
936 throw x; | 936 throw x; |
937 } | 937 } |
938 | 938 |
939 } finally { | 939 } finally { |
940 | 940 |
941 if (document instanceof IDocumentExtension4) { | 941 if ( cast(IDocumentExtension4)document ) { |
942 IDocumentExtension4 extension= cast(IDocumentExtension4) document; | 942 IDocumentExtension4 extension= cast(IDocumentExtension4) document; |
943 extension.stopRewriteSession(rewriteSession); | 943 extension.stopRewriteSession(rewriteSession); |
944 } else { | 944 } else { |
945 target.endCompoundChange(); | 945 target.endCompoundChange(); |
946 setRedraw(true); | 946 setRedraw(true); |
964 * @param masterDocument the master document | 964 * @param masterDocument the master document |
965 * @since 3.0 | 965 * @since 3.0 |
966 */ | 966 */ |
967 protected void updateSlaveDocuments(IDocument masterDocument) { | 967 protected void updateSlaveDocuments(IDocument masterDocument) { |
968 ISlaveDocumentManager manager= getSlaveDocumentManager(); | 968 ISlaveDocumentManager manager= getSlaveDocumentManager(); |
969 if (manager instanceof ISlaveDocumentManagerExtension) { | 969 if ( cast(ISlaveDocumentManagerExtension)manager ) { |
970 ISlaveDocumentManagerExtension extension= cast(ISlaveDocumentManagerExtension) manager; | 970 ISlaveDocumentManagerExtension extension= cast(ISlaveDocumentManagerExtension) manager; |
971 IDocument[] slaves= extension.getSlaveDocuments(masterDocument); | 971 IDocument[] slaves= extension.getSlaveDocuments(masterDocument); |
972 if (slaves !is null) { | 972 if (slaves !is null) { |
973 for (int i= 0; i < slaves.length; i++) { | 973 for (int i= 0; i < slaves.length; i++) { |
974 if (slaves[i] instanceof ChildDocument) { | 974 if (slaves[i] instanceof ChildDocument) { |
1097 * | 1097 * |
1098 * @return <code>true</code> if the vertical ruler only show annotations | 1098 * @return <code>true</code> if the vertical ruler only show annotations |
1099 * @since 3.3 | 1099 * @since 3.3 |
1100 */ | 1100 */ |
1101 private bool isVerticalRulerOnlyShowingAnnotations() { | 1101 private bool isVerticalRulerOnlyShowingAnnotations() { |
1102 if (fVerticalRuler instanceof VerticalRuler) | 1102 if ( cast(VerticalRuler)fVerticalRuler ) |
1103 return true; | 1103 return true; |
1104 | 1104 |
1105 if (fVerticalRuler instanceof CompositeRuler) { | 1105 if ( cast(CompositeRuler)fVerticalRuler ) { |
1106 Iterator iter= (cast(CompositeRuler)fVerticalRuler).getDecoratorIterator(); | 1106 Iterator iter= (cast(CompositeRuler)fVerticalRuler).getDecoratorIterator(); |
1107 return iter.hasNext() && iter.next() instanceof AnnotationRulerColumn && !iter.hasNext(); | 1107 return iter.hasNext() && iter.next() instanceof AnnotationRulerColumn && !iter.hasNext(); |
1108 } | 1108 } |
1109 return false; | 1109 return false; |
1110 } | 1110 } |