changeset 143:53b889547456

instanceof after &&
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 21:32:37 +0200
parents 893c017bcdc5
children 16a71f577815
files dwtx/jface/internal/text/StickyHoverManager.d dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d dwtx/jface/text/AbstractHoverInformationControlManager.d dwtx/jface/text/information/InformationPresenter.d dwtx/jface/text/link/LinkedModeUI.d dwtx/jface/text/source/AnnotationBarHoverManager.d dwtx/jface/text/source/AnnotationModelEvent.d dwtx/jface/text/source/LineNumberRulerColumn.d dwtx/jface/text/source/SourceViewer.d dwtx/jface/text/source/projection/ProjectionSummary.d dwtx/jface/text/source/projection/ProjectionViewer.d
diffstat 11 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/dwtx/jface/internal/text/StickyHoverManager.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/internal/text/StickyHoverManager.d	Sun Aug 24 21:32:37 2008 +0200
@@ -249,7 +249,7 @@
                     return;
                 
                 IInformationControl infoControl= getCurrentInformationControl2();
-                if (infoControl !is null && !infoControl.isFocusControl() && infoControl instanceof IInformationControlExtension3) {
+                if (infoControl !is null && !infoControl.isFocusControl() && cast(IInformationControlExtension3)infoControl ) {
 //                  if cast(DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): activeShell= " + fDisplay.getActiveShell()); //$NON-NLS-1$
                     IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) infoControl;
                     Rectangle controlBounds= iControl3.getBounds();
--- a/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d	Sun Aug 24 21:32:37 2008 +0200
@@ -559,7 +559,7 @@
                 
                 String displayString;
                 StyleRange[] styleRanges= null;
-                if (fIsColoredLabelsSupportEnabled && p instanceof ICompletionProposalExtension6) {
+                if (fIsColoredLabelsSupportEnabled && cast(ICompletionProposalExtension6)p ) {
                     StyledString styledString= (cast(ICompletionProposalExtension6)p).getStyledDisplayString();
                     displayString= styledString.getString();
                     styleRanges= styledString.getStyleRanges();
--- a/dwtx/jface/text/AbstractHoverInformationControlManager.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/AbstractHoverInformationControlManager.d	Sun Aug 24 21:32:37 2008 +0200
@@ -428,7 +428,7 @@
                     else if (!isReplaceInProgress()) {
                         IInformationControl infoControl= getCurrentInformationControl();
                         // During isReplaceInProgress(), events can come from the replacing information control
-                        if (event.widget instanceof Control && infoControl instanceof IInformationControlExtension5) {
+                        if (event.widget instanceof Control && cast(IInformationControlExtension5)infoControl ) {
                             Control control= cast(Control) event.widget;
                             IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) infoControl;
                             if (!(iControl5.containsControl(control)))
@@ -447,7 +447,7 @@
                         hideInformationControl();
                     else if (!isReplaceInProgress()) {
                         IInformationControl infoControl= getCurrentInformationControl();
-                        if (event.widget instanceof Control && infoControl instanceof IInformationControlExtension5) {
+                        if (event.widget instanceof Control && cast(IInformationControlExtension5)infoControl ) {
                             Control control= cast(Control) event.widget;
                             final IInformationControlExtension5 iControl5= cast(IInformationControlExtension5) infoControl;
                             if (!(iControl5.containsControl(control))) {
--- a/dwtx/jface/text/information/InformationPresenter.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/information/InformationPresenter.d	Sun Aug 24 21:32:37 2008 +0200
@@ -433,7 +433,7 @@
      * @see AbstractInformationControlManager#showInformationControl(Rectangle)
      */
     protected void showInformationControl(Rectangle subjectArea) {
-        if ( cast(IWidgetTokenOwnerExtension)fTextViewer  && fTextViewer instanceof IWidgetTokenOwner) {
+        if ( cast(IWidgetTokenOwnerExtension)fTextViewer  && cast(IWidgetTokenOwner)fTextViewer ) {
             IWidgetTokenOwnerExtension extension= cast(IWidgetTokenOwnerExtension) fTextViewer;
             if (extension.requestWidgetToken(this, WIDGET_PRIORITY))
                 super.showInformationControl(subjectArea);
--- a/dwtx/jface/text/link/LinkedModeUI.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/link/LinkedModeUI.d	Sun Aug 24 21:32:37 2008 +0200
@@ -347,7 +347,7 @@
                 // Post in UI thread since the assistant popup will only get the focus after we lose it.
                 display.asyncExec(new class()  Runnable {
                     public void run() {
-                        if (fIsActive && viewer instanceof IEditingSupportRegistry) {
+                        if (fIsActive && cast(IEditingSupportRegistry)viewer ) {
                             IEditingSupport[] helpers= (cast(IEditingSupportRegistry) viewer).getRegisteredSupports();
                             for (int i= 0; i < helpers.length; i++) {
                                 if (helpers[i].ownsFocusShell())
@@ -400,7 +400,7 @@
             for (int offset= event.getOffset(); offset <= end; offset++) {
                 if (!fModel.anyPositionContains(offset)) {
                     ITextViewer viewer= fCurrentTarget.getViewer();
-                    if (fFramePosition !is null && viewer instanceof IEditingSupportRegistry) {
+                    if (fFramePosition !is null && cast(IEditingSupportRegistry)viewer ) {
                         IEditingSupport[] helpers= (cast(IEditingSupportRegistry) viewer).getRegisteredSupports();
                         for (int i= 0; i < helpers.length; i++) {
                             if (helpers[i].isOriginator(null, new Region(fFramePosition.getOffset(), fFramePosition.getLength())))
--- a/dwtx/jface/text/source/AnnotationBarHoverManager.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationBarHoverManager.d	Sun Aug 24 21:32:37 2008 +0200
@@ -646,7 +646,7 @@
             CompositeRuler comp= cast(CompositeRuler) fVerticalRulerInfo;
             for (Iterator it= comp.getDecoratorIterator(); it.hasNext();) {
                 Object o= it.next();
-                if ( cast(IVerticalRulerInfoExtension)o  && o instanceof IVerticalRulerInfo) {
+                if ( cast(IVerticalRulerInfoExtension)o  && cast(IVerticalRulerInfo)o ) {
                     if ((cast(IVerticalRulerInfo) o).getControl() is event.getSource()) {
                         IAnnotationHover hover= (cast(IVerticalRulerInfoExtension) o).getHover();
                         if (hover !is null)
--- a/dwtx/jface/text/source/AnnotationModelEvent.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationModelEvent.d	Sun Aug 24 21:32:37 2008 +0200
@@ -304,7 +304,7 @@
      * @since 3.0
      */
     public bool isValid() {
-        if (fModificationStamp !is null && fAnnotationModel instanceof IAnnotationModelExtension) {
+        if (fModificationStamp !is null && cast(IAnnotationModelExtension)fAnnotationModel ) {
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) fAnnotationModel;
             return fModificationStamp is extension.getModificationStamp();
         }
--- a/dwtx/jface/text/source/LineNumberRulerColumn.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/source/LineNumberRulerColumn.d	Sun Aug 24 21:32:37 2008 +0200
@@ -233,7 +233,7 @@
                 // select line
                 IDocument document= fCachedTextViewer.getDocument();
                 int lineNumber= fParentRuler.getLineOfLastMouseButtonActivity();
-                if (expandExistingSelection && fCachedTextViewer instanceof ITextViewerExtension5
+                if (expandExistingSelection && cast(ITextViewerExtension5)fCachedTextViewer 
                         && fCachedTextViewer.getTextWidget() !is null) {
                     ITextViewerExtension5 extension5= (cast(ITextViewerExtension5)fCachedTextViewer);
                     // Find model curosr position
--- a/dwtx/jface/text/source/SourceViewer.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/source/SourceViewer.d	Sun Aug 24 21:32:37 2008 +0200
@@ -435,7 +435,7 @@
         fContentAssistant= configuration.getContentAssistant(this);
         if (fContentAssistant !is null) {
             fContentAssistant.install(this);
-            if ( cast(IContentAssistantExtension4)fContentAssistant  && fContentAssistant instanceof IContentAssistantExtension4)
+            if ( cast(IContentAssistantExtension4)fContentAssistant  && cast(IContentAssistantExtension4)fContentAssistant )
                 fContentAssistantFacade= new ContentAssistantFacade(fContentAssistant);
             fContentAssistantInstalled= true;
         }
@@ -1047,7 +1047,7 @@
             revealRange(start, length);
         }
 
-        if (fRangeIndicator !is null && fVisualAnnotationModel instanceof IAnnotationModelExtension) {
+        if (fRangeIndicator !is null && cast(IAnnotationModelExtension)fVisualAnnotationModel ) {
             IAnnotationModelExtension extension= cast(IAnnotationModelExtension) fVisualAnnotationModel;
             extension.modifyAnnotationPosition(fRangeIndicator, new Position(start, length));
         }
--- a/dwtx/jface/text/source/projection/ProjectionSummary.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionSummary.d	Sun Aug 24 21:32:37 2008 +0200
@@ -174,7 +174,7 @@
 
 
             IDocument document= fProjectionViewer.getDocument();
-            if ( cast(ISynchronizable)document  && fAnnotationModel instanceof ISynchronizable) {
+            if ( cast(ISynchronizable)document  && cast(ISynchronizable)fAnnotationModel ) {
                 ISynchronizable sync= cast(ISynchronizable) fAnnotationModel;
                 previousLockObject= sync.getLockObject();
                 sync.setLockObject((cast(ISynchronizable) document).getLockObject());
@@ -320,7 +320,7 @@
 
     private AnnotationBag findBagForType(Map bagMap, String annotationType) {
         AnnotationBag bag= cast(AnnotationBag) bagMap.get(annotationType);
-        if (bag is null && fAnnotationAccess instanceof IAnnotationAccessExtension) {
+        if (bag is null && cast(IAnnotationAccessExtension)fAnnotationAccess ) {
             IAnnotationAccessExtension extension= cast(IAnnotationAccessExtension) fAnnotationAccess;
             Object[] superTypes= extension.getSupertypes(annotationType);
             for (int i= 0; i < superTypes.length && bag is null; i++) {
--- a/dwtx/jface/text/source/projection/ProjectionViewer.d	Sun Aug 24 21:29:00 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionViewer.d	Sun Aug 24 21:32:37 2008 +0200
@@ -1353,7 +1353,7 @@
      * @see dwtx.jface.text.TextViewer#handleVisibleDocumentAboutToBeChanged(dwtx.jface.text.DocumentEvent)
      */
     protected void handleVisibleDocumentChanged(DocumentEvent event) {
-        if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) {
+        if (fHandleProjectionChanges && cast(ProjectionDocumentEvent)event  && isProjectionMode()) {
             ProjectionDocumentEvent e= cast(ProjectionDocumentEvent) event;
 
             DocumentEvent master= e.getMasterEvent();
@@ -1387,7 +1387,7 @@
      * @since 3.1
      */
     protected void handleVisibleDocumentAboutToBeChanged(DocumentEvent event) {
-        if (fHandleProjectionChanges && event instanceof ProjectionDocumentEvent && isProjectionMode()) {
+        if (fHandleProjectionChanges && cast(ProjectionDocumentEvent)event  && isProjectionMode()) {
             int deletedLines;
             try {
                 deletedLines= event.getDocument().getNumberOfLines(event.getOffset(), event.getLength());