changeset 138:b6bad70d540a

Regex instanceof changes
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 02:26:23 +0200
parents 25170b5a8951
children 93a6ec48fd28
files dwtx/jface/internal/text/InformationControlReplacer.d dwtx/jface/internal/text/StickyHoverManager.d dwtx/jface/internal/text/html/BrowserInformationControl.d dwtx/jface/internal/text/link/contentassist/AdditionalInfoController2.d dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d dwtx/jface/internal/text/link/contentassist/ContentAssistant2.d dwtx/jface/internal/text/link/contentassist/ContextInformationPopup2.d dwtx/jface/internal/text/revisions/Hunk.d dwtx/jface/internal/text/revisions/RevisionPainter.d dwtx/jface/internal/text/revisions/RevisionSelectionProvider.d dwtx/jface/internal/text/source/DiffPainter.d dwtx/jface/text/AbstractDocument.d dwtx/jface/text/AbstractHoverInformationControlManager.d dwtx/jface/text/AbstractInformationControlManager.d dwtx/jface/text/AbstractReusableInformationControlCreator.d dwtx/jface/text/CursorLinePainter.d dwtx/jface/text/DefaultDocumentAdapter.d dwtx/jface/text/DefaultInformationControl.d dwtx/jface/text/DefaultUndoManager.d dwtx/jface/text/DocumentCommand.d dwtx/jface/text/DocumentEvent.d dwtx/jface/text/JFaceTextUtil.d dwtx/jface/text/Position.d dwtx/jface/text/PropagatingFontFieldEditor.d dwtx/jface/text/Region.d dwtx/jface/text/RewriteSessionEditProcessor.d dwtx/jface/text/TextAttribute.d dwtx/jface/text/TextViewer.d dwtx/jface/text/TextViewerHoverManager.d dwtx/jface/text/TextViewerUndoManager.d dwtx/jface/text/TypedPosition.d dwtx/jface/text/TypedRegion.d dwtx/jface/text/WhitespaceCharacterPainter.d dwtx/jface/text/contentassist/AdditionalInfoController.d dwtx/jface/text/contentassist/CompletionProposalPopup.d dwtx/jface/text/contentassist/ContentAssistSubjectControlAdapter.d dwtx/jface/text/contentassist/ContentAssistant.d dwtx/jface/text/contentassist/ContextInformation.d dwtx/jface/text/contentassist/ContextInformationPopup.d dwtx/jface/text/contentassist/PopupCloser.d dwtx/jface/text/formatter/ContentFormatter.d dwtx/jface/text/formatter/MultiPassContentFormatter.d dwtx/jface/text/hyperlink/DefaultHyperlinkPresenter.d dwtx/jface/text/hyperlink/HyperlinkManager.d dwtx/jface/text/hyperlink/MultipleHyperlinkPresenter.d dwtx/jface/text/information/InformationPresenter.d dwtx/jface/text/link/LinkedModeModel.d dwtx/jface/text/link/LinkedModeUI.d dwtx/jface/text/link/LinkedPosition.d dwtx/jface/text/link/ProposalPosition.d dwtx/jface/text/presentation/PresentationReconciler.d dwtx/jface/text/projection/ProjectionDocument.d dwtx/jface/text/projection/ProjectionDocumentManager.d dwtx/jface/text/projection/SegmentUpdater.d dwtx/jface/text/quickassist/QuickAssistAssistant.d dwtx/jface/text/reconciler/MonoReconciler.d dwtx/jface/text/reconciler/Reconciler.d dwtx/jface/text/rules/DefaultDamagerRepairer.d dwtx/jface/text/rules/DefaultPartitioner.d dwtx/jface/text/rules/FastPartitioner.d dwtx/jface/text/rules/RuleBasedPartitioner.d dwtx/jface/text/source/AnnotationBarHoverManager.d dwtx/jface/text/source/AnnotationModel.d dwtx/jface/text/source/AnnotationModelEvent.d dwtx/jface/text/source/AnnotationPainter.d dwtx/jface/text/source/AnnotationRulerColumn.d dwtx/jface/text/source/ChangeRulerColumn.d dwtx/jface/text/source/CompositeRuler.d dwtx/jface/text/source/DefaultAnnotationHover.d dwtx/jface/text/source/LineChangeHover.d dwtx/jface/text/source/LineNumberRulerColumn.d dwtx/jface/text/source/MatchingCharacterPainter.d dwtx/jface/text/source/OverviewRuler.d dwtx/jface/text/source/OverviewRulerHoverManager.d dwtx/jface/text/source/SourceViewer.d dwtx/jface/text/source/VerticalRuler.d dwtx/jface/text/source/projection/ProjectionAnnotationHover.d dwtx/jface/text/source/projection/ProjectionAnnotationModel.d dwtx/jface/text/source/projection/ProjectionRulerColumn.d dwtx/jface/text/source/projection/ProjectionSummary.d dwtx/jface/text/source/projection/ProjectionSupport.d dwtx/jface/text/source/projection/ProjectionViewer.d dwtx/jface/text/source/projection/SourceViewerInformationControl.d dwtx/jface/text/templates/Template.d dwtx/jface/text/templates/TemplateProposal.d dwtx/jface/text/templates/TemplateVariableType.d dwtx/jface/text/templates/persistence/TemplateReaderWriter.d dwtx/jface/text/templates/persistence/TemplateStore.d
diffstat 88 files changed, 316 insertions(+), 316 deletions(-) [+]
line wrap: on
line diff
--- a/dwtx/jface/internal/text/InformationControlReplacer.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/InformationControlReplacer.d	Sun Aug 24 02:26:23 2008 +0200
@@ -138,7 +138,7 @@
         IInformationControl informationControl= getInformationControl();
         
         Rectangle controlBounds= fContentBounds;
-        if (informationControl instanceof IInformationControlExtension3) {
+        if ( cast(IInformationControlExtension3)informationControl ) {
             IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) informationControl;
             Rectangle trim= iControl3.computeTrim();
             controlBounds= Geometry.add(controlBounds, trim);
@@ -159,7 +159,7 @@
         // Caveat: some IInformationControls fail unless setSizeConstraints(..) is called with concrete values
         informationControl.setSizeConstraints(size.x, size.y);
         
-        if (informationControl instanceof IInformationControlExtension2)
+        if ( cast(IInformationControlExtension2)informationControl )
             (cast(IInformationControlExtension2) informationControl).setInput(information);
         else
             informationControl.setInformation(information.toString());
--- a/dwtx/jface/internal/text/StickyHoverManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/StickyHoverManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -373,7 +373,7 @@
      */
     public bool setFocus(IWidgetTokenOwner owner) {
         IInformationControl iControl= getCurrentInformationControl2();
-        if (iControl instanceof IInformationControlExtension5) {
+        if ( cast(IInformationControlExtension5)iControl ) {
             IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) iControl;
             if (iControl5.isVisible()) {
                 iControl.setFocus();
--- a/dwtx/jface/internal/text/html/BrowserInformationControl.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/html/BrowserInformationControl.d	Sun Aug 24 02:26:23 2008 +0200
@@ -274,7 +274,7 @@
     public void setInput(Object input) {
         Assert.isLegal(input is null || input instanceof String || input instanceof BrowserInformationControlInput);
 
-        if (input instanceof String) {
+        if ( cast(String)input ) {
             setInformation(cast(String)input);
             return;
         }
--- a/dwtx/jface/internal/text/link/contentassist/AdditionalInfoController2.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/AdditionalInfoController2.d	Sun Aug 24 02:26:23 2008 +0200
@@ -116,7 +116,7 @@
 
         super.install(control);
 
-        Assert.isTrue(control instanceof Table);
+        Assert.isTrue( cast(Table)control );
         fProposalTable= cast(Table) control;
         fProposalTable.addSelectionListener(fSelectionListener);
         synchronized (fThreadAccess) {
@@ -234,12 +234,12 @@
             String information= null;
             Object d= item.getData();
 
-            if (d instanceof ICompletionProposal) {
+            if ( cast(ICompletionProposal)d ) {
                 ICompletionProposal p= cast(ICompletionProposal) d;
                 information= p.getAdditionalProposalInfo();
             }
 
-            if (d instanceof ICompletionProposalExtension3)
+            if ( cast(ICompletionProposalExtension3)d )
                 setCustomInformationControlCreator((cast(ICompletionProposalExtension3) d).getInformationControlCreator());
             else
                 setCustomInformationControlCreator(null);
--- a/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d	Sun Aug 24 02:26:23 2008 +0200
@@ -391,7 +391,7 @@
 
             IDocument document= fViewer.getDocument();
 
-            if (fViewer instanceof ITextViewerExtension) {
+            if ( cast(ITextViewerExtension)fViewer ) {
                 ITextViewerExtension extension= cast(ITextViewerExtension) fViewer;
                 target= extension.getRewriteTarget();
             }
@@ -399,15 +399,15 @@
             if (target !is null)
                 target.beginCompoundChange();
 
-            if (fViewer instanceof IEditingSupportRegistry) {
+            if ( cast(IEditingSupportRegistry)fViewer ) {
                 registry= cast(IEditingSupportRegistry) fViewer;
                 registry.register(fModificationEditingSupport);
             }
 
-            if (p instanceof ICompletionProposalExtension2) {
+            if ( cast(ICompletionProposalExtension2)p ) {
                 ICompletionProposalExtension2 e= cast(ICompletionProposalExtension2) p;
                 e.apply(fViewer, trigger, stateMask, offset);
-            } else if (p instanceof ICompletionProposalExtension) {
+            } else if ( cast(ICompletionProposalExtension)p ) {
                 ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
                 e.apply(document, trigger, offset);
             } else {
@@ -424,7 +424,7 @@
             if (info !is null) {
 
                 int position;
-                if (p instanceof ICompletionProposalExtension) {
+                if ( cast(ICompletionProposalExtension)p ) {
                     ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
                     position= e.getContextInformationPosition();
                 } else {
@@ -468,7 +468,7 @@
 
         unregister();
 
-        if (fViewer instanceof IEditingSupportRegistry) {
+        if ( cast(IEditingSupportRegistry)fViewer ) {
             IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
             registry.unregister(fFocusEditingSupport);
         }
@@ -502,7 +502,7 @@
             styledText.removeKeyListener(fKeyListener);
 
         if (fLastProposal !is null) {
-            if (fLastProposal instanceof ICompletionProposalExtension2) {
+            if ( cast(ICompletionProposalExtension2)fLastProposal ) {
                 ICompletionProposalExtension2 extension= cast(ICompletionProposalExtension2) fLastProposal;
                 extension.unselected(fViewer);
             }
@@ -533,7 +533,7 @@
         if (Helper2.okToUse(fProposalTable)) {
 
             ICompletionProposal oldProposal= getSelectedProposal();
-            if (oldProposal instanceof ICompletionProposalExtension2)
+            if ( cast(ICompletionProposalExtension2)oldProposal )
                 (cast(ICompletionProposalExtension2) oldProposal).unselected(fViewer);
 
             fFilteredProposals= proposals;
@@ -627,11 +627,11 @@
 
     private bool validateProposal(IDocument document, ICompletionProposal p, int offset, DocumentEvent event) {
         // detect selected
-        if (p instanceof ICompletionProposalExtension2) {
+        if ( cast(ICompletionProposalExtension2)p ) {
             ICompletionProposalExtension2 e= cast(ICompletionProposalExtension2) p;
             if (e.validate(document, offset, event))
                 return true;
-        } else if (p instanceof ICompletionProposalExtension) {
+        } else if ( cast(ICompletionProposalExtension)p ) {
             ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
             if (e.isValidFor(document, offset))
                 return true;
@@ -680,7 +680,7 @@
                 document.addDocumentListener(fDocumentListener);
 
 
-            if (fViewer instanceof IEditingSupportRegistry) {
+            if ( cast(IEditingSupportRegistry)fViewer ) {
                 IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
                 registry.register(fFocusEditingSupport);
             }
@@ -787,7 +787,7 @@
 
                 default:
                     ICompletionProposal p= getSelectedProposal();
-                if (p instanceof ICompletionProposalExtension) {
+                if ( cast(ICompletionProposalExtension)p ) {
                     ICompletionProposalExtension t= cast(ICompletionProposalExtension) p;
                     char[] triggers= t.getTriggerCharacters();
                     if (contains(triggers, key)) {
@@ -817,11 +817,11 @@
     private void selectProposal(int index, bool smartToggle) {
 
         ICompletionProposal oldProposal= getSelectedProposal();
-        if (oldProposal instanceof ICompletionProposalExtension2)
+        if ( cast(ICompletionProposalExtension2)oldProposal )
             (cast(ICompletionProposalExtension2) oldProposal).unselected(fViewer);
 
         ICompletionProposal proposal= fFilteredProposals[index];
-        if (proposal instanceof ICompletionProposalExtension2)
+        if ( cast(ICompletionProposalExtension2)proposal )
             (cast(ICompletionProposalExtension2) proposal).selected(fViewer, smartToggle);
 
         fLastProposal= proposal;
--- a/dwtx/jface/internal/text/link/contentassist/ContentAssistant2.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/ContentAssistant2.d	Sun Aug 24 02:26:23 2008 +0200
@@ -848,7 +848,7 @@
 
             if (fViewer !is null && fAutoAssistListener is null) {
                 fAutoAssistListener= new AutoAssistListener();
-                if (fViewer instanceof ITextViewerExtension) {
+                if ( cast(ITextViewerExtension)fViewer ) {
                     ITextViewerExtension extension= cast(ITextViewerExtension) fViewer;
                     extension.appendVerifyKeyListener(fAutoAssistListener);
                 } else {
@@ -860,7 +860,7 @@
 
         } else if (fAutoAssistListener !is null) {
 
-            if (fViewer instanceof ITextViewerExtension) {
+            if ( cast(ITextViewerExtension)fViewer ) {
                 ITextViewerExtension extension= cast(ITextViewerExtension) fViewer;
                 extension.removeVerifyKeyListener(fAutoAssistListener);
             } else {
@@ -1124,10 +1124,10 @@
         switch (type) {
             case CONTEXT_SELECTOR:
             case PROPOSAL_SELECTOR:
-                if (fViewer instanceof IWidgetTokenOwner) {
+                if ( cast(IWidgetTokenOwner)fViewer ) {
                     IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fViewer;
                     return owner.requestWidgetToken(this);
-                } else if (fViewer instanceof IWidgetTokenOwnerExtension)  {
+                } else if ( cast(IWidgetTokenOwnerExtension)fViewer )  {
                     IWidgetTokenOwnerExtension extension= cast(IWidgetTokenOwnerExtension) fViewer;
                     return extension.requestWidgetToken(this, WIDGET_PRIORITY);
                 }
@@ -1177,7 +1177,7 @@
             StyledText text= fViewer.getTextWidget();
             if (Helper2.okToUse(text)) {
 
-                if (fViewer instanceof ITextViewerExtension) {
+                if ( cast(ITextViewerExtension)fViewer ) {
                     ITextViewerExtension e= cast(ITextViewerExtension) fViewer;
                     e.prependVerifyKeyListener(fInternalListener);
                 } else {
@@ -1205,7 +1205,7 @@
      */
     private void releaseWidgetToken(int type) {
         if (fListeners[CONTEXT_SELECTOR] is null && fListeners[PROPOSAL_SELECTOR] is null) {
-            if (fViewer instanceof IWidgetTokenOwner) {
+            if ( cast(IWidgetTokenOwner)fViewer ) {
                 IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fViewer;
                 owner.releaseWidgetToken(this);
             }
@@ -1245,7 +1245,7 @@
             StyledText text= fViewer.getTextWidget();
             if (Helper2.okToUse(text)) {
 
-                if (fViewer instanceof ITextViewerExtension) {
+                if ( cast(ITextViewerExtension)fViewer ) {
                     ITextViewerExtension e= cast(ITextViewerExtension) fViewer;
                     e.removeVerifyKeyListener(fInternalListener);
                 } else {
@@ -1433,7 +1433,7 @@
      */
     IContextInformationPresenter getContextInformationPresenter(ITextViewer textViewer, int offset) {
         IContextInformationValidator validator= getContextInformationValidator(textViewer, offset);
-        if (validator instanceof IContextInformationPresenter)
+        if ( cast(IContextInformationPresenter)validator )
             return cast(IContextInformationPresenter) validator;
         return null;
     }
--- a/dwtx/jface/internal/text/link/contentassist/ContextInformationPopup2.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/ContextInformationPopup2.d	Sun Aug 24 02:26:23 2008 +0200
@@ -184,7 +184,7 @@
         if (validator !is null) {
             ContextFrame current= new ContextFrame();
             current.fInformation= information;
-            current.fBeginOffset= (information instanceof IContextInformationExtension) ? (cast(IContextInformationExtension) information).getContextInformationPosition() : offset;
+            current.fBeginOffset= ( cast(IContextInformationExtension)information ) ? (cast(IContextInformationExtension) information).getContextInformationPosition() : offset;
             if (current.fBeginOffset is -1) current.fBeginOffset= offset;
             current.fOffset= offset;
             current.fVisibleOffset= fViewer.getTextWidget().getSelectionRange().x - (offset - current.fBeginOffset);
--- a/dwtx/jface/internal/text/revisions/Hunk.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/revisions/Hunk.d	Sun Aug 24 02:26:23 2008 +0200
@@ -86,7 +86,7 @@
     public bool equals(Object obj) {
         if (obj is this)
             return true;
-        if (obj instanceof Hunk) {
+        if ( cast(Hunk)obj ) {
             Hunk other= cast(Hunk) obj;
             return other.line is this.line && other.delta is this.delta && other.changed is this.changed;
         }
--- a/dwtx/jface/internal/text/revisions/RevisionPainter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/revisions/RevisionPainter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -793,7 +793,7 @@
      */
     public void setModel(IAnnotationModel model) {
         IAnnotationModel diffModel;
-        if (model instanceof IAnnotationModelExtension)
+        if ( cast(IAnnotationModelExtension)model )
             diffModel= (cast(IAnnotationModelExtension) model).getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
         else
             diffModel= model;
@@ -1052,7 +1052,7 @@
     private ILineRange modelLinesToWidgetLines(ILineRange range) {
         int widgetStartLine= -1;
         int widgetEndLine= -1;
-        if (fViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fViewer;
             int modelEndLine= end(range);
             for (int modelLine= range.getStartLine(); modelLine < modelEndLine; modelLine++) {
@@ -1130,7 +1130,7 @@
             }
         }
 
-        if (fAnnotationModel instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)fAnnotationModel ) {
             IAnnotationModelExtension ext= cast(IAnnotationModelExtension) fAnnotationModel;
             ext.replaceAnnotations((Annotation[]) fAnnotations.toArray(new Annotation[fAnnotations.size()]), added);
         } else {
--- a/dwtx/jface/internal/text/revisions/RevisionSelectionProvider.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/revisions/RevisionSelectionProvider.d	Sun Aug 24 02:26:23 2008 +0200
@@ -66,7 +66,7 @@
 
         public void selectionChanged(SelectionChangedEvent event) {
             ISelection selection= event.getSelection();
-            if (selection instanceof ITextSelection) {
+            if ( cast(ITextSelection)selection ) {
                 ITextSelection ts= cast(ITextSelection) selection;
                 int offset= ts.getOffset();
                 setSelectedRevision(fPainter.getRevision(offset));
@@ -139,11 +139,11 @@
     public void setSelection(ISelection selection) {
         if (fIgnoreEvents)
             return;
-        if (selection instanceof IStructuredSelection) {
+        if ( cast(IStructuredSelection)selection ) {
             Object first= (cast(IStructuredSelection) selection).getFirstElement();
-            if (first instanceof Revision)
+            if ( cast(Revision)first )
                 fPainter.handleRevisionSelected(cast(Revision) first);
-            else if (first instanceof String)
+            else if ( cast(String)first )
                 fPainter.handleRevisionSelected(cast(String) first);
             else if (selection.isEmpty())
                 fPainter.handleRevisionSelected(cast(Revision) null);
@@ -160,7 +160,7 @@
         fViewer= viewer;
         if (fViewer !is null) {
             ISelectionProvider provider= fViewer.getSelectionProvider();
-            if (provider instanceof IPostSelectionProvider) {
+            if ( cast(IPostSelectionProvider)provider ) {
                 IPostSelectionProvider postProvider= cast(IPostSelectionProvider) provider;
                 fSelectionListener= new PostSelectionListener(postProvider);
             }
--- a/dwtx/jface/internal/text/source/DiffPainter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/internal/text/source/DiffPainter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -341,7 +341,7 @@
      */
     public void setModel(IAnnotationModel model) {
         IAnnotationModel newModel;
-        if (model instanceof IAnnotationModelExtension)
+        if ( cast(IAnnotationModelExtension)model )
             newModel= (cast(IAnnotationModelExtension) model).getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
         else
             newModel= model;
@@ -355,7 +355,7 @@
      * @param differ the line differ
      */
     private void setDiffer(IAnnotationModel differ) {
-        if (differ instanceof ILineDiffer) {
+        if ( cast(ILineDiffer)differ ) {
             if (fLineDiffer !is differ) {
                 if (fLineDiffer !is null)
                     (cast(IAnnotationModel) fLineDiffer).removeAnnotationModelListener(fAnnotationListener);
@@ -530,7 +530,7 @@
      * @since 3.3
      */
     public bool hasInformation() {
-        if (fLineDiffer instanceof ILineDifferExtension2)
+        if ( cast(ILineDifferExtension2)fLineDiffer )
             return !(cast(ILineDifferExtension2) fLineDiffer).isSuspended();
         return fLineDiffer !is null;
     }
--- a/dwtx/jface/text/AbstractDocument.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/AbstractDocument.d	Sun Aug 24 02:26:23 2008 +0200
@@ -722,7 +722,7 @@
         Object[] listeners= fDocumentPartitioningListeners.getListeners();
         for (int i= 0; i < listeners.length; i++) {
             IDocumentPartitioningListener l= cast(IDocumentPartitioningListener)listeners[i];
-            if (l instanceof IDocumentPartitioningListenerExtension)
+            if ( cast(IDocumentPartitioningListenerExtension)l )
                 (cast(IDocumentPartitioningListenerExtension) l).documentPartitioningChanged(this, region);
             else
                 l.documentPartitioningChanged(this);
@@ -745,10 +745,10 @@
         Object[] listeners= fDocumentPartitioningListeners.getListeners();
         for (int i= 0; i < listeners.length; i++) {
             IDocumentPartitioningListener l= cast(IDocumentPartitioningListener)listeners[i];
-            if (l instanceof IDocumentPartitioningListenerExtension2) {
+            if ( cast(IDocumentPartitioningListenerExtension2)l ) {
                 IDocumentPartitioningListenerExtension2 extension2= cast(IDocumentPartitioningListenerExtension2) l;
                 extension2.documentPartitioningChanged(event);
-            } else if (l instanceof IDocumentPartitioningListenerExtension) {
+            } else if ( cast(IDocumentPartitioningListenerExtension)l ) {
                 IDocumentPartitioningListenerExtension extension= cast(IDocumentPartitioningListenerExtension) l;
                 extension.documentPartitioningChanged(this, event.getCoverage());
             } else {
@@ -773,7 +773,7 @@
             Iterator e= fDocumentPartitioners.values().iterator();
             while (e.hasNext()) {
                 IDocumentPartitioner p= cast(IDocumentPartitioner) e.next();
-                if (p instanceof IDocumentPartitionerExtension3) {
+                if ( cast(IDocumentPartitionerExtension3)p ) {
                     IDocumentPartitionerExtension3 extension= cast(IDocumentPartitionerExtension3) p;
                     if (extension.getActiveRewriteSession() !is null)
                         continue;
@@ -807,13 +807,13 @@
                 String partitioning= cast(String) e.next();
                 IDocumentPartitioner partitioner= cast(IDocumentPartitioner) fDocumentPartitioners.get(partitioning);
 
-                if (partitioner instanceof IDocumentPartitionerExtension3) {
+                if ( cast(IDocumentPartitionerExtension3)partitioner ) {
                     IDocumentPartitionerExtension3 extension= cast(IDocumentPartitionerExtension3) partitioner;
                     if (extension.getActiveRewriteSession() !is null)
                         continue;
                 }
 
-                if (partitioner instanceof IDocumentPartitionerExtension) {
+                if ( cast(IDocumentPartitionerExtension)partitioner ) {
                     IDocumentPartitionerExtension extension= cast(IDocumentPartitionerExtension) partitioner;
                     IRegion r= extension.documentChanged2(event);
                     if (r !is null)
@@ -1529,7 +1529,7 @@
 
         IDocumentPartitioner partitioner= getDocumentPartitioner(partitioning);
 
-        if (partitioner instanceof IDocumentPartitionerExtension2) {
+        if ( cast(IDocumentPartitionerExtension2)partitioner ) {
             checkStateOfPartitioner(partitioner, partitioning);
             return (cast(IDocumentPartitionerExtension2) partitioner).computePartitioning(offset, length, includeZeroLengthPartitions);
         } else if (partitioner !is null) {
@@ -1551,7 +1551,7 @@
 
         IDocumentPartitioner partitioner= getDocumentPartitioner(partitioning);
 
-        if (partitioner instanceof IDocumentPartitionerExtension2) {
+        if ( cast(IDocumentPartitionerExtension2)partitioner ) {
             checkStateOfPartitioner(partitioner, partitioning);
             return (cast(IDocumentPartitionerExtension2) partitioner).getContentType(offset, preferOpenPartitions);
         } else if (partitioner !is null) {
@@ -1594,7 +1594,7 @@
 
         IDocumentPartitioner partitioner= getDocumentPartitioner(partitioning);
 
-        if (partitioner instanceof IDocumentPartitionerExtension2) {
+        if ( cast(IDocumentPartitionerExtension2)partitioner ) {
             checkStateOfPartitioner(partitioner, partitioning);
             return (cast(IDocumentPartitionerExtension2) partitioner).getPartition(offset, preferOpenPartitions);
         } else if (partitioner !is null) {
@@ -1690,7 +1690,7 @@
         startRewriteSessionOnPartitioners(fDocumentRewriteSession);
 
         ILineTracker tracker= getTracker();
-        if (tracker instanceof ILineTrackerExtension) {
+        if ( cast(ILineTrackerExtension)tracker ) {
             ILineTrackerExtension extension= cast(ILineTrackerExtension) tracker;
             extension.startRewriteSession(fDocumentRewriteSession);
         }
@@ -1714,7 +1714,7 @@
             Iterator e= fDocumentPartitioners.values().iterator();
             while (e.hasNext()) {
                 Object partitioner= e.next();
-                if (partitioner instanceof IDocumentPartitionerExtension3) {
+                if ( cast(IDocumentPartitionerExtension3)partitioner ) {
                     IDocumentPartitionerExtension3 extension= cast(IDocumentPartitionerExtension3) partitioner;
                     extension.startRewriteSession(session);
                 }
@@ -1737,7 +1737,7 @@
                 stopSequentialRewrite();
 
             ILineTracker tracker= getTracker();
-            if (tracker instanceof ILineTrackerExtension) {
+            if ( cast(ILineTrackerExtension)tracker ) {
                 ILineTrackerExtension extension= cast(ILineTrackerExtension) tracker;
                 extension.stopRewriteSession(session, get());
             }
@@ -1762,7 +1762,7 @@
             while (e.hasNext()) {
                 String partitioning= cast(String) e.next();
                 IDocumentPartitioner partitioner= cast(IDocumentPartitioner) fDocumentPartitioners.get(partitioning);
-                if (partitioner instanceof IDocumentPartitionerExtension3) {
+                if ( cast(IDocumentPartitionerExtension3)partitioner ) {
                     IDocumentPartitionerExtension3 extension= cast(IDocumentPartitionerExtension3) partitioner;
                     extension.stopRewriteSession(session);
                     event.setPartitionChange(partitioning, 0, getLength());
@@ -1801,7 +1801,7 @@
      * @since 3.1
      */
     protected final void checkStateOfPartitioner(IDocumentPartitioner partitioner, String partitioning) {
-        if (!(partitioner instanceof IDocumentPartitionerExtension3))
+        if (!( cast(IDocumentPartitionerExtension3)partitioner ))
             return;
 
         IDocumentPartitionerExtension3 extension= cast(IDocumentPartitionerExtension3) partitioner;
--- a/dwtx/jface/text/AbstractHoverInformationControlManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/AbstractHoverInformationControlManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -268,7 +268,7 @@
                 fSubjectControl.addMouseMoveListener(this);
                 fSubjectControl.addControlListener(this);
                 fSubjectControl.addKeyListener(this);
-                if (fSubjectControl instanceof Scrollable) {
+                if ( cast(Scrollable)fSubjectControl ) {
                     Scrollable scrollable= cast(Scrollable) fSubjectControl;
                     ScrollBar vBar= scrollable.getVerticalBar();
                     if (vBar !is null)
@@ -312,7 +312,7 @@
                 fSubjectControl.removeMouseMoveListener(this);
                 fSubjectControl.removeControlListener(this);
                 fSubjectControl.removeKeyListener(this);
-                if (fSubjectControl instanceof Scrollable) {
+                if ( cast(Scrollable)fSubjectControl ) {
                     Scrollable scrollable= cast(Scrollable) fSubjectControl;
                     ScrollBar vBar= scrollable.getVerticalBar();
                     if (vBar !is null)
@@ -455,7 +455,7 @@
                             } else if (cancelReplacingDelay()) {
                                 if (event.type is DWT.MouseUp) {
                                     stop(); // avoid that someone else replaces the info control before the async is exec'd
-                                    if (infoControl instanceof IDelayedInputChangeProvider) {
+                                    if ( cast(IDelayedInputChangeProvider)infoControl ) {
                                         final IDelayedInputChangeProvider delayedICP= cast(IDelayedInputChangeProvider) infoControl;
                                         final IInputChangedListener inputChangeListener= new DelayedInputChangeListener(delayedICP, getInformationControlReplacer());
                                         delayedICP.setDelayedInputChangeListener(inputChangeListener);
@@ -837,7 +837,7 @@
                 }
             }
         }
-        if (iControl instanceof IInformationControlExtension3) {
+        if ( cast(IInformationControlExtension3)iControl ) {
             IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) iControl;
             
             Rectangle iControlBounds= subjectControl.getDisplay().map(null, subjectControl, iControl3.getBounds());
--- a/dwtx/jface/text/AbstractInformationControlManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/AbstractInformationControlManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -860,7 +860,7 @@
     protected Point computeSizeConstraints(Control subjectControl, IInformationControl informationControl) {
 
         if (fSizeConstraints is null) {
-            if (informationControl instanceof IInformationControlExtension5) {
+            if ( cast(IInformationControlExtension5)informationControl ) {
                 IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) informationControl;
                 fSizeConstraints= iControl5.computeSizeConstraints(fWidthConstraint, fHeightConstraint);
                 if (fSizeConstraints !is null)
@@ -902,7 +902,7 @@
 
         storeInformationControlBounds();
 
-        if (fInformationControl instanceof IInformationControlExtension5)
+        if ( cast(IInformationControlExtension5)fInformationControl )
             fSizeConstraints= null;
         fInformationControl= null;
         if (fInformationControlCloser !is null) {
@@ -927,7 +927,7 @@
         if (fCustomInformationControlCreator is null) {
             creator= fInformationControlCreator;
             if (fIsCustomInformationControl && fInformationControl !is null) {
-                if (fInformationControl instanceof IInformationControlExtension5)
+                if ( cast(IInformationControlExtension5)fInformationControl )
                     fSizeConstraints= null;
                 fInformationControl.dispose();
                 fInformationControl= null;
@@ -937,13 +937,13 @@
         } else  {
 
             creator= fCustomInformationControlCreator;
-            if (creator instanceof IInformationControlCreatorExtension)  {
+            if ( cast(IInformationControlCreatorExtension)creator )  {
                 IInformationControlCreatorExtension extension= cast(IInformationControlCreatorExtension) creator;
                 if (fInformationControl !is null && extension.canReuse(fInformationControl))
                     return fInformationControl;
             }
             if (fInformationControl !is null)  {
-                if (fInformationControl instanceof IInformationControlExtension5)
+                if ( cast(IInformationControlExtension5)fInformationControl )
                     fSizeConstraints= null;
                 fInformationControl.dispose();
                 fInformationControl= null;
@@ -1274,7 +1274,7 @@
      */
     protected void presentInformation() {
         bool hasContents= false;
-        if (fInformation instanceof String)
+        if ( cast(String)fInformation )
             hasContents= (cast(String)fInformation).trim().length() > 0;
         else
             hasContents= (fInformation !is null);
@@ -1293,7 +1293,7 @@
      * @param information the information
      */
     private void internalShowInformationControl(Rectangle subjectArea, Object information) {
-        if (this instanceof InformationControlReplacer) {
+        if ( cast(InformationControlReplacer)this ) {
             (cast(InformationControlReplacer) this).showInformationControl(subjectArea, information);
             return;
         }
@@ -1302,7 +1302,7 @@
         if (informationControl !is null) {
 
             Point sizeConstraints= computeSizeConstraints(fSubjectControl, fSubjectArea, informationControl);
-            if (informationControl instanceof IInformationControlExtension3) {
+            if ( cast(IInformationControlExtension3)informationControl ) {
                 IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) informationControl;
                 Rectangle trim= iControl3.computeTrim();
                 sizeConstraints.x += trim.width;
@@ -1310,12 +1310,12 @@
             }
             informationControl.setSizeConstraints(sizeConstraints.x, sizeConstraints.y);
 
-            if (informationControl instanceof IInformationControlExtension2)
+            if ( cast(IInformationControlExtension2)informationControl )
                 (cast(IInformationControlExtension2)informationControl).setInput(information);
             else
                 informationControl.setInformation(information.toString());
 
-            if (informationControl instanceof IInformationControlExtension) {
+            if ( cast(IInformationControlExtension)informationControl ) {
                 IInformationControlExtension extension= cast(IInformationControlExtension)informationControl;
                 if (!extension.hasContents())
                     return;
@@ -1465,7 +1465,7 @@
         if (fDialogSettings is null || fInformationControl is null || !(fIsRestoringLocation || fIsRestoringSize))
             return;
 
-        if (!(fInformationControl instanceof IInformationControlExtension3))
+        if (!( cast(IInformationControlExtension3)fInformationControl ))
             throw new UnsupportedOperationException();
 
         bool controlRestoresSize= (cast(IInformationControlExtension3)fInformationControl).restoresSize();
@@ -1494,7 +1494,7 @@
         if (fDialogSettings is null || !(fIsRestoringLocation || fIsRestoringSize))
             return null;
 
-        if (!(fInformationControl instanceof IInformationControlExtension3))
+        if (!( cast(IInformationControlExtension3)fInformationControl ))
             throw new UnsupportedOperationException();
 
         bool controlRestoresSize= (cast(IInformationControlExtension3)fInformationControl).restoresSize();
--- a/dwtx/jface/text/AbstractReusableInformationControlCreator.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/AbstractReusableInformationControlCreator.d	Sun Aug 24 02:26:23 2008 +0200
@@ -202,7 +202,7 @@
         Composite parent= null;
         if (e.widget instanceof Shell)
             parent= (cast(Shell)e.widget).getParent();
-        if (parent instanceof Shell)
+        if ( cast(Shell)parent )
             fInformationControls.remove(parent);
     }
 
--- a/dwtx/jface/text/CursorLinePainter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/CursorLinePainter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -283,7 +283,7 @@
      */
     private int getModelCaret() {
         int widgetCaret= fViewer.getTextWidget().getCaretOffset();
-        if (fViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fViewer;
             return extension.widgetOffset2ModelOffset(widgetCaret);
         }
@@ -303,7 +303,7 @@
             return;
 
         int widgetOffset= 0;
-        if (fViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fViewer ) {
 
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fViewer;
             widgetOffset= extension.modelOffset2WidgetOffset(position.getOffset());
--- a/dwtx/jface/text/DefaultDocumentAdapter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/DefaultDocumentAdapter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -275,7 +275,7 @@
      * @since 3.0
      */
     private void repairLineInformation(IDocument document) {
-        if (document instanceof IRepairableDocument) {
+        if ( cast(IRepairableDocument)document ) {
             IRepairableDocument repairable= cast(IRepairableDocument) document;
             repairable.repairLineInformation();
         }
--- a/dwtx/jface/text/DefaultInformationControl.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/DefaultInformationControl.d	Sun Aug 24 02:26:23 2008 +0200
@@ -479,7 +479,7 @@
             if (isResizable())
                 maxHeight= Integer.MAX_VALUE;
             
-            if (fPresenter instanceof IInformationPresenterExtension)
+            if ( cast(IInformationPresenterExtension)fPresenter )
                 content= (cast(IInformationPresenterExtension)fPresenter).updatePresentation(fText, content, fPresentation, maxWidth, maxHeight);
             else
                 content= fPresenter.updatePresentation(getShell().getDisplay(), content, fPresentation, maxWidth, maxHeight);
--- a/dwtx/jface/text/DefaultUndoManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/DefaultUndoManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -288,7 +288,7 @@
         protected void undoTextChange() {
             try {
                 IDocument document= fTextViewer.getDocument();
-                if (document instanceof IDocumentExtension4)
+                if ( cast(IDocumentExtension4)document )
                     (cast(IDocumentExtension4)document).replace(fStart, fText.length(), fPreservedText, fUndoModificationStamp);
                 else
                     document.replace(fStart, fText.length(), fPreservedText);
@@ -304,7 +304,7 @@
             
             if (isConnected() && isValid()) {
                 IDocument doc= fTextViewer.getDocument();
-                if (doc instanceof IDocumentExtension4) {
+                if ( cast(IDocumentExtension4)doc ) {
                     long docStamp= (cast(IDocumentExtension4)doc).getModificationStamp();
                     
                     // Normal case: an undo is valid if its redo will restore document
@@ -360,7 +360,7 @@
         public bool canRedo() {
             if (isConnected() && isValid()) {
                 IDocument doc= fTextViewer.getDocument();
-                if (doc instanceof IDocumentExtension4) {
+                if ( cast(IDocumentExtension4)doc ) {
                     long docStamp= (cast(IDocumentExtension4)doc).getModificationStamp();
                     return docStamp is IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP || 
                         docStamp is getUndoModificationStamp();
@@ -419,7 +419,7 @@
         protected void redoTextChange() {
             try {
                 IDocument document= fTextViewer.getDocument();
-                if (document instanceof IDocumentExtension4)
+                if ( cast(IDocumentExtension4)document )
                     (cast(IDocumentExtension4)document).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp);
                 else
                     fTextViewer.getDocument().replace(fStart, fEnd - fStart, fText);
@@ -887,7 +887,7 @@
                             // if we are undoing/redoing a command we generated, then ignore
                             // the document changes associated with this undo or redo.
                             if (event.getOperation() instanceof TextCommand) {
-                                if (fTextViewer instanceof TextViewer)
+                                if ( cast(TextViewer)fTextViewer )
                                     (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(true);
                                 listenToTextChanges(false);
     
@@ -917,7 +917,7 @@
                         public void run() {
                             listenToTextChanges(true);
                             fOperation= null;
-                            if (fTextViewer instanceof TextViewer)
+                            if ( cast(TextViewer)fTextViewer )
                                 (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(false);
                          }
                     });
@@ -1458,7 +1458,7 @@
      * @since 3.0
      */
     protected void selectAndReveal(int offset, int length) {
-        if (fTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer;
             extension.exposeModelRange(new Region(offset, length));
         } else if (!fTextViewer.overlapsWithVisibleRegion(offset, length))
--- a/dwtx/jface/text/DocumentCommand.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/DocumentCommand.d	Sun Aug 24 02:26:23 2008 +0200
@@ -263,7 +263,7 @@
         private bool isEqual(Object object) {
             if (object is this)
                 return true;
-            if (!(object instanceof Command))
+            if (!( cast(Command)object ))
                 return false;
             final Command command= cast(Command) object;
             return command.fOffset is fOffset && command.fLength is fLength;
--- a/dwtx/jface/text/DocumentEvent.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/DocumentEvent.d	Sun Aug 24 02:26:23 2008 +0200
@@ -215,7 +215,7 @@
         fLength= length;
         fText= text;
 
-        if (fDocument instanceof IDocumentExtension4)
+        if ( cast(IDocumentExtension4)fDocument )
             fModificationStamp= (cast(IDocumentExtension4)fDocument).getModificationStamp();
         else
             fModificationStamp= IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP;
--- a/dwtx/jface/text/JFaceTextUtil.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/JFaceTextUtil.d	Sun Aug 24 02:26:23 2008 +0200
@@ -335,7 +335,7 @@
      */
     public static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) {
         int modelLine;
-        if (viewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)viewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) viewer;
             modelLine= extension.widgetLine2ModelLine(widgetLine);
         } else {
@@ -362,7 +362,7 @@
      */
     public static int modelLineToWidgetLine(ITextViewer viewer, final int modelLine) {
         int widgetLine;
-        if (viewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)viewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) viewer;
             widgetLine= extension.modelLine2WidgetLine(modelLine);
         } else {
@@ -470,7 +470,7 @@
      * @since 3.4
      */
     private static IRegion modelRange2WidgetRange(IRegion region, ITextViewer textViewer) {
-        if (textViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)textViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) textViewer;
             return extension.modelRange2WidgetRange(region);
         }
--- a/dwtx/jface/text/Position.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/Position.d	Sun Aug 24 02:26:23 2008 +0200
@@ -245,7 +245,7 @@
      * @see java.lang.Object#equals(java.lang.Object)
      */
     public bool equals(Object other) {
-        if (other instanceof Position) {
+        if ( cast(Position)other ) {
             Position rp= cast(Position) other;
             return (rp.offset is offset) && (rp.length is length);
         }
--- a/dwtx/jface/text/PropagatingFontFieldEditor.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/PropagatingFontFieldEditor.d	Sun Aug 24 02:26:23 2008 +0200
@@ -230,7 +230,7 @@
     private void checkForDefault() {
         if (presentsDefaultValue()) {
             Control c= getValueControl(fParent);
-            if (c instanceof Label)
+            if ( cast(Label)c )
                 (cast(Label) c).setText(fDefaultFontLabel);
         }
     }
--- a/dwtx/jface/text/Region.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/Region.d	Sun Aug 24 02:26:23 2008 +0200
@@ -196,7 +196,7 @@
      * @see java.lang.Object#equals(java.lang.Object)
      */
     public bool equals(Object o) {
-        if (o instanceof IRegion) {
+        if ( cast(IRegion)o ) {
             IRegion r= cast(IRegion) o;
             return r.getOffset() is fOffset && r.getLength() is fLength;
         }
--- a/dwtx/jface/text/RewriteSessionEditProcessor.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/RewriteSessionEditProcessor.d	Sun Aug 24 02:26:23 2008 +0200
@@ -227,7 +227,7 @@
      */
     public UndoEdit performEdits() throws MalformedTreeException, BadLocationException {
         IDocument document= getDocument();
-        if (!(document instanceof IDocumentExtension4))
+        if (!( cast(IDocumentExtension4)document ))
             return super.performEdits();
 
         IDocumentExtension4 extension= cast(IDocumentExtension4) document;
--- a/dwtx/jface/text/TextAttribute.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/TextAttribute.d	Sun Aug 24 02:26:23 2008 +0200
@@ -253,7 +253,7 @@
         if (object is this)
             return true;
 
-        if (!(object instanceof TextAttribute))
+        if (!( cast(TextAttribute)object ))
             return false;
         TextAttribute a= cast(TextAttribute)object;
         
--- a/dwtx/jface/text/TextViewer.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/TextViewer.d	Sun Aug 24 02:26:23 2008 +0200
@@ -298,7 +298,7 @@
             if (length !is 0) {
                 try {
 
-                    if (e instanceof SlaveDocumentEvent) {
+                    if ( cast(SlaveDocumentEvent)e ) {
                         SlaveDocumentEvent slave= cast(SlaveDocumentEvent) e;
                         DocumentEvent master= slave.getMasterEvent();
                         if (master !is null)
@@ -1125,7 +1125,7 @@
 
             if (replaceAll) {
 
-                if (document instanceof IDocumentExtension4) {
+                if ( cast(IDocumentExtension4)document ) {
                     IDocumentExtension4 extension= cast(IDocumentExtension4) document;
                     fRewriteSession= extension.startRewriteSession(DocumentRewriteSessionType.SEQUENTIAL);
                 } else {
@@ -1140,7 +1140,7 @@
 
             } else {
 
-                if (document instanceof IDocumentExtension4) {
+                if ( cast(IDocumentExtension4)document ) {
                     IDocumentExtension4 extension= cast(IDocumentExtension4) document;
                     extension.stopRewriteSession(fRewriteSession);
                 } else {
@@ -2389,7 +2389,7 @@
                     return true;
 
                 bool accepted= false;
-                if (fWidgetTokenKeeper instanceof IWidgetTokenKeeperExtension)  {
+                if ( cast(IWidgetTokenKeeperExtension)fWidgetTokenKeeper )  {
                     IWidgetTokenKeeperExtension extension= cast(IWidgetTokenKeeperExtension) fWidgetTokenKeeper;
                     accepted= extension.requestWidgetToken(this, priority);
                 } else  {
@@ -2550,7 +2550,7 @@
      * @see Viewer#setSelection(ISelection)
      */
     public void setSelection(ISelection selection, bool reveal) {
-        if (selection instanceof ITextSelection) {
+        if ( cast(ITextSelection)selection ) {
             ITextSelection s= cast(ITextSelection) selection;
             setSelectedRange(s.getOffset(), s.getLength());
             if (reveal)
@@ -2784,7 +2784,7 @@
         if (textListeners !is null) {
             textListeners= new ArrayList(textListeners);
             DocumentEvent event= cmd.event;
-            if (event instanceof SlaveDocumentEvent)
+            if ( cast(SlaveDocumentEvent)event )
                 event= (cast(SlaveDocumentEvent) event).getMasterEvent();
 
             TextEvent e= new TextEvent(cmd.start, cmd.length, cmd.text, cmd.preservedText, event, redraws());
@@ -2881,7 +2881,7 @@
     public void setInput(Object input) {
 
         IDocument document= null;
-        if (input instanceof IDocument)
+        if ( cast(IDocument)input )
             document= cast(IDocument) input;
 
         setDocument(document);
@@ -2967,7 +2967,7 @@
      * @deprecated use <code>updateSlaveDocument</code> instead
      */
     protected bool updateVisibleDocument(IDocument visibleDocument, int visibleRegionOffset, int visibleRegionLength)  {
-        if (visibleDocument instanceof ChildDocument) {
+        if ( cast(ChildDocument)visibleDocument ) {
             ChildDocument childDocument= cast(ChildDocument) visibleDocument;
 
             IDocument document= childDocument.getParentDocument();
@@ -3554,7 +3554,7 @@
     protected int _getVisibleRegionOffset() {
 
         IDocument document= getVisibleDocument();
-        if (document instanceof ChildDocument) {
+        if ( cast(ChildDocument)document ) {
             ChildDocument cdoc= cast(ChildDocument) document;
             return cdoc.getParentDocumentRange().getOffset();
         }
@@ -3568,7 +3568,7 @@
     public IRegion getVisibleRegion() {
 
         IDocument document= getVisibleDocument();
-        if (document instanceof ChildDocument) {
+        if ( cast(ChildDocument)document ) {
             Position p= (cast(ChildDocument) document).getParentDocumentRange();
             return new Region(p.getOffset(), p.getLength());
         }
@@ -3581,7 +3581,7 @@
      */
     public bool overlapsWithVisibleRegion(int start, int length) {
         IDocument document= getVisibleDocument();
-        if (document instanceof ChildDocument) {
+        if ( cast(ChildDocument)document ) {
             ChildDocument cdoc= cast(ChildDocument) document;
             return cdoc.getParentDocumentRange().overlapsWith(start, length);
         } else if (document !is null) {
@@ -3933,7 +3933,7 @@
         fIgnoreAutoIndent= ignore;
 
         IDocument document= getDocument();
-        if (document instanceof IDocumentExtension2) {
+        if ( cast(IDocumentExtension2)document ) {
             IDocumentExtension2 extension= cast(IDocumentExtension2) document;
             if (ignore)
                 extension.ignorePostNotificationReplaces();
@@ -4156,7 +4156,7 @@
                 lineCount += lines[j + 1] - lines[j] + 1;
             }
 
-            if (d instanceof IDocumentExtension4) {
+            if ( cast(IDocumentExtension4)d ) {
                 IDocumentExtension4 extension= cast(IDocumentExtension4) d;
                 rewriteSession= extension.startRewriteSession(DocumentRewriteSessionType.SEQUENTIAL);
             } else {
@@ -4187,7 +4187,7 @@
             if (partitioners !is null)
                 TextUtilities.addDocumentPartitioners(d, partitioners);
             
-            if (d instanceof IDocumentExtension4) {
+            if ( cast(IDocumentExtension4)d ) {
                 IDocumentExtension4 extension= cast(IDocumentExtension4) d;
                 extension.stopRewriteSession(rewriteSession);
             } else {
@@ -4620,7 +4620,7 @@
     protected IRegion _internalGetVisibleRegion() {
 
         IDocument document= getVisibleDocument();
-        if (document instanceof ChildDocument) {
+        if ( cast(ChildDocument)document ) {
             Position p= (cast(ChildDocument) document).getParentDocumentRange();
             return new Region(p.getOffset(), p.getLength());
         }
@@ -4800,14 +4800,14 @@
 
         fMarkPosition= null;
 
-        if (oldDocument instanceof IDocumentExtension4) {
+        if ( cast(IDocumentExtension4)oldDocument ) {
             IDocumentExtension4 document= cast(IDocumentExtension4) oldDocument;
             document.removeDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
         }
 
         super.inputChanged(newInput, oldInput);
 
-        if (newInput instanceof IDocumentExtension4) {
+        if ( cast(IDocumentExtension4)newInput ) {
             IDocumentExtension4 document= cast(IDocumentExtension4) newInput;
             document.addDocumentRewriteSessionListener(fDocumentRewriteSessionListener);
         }
@@ -4845,7 +4845,7 @@
      * @since 3.0
      */
     protected void enabledRedrawing(int topIndex) {
-        if (fDocumentAdapter instanceof IDocumentAdapterExtension) {
+        if ( cast(IDocumentAdapterExtension)fDocumentAdapter ) {
             IDocumentAdapterExtension extension= cast(IDocumentAdapterExtension) fDocumentAdapter;
             StyledText textWidget= getTextWidget();
             if (textWidget !is null && !textWidget.isDisposed()) {
@@ -4879,7 +4879,7 @@
         if (fViewerState is null)
             fViewerState= new ViewerState();
 
-        if (fDocumentAdapter instanceof IDocumentAdapterExtension) {
+        if ( cast(IDocumentAdapterExtension)fDocumentAdapter ) {
             IDocumentAdapterExtension extension= cast(IDocumentAdapterExtension) fDocumentAdapter;
             extension.stopForwardingDocumentChanges();
         }
@@ -4949,7 +4949,7 @@
      */
     protected final void startSequentialRewriteMode(bool normalized) {
         IDocument document= getDocument();
-        if (document instanceof IDocumentExtension) {
+        if ( cast(IDocumentExtension)document ) {
             IDocumentExtension extension= cast(IDocumentExtension) document;
             extension.startSequentialRewrite(normalized);
         }
@@ -4963,7 +4963,7 @@
      */
     protected final void stopSequentialRewriteMode() {
         IDocument document= getDocument();
-        if (document instanceof IDocumentExtension) {
+        if ( cast(IDocumentExtension)document ) {
             IDocumentExtension extension= cast(IDocumentExtension) document;
             extension.stopSequentialRewrite();
         }
@@ -5109,7 +5109,7 @@
      * @since 3.1
      */
     protected IRegion modelRange2ClosestWidgetRange(IRegion modelRange) {
-        if (!(fInformationMapping instanceof IDocumentInformationMappingExtension2))
+        if (!( cast(IDocumentInformationMappingExtension2)fInformationMapping ))
             return modelRange2WidgetRange(modelRange);
 
         try {
@@ -5359,7 +5359,7 @@
      * @since 3.0
      */
     public bool moveFocusToWidgetToken() {
-        if (fWidgetTokenKeeper instanceof IWidgetTokenKeeperExtension) {
+        if ( cast(IWidgetTokenKeeperExtension)fWidgetTokenKeeper ) {
             IWidgetTokenKeeperExtension extension= cast(IWidgetTokenKeeperExtension) fWidgetTokenKeeper;
             return extension.setFocus(this);
         }
--- a/dwtx/jface/text/TextViewerHoverManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/TextViewerHoverManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -309,7 +309,7 @@
                     if (fThread !is null) {
                         Object information;
                         try {
-                            if (hover instanceof ITextHoverExtension2)
+                            if ( cast(ITextHoverExtension2)hover )
                                 information= (cast(ITextHoverExtension2)hover).getHoverInfo2(fTextViewer, region);
                             else
                                 information= hover.getHoverInfo(fTextViewer, region);
@@ -322,7 +322,7 @@
                             information= null;
                         }
 
-                        if (hover instanceof ITextHoverExtension)
+                        if ( cast(ITextHoverExtension)hover )
                             setCustomInformationControlCreator((cast(ITextHoverExtension) hover).getHoverControlCreator());
                         else
                             setCustomInformationControlCreator(null);
@@ -410,7 +410,7 @@
             if (p.x > x)
                 widgetOffset--;
 
-            if (fTextViewer instanceof ITextViewerExtension5) {
+            if ( cast(ITextViewerExtension5)fTextViewer ) {
                 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer;
                 return extension.widgetOffset2ModelOffset(widgetOffset);
             }
--- a/dwtx/jface/text/TextViewerUndoManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/TextViewerUndoManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -292,7 +292,7 @@
             if (((eventType & DocumentUndoEvent.ABOUT_TO_UNDO) !is 0) || ((eventType & DocumentUndoEvent.ABOUT_TO_REDO) !is 0))  {
                 if (event.isCompound()) {
                     ITextViewerExtension extension= null;
-                    if (fTextViewer instanceof ITextViewerExtension)
+                    if ( cast(ITextViewerExtension)fTextViewer )
                         extension= cast(ITextViewerExtension) fTextViewer;
 
                     if (extension !is null)
@@ -300,7 +300,7 @@
                 }
                 fTextViewer.getTextWidget().getDisplay().syncExec(new class()  Runnable {
                     public void run() {
-                        if (fTextViewer instanceof TextViewer)
+                        if ( cast(TextViewer)fTextViewer )
                             (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(true);
                     }
                 });
@@ -308,13 +308,13 @@
             } else if (((eventType & DocumentUndoEvent.UNDONE) !is 0) || ((eventType & DocumentUndoEvent.REDONE) !is 0))  {
                 fTextViewer.getTextWidget().getDisplay().syncExec(new class()  Runnable {
                     public void run() {
-                        if (fTextViewer instanceof TextViewer)
+                        if ( cast(TextViewer)fTextViewer )
                             (cast(TextViewer)fTextViewer).ignoreAutoEditStrategies(false);
                     }
                 });
                 if (event.isCompound()) {
                     ITextViewerExtension extension= null;
-                    if (fTextViewer instanceof ITextViewerExtension)
+                    if ( cast(ITextViewerExtension)fTextViewer )
                         extension= cast(ITextViewerExtension) fTextViewer;
 
                     if (extension !is null)
@@ -545,7 +545,7 @@
      * @param length the length of the range
      */
     private void selectAndReveal(int offset, int length) {
-        if (fTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer;
             extension.exposeModelRange(new Region(offset, length));
         } else if (!fTextViewer.overlapsWithVisibleRegion(offset, length))
--- a/dwtx/jface/text/TypedPosition.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/TypedPosition.d	Sun Aug 24 02:26:23 2008 +0200
@@ -205,7 +205,7 @@
      * @see java.lang.Object#equals(java.lang.Object)
      */
     public bool equals(Object o) {
-        if (o instanceof TypedPosition) {
+        if ( cast(TypedPosition)o ) {
             if (super.equals(o)) {
                 TypedPosition p= cast(TypedPosition) o;
                 return (fType is null && p.getType() is null) || fType.equals(p.getType());
--- a/dwtx/jface/text/TypedRegion.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/TypedRegion.d	Sun Aug 24 02:26:23 2008 +0200
@@ -189,7 +189,7 @@
      * @see java.lang.Object#equals(java.lang.Object)
      */
     public bool equals(Object o) {
-        if (o instanceof TypedRegion) {
+        if ( cast(TypedRegion)o ) {
             TypedRegion r= cast(TypedRegion) o;
             return super.equals(r) && ((fType is null && r.getType() is null) || fType.equals(r.getType()));
         }
--- a/dwtx/jface/text/WhitespaceCharacterPainter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/WhitespaceCharacterPainter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -446,7 +446,7 @@
      * @return <code>true</code> if the line is folded
      */
     private bool isFoldedLine(int widgetLine) {
-        if (fTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5)fTextViewer;
             int modelLine= extension.widgetLine2ModelLine(widgetLine);
             int widgetLine2= extension.modelLine2WidgetLine(modelLine + 1);
@@ -489,7 +489,7 @@
      * @return widget offset
      */
     private int getWidgetOffset(int documentOffset) {
-        if (fTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5)fTextViewer;
             return extension.modelOffset2WidgetOffset(documentOffset);
         }
@@ -508,7 +508,7 @@
      * @return document offset
      */
     private int getDocumentOffset(int widgetOffset) {
-        if (fTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5)fTextViewer;
             return extension.widgetOffset2ModelOffset(widgetOffset);
         }
--- a/dwtx/jface/text/contentassist/AdditionalInfoController.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/contentassist/AdditionalInfoController.d	Sun Aug 24 02:26:23 2008 +0200
@@ -356,7 +356,7 @@
         }
         
         ICompletionProposalExtension5 getCurrentProposalEx() {
-            Assert.isTrue(fCurrentProposal instanceof ICompletionProposalExtension5);
+            Assert.isTrue( cast(ICompletionProposalExtension5)fCurrentProposal );
             return cast(ICompletionProposalExtension5) fCurrentProposal;
         }
 
@@ -486,7 +486,7 @@
 
         super.install(control.getShell());
 
-        Assert.isTrue(control instanceof Table);
+        Assert.isTrue( cast(Table)control );
         fProposalTable= cast(Table) control;
         fProposalTable.addSelectionListener(fSelectionListener);
         getInternalAccessor().getInformationControlReplacer().install(fProposalTable);
@@ -534,7 +534,7 @@
                 TableItem item= selection[0];
 
                 Object d= item.getData();
-                if (d instanceof ICompletionProposal) {
+                if ( cast(ICompletionProposal)d ) {
                     ICompletionProposal p= cast(ICompletionProposal) d;
                     fTimer.reset(p);
                 }
@@ -558,7 +558,7 @@
      * @see AbstractInformationControlManager#computeInformation()
      */
     protected void computeInformation() {
-        if (fProposal instanceof ICompletionProposalExtension3)
+        if ( cast(ICompletionProposalExtension3)fProposal )
             setCustomInformationControlCreator((cast(ICompletionProposalExtension3) fProposal).getInformationControlCreator());
         else
             setCustomInformationControlCreator(null);
@@ -599,7 +599,7 @@
         // AbstractInformationControlManager#internalShowInformationControl(Rectangle, Object) adds trims
         // to the computed constraints. Need to remove them here, to make the outer bounds of the additional
         // info shell fit the bounds of the proposal shell:
-        if (fInformationControl instanceof IInformationControlExtension3) {
+        if ( cast(IInformationControlExtension3)fInformationControl ) {
             Rectangle shellTrim= (cast(IInformationControlExtension3) fInformationControl).computeTrim();
             size.x -= shellTrim.width;
             size.y -= shellTrim.height;
--- a/dwtx/jface/text/contentassist/CompletionProposalPopup.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/contentassist/CompletionProposalPopup.d	Sun Aug 24 02:26:23 2008 +0200
@@ -938,7 +938,7 @@
 
             IDocument document= fContentAssistSubjectControlAdapter.getDocument();
 
-            if (fViewer instanceof ITextViewerExtension) {
+            if ( cast(ITextViewerExtension)fViewer ) {
                 ITextViewerExtension extension= cast(ITextViewerExtension) fViewer;
                 target= extension.getRewriteTarget();
             }
@@ -946,7 +946,7 @@
             if (target !is null)
                 target.beginCompoundChange();
 
-            if (fViewer instanceof IEditingSupportRegistry) {
+            if ( cast(IEditingSupportRegistry)fViewer ) {
                 IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
                 registry.register(helper);
             }
@@ -955,7 +955,7 @@
             if (p instanceof ICompletionProposalExtension2 && fViewer !is null) {
                 ICompletionProposalExtension2 e= cast(ICompletionProposalExtension2) p;
                 e.apply(fViewer, trigger, stateMask, offset);
-            } else if (p instanceof ICompletionProposalExtension) {
+            } else if ( cast(ICompletionProposalExtension)p ) {
                 ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
                 e.apply(document, trigger, offset);
             } else {
@@ -972,7 +972,7 @@
             if (info !is null) {
 
                 int contextInformationOffset;
-                if (p instanceof ICompletionProposalExtension) {
+                if ( cast(ICompletionProposalExtension)p ) {
                     ICompletionProposalExtension e= cast(ICompletionProposalExtension) p;
                     contextInformationOffset= e.getContextInformationPosition();
                 } else {
@@ -990,7 +990,7 @@
             if (target !is null)
                 target.endCompoundChange();
 
-            if (fViewer instanceof IEditingSupportRegistry) {
+            if ( cast(IEditingSupportRegistry)fViewer ) {
                 IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
                 registry.unregister(helper);
             }
@@ -1036,7 +1036,7 @@
 
         unregister();
 
-        if (fViewer instanceof IEditingSupportRegistry) {
+        if ( cast(IEditingSupportRegistry)fViewer ) {
             IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
             registry.unregister(fFocusHelper);
         }
@@ -1207,7 +1207,7 @@
 
                 };
             }
-            if (fViewer instanceof IEditingSupportRegistry) {
+            if ( cast(IEditingSupportRegistry)fViewer ) {
                 IEditingSupportRegistry registry= cast(IEditingSupportRegistry) fViewer;
                 registry.register(fFocusHelper);
             }
@@ -1342,7 +1342,7 @@
 
             default:
                 ICompletionProposal p= getSelectedProposal();
-                if (p instanceof ICompletionProposalExtension) {
+                if ( cast(ICompletionProposalExtension)p ) {
                     ICompletionProposalExtension t= cast(ICompletionProposalExtension) p;
                     char[] triggers= t.getTriggerCharacters();
                     if (contains(triggers, key)) {
@@ -1530,7 +1530,7 @@
      */
     private bool canAutoInsert(ICompletionProposal proposal) {
         if (fContentAssistant.isAutoInserting()) {
-            if (proposal instanceof ICompletionProposalExtension4) {
+            if ( cast(ICompletionProposalExtension4)proposal ) {
                 ICompletionProposalExtension4 ext= cast(ICompletionProposalExtension4) proposal;
                 return ext.isAutoInsertable();
             }
@@ -1637,7 +1637,7 @@
         for (int i= 0; i < fFilteredProposals.length; i++) {
             ICompletionProposal proposal= fFilteredProposals[i];
             
-            if (!(proposal instanceof ICompletionProposalExtension3))
+            if (!( cast(ICompletionProposalExtension3)proposal ))
                 return false;
             
             int start= (cast(ICompletionProposalExtension3)proposal).getPrefixCompletionStart(fContentAssistSubjectControlAdapter.getDocument(), fFilterOffset);
--- a/dwtx/jface/text/contentassist/ContentAssistSubjectControlAdapter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/contentassist/ContentAssistSubjectControlAdapter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -206,7 +206,7 @@
     public bool prependVerifyKeyListener(VerifyKeyListener verifyKeyListener) {
         if (fContentAssistSubjectControl !is null) {
             return fContentAssistSubjectControl.prependVerifyKeyListener(verifyKeyListener);
-        } else if (fViewer instanceof ITextViewerExtension) {
+        } else if ( cast(ITextViewerExtension)fViewer ) {
             ITextViewerExtension e= cast(ITextViewerExtension) fViewer;
             e.prependVerifyKeyListener(verifyKeyListener);
             return true;
@@ -227,7 +227,7 @@
     public bool appendVerifyKeyListener(VerifyKeyListener verifyKeyListener) {
         if (fContentAssistSubjectControl !is null)
             return fContentAssistSubjectControl.appendVerifyKeyListener(verifyKeyListener);
-        else if (fViewer instanceof ITextViewerExtension) {
+        else if ( cast(ITextViewerExtension)fViewer ) {
             ITextViewerExtension extension= cast(ITextViewerExtension)fViewer;
             extension.appendVerifyKeyListener(verifyKeyListener);
             return true;
@@ -247,7 +247,7 @@
     public void removeVerifyKeyListener(VerifyKeyListener verifyKeyListener) {
         if (fContentAssistSubjectControl !is null) {
             fContentAssistSubjectControl.removeVerifyKeyListener(verifyKeyListener);
-        } else if (fViewer instanceof ITextViewerExtension) {
+        } else if ( cast(ITextViewerExtension)fViewer ) {
             ITextViewerExtension extension= cast(ITextViewerExtension) fViewer;
             extension.removeVerifyKeyListener(verifyKeyListener);
         } else {
--- a/dwtx/jface/text/contentassist/ContentAssistant.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/contentassist/ContentAssistant.d	Sun Aug 24 02:26:23 2008 +0200
@@ -1535,16 +1535,16 @@
         switch (type) {
             case CONTEXT_SELECTOR:
             case PROPOSAL_SELECTOR:
-                if (fContentAssistSubjectControl instanceof IWidgetTokenOwnerExtension) {
+                if ( cast(IWidgetTokenOwnerExtension)fContentAssistSubjectControl ) {
                     IWidgetTokenOwnerExtension extension= cast(IWidgetTokenOwnerExtension) fContentAssistSubjectControl;
                     return extension.requestWidgetToken(this, WIDGET_PRIORITY);
-                } else if (fContentAssistSubjectControl instanceof IWidgetTokenOwner) {
+                } else if ( cast(IWidgetTokenOwner)fContentAssistSubjectControl ) {
                     IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fContentAssistSubjectControl;
                     return owner.requestWidgetToken(this);
-                } else if (fViewer instanceof IWidgetTokenOwnerExtension) {
+                } else if ( cast(IWidgetTokenOwnerExtension)fViewer ) {
                     IWidgetTokenOwnerExtension extension= cast(IWidgetTokenOwnerExtension) fViewer;
                     return extension.requestWidgetToken(this, WIDGET_PRIORITY);
-                } else if (fViewer instanceof IWidgetTokenOwner) {
+                } else if ( cast(IWidgetTokenOwner)fViewer ) {
                     IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fViewer;
                     return owner.requestWidgetToken(this);
                 }
@@ -1625,9 +1625,9 @@
     private void releaseWidgetToken(int type) {
         if (fListeners[CONTEXT_SELECTOR] is null && fListeners[PROPOSAL_SELECTOR] is null) {
             IWidgetTokenOwner owner= null;
-            if (fContentAssistSubjectControl instanceof IWidgetTokenOwner)
+            if ( cast(IWidgetTokenOwner)fContentAssistSubjectControl )
                 owner= cast(IWidgetTokenOwner) fContentAssistSubjectControl;
-            else if (fViewer instanceof IWidgetTokenOwner)
+            else if ( cast(IWidgetTokenOwner)fViewer )
                 owner= cast(IWidgetTokenOwner) fViewer;
             if (owner !is null)
                 owner.releaseWidgetToken(this);
@@ -1842,7 +1842,7 @@
         ICompletionProposal[] result= null;
 
         IContentAssistProcessor p= getProcessor(contentAssistSubjectControl, offset);
-        if (p instanceof ISubjectControlContentAssistProcessor) {
+        if ( cast(ISubjectControlContentAssistProcessor)p ) {
             result= (cast(ISubjectControlContentAssistProcessor) p).computeCompletionProposals(contentAssistSubjectControl, offset);
             fLastErrorMessage= p.getErrorMessage();
         }
@@ -1914,7 +1914,7 @@
         IContextInformation[] result= null;
 
         IContentAssistProcessor p= getProcessor(contentAssistSubjectControl, offset);
-        if (p instanceof ISubjectControlContentAssistProcessor) {
+        if ( cast(ISubjectControlContentAssistProcessor)p ) {
             result= (cast(ISubjectControlContentAssistProcessor) p).computeContextInformation(contentAssistSubjectControl, offset);
             fLastErrorMessage= p.getErrorMessage();
         }
@@ -1965,7 +1965,7 @@
      */
     IContextInformationPresenter getContextInformationPresenter(ITextViewer viewer, int offset) {
         IContextInformationValidator validator= getContextInformationValidator(viewer, offset);
-        if (validator instanceof IContextInformationPresenter)
+        if ( cast(IContextInformationPresenter)validator )
             return cast(IContextInformationPresenter) validator;
         return null;
     }
@@ -1981,7 +1981,7 @@
      */
     IContextInformationPresenter getContextInformationPresenter(IContentAssistSubjectControl contentAssistSubjectControl, int offset) {
         IContextInformationValidator validator= getContextInformationValidator(contentAssistSubjectControl, offset);
-        if (validator instanceof IContextInformationPresenter)
+        if ( cast(IContextInformationPresenter)validator )
             return cast(IContextInformationPresenter) validator;
         return null;
     }
@@ -2265,7 +2265,7 @@
             Object[] listeners= fCompletionListeners.getListeners();
             for (int i= 0; i < listeners.length; i++) {
                 ICompletionListener listener= cast(ICompletionListener)listeners[i];
-                if (listener instanceof ICompletionListenerExtension)
+                if ( cast(ICompletionListenerExtension)listener )
                     (cast(ICompletionListenerExtension)listener).assistSessionRestarted(event);
             }
         }
--- a/dwtx/jface/text/contentassist/ContextInformation.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/contentassist/ContextInformation.d	Sun Aug 24 02:26:23 2008 +0200
@@ -97,7 +97,7 @@
      * @see IContextInformation#equals(Object)
      */
     public bool equals(Object object) {
-        if (object instanceof IContextInformation) {
+        if ( cast(IContextInformation)object ) {
             IContextInformation contextInformation= cast(IContextInformation) object;
             bool equals= fInformationDisplayString.equalsIgnoreCase(contextInformation.getInformationDisplayString());
             if (fContextDisplayString !is null)
--- a/dwtx/jface/text/contentassist/ContextInformationPopup.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/contentassist/ContextInformationPopup.d	Sun Aug 24 02:26:23 2008 +0200
@@ -122,7 +122,7 @@
          * @since 3.0
          */
         public bool equals(Object obj) {
-            if (obj instanceof ContextFrame) {
+            if ( cast(ContextFrame)obj ) {
                 ContextFrame frame= cast(ContextFrame) obj;
                 return fInformation.equals(frame.fInformation) && fBeginOffset is frame.fBeginOffset;
             }
@@ -329,7 +329,7 @@
         IContextInformationValidator validator= fContentAssistSubjectControlAdapter.getContextInformationValidator(fContentAssistant, offset);
 
         if (validator !is null) {
-            int beginOffset= (information instanceof IContextInformationExtension) ? (cast(IContextInformationExtension) information).getContextInformationPosition() : offset;
+            int beginOffset= ( cast(IContextInformationExtension)information ) ? (cast(IContextInformationExtension) information).getContextInformationPosition() : offset;
             if (beginOffset is -1) beginOffset= offset;
             int visibleOffset= fContentAssistSubjectControlAdapter.getWidgetSelectionRange().x - (offset - beginOffset);
             IContextInformationPresenter presenter = fContentAssistSubjectControlAdapter.getContextInformationPresenter(fContentAssistant, offset);
--- a/dwtx/jface/text/contentassist/PopupCloser.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/contentassist/PopupCloser.d	Sun Aug 24 02:26:23 2008 +0200
@@ -257,10 +257,10 @@
                 if (event.widget instanceof Control) {
                     Control control= cast(Control) event.widget;
                     IInformationControl infoControl= fAdditionalInfoController.getCurrentInformationControl2();
-                    if (infoControl instanceof IInformationControlExtension5) {
+                    if ( cast(IInformationControlExtension5)infoControl ) {
                         final IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) infoControl;
                         if (iControl5.containsControl(control)) {
-                            if (infoControl instanceof IDelayedInputChangeProvider) {
+                            if ( cast(IDelayedInputChangeProvider)infoControl ) {
                                 final IDelayedInputChangeProvider delayedICP= cast(IDelayedInputChangeProvider) infoControl;
                                 final IInputChangedListener inputChangeListener= new DelayedInputChangeListener(delayedICP, fAdditionalInfoController.getInternalAccessor().getInformationControlReplacer());
                                 delayedICP.setDelayedInputChangeListener(inputChangeListener);
--- a/dwtx/jface/text/formatter/ContentFormatter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/formatter/ContentFormatter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -185,7 +185,7 @@
          */
         public int compareTo(Object obj) {
 
-            if (obj instanceof PositionReference) {
+            if ( cast(PositionReference)obj ) {
                 PositionReference r= cast(PositionReference) obj;
                 return getCharacterPosition() - r.getCharacterPosition();
             }
--- a/dwtx/jface/text/formatter/MultiPassContentFormatter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/formatter/MultiPassContentFormatter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -308,7 +308,7 @@
      *  {@link IFormattingStrategyExtension}
      */
     public final void setMasterStrategy(final IFormattingStrategy strategy) {
-        Assert.isTrue(strategy instanceof IFormattingStrategyExtension);
+        Assert.isTrue( cast(IFormattingStrategyExtension)strategy );
         fMaster= cast(IFormattingStrategyExtension) strategy;
     }
 
@@ -326,7 +326,7 @@
      *  must implement {@link IFormattingStrategyExtension}
      */
     public final void setSlaveStrategy(final IFormattingStrategy strategy, final String type) {
-        Assert.isTrue(strategy instanceof IFormattingStrategyExtension);
+        Assert.isTrue( cast(IFormattingStrategyExtension)strategy );
         if (!fType.equals(type))
             fSlaves.put(type, strategy);
     }
--- a/dwtx/jface/text/hyperlink/DefaultHyperlinkPresenter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/hyperlink/DefaultHyperlinkPresenter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -174,7 +174,7 @@
         Assert.isNotNull(textViewer);
         fTextViewer= textViewer;
         fTextViewer.addTextInputListener(this);
-        if (fTextViewer instanceof ITextViewerExtension4)
+        if ( cast(ITextViewerExtension4)fTextViewer )
             (cast(ITextViewerExtension4)fTextViewer).addTextPresentationListener(this);
 
         StyledText text= fTextViewer.getTextWidget();
@@ -209,7 +209,7 @@
             fCursor= null;
         }
 
-        if (fTextViewer instanceof ITextViewerExtension4)
+        if ( cast(ITextViewerExtension4)fTextViewer )
             (cast(ITextViewerExtension4)fTextViewer).removeTextPresentationListener(this);
         fTextViewer= null;
 
@@ -249,7 +249,7 @@
 
         // Invalidate region is> apply text presentation
         fActiveRegion= region;
-        if (fTextViewer instanceof ITextViewerExtension2)
+        if ( cast(ITextViewerExtension2)fTextViewer )
             (cast(ITextViewerExtension2)fTextViewer).invalidateTextPresentation(region.getOffset(), region.getLength());
         else
             fTextViewer.invalidateTextPresentation();
@@ -288,7 +288,7 @@
         resetCursor();
 
         // Invalidate is> remove applied text presentation
-        if (fTextViewer instanceof ITextViewerExtension2)
+        if ( cast(ITextViewerExtension2)fTextViewer )
             (cast(ITextViewerExtension2) fTextViewer).invalidateTextPresentation(offset, length);
         else
             fTextViewer.invalidateTextPresentation();
--- a/dwtx/jface/text/hyperlink/HyperlinkManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/hyperlink/HyperlinkManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -269,7 +269,7 @@
                 if (detector is null)
                     continue;
                 
-                if (detector instanceof IHyperlinkDetectorExtension2) {
+                if ( cast(IHyperlinkDetectorExtension2)detector ) {
                     int stateMask= (cast(IHyperlinkDetectorExtension2)detector).getStateMask();
                     if (stateMask !is -1 && stateMask !is fActiveHyperlinkStateMask)
                         continue;
@@ -354,7 +354,7 @@
             if (p.x > relativePosition.x)
                 widgetOffset--;
             
-            if (fTextViewer instanceof ITextViewerExtension5) {
+            if ( cast(ITextViewerExtension5)fTextViewer ) {
                 ITextViewerExtension5 extension= cast(ITextViewerExtension5)fTextViewer;
                 return extension.widgetOffset2ModelOffset(widgetOffset);
             }
@@ -453,7 +453,7 @@
      * @see dwt.events.MouseMoveListener#mouseMove(dwt.events.MouseEvent)
      */
     public void mouseMove(MouseEvent event) {
-        if (fHyperlinkPresenter instanceof IHyperlinkPresenterExtension) {
+        if ( cast(IHyperlinkPresenterExtension)fHyperlinkPresenter ) {
             if (!(cast(IHyperlinkPresenterExtension)fHyperlinkPresenter).canHideHyperlinks())
                 return;
         }
@@ -547,7 +547,7 @@
      * @since 3.4
      */
     public void mouseExit(MouseEvent e) {
-        if (fHyperlinkPresenter instanceof IHyperlinkPresenterExtension) {
+        if ( cast(IHyperlinkPresenterExtension)fHyperlinkPresenter ) {
             if (!(cast(IHyperlinkPresenterExtension)fHyperlinkPresenter).canHideHyperlinks())
                 return;
         }
--- a/dwtx/jface/text/hyperlink/MultipleHyperlinkPresenter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/hyperlink/MultipleHyperlinkPresenter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -253,7 +253,7 @@
                 public void mouseMove(MouseEvent e) {
                     if (fTable.equals(e.getSource())) {
                         Object o= fTable.getItem(new Point(e.x, e.y));
-                        if (o instanceof TableItem) {
+                        if ( cast(TableItem)o ) {
                             TableItem item= cast(TableItem) o;
                             if (!o.equals(fLastItem)) {
                                 fLastItem= cast(TableItem) o;
@@ -575,10 +575,10 @@
          * @see dwtx.jface.text.AbstractInformationControlManager#showInformationControl(dwt.graphics.Rectangle)
          */
         protected void showInformationControl(Rectangle subjectArea) {
-            if (fTextViewer instanceof IWidgetTokenOwnerExtension) {
+            if ( cast(IWidgetTokenOwnerExtension)fTextViewer ) {
                 if ((cast(IWidgetTokenOwnerExtension) fTextViewer).requestWidgetToken(this, WIDGET_TOKEN_PRIORITY))
                     super.showInformationControl(subjectArea);
-            } else if (fTextViewer instanceof IWidgetTokenOwner) {
+            } else if ( cast(IWidgetTokenOwner)fTextViewer ) {
                 if ((cast(IWidgetTokenOwner) fTextViewer).requestWidgetToken(this))
                     super.showInformationControl(subjectArea);
             } else {
@@ -594,7 +594,7 @@
         protected void hideInformationControl() {
             super.hideInformationControl();
             
-            if (fTextViewer instanceof IWidgetTokenOwner) {
+            if ( cast(IWidgetTokenOwner)fTextViewer ) {
                 (cast(IWidgetTokenOwner) fTextViewer).releaseWidgetToken(this);
             }
             
@@ -608,7 +608,7 @@
         public void disposeInformationControl() {
             super.disposeInformationControl();
             
-            if (fTextViewer instanceof IWidgetTokenOwner) {
+            if ( cast(IWidgetTokenOwner)fTextViewer ) {
                 (cast(IWidgetTokenOwner) fTextViewer).releaseWidgetToken(this);
             }
             
--- a/dwtx/jface/text/information/InformationPresenter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/information/InformationPresenter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -346,7 +346,7 @@
             return;
 
         Object info;
-        if (provider instanceof IInformationProviderExtension) {
+        if ( cast(IInformationProviderExtension)provider ) {
             IInformationProviderExtension extension= cast(IInformationProviderExtension) provider;
             info= extension.getInformation2(fTextViewer, subject);
         } else {
@@ -354,7 +354,7 @@
             info= provider.getInformation(fTextViewer, subject);
         }
         
-        if (provider instanceof IInformationProviderExtension2)
+        if ( cast(IInformationProviderExtension2)provider )
             setCustomInformationControlCreator((cast(IInformationProviderExtension2) provider).getInformationPresenterControlCreator());
         else
             setCustomInformationControlCreator(null);
@@ -400,7 +400,7 @@
      * @since 2.1
      */
     private IRegion modelRange2WidgetRange(IRegion region) {
-        if (fTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer;
             return extension.modelRange2WidgetRange(region);
         }
@@ -437,7 +437,7 @@
             IWidgetTokenOwnerExtension extension= cast(IWidgetTokenOwnerExtension) fTextViewer;
             if (extension.requestWidgetToken(this, WIDGET_PRIORITY))
                 super.showInformationControl(subjectArea);
-        } else if (fTextViewer instanceof IWidgetTokenOwner) {
+        } else if ( cast(IWidgetTokenOwner)fTextViewer ) {
             IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fTextViewer;
             if (owner.requestWidgetToken(this))
                 super.showInformationControl(subjectArea);
@@ -453,7 +453,7 @@
         try {
             super.hideInformationControl();
         } finally {
-            if (fTextViewer instanceof IWidgetTokenOwner) {
+            if ( cast(IWidgetTokenOwner)fTextViewer ) {
                 IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fTextViewer;
                 owner.releaseWidgetToken(this);
             }
@@ -467,7 +467,7 @@
         try {
             super.handleInformationControlDisposed();
         } finally {
-            if (fTextViewer instanceof IWidgetTokenOwner) {
+            if ( cast(IWidgetTokenOwner)fTextViewer ) {
                 IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fTextViewer;
                 owner.releaseWidgetToken(this);
             }
--- a/dwtx/jface/text/link/LinkedModeModel.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/link/LinkedModeModel.d	Sun Aug 24 02:26:23 2008 +0200
@@ -247,7 +247,7 @@
                     // on the calling document or directly on any other
                     // document
                     if (doc is event.getDocument()) {
-                        if (doc instanceof IDocumentExtension) {
+                        if ( cast(IDocumentExtension)doc ) {
                             (cast(IDocumentExtension) doc).registerPostNotificationReplace(this, replace);
                         } else {
                             // ignore - there is no way we can log from JFace text...
--- a/dwtx/jface/text/link/LinkedModeUI.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/link/LinkedModeUI.d	Sun Aug 24 02:26:23 2008 +0200
@@ -540,7 +540,7 @@
          */
         public void selectionChanged(SelectionChangedEvent event) {
             ISelection selection= event.getSelection();
-            if (selection instanceof ITextSelection) {
+            if ( cast(ITextSelection)selection ) {
                 ITextSelection textsel= cast(ITextSelection) selection;
                 if (event.getSelectionProvider() instanceof ITextViewer) {
                     IDocument doc= (cast(ITextViewer) event.getSelectionProvider()).getDocument();
@@ -833,7 +833,7 @@
 
     /** Trigger content assist on choice positions */
     private void triggerContentAssist() {
-        if (fFramePosition instanceof ProposalPosition) {
+        if ( cast(ProposalPosition)fFramePosition ) {
             ProposalPosition pp= cast(ProposalPosition) fFramePosition;
             ICompletionProposal[] choices= pp.getChoices();
             if (choices !is null && choices.length > 0) {
@@ -887,10 +887,10 @@
         LinkedPositionAnnotations lpa= fCurrentTarget.fAnnotationModel;
         if (lpa !is null) {
             ITextViewer viewer= fCurrentTarget.getViewer();
-            if (viewer instanceof ISourceViewer) {
+            if ( cast(ISourceViewer)viewer ) {
                 ISourceViewer sv= cast(ISourceViewer) viewer;
                 IAnnotationModel model= sv.getAnnotationModel();
-                if (model instanceof IAnnotationModelExtension) {
+                if ( cast(IAnnotationModelExtension)model ) {
                     IAnnotationModelExtension ext= cast(IAnnotationModelExtension) model;
                     IAnnotationModel ourModel= ext.getAnnotationModel(getUniqueKey());
                     if (ourModel is null) {
@@ -903,10 +903,10 @@
 
     private void uninstallAnnotationModel(LinkedModeUITarget target) {
         ITextViewer viewer= target.getViewer();
-        if (viewer instanceof ISourceViewer) {
+        if ( cast(ISourceViewer)viewer ) {
             ISourceViewer sv= cast(ISourceViewer) viewer;
             IAnnotationModel model= sv.getAnnotationModel();
-            if (model instanceof IAnnotationModelExtension) {
+            if ( cast(IAnnotationModelExtension)model ) {
                 IAnnotationModelExtension ext= cast(IAnnotationModelExtension) model;
                 ext.removeAnnotationModel(getUniqueKey());
             }
@@ -941,7 +941,7 @@
 
     private void select() {
         ITextViewer viewer= fCurrentTarget.getViewer();
-        if (viewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)viewer ) {
             ITextViewerExtension5 extension5= cast(ITextViewerExtension5) viewer;
             extension5.exposeModelRange(new Region(fFramePosition.offset, fFramePosition.length));
         } else if (!viewer.overlapsWithVisibleRegion(fFramePosition.offset, fFramePosition.length)) {
@@ -1028,7 +1028,7 @@
     private void registerAutoEditVetoer(ITextViewer viewer) {
         try {
             String[] contentTypes= getContentTypes(viewer.getDocument());
-            if (viewer instanceof ITextViewerExtension2) {
+            if ( cast(ITextViewerExtension2)viewer ) {
                 ITextViewerExtension2 vExtension= (cast(ITextViewerExtension2) viewer);
                 for (int i= 0; i < contentTypes.length; i++) {
                     vExtension.prependAutoEditStrategy(fAutoEditVetoer, contentTypes[i]);
@@ -1045,7 +1045,7 @@
     private void unregisterAutoEditVetoer(ITextViewer viewer) {
         try {
             String[] contentTypes= getContentTypes(viewer.getDocument());
-            if (viewer instanceof ITextViewerExtension2) {
+            if ( cast(ITextViewerExtension2)viewer ) {
                 ITextViewerExtension2 vExtension= (cast(ITextViewerExtension2) viewer);
                 for (int i= 0; i < contentTypes.length; i++) {
                     vExtension.removeAutoEditStrategy(fAutoEditVetoer, contentTypes[i]);
@@ -1067,7 +1067,7 @@
      * @since 3.1
      */
     private String[] getContentTypes(IDocument document)  {
-        if (document instanceof IDocumentExtension3) {
+        if ( cast(IDocumentExtension3)document ) {
             IDocumentExtension3 ext= cast(IDocumentExtension3) document;
             String[] partitionings= ext.getPartitionings();
             Set contentTypes= new HashSet(20);
--- a/dwtx/jface/text/link/LinkedPosition.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/link/LinkedPosition.d	Sun Aug 24 02:26:23 2008 +0200
@@ -84,7 +84,7 @@
      * @see dwtx.jface.text.Position#equals(java.lang.Object)
      */
     public bool equals(Object other) {
-        if (other instanceof LinkedPosition) {
+        if ( cast(LinkedPosition)other ) {
             LinkedPosition p= cast(LinkedPosition) other;
             return p.offset is offset && p.length is length && p.fDocument is fDocument;
         }
--- a/dwtx/jface/text/link/ProposalPosition.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/link/ProposalPosition.d	Sun Aug 24 02:26:23 2008 +0200
@@ -88,7 +88,7 @@
      * @see java.lang.Object#equals(java.lang.Object)
      */
     public bool equals(Object o) {
-        if (o instanceof ProposalPosition) {
+        if ( cast(ProposalPosition)o ) {
             if (super.equals(o)) {
                 return Arrays.equals(fProposals, (cast(ProposalPosition)o).fProposals);
             }
--- a/dwtx/jface/text/presentation/PresentationReconciler.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/presentation/PresentationReconciler.d	Sun Aug 24 02:26:23 2008 +0200
@@ -248,7 +248,7 @@
             String text= e.getText();
             int length= text is null ? 0 : text.length();
 
-            if (fViewer instanceof ITextViewerExtension5) {
+            if ( cast(ITextViewerExtension5)fViewer ) {
                 ITextViewerExtension5 extension= cast(ITextViewerExtension5) fViewer;
                 return extension.widgetRange2ModelRange(new Region(e.getOffset(), length));
             }
--- a/dwtx/jface/text/projection/ProjectionDocument.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/projection/ProjectionDocument.d	Sun Aug 24 02:26:23 2008 +0200
@@ -128,7 +128,7 @@
         super();
 
         fMasterDocument= masterDocument;
-        if (fMasterDocument instanceof IDocumentExtension)
+        if ( cast(IDocumentExtension)fMasterDocument )
             fMasterDocumentExtension= cast(IDocumentExtension) fMasterDocument;
 
         fSegmentsCategory= SEGMENTS_CATEGORY;
@@ -807,7 +807,7 @@
     }
 
     private int computeAnchor(DocumentEvent event) {
-        if (event instanceof ProjectionDocumentEvent) {
+        if ( cast(ProjectionDocumentEvent)event ) {
             ProjectionDocumentEvent slave= cast(ProjectionDocumentEvent) event;
             Object changeType= slave.getChangeType();
             if (ProjectionDocumentEvent.CONTENT_CHANGE is changeType) {
--- a/dwtx/jface/text/projection/ProjectionDocumentManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/projection/ProjectionDocumentManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -159,7 +159,7 @@
      * @see dwtx.jface.text.ISlaveDocumentManager#createMasterSlaveMapping(dwtx.jface.text.IDocument)
      */
     public IDocumentInformationMapping createMasterSlaveMapping(IDocument slave) {
-        if (slave instanceof ProjectionDocument) {
+        if ( cast(ProjectionDocument)slave ) {
             ProjectionDocument projectionDocument= cast(ProjectionDocument) slave;
             return projectionDocument.getDocumentInformationMapping();
         }
@@ -191,7 +191,7 @@
      * @see dwtx.jface.text.ISlaveDocumentManager#freeSlaveDocument(dwtx.jface.text.IDocument)
      */
     public void freeSlaveDocument(IDocument slave) {
-        if (slave instanceof ProjectionDocument) {
+        if ( cast(ProjectionDocument)slave ) {
             ProjectionDocument projectionDocument= cast(ProjectionDocument) slave;
             IDocument master= projectionDocument.getMasterDocument();
             remove(master, projectionDocument);
@@ -205,7 +205,7 @@
      * @see dwtx.jface.text.ISlaveDocumentManager#getMasterDocument(dwtx.jface.text.IDocument)
      */
     public IDocument getMasterDocument(IDocument slave) {
-        if (slave instanceof ProjectionDocument)
+        if ( cast(ProjectionDocument)slave )
             return (cast(ProjectionDocument) slave).getMasterDocument();
         return null;
     }
@@ -214,14 +214,14 @@
      * @see dwtx.jface.text.ISlaveDocumentManager#isSlaveDocument(dwtx.jface.text.IDocument)
      */
     public bool isSlaveDocument(IDocument document) {
-        return (document instanceof ProjectionDocument);
+        return ( cast(ProjectionDocument)document );
     }
 
     /*
      * @see dwtx.jface.text.ISlaveDocumentManager#setAutoExpandMode(dwtx.jface.text.IDocument, bool)
      */
     public void setAutoExpandMode(IDocument slave, bool autoExpanding) {
-        if (slave instanceof ProjectionDocument)
+        if ( cast(ProjectionDocument)slave )
             (cast(ProjectionDocument) slave).setAutoExpandMode(autoExpanding);
     }
 
--- a/dwtx/jface/text/projection/SegmentUpdater.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/projection/SegmentUpdater.d	Sun Aug 24 02:26:23 2008 +0200
@@ -64,7 +64,7 @@
      */
     public void update(DocumentEvent event) {
 
-        Assert.isTrue(event instanceof ProjectionDocumentEvent);
+        Assert.isTrue( cast(ProjectionDocumentEvent)event );
         fIsProjectionChange= (cast(ProjectionDocumentEvent) event).getChangeType() is ProjectionDocumentEvent.PROJECTION_CHANGE;
 
         try {
@@ -79,7 +79,7 @@
             for (int i= 0; i < category.length; i++) {
 
                 fPosition= category[i];
-                Assert.isTrue(fPosition instanceof Segment);
+                Assert.isTrue( cast(Segment)fPosition );
 
                 if (i < category.length - 1)
                     fNextSegment= cast(Segment) category[i + 1];
--- a/dwtx/jface/text/quickassist/QuickAssistAssistant.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/quickassist/QuickAssistAssistant.d	Sun Aug 24 02:26:23 2008 +0200
@@ -79,7 +79,7 @@
          */
         public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
             // panic code - should not happen
-            if (!(viewer instanceof ISourceViewer))
+            if (!( cast(ISourceViewer)viewer ))
                 return null;
             
             return fQuickAssistProcessor.computeQuickAssistProposals(new TextInvocationContext(cast(ISourceViewer)viewer, offset, -1));
--- a/dwtx/jface/text/reconciler/MonoReconciler.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/reconciler/MonoReconciler.d	Sun Aug 24 02:26:23 2008 +0200
@@ -66,7 +66,7 @@
     public this(IReconcilingStrategy strategy, bool isIncremental) {
         Assert.isNotNull(strategy);
         fStrategy= strategy;
-        if (fStrategy instanceof IReconcilingStrategyExtension) {
+        if ( cast(IReconcilingStrategyExtension)fStrategy ) {
             IReconcilingStrategyExtension extension= cast(IReconcilingStrategyExtension)fStrategy;
             extension.setProgressMonitor(getProgressMonitor());
         }
@@ -108,7 +108,7 @@
      */
     public void setProgressMonitor(IProgressMonitor monitor) {
         super.setProgressMonitor(monitor);
-        if (fStrategy instanceof IReconcilingStrategyExtension) {
+        if ( cast(IReconcilingStrategyExtension)fStrategy ) {
             IReconcilingStrategyExtension extension= cast(IReconcilingStrategyExtension) fStrategy;
             extension.setProgressMonitor(monitor);
         }
@@ -118,7 +118,7 @@
      * @see AbstractReconciler#initialProcess()
      */
     protected void initialProcess() {
-        if (fStrategy instanceof IReconcilingStrategyExtension) {
+        if ( cast(IReconcilingStrategyExtension)fStrategy ) {
             IReconcilingStrategyExtension extension= cast(IReconcilingStrategyExtension) fStrategy;
             extension.initialReconcile();
         }
--- a/dwtx/jface/text/reconciler/Reconciler.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/reconciler/Reconciler.d	Sun Aug 24 02:26:23 2008 +0200
@@ -194,7 +194,7 @@
             Iterator e= fStrategies.values().iterator();
             while (e.hasNext()) {
                 IReconcilingStrategy strategy= cast(IReconcilingStrategy) e.next();
-                if (strategy instanceof IReconcilingStrategyExtension) {
+                if ( cast(IReconcilingStrategyExtension)strategy ) {
                     IReconcilingStrategyExtension extension= cast(IReconcilingStrategyExtension) strategy;
                     extension.setProgressMonitor(monitor);
                 }
@@ -215,7 +215,7 @@
                 continue;
             contentTypes.add(contentType);
             IReconcilingStrategy s= getReconcilingStrategy(contentType);
-            if (s instanceof IReconcilingStrategyExtension) {
+            if ( cast(IReconcilingStrategyExtension)s ) {
                 IReconcilingStrategyExtension e= cast(IReconcilingStrategyExtension) s;
                 e.initialReconcile();
             }
--- a/dwtx/jface/text/rules/DefaultDamagerRepairer.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/rules/DefaultDamagerRepairer.d	Sun Aug 24 02:26:23 2008 +0200
@@ -230,7 +230,7 @@
      */
     protected TextAttribute getTokenTextAttribute(IToken token) {
         Object data= token.getData();
-        if (data instanceof TextAttribute)
+        if ( cast(TextAttribute)data )
             return cast(TextAttribute) data;
         return fDefaultTextAttribute;
     }
--- a/dwtx/jface/text/rules/DefaultPartitioner.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/rules/DefaultPartitioner.d	Sun Aug 24 02:26:23 2008 +0200
@@ -558,7 +558,7 @@
      */
     protected String getTokenContentType(IToken token) {
         Object data= token.getData();
-        if (data instanceof String)
+        if ( cast(String)data )
             return cast(String) data;
         return null;
     }
--- a/dwtx/jface/text/rules/FastPartitioner.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/rules/FastPartitioner.d	Sun Aug 24 02:26:23 2008 +0200
@@ -594,7 +594,7 @@
      */
     protected String getTokenContentType(IToken token) {
         Object data= token.getData();
-        if (data instanceof String)
+        if ( cast(String)data )
             return cast(String) data;
         return null;
     }
--- a/dwtx/jface/text/rules/RuleBasedPartitioner.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/rules/RuleBasedPartitioner.d	Sun Aug 24 02:26:23 2008 +0200
@@ -523,7 +523,7 @@
      */
     protected String getTokenContentType(IToken token) {
         Object data= token.getData();
-        if (data instanceof String)
+        if ( cast(String)data )
             return cast(String) data;
         return null;
     }
--- a/dwtx/jface/text/source/AnnotationBarHoverManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationBarHoverManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -427,7 +427,7 @@
 
         int line= getHoverLine(event);
 
-        if (hover instanceof IAnnotationHoverExtension) {
+        if ( cast(IAnnotationHoverExtension)hover ) {
             IAnnotationHoverExtension extension= cast(IAnnotationHoverExtension) hover;
             ILineRange range= extension.getHoverLineRange(fSourceViewer, line);
             setCustomInformationControlCreator(extension.getHoverControlCreator());
@@ -492,7 +492,7 @@
      */
     private ILineRange adaptLineRangeToFolding(ILineRange lineRange, int line) {
 
-        if (fSourceViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fSourceViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer;
 
             try {
@@ -642,7 +642,7 @@
         if (event is null || event.getSource() is null)
             return fAnnotationHover;
 
-        if (fVerticalRulerInfo instanceof CompositeRuler) {
+        if ( cast(CompositeRuler)fVerticalRulerInfo ) {
             CompositeRuler comp= cast(CompositeRuler) fVerticalRulerInfo;
             for (Iterator it= comp.getDecoratorIterator(); it.hasNext();) {
                 Object o= it.next();
@@ -677,7 +677,7 @@
      * @throws BadLocationException if <code>line</code> is not valid in the viewer's document
      */
     private int getWidgetLineNumber(int line)  {
-        if (fSourceViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fSourceViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer;
             return extension.modelLine2WidgetLine(line);
         }
@@ -766,12 +766,12 @@
         IAnnotationHover hover= getHover(event);
 
         bool allowMouseExit= false;
-        if (hover instanceof IAnnotationHoverExtension) {
+        if ( cast(IAnnotationHoverExtension)hover ) {
             IAnnotationHoverExtension extension= cast(IAnnotationHoverExtension) hover;
             allowMouseExit= extension.canHandleMouseCursor();
         }
         bool hideOnMouseWheel= true;
-        if (hover instanceof IAnnotationHoverExtension2) {
+        if ( cast(IAnnotationHoverExtension2)hover ) {
             IAnnotationHoverExtension2 extension= cast(IAnnotationHoverExtension2) hover;
             hideOnMouseWheel= !extension.canHandleMouseWheel();
         }
--- a/dwtx/jface/text/source/AnnotationModel.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationModel.d	Sun Aug 24 02:26:23 2008 +0200
@@ -520,7 +520,7 @@
     public void addAnnotationModelListener(IAnnotationModelListener listener) {
         if (!fAnnotationModelListeners.contains(listener)) {
             fAnnotationModelListeners.add(listener);
-            if (listener instanceof IAnnotationModelListenerExtension) {
+            if ( cast(IAnnotationModelListenerExtension)listener ) {
                 IAnnotationModelListenerExtension extension= cast(IAnnotationModelListenerExtension) listener;
                 AnnotationModelEvent event= createAnnotationModelEvent();
                 event.markSealed();
@@ -676,7 +676,7 @@
         Iterator e= v.iterator();
         while (e.hasNext()) {
             IAnnotationModelListener l= cast(IAnnotationModelListener) e.next();
-            if (l instanceof IAnnotationModelListenerExtension)
+            if ( cast(IAnnotationModelListenerExtension)l )
                 (cast(IAnnotationModelListenerExtension) l).modelChanged(event);
             else if (l !is null)
                 l.modelChanged(this);
@@ -774,7 +774,7 @@
         Iterator it= fAttachments.keySet().iterator();
         while (it.hasNext()) {
             IAnnotationModel attachment= cast(IAnnotationModel) fAttachments.get(it.next());
-            if (attachment instanceof IAnnotationModelExtension2)
+            if ( cast(IAnnotationModelExtension2)attachment )
                 iterators.add((cast(IAnnotationModelExtension2) attachment).getAnnotationIterator(offset, length, canStartBefore, canEndAfter));
             else
                 iterators.add(new RegionIterator(attachment.getAnnotationIterator(), attachment, offset, length, canStartBefore, canEndAfter));
@@ -795,7 +795,7 @@
      * @since 3.4
      */
     private Iterator getRegionAnnotationIterator(int offset, int length, bool canStartBefore, bool canEndAfter) {
-        if (!(fDocument instanceof AbstractDocument))
+        if (!( cast(AbstractDocument)fDocument ))
             return new RegionIterator(getAnnotationIterator(true), this, offset, length, canStartBefore, canEndAfter);
         
         AbstractDocument document= cast(AbstractDocument) fDocument;
--- a/dwtx/jface/text/source/AnnotationModelEvent.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationModelEvent.d	Sun Aug 24 02:26:23 2008 +0200
@@ -318,7 +318,7 @@
      * @since 3.0
      */
     public void markSealed() {
-        if (fAnnotationModel instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)fAnnotationModel ) {
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) fAnnotationModel;
             fModificationStamp= extension.getModificationStamp();
         }
--- a/dwtx/jface/text/source/AnnotationPainter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationPainter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -912,7 +912,7 @@
 
         decoration.fPosition= position;
         decoration.fColor= color;
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) {
             IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess;
             decoration.fLayer= extension.getLayer(annotation);
         } else {
@@ -942,7 +942,7 @@
             return strategy;
         }
 
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) {
             IAnnotationAccessExtension ext = cast(IAnnotationAccessExtension) fAnnotationAccess;
             Object[] sts = ext.getSupertypes(type);
             for (int i= 0; i < sts.length; i++) {
@@ -977,7 +977,7 @@
             return color;
         }
 
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) {
             IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess;
             Object[] superTypes= extension.getSupertypes(annotationType);
             if (superTypes !is null) {
@@ -1020,7 +1020,7 @@
         if (r is null)
             return;
 
-        if (fSourceViewer instanceof ITextViewerExtension2) {
+        if ( cast(ITextViewerExtension2)fSourceViewer ) {
             if cast(DEBUG)
                 System.out.println("AP: invalidating offset: " + r.getOffset() + ", length= " + r.getLength()); //$NON-NLS-1$ //$NON-NLS-2$
 
@@ -1066,7 +1066,7 @@
                     continue;
 
                 Position p= pp.fPosition;
-                if (fSourceViewer instanceof ITextViewerExtension5) {
+                if ( cast(ITextViewerExtension5)fSourceViewer ) {
                     ITextViewerExtension5 extension3= cast(ITextViewerExtension5) fSourceViewer;
                     if (null is extension3.modelRange2WidgetRange(new Region(p.getOffset(), p.getLength())))
                         continue;
@@ -1588,7 +1588,7 @@
         if (fReusableRegion is null || fReusableRegion.getOffset() is Integer.MAX_VALUE)
             return null;
 
-        if (fSourceViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fSourceViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer;
             return extension.modelRange2WidgetRange(fReusableRegion);
         }
@@ -1618,7 +1618,7 @@
         if (offset is Integer.MAX_VALUE)
             return null;
 
-        if (fSourceViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fSourceViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer;
             return extension.widgetRange2ModelRange(new Region(offset, length));
         }
--- a/dwtx/jface/text/source/AnnotationRulerColumn.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationRulerColumn.d	Sun Aug 24 02:26:23 2008 +0200
@@ -287,7 +287,7 @@
      */
     public this(int width, IAnnotationAccess annotationAccess) {
         fWidth= width;
-        if (annotationAccess instanceof IAnnotationAccessExtension)
+        if ( cast(IAnnotationAccessExtension)annotationAccess )
             fAnnotationAccessExtension= cast(IAnnotationAccessExtension) annotationAccess;
     }
 
@@ -478,7 +478,7 @@
     protected bool hasAnnotation(int lineNumber) {
 
         IAnnotationModel model= fModel;
-        if (fModel instanceof IAnnotationModelExtension)
+        if ( cast(IAnnotationModelExtension)fModel )
             model= (cast(IAnnotationModelExtension)fModel).getAnnotationModel(SourceViewer.MODEL_ANNOTATION_MODEL);
 
         if (model is null)
@@ -499,7 +499,7 @@
         int lineLength= line.getLength();
 
         Iterator e;
-        if (fModel instanceof IAnnotationModelExtension2)
+        if ( cast(IAnnotationModelExtension2)fModel )
             e= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(lineStart, lineLength + 1, true, true);
         else
             e= model.getAnnotationIterator();
@@ -580,7 +580,7 @@
             gc.setBackground(fCanvas.getBackground());
             gc.fillRectangle(0, 0, size.x, size.y);
 
-            if (fCachedTextViewer instanceof ITextViewerExtension5)
+            if ( cast(ITextViewerExtension5)fCachedTextViewer )
                 doPaint1(gc);
             else
                 doPaint(gc);
@@ -676,7 +676,7 @@
 
         for (int layer= 0; layer < maxLayer; layer++) {
             Iterator iter;
-            if (fModel instanceof IAnnotationModelExtension2)
+            if ( cast(IAnnotationModelExtension2)fModel )
                 iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(topLeft, viewPort + 1, true, true);
             else
                 iter= fModel.getAnnotationIterator();
@@ -766,7 +766,7 @@
         int minLayer= Integer.MAX_VALUE, maxLayer= Integer.MIN_VALUE;
         fCachedAnnotations.clear();
         Iterator iter;
-        if (fModel instanceof IAnnotationModelExtension2)
+        if ( cast(IAnnotationModelExtension2)fModel )
             iter= (cast(IAnnotationModelExtension2)fModel).getAnnotationIterator(vOffset, vLength + 1, true, true);
         else
             iter= fModel.getAnnotationIterator();
--- a/dwtx/jface/text/source/ChangeRulerColumn.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/ChangeRulerColumn.d	Sun Aug 24 02:26:23 2008 +0200
@@ -568,7 +568,7 @@
         int topLine;
         IRegion coverage;
         
-        if (fCachedTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fCachedTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fCachedTextViewer;
             
             // ITextViewer.getTopIndex returns the fully visible line, but we want the partially
--- a/dwtx/jface/text/source/CompositeRuler.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/CompositeRuler.d	Sun Aug 24 02:26:23 2008 +0200
@@ -665,7 +665,7 @@
 
         Control parent= fTextViewer.getTextWidget();
 
-        if (fTextViewer instanceof ITextViewerExtension) {
+        if ( cast(ITextViewerExtension)fTextViewer ) {
             ITextViewerExtension extension= cast(ITextViewerExtension) fTextViewer;
             parent= extension.getControl();
         }
@@ -816,7 +816,7 @@
      */
     protected final static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) {
 
-        if (viewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)viewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) viewer;
             return extension.widgetLine2ModelLine(widgetLine);
         }
--- a/dwtx/jface/text/source/DefaultAnnotationHover.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/DefaultAnnotationHover.d	Sun Aug 24 02:26:23 2008 +0200
@@ -223,7 +223,7 @@
     }
     
     private IAnnotationModel getAnnotationModel(ISourceViewer viewer) {
-        if (viewer instanceof ISourceViewerExtension2) {
+        if ( cast(ISourceViewerExtension2)viewer ) {
             ISourceViewerExtension2 extension= cast(ISourceViewerExtension2) viewer;
             return extension.getVisualAnnotationModel();
         }
@@ -236,7 +236,7 @@
             if (message.equals(value))
                 return true;
             
-            if (value instanceof List) {
+            if ( cast(List)value ) {
                 List messages= cast(List)value;
                 if  (messages.contains(message))
                     return true;
@@ -281,7 +281,7 @@
             if (!isRulerLine(position, document, line))
                 continue;
             
-            if (annotation instanceof AnnotationBag) {
+            if ( cast(AnnotationBag)annotation ) {
                 AnnotationBag bag= cast(AnnotationBag) annotation;
                 Iterator e= bag.iterator();
                 while (e.hasNext()) {
--- a/dwtx/jface/text/source/LineChangeHover.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/LineChangeHover.d	Sun Aug 24 02:26:23 2008 +0200
@@ -239,12 +239,12 @@
         if (model is null)
             return null;
 
-        if (model instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)model ) {
             IAnnotationModel diffModel= (cast(IAnnotationModelExtension)model).getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
             if (diffModel !is null)
                 model= diffModel;
         }
-        if (model instanceof ILineDiffer) {
+        if ( cast(ILineDiffer)model ) {
             if (model instanceof ILineDifferExtension2 && (cast(ILineDifferExtension2)model).isSuspended())
                 return null;
             return cast(ILineDiffer)model;
--- a/dwtx/jface/text/source/LineNumberRulerColumn.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/LineNumberRulerColumn.d	Sun Aug 24 02:26:23 2008 +0200
@@ -299,7 +299,7 @@
                             widgetOffset--;
 
                         // Convert to model offset
-                        if (fCachedTextViewer instanceof ITextViewerExtension5) {
+                        if ( cast(ITextViewerExtension5)fCachedTextViewer ) {
                             ITextViewerExtension5 extension= cast(ITextViewerExtension5)fCachedTextViewer;
                             offset= extension.widgetOffset2ModelOffset(widgetOffset);
                         } else
@@ -310,7 +310,7 @@
 
                         // Convert to widget offset
                         int lineEndWidgetOffset;
-                        if (fCachedTextViewer instanceof ITextViewerExtension5) {
+                        if ( cast(ITextViewerExtension5)fCachedTextViewer ) {
                             ITextViewerExtension5 extension= cast(ITextViewerExtension5)fCachedTextViewer;
                             lineEndWidgetOffset= extension.modelOffset2WidgetOffset(lineEndOffset);
                         } else
@@ -596,7 +596,7 @@
         }
 
         fRelayoutRequired= false;
-        if (fCachedTextViewer instanceof ITextViewerExtension) {
+        if ( cast(ITextViewerExtension)fCachedTextViewer ) {
             ITextViewerExtension extension= cast(ITextViewerExtension) fCachedTextViewer;
             Control control= extension.getControl();
             if (control instanceof Composite && !control.isDisposed()) {
--- a/dwtx/jface/text/source/MatchingCharacterPainter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/MatchingCharacterPainter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -199,7 +199,7 @@
         if (length < 1)
             return;
 
-        if (fSourceViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fSourceViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer;
             IRegion widgetRange= extension.modelRange2WidgetRange(new Region(offset, length));
             if (widgetRange is null)
--- a/dwtx/jface/text/source/OverviewRuler.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/OverviewRuler.d	Sun Aug 24 02:26:23 2008 +0200
@@ -251,7 +251,7 @@
                 if (next.isMarkedDeleted())
                     continue;
 
-                if (ignr && (next instanceof AnnotationBag))
+                if (ignr && ( cast(AnnotationBag)next ))
                     continue;
 
                 fNext= next;
@@ -266,7 +266,7 @@
         }
 
         private bool isSubtype(Object annotationType) {
-            if (fAnnotationAccess instanceof  IAnnotationAccessExtension) {
+            if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) {
                 IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess;
                 return extension.isSubtype(annotationType, fType);
             }
@@ -537,7 +537,7 @@
 
         fHeader= new Canvas(parent, DWT.NONE);
 
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) {
             fHeader.addMouseTrackListener(new class()  MouseTrackAdapter {
                 /*
                  * @see dwt.events.MouseTrackAdapter#mouseHover(dwt.events.MouseEvent)
@@ -644,7 +644,7 @@
 
             cacheAnnotations();
             
-            if (fTextViewer instanceof ITextViewerExtension5)
+            if ( cast(ITextViewerExtension5)fTextViewer )
                 doPaint1(gc);
             else
                 doPaint(gc);
@@ -908,7 +908,7 @@
         lines[0]= (pixel0 * maxLines) / rulerLength;
         lines[1]= (pixel1 * maxLines) / rulerLength;
 
-        if (fTextViewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)fTextViewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer;
             lines[0]= extension.widgetLine2ModelLine(lines[0]);
             lines[1]= extension.widgetLine2ModelLine(lines[1]);
@@ -1147,7 +1147,7 @@
      * @since 3.0
      */
     private bool isCovered(Object annotationType, Set configured) {
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) {
             IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess;
             Iterator e= configured.iterator();
             while (e.hasNext()) {
@@ -1235,7 +1235,7 @@
         if (color !is null)
             return color;
 
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension) {
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess ) {
             IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess;
             Object[] superTypes= extension.getSupertypes(annotationType);
             if (superTypes !is null) {
--- a/dwtx/jface/text/source/OverviewRulerHoverManager.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/OverviewRulerHoverManager.d	Sun Aug 24 02:26:23 2008 +0200
@@ -123,7 +123,7 @@
         IAnnotationHover hover= getAnnotationHover();
         
         IInformationControlCreator controlCreator= null;
-        if (hover instanceof IAnnotationHoverExtension)
+        if ( cast(IAnnotationHoverExtension)hover )
             controlCreator= (cast(IAnnotationHoverExtension)hover).getHoverControlCreator();
         setCustomInformationControlCreator(controlCreator);
         
--- a/dwtx/jface/text/source/SourceViewer.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/SourceViewer.d	Sun Aug 24 02:26:23 2008 +0200
@@ -584,7 +584,7 @@
             if (getDocument() !is null)
                 fVisualAnnotationModel.disconnect(getDocument());
         
-            if ( fVisualAnnotationModel instanceof IAnnotationModelExtension)
+            if ( cast(IAnnotationModelExtension)fVisualAnnotationModel )
                 (cast(IAnnotationModelExtension)fVisualAnnotationModel).removeAnnotationModel(MODEL_ANNOTATION_MODEL);
             
             fVisualAnnotationModel= null;
@@ -618,7 +618,7 @@
      * @see ISourceViewer#getAnnotationModel()
      */
     public IAnnotationModel getAnnotationModel() {
-        if (fVisualAnnotationModel instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)fVisualAnnotationModel ) {
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) fVisualAnnotationModel;
             return extension.getAnnotationModel(MODEL_ANNOTATION_MODEL);
         }
@@ -890,7 +890,7 @@
                     IFormattingContext context= null;
                     DocumentRewriteSession rewriteSession= null;
 
-                    if (document instanceof IDocumentExtension4) {
+                    if ( cast(IDocumentExtension4)document ) {
                         IDocumentExtension4 extension= cast(IDocumentExtension4) document;
                         DocumentRewriteSessionType type= selection.y is 0 || selection.y > 1000 ? DocumentRewriteSessionType.SEQUENTIAL : DocumentRewriteSessionType.UNRESTRICTED_SMALL;
                         rewriteSession= extension.startRewriteSession(type);
@@ -905,7 +905,7 @@
 
                         try {
 
-                            if (fContentFormatter instanceof IContentFormatterExtension) {
+                            if ( cast(IContentFormatterExtension)fContentFormatter ) {
                                 final IContentFormatterExtension extension= cast(IContentFormatterExtension) fContentFormatter;
                                 context= createFormattingContext();
                                 if (selection.y is 0) {
@@ -938,7 +938,7 @@
 
                     } finally {
 
-                        if (document instanceof IDocumentExtension4) {
+                        if ( cast(IDocumentExtension4)document ) {
                             IDocumentExtension4 extension= cast(IDocumentExtension4) document;
                             extension.stopRewriteSession(rewriteSession);
                         } else {
@@ -966,7 +966,7 @@
      */
     protected void updateSlaveDocuments(IDocument masterDocument) {
         ISlaveDocumentManager manager= getSlaveDocumentManager();
-        if (manager instanceof ISlaveDocumentManagerExtension) {
+        if ( cast(ISlaveDocumentManagerExtension)manager ) {
             ISlaveDocumentManagerExtension extension= cast(ISlaveDocumentManagerExtension) manager;
             IDocument[] slaves= extension.getSlaveDocuments(masterDocument);
             if (slaves !is null) {
@@ -1099,10 +1099,10 @@
      * @since 3.3
      */
     private bool isVerticalRulerOnlyShowingAnnotations() {
-        if (fVerticalRuler instanceof VerticalRuler)
+        if ( cast(VerticalRuler)fVerticalRuler )
             return true;
         
-        if (fVerticalRuler instanceof CompositeRuler) {
+        if ( cast(CompositeRuler)fVerticalRuler ) {
             Iterator iter= (cast(CompositeRuler)fVerticalRuler).getDecoratorIterator();
             return iter.hasNext() && iter.next() instanceof AnnotationRulerColumn && !iter.hasNext();
         }
--- a/dwtx/jface/text/source/VerticalRuler.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/VerticalRuler.d	Sun Aug 24 02:26:23 2008 +0200
@@ -295,7 +295,7 @@
             gc.setBackground(fCanvas.getBackground());
             gc.fillRectangle(0, 0, size.x, size.y);
 
-            if (fTextViewer instanceof ITextViewerExtension5)
+            if ( cast(ITextViewerExtension5)fTextViewer )
                 doPaint1(gc);
             else
                 doPaint(gc);
@@ -342,7 +342,7 @@
             return;
 
         IAnnotationAccessExtension annotationAccessExtension= null;
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension)
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess )
             annotationAccessExtension= cast(IAnnotationAccessExtension) fAnnotationAccess;
 
         StyledText styledText= fTextViewer.getTextWidget();
@@ -377,7 +377,7 @@
                 int lay= IAnnotationAccessExtension.DEFAULT_LAYER;
                 if (annotationAccessExtension !is null)
                     lay= annotationAccessExtension.getLayer(annotation);
-                else if (annotation instanceof IAnnotationPresentation) {
+                else if ( cast(IAnnotationPresentation)annotation ) {
                     annotationPresentation= cast(IAnnotationPresentation)annotation;
                     lay= annotationPresentation.getLayer();
                 }
@@ -442,7 +442,7 @@
             return;
 
         IAnnotationAccessExtension annotationAccessExtension= null;
-        if (fAnnotationAccess instanceof IAnnotationAccessExtension)
+        if ( cast(IAnnotationAccessExtension)fAnnotationAccess )
             annotationAccessExtension= cast(IAnnotationAccessExtension) fAnnotationAccess;
 
         ITextViewerExtension5 extension= cast(ITextViewerExtension5) fTextViewer;
@@ -464,7 +464,7 @@
                 int lay= IAnnotationAccessExtension.DEFAULT_LAYER;
                 if (annotationAccessExtension !is null)
                     lay= annotationAccessExtension.getLayer(annotation);
-                else if (annotation instanceof IAnnotationPresentation) {
+                else if ( cast(IAnnotationPresentation)annotation ) {
                     annotationPresentation= cast(IAnnotationPresentation)annotation;
                     lay= annotationPresentation.getLayer();
                 }
@@ -606,7 +606,7 @@
      */
     protected final static int widgetLine2ModelLine(ITextViewer viewer, int widgetLine) {
 
-        if (viewer instanceof ITextViewerExtension5) {
+        if ( cast(ITextViewerExtension5)viewer ) {
             ITextViewerExtension5 extension= cast(ITextViewerExtension5) viewer;
             return extension.widgetLine2ModelLine(widgetLine);
         }
--- a/dwtx/jface/text/source/projection/ProjectionAnnotationHover.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionAnnotationHover.d	Sun Aug 24 02:26:23 2008 +0200
@@ -91,7 +91,7 @@
         if (position.getOffset() > -1 && position.getLength() > -1) {
             try {
                 int captionOffset;
-                if (position instanceof IProjectionPosition)
+                if ( cast(IProjectionPosition)position )
                     captionOffset= (cast(IProjectionPosition) position).computeCaptionOffset(document);
                 else
                     captionOffset= 0;
@@ -106,10 +106,10 @@
     private String getProjectionTextAtLine(ISourceViewer viewer, int line, int numberOfLines) {
 
         IAnnotationModel model= null;
-        if (viewer instanceof ISourceViewerExtension2) {
+        if ( cast(ISourceViewerExtension2)viewer ) {
             ISourceViewerExtension2 viewerExtension= cast(ISourceViewerExtension2) viewer;
             IAnnotationModel visual= viewerExtension.getVisualAnnotationModel();
-            if (visual instanceof IAnnotationModelExtension) {
+            if ( cast(IAnnotationModelExtension)visual ) {
                 IAnnotationModelExtension modelExtension= cast(IAnnotationModelExtension) visual;
                 model= modelExtension.getAnnotationModel(ProjectionSupport.PROJECTION);
             }
--- a/dwtx/jface/text/source/projection/ProjectionAnnotationModel.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionAnnotationModel.d	Sun Aug 24 02:26:23 2008 +0200
@@ -61,7 +61,7 @@
      * @param annotation the annotation
      */
     public void collapse(Annotation annotation) {
-        if (annotation instanceof ProjectionAnnotation) {
+        if ( cast(ProjectionAnnotation)annotation ) {
             ProjectionAnnotation projection= cast(ProjectionAnnotation) annotation;
             if (!projection.isCollapsed()) {
                 projection.markCollapsed();
@@ -77,7 +77,7 @@
      * @param annotation the annotation
      */
     public void expand(Annotation annotation) {
-        if (annotation instanceof ProjectionAnnotation) {
+        if ( cast(ProjectionAnnotation)annotation ) {
             ProjectionAnnotation projection= cast(ProjectionAnnotation) annotation;
             if (projection.isCollapsed()) {
                 projection.markExpanded();
@@ -93,7 +93,7 @@
      * @param annotation the annotation
      */
     public void toggleExpansionState(Annotation annotation) {
-        if (annotation instanceof ProjectionAnnotation) {
+        if ( cast(ProjectionAnnotation)annotation ) {
             ProjectionAnnotation projection= cast(ProjectionAnnotation) annotation;
 
             if (projection.isCollapsed())
--- a/dwtx/jface/text/source/projection/ProjectionRulerColumn.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionRulerColumn.d	Sun Aug 24 02:26:23 2008 +0200
@@ -111,7 +111,7 @@
             Iterator e= model.getAnnotationIterator();
             while (e.hasNext()) {
                 Object next= e.next();
-                if (next instanceof ProjectionAnnotation) {
+                if ( cast(ProjectionAnnotation)next ) {
                     ProjectionAnnotation annotation= cast(ProjectionAnnotation) next;
                     Position p= model.getPosition(annotation);
                     if (p is null)
@@ -154,7 +154,7 @@
                 if (startLine <= line && line < endLine) {
                     if (annotation.isCollapsed()) {
                         int captionOffset;
-                        if (position instanceof IProjectionPosition)
+                        if ( cast(IProjectionPosition)position )
                             captionOffset= (cast(IProjectionPosition) position).computeCaptionOffset(document);
                         else
                             captionOffset= 0;
@@ -226,7 +226,7 @@
      * @see dwtx.jface.text.source.AnnotationRulerColumn#setModel(dwtx.jface.text.source.IAnnotationModel)
      */
     public void setModel(IAnnotationModel model) {
-        if (model instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)model ) {
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) model;
             model= extension.getAnnotationModel(ProjectionSupport.PROJECTION);
         }
--- a/dwtx/jface/text/source/projection/ProjectionSummary.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionSummary.d	Sun Aug 24 02:26:23 2008 +0200
@@ -190,7 +190,7 @@
 
         } finally {
 
-            if (fAnnotationModel instanceof ISynchronizable) {
+            if ( cast(ISynchronizable)fAnnotationModel ) {
                 ISynchronizable sync= cast(ISynchronizable) fAnnotationModel;
                 sync.setLockObject(previousLockObject);
             }
@@ -207,7 +207,7 @@
         IAnnotationModelExtension extension= null;
         List bags= null;
 
-        if (fAnnotationModel instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)fAnnotationModel ) {
             extension= cast(IAnnotationModelExtension) fAnnotationModel;
             bags= new ArrayList();
         }
@@ -215,7 +215,7 @@
         Iterator e= fAnnotationModel.getAnnotationIterator();
         while (e.hasNext()) {
             Annotation annotation= cast(Annotation) e.next();
-            if (annotation instanceof AnnotationBag) {
+            if ( cast(AnnotationBag)annotation ) {
                 if (bags is null)
                     fAnnotationModel.removeAnnotation(annotation);
                 else
@@ -261,7 +261,7 @@
         }
 
         if (additions.size() > 0) {
-            if (fAnnotationModel instanceof IAnnotationModelExtension) {
+            if ( cast(IAnnotationModelExtension)fAnnotationModel ) {
                 IAnnotationModelExtension extension= cast(IAnnotationModelExtension) fAnnotationModel;
                 if (!isCanceled(monitor))
                     extension.replaceAnnotations(null, additions);
--- a/dwtx/jface/text/source/projection/ProjectionSupport.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionSupport.d	Sun Aug 24 02:26:23 2008 +0200
@@ -79,7 +79,7 @@
          * @see dwtx.jface.text.source.AnnotationPainter#findAnnotationModel(dwtx.jface.text.source.ISourceViewer)
          */
         protected IAnnotationModel findAnnotationModel(ISourceViewer sourceViewer) {
-            if (sourceViewer instanceof ProjectionViewer) {
+            if ( cast(ProjectionViewer)sourceViewer ) {
                 ProjectionViewer projectionViewer= cast(ProjectionViewer) sourceViewer;
                 return projectionViewer.getProjectionAnnotationModel();
             }
@@ -90,7 +90,7 @@
          * @see dwtx.jface.text.source.AnnotationPainter#skip(dwtx.jface.text.source.Annotation)
          */
         protected bool skip(Annotation annotation) {
-            if (annotation instanceof ProjectionAnnotation)
+            if ( cast(ProjectionAnnotation)annotation )
                 return !(cast(ProjectionAnnotation) annotation).isCollapsed();
 
             return super.skip(annotation);
@@ -102,7 +102,7 @@
          * @see dwtx.jface.text.source.AnnotationPainter.IDrawingStrategy#draw(dwt.graphics.GC, dwt.custom.StyledText, int, int, dwt.graphics.Color)
          */
         public void draw(Annotation annotation, GC gc, StyledText textWidget, int offset, int length, Color color) {
-            if (annotation instanceof ProjectionAnnotation) {
+            if ( cast(ProjectionAnnotation)annotation ) {
                 ProjectionAnnotation projectionAnnotation= cast(ProjectionAnnotation) annotation;
                 if (projectionAnnotation.isCollapsed()) {
 
@@ -373,7 +373,7 @@
      */
     public Object getAdapter(ISourceViewer viewer, Class required) {
         if (ProjectionAnnotationModel.class.equals(required)) {
-            if (viewer instanceof ProjectionViewer) {
+            if ( cast(ProjectionViewer)viewer ) {
                 ProjectionViewer projectionViewer= cast(ProjectionViewer) viewer;
                 return projectionViewer.getProjectionAnnotationModel();
             }
--- a/dwtx/jface/text/source/projection/ProjectionViewer.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionViewer.d	Sun Aug 24 02:26:23 2008 +0200
@@ -343,7 +343,7 @@
      * @param model the model to which the projection annotation model is added
      */
     private void addProjectionAnnotationModel(IAnnotationModel model) {
-        if (model instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)model ) {
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) model;
             extension.addAnnotationModel(ProjectionSupport.PROJECTION, fProjectionAnnotationModel);
             model.addAnnotationModelListener(fAnnotationModelListener);
@@ -357,7 +357,7 @@
      * @return the removed projection annotation model or <code>null</code> if there was none
      */
     private IAnnotationModel removeProjectionAnnotationModel(IAnnotationModel model) {
-        if (model instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)model ) {
             model.removeAnnotationModelListener(fAnnotationModelListener);
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) model;
             return extension.removeAnnotationModel(ProjectionSupport.PROJECTION);
@@ -402,7 +402,7 @@
      */
     public ProjectionAnnotationModel getProjectionAnnotationModel() {
         IAnnotationModel model= getVisualAnnotationModel();
-        if (model instanceof IAnnotationModelExtension) {
+        if ( cast(IAnnotationModelExtension)model ) {
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) model;
             return cast(ProjectionAnnotationModel) extension.getAnnotationModel(ProjectionSupport.PROJECTION);
         }
@@ -420,7 +420,7 @@
      * @see dwtx.jface.text.TextViewer#updateSlaveDocument(dwtx.jface.text.IDocument, int, int)
      */
     protected bool updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength)  {
-        if (slaveDocument instanceof ProjectionDocument) {
+        if ( cast(ProjectionDocument)slaveDocument ) {
             ProjectionDocument projection= cast(ProjectionDocument) slaveDocument;
 
             int offset= modelRangeOffset;
@@ -805,12 +805,12 @@
         ProjectionDocument projection= null;
 
         IDocument visibleDocument= getVisibleDocument();
-        if (visibleDocument instanceof ProjectionDocument)
+        if ( cast(ProjectionDocument)visibleDocument )
             projection= cast(ProjectionDocument) visibleDocument;
         else {
             IDocument master= getDocument();
             IDocument slave= createSlaveDocument(getDocument());
-            if (slave instanceof ProjectionDocument) {
+            if ( cast(ProjectionDocument)slave ) {
                 projection= cast(ProjectionDocument) slave;
                 addMasterDocumentRange(projection, 0, master.getLength());
                 replaceVisibleDocument(projection);
@@ -843,7 +843,7 @@
      */
     private void expand(int offset, int length, bool fireRedraw)  {
         IDocument slave= getVisibleDocument();
-        if (slave instanceof ProjectionDocument) {
+        if ( cast(ProjectionDocument)slave ) {
             ProjectionDocument projection= cast(ProjectionDocument) slave;
 
             // expand
@@ -947,7 +947,7 @@
      */
     private bool isVisibleMasterDocumentSameAsDocument() {
         IDocument visibleDocument= getVisibleDocument();
-        return (visibleDocument instanceof ProjectionDocument) && (cast(ProjectionDocument)visibleDocument).getMasterDocument() is getDocument();
+        return ( cast(ProjectionDocument)visibleDocument ) && (cast(ProjectionDocument)visibleDocument).getMasterDocument() is getDocument();
     }
 
     /**
@@ -1134,7 +1134,7 @@
             if (document is null)
                 return null;
 
-            if (position instanceof IProjectionPosition) {
+            if ( cast(IProjectionPosition)position ) {
                 IProjectionPosition projPosition= cast(IProjectionPosition) position;
                 return projPosition.computeProjectionRegions(document);
             }
@@ -1168,7 +1168,7 @@
                 return null;
 
             int captionOffset= position.getOffset();
-            if (position instanceof IProjectionPosition)
+            if ( cast(IProjectionPosition)position )
                 captionOffset+= (cast(IProjectionPosition) position).computeCaptionOffset(document);
 
             IRegion lineInfo= document.getLineInformationOfOffset(captionOffset);
@@ -1225,7 +1225,7 @@
             IDocument master= getDocument();
             if (master !is null) {
                 IDocument slave= manager.createSlaveDocument(master);
-                if (slave instanceof ProjectionDocument) {
+                if ( cast(ProjectionDocument)slave ) {
                     projection= cast(ProjectionDocument) slave;
                     addMasterDocumentRange(projection, 0, master.getLength());
                 }
@@ -1270,7 +1270,7 @@
      */
     public void addVerticalRulerColumn(IVerticalRulerColumn column) {
         IVerticalRuler ruler= getVerticalRuler();
-        if (ruler instanceof CompositeRuler) {
+        if ( cast(CompositeRuler)ruler ) {
             CompositeRuler compositeRuler= cast(CompositeRuler) ruler;
             compositeRuler.addDecorator(99, column);
         }
@@ -1283,7 +1283,7 @@
      */
     public void removeVerticalRulerColumn(IVerticalRulerColumn column) {
         IVerticalRuler ruler= getVerticalRuler();
-        if (ruler instanceof CompositeRuler) {
+        if ( cast(CompositeRuler)ruler ) {
             CompositeRuler compositeRuler= cast(CompositeRuler) ruler;
             compositeRuler.removeDecorator(column);
         }
@@ -1405,7 +1405,7 @@
         if (fInformationMapping is null)
             return new IRegion[] { new Region(modelRange.getOffset(), modelRange.getLength()) };
 
-        if (fInformationMapping instanceof IDocumentInformationMappingExtension) {
+        if ( cast(IDocumentInformationMappingExtension)fInformationMapping ) {
             IDocumentInformationMappingExtension extension= cast(IDocumentInformationMappingExtension) fInformationMapping;
             try {
                 return extension.getExactCoverage(modelRange);
--- a/dwtx/jface/text/source/projection/SourceViewerInformationControl.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/source/projection/SourceViewerInformationControl.d	Sun Aug 24 02:26:23 2008 +0200
@@ -189,7 +189,7 @@
      * @param input the input object
      */
     public void setInput(Object input) {
-        if (input instanceof String)
+        if ( cast(String)input )
             setInformation(cast(String)input);
         else
             setInformation(null);
@@ -421,7 +421,7 @@
         do {
             if (control is fShell)
                 return true;
-            if (control instanceof Shell)
+            if ( cast(Shell)control )
                 return false;
             control= control.getParent();
         } while (control !is null);
--- a/dwtx/jface/text/templates/Template.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/templates/Template.d	Sun Aug 24 02:26:23 2008 +0200
@@ -212,7 +212,7 @@
      * @see java.lang.Object#equals(java.lang.Object)
      */
     public bool equals(Object o) {
-        if (!(o instanceof Template))
+        if (!( cast(Template)o ))
             return false;
 
         Template t= cast(Template) o;
--- a/dwtx/jface/text/templates/TemplateProposal.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/templates/TemplateProposal.d	Sun Aug 24 02:26:23 2008 +0200
@@ -314,7 +314,7 @@
      */
     protected final int getReplaceOffset() {
         int start;
-        if (fContext instanceof DocumentTemplateContext) {
+        if ( cast(DocumentTemplateContext)fContext ) {
             DocumentTemplateContext docContext = cast(DocumentTemplateContext)fContext;
             start= docContext.getStart();
         } else {
@@ -333,7 +333,7 @@
      */
     protected final int getReplaceEndOffset() {
         int end;
-        if (fContext instanceof DocumentTemplateContext) {
+        if ( cast(DocumentTemplateContext)fContext ) {
             DocumentTemplateContext docContext = cast(DocumentTemplateContext)fContext;
             end= docContext.getEnd();
         } else {
--- a/dwtx/jface/text/templates/TemplateVariableType.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/templates/TemplateVariableType.d	Sun Aug 24 02:26:23 2008 +0200
@@ -89,7 +89,7 @@
      * @see java.lang.Object#equals(java.lang.Object)
      */
     public bool equals(Object obj) {
-        if (obj instanceof TemplateVariableType) {
+        if ( cast(TemplateVariableType)obj ) {
             TemplateVariableType other= cast(TemplateVariableType) obj;
             return other.fName.equals(fName) && other.fParams.equals(fParams);
         }
--- a/dwtx/jface/text/templates/persistence/TemplateReaderWriter.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/templates/persistence/TemplateReaderWriter.d	Sun Aug 24 02:26:23 2008 +0200
@@ -216,7 +216,7 @@
             Assert.isTrue(false);
         } catch (SAXException e) {
             Throwable t= e.getCause();
-            if (t instanceof IOException)
+            if ( cast(IOException)t )
                 throw cast(IOException) t;
             else if (t !is null)
                 throw new IOException(t.getMessage());
--- a/dwtx/jface/text/templates/persistence/TemplateStore.d	Sun Aug 24 02:22:48 2008 +0200
+++ b/dwtx/jface/text/templates/persistence/TemplateStore.d	Sun Aug 24 02:26:23 2008 +0200
@@ -220,7 +220,7 @@
         fIgnorePreferenceStoreChanges= true;
         try {
             fPreferenceStore.setValue(fKey, output.toString());
-            if (fPreferenceStore instanceof IPersistentPreferenceStore)
+            if ( cast(IPersistentPreferenceStore)fPreferenceStore )
                 (cast(IPersistentPreferenceStore)fPreferenceStore).save();
         } finally {
             fIgnorePreferenceStoreChanges= false;