diff dwtx/jface/text/contentassist/ContentAssistant.d @ 134:51e6e63f930e

Regex fix for casts
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 01:46:20 +0200
parents 7d818bd32d63
children 65801ad2b265
line wrap: on
line diff
--- a/dwtx/jface/text/contentassist/ContentAssistant.d	Sun Aug 24 01:29:22 2008 +0200
+++ b/dwtx/jface/text/contentassist/ContentAssistant.d	Sun Aug 24 01:46:20 2008 +0200
@@ -476,7 +476,7 @@
                     if (fContextType is LAYOUT_CONTEXT_SELECTOR &&
                             Helper.okToUse(fShells[LAYOUT_CONTEXT_SELECTOR])) {
                         // Restore event notification to the tip popup.
-                        addContentAssistListener((IContentAssistListener) fPopups[LAYOUT_CONTEXT_SELECTOR], CONTEXT_SELECTOR);
+                        addContentAssistListener(cast(IContentAssistListener) fPopups[LAYOUT_CONTEXT_SELECTOR], CONTEXT_SELECTOR);
                     }
                     break;
 
@@ -485,7 +485,7 @@
                         if (fProposalPopupOrientation is PROPOSAL_STACKED)
                             layout(LAYOUT_PROPOSAL_SELECTOR, getSelectionOffset());
                         // Restore event notification to the proposal popup.
-                        addContentAssistListener((IContentAssistListener) fPopups[LAYOUT_PROPOSAL_SELECTOR], PROPOSAL_SELECTOR);
+                        addContentAssistListener(cast(IContentAssistListener) fPopups[LAYOUT_PROPOSAL_SELECTOR], PROPOSAL_SELECTOR);
                     }
                     fContextType= LAYOUT_CONTEXT_INFO_POPUP;
                     break;
@@ -541,10 +541,10 @@
                 // There are no other presentations to be concerned with,
                 // so place the proposal selector beneath the cursor line.
                 Shell shell= fShells[LAYOUT_PROPOSAL_SELECTOR];
-                CompletionProposalPopup popup= (CompletionProposalPopup) fPopups[LAYOUT_PROPOSAL_SELECTOR];
+                CompletionProposalPopup popup= cast(CompletionProposalPopup) fPopups[LAYOUT_PROPOSAL_SELECTOR];
                 shell.setBounds(computeBoundsBelowAbove(shell, shell.getSize(), offset, popup));
             } else {
-                CompletionProposalPopup popup= ((CompletionProposalPopup) fPopups[LAYOUT_PROPOSAL_SELECTOR]);
+                CompletionProposalPopup popup= (cast(CompletionProposalPopup) fPopups[LAYOUT_PROPOSAL_SELECTOR]);
                 switch (fProposalPopupOrientation) {
                     case PROPOSAL_REMOVE: {
                         // Remove the tip selector and place the
@@ -771,12 +771,12 @@
                     if (fContextType is LAYOUT_CONTEXT_SELECTOR &&
                             Helper.okToUse(fShells[LAYOUT_CONTEXT_SELECTOR]))
                         // Disable event notification to the tip selector.
-                        removeContentAssistListener((IContentAssistListener) fPopups[LAYOUT_CONTEXT_SELECTOR], CONTEXT_SELECTOR);
+                        removeContentAssistListener(cast(IContentAssistListener) fPopups[LAYOUT_CONTEXT_SELECTOR], CONTEXT_SELECTOR);
                     break;
                 case LAYOUT_CONTEXT_SELECTOR:
                     if (Helper.okToUse(fShells[LAYOUT_PROPOSAL_SELECTOR]))
                         // Disable event notification to the proposal selector.
-                        removeContentAssistListener((IContentAssistListener) fPopups[LAYOUT_PROPOSAL_SELECTOR], PROPOSAL_SELECTOR);
+                        removeContentAssistListener(cast(IContentAssistListener) fPopups[LAYOUT_PROPOSAL_SELECTOR], PROPOSAL_SELECTOR);
                     break;
                 case LAYOUT_CONTEXT_INFO_POPUP:
                     break;
@@ -1080,7 +1080,7 @@
         if (fProcessors is null)
             return null;
 
-        return (IContentAssistProcessor) fProcessors.get(contentType);
+        return cast(IContentAssistProcessor) fProcessors.get(contentType);
     }
 
     /**
@@ -1096,8 +1096,8 @@
         StringBuffer buf= new StringBuffer(5);
         Iterator iter= fProcessors.entrySet().iterator();
         while (iter.hasNext()) {
-            Entry entry= (Entry) iter.next();
-            IContentAssistProcessor processor= (IContentAssistProcessor) entry.getValue();
+            Entry entry= cast(Entry) iter.next();
+            IContentAssistProcessor processor= cast(IContentAssistProcessor) entry.getValue();
             char[] triggers= processor.getCompletionProposalAutoActivationCharacters();
             if (triggers !is null)
                 buf.append(triggers);
@@ -1536,16 +1536,16 @@
             case CONTEXT_SELECTOR:
             case PROPOSAL_SELECTOR:
                 if (fContentAssistSubjectControl instanceof IWidgetTokenOwnerExtension) {
-                    IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fContentAssistSubjectControl;
+                    IWidgetTokenOwnerExtension extension= cast(IWidgetTokenOwnerExtension) fContentAssistSubjectControl;
                     return extension.requestWidgetToken(this, WIDGET_PRIORITY);
                 } else if (fContentAssistSubjectControl instanceof IWidgetTokenOwner) {
-                    IWidgetTokenOwner owner= (IWidgetTokenOwner) fContentAssistSubjectControl;
+                    IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fContentAssistSubjectControl;
                     return owner.requestWidgetToken(this);
                 } else if (fViewer instanceof IWidgetTokenOwnerExtension) {
-                    IWidgetTokenOwnerExtension extension= (IWidgetTokenOwnerExtension) fViewer;
+                    IWidgetTokenOwnerExtension extension= cast(IWidgetTokenOwnerExtension) fViewer;
                     return extension.requestWidgetToken(this, WIDGET_PRIORITY);
                 } else if (fViewer instanceof IWidgetTokenOwner) {
-                    IWidgetTokenOwner owner= (IWidgetTokenOwner) fViewer;
+                    IWidgetTokenOwner owner= cast(IWidgetTokenOwner) fViewer;
                     return owner.requestWidgetToken(this);
                 }
         }
@@ -1626,9 +1626,9 @@
         if (fListeners[CONTEXT_SELECTOR] is null && fListeners[PROPOSAL_SELECTOR] is null) {
             IWidgetTokenOwner owner= null;
             if (fContentAssistSubjectControl instanceof IWidgetTokenOwner)
-                owner= (IWidgetTokenOwner) fContentAssistSubjectControl;
+                owner= cast(IWidgetTokenOwner) fContentAssistSubjectControl;
             else if (fViewer instanceof IWidgetTokenOwner)
-                owner= (IWidgetTokenOwner) fViewer;
+                owner= cast(IWidgetTokenOwner) fViewer;
             if (owner !is null)
                 owner.releaseWidgetToken(this);
         }
@@ -1843,7 +1843,7 @@
 
         IContentAssistProcessor p= getProcessor(contentAssistSubjectControl, offset);
         if (p instanceof ISubjectControlContentAssistProcessor) {
-            result= ((ISubjectControlContentAssistProcessor) p).computeCompletionProposals(contentAssistSubjectControl, offset);
+            result= (cast(ISubjectControlContentAssistProcessor) p).computeCompletionProposals(contentAssistSubjectControl, offset);
             fLastErrorMessage= p.getErrorMessage();
         }
 
@@ -1915,7 +1915,7 @@
 
         IContentAssistProcessor p= getProcessor(contentAssistSubjectControl, offset);
         if (p instanceof ISubjectControlContentAssistProcessor) {
-            result= ((ISubjectControlContentAssistProcessor) p).computeContextInformation(contentAssistSubjectControl, offset);
+            result= (cast(ISubjectControlContentAssistProcessor) p).computeContextInformation(contentAssistSubjectControl, offset);
             fLastErrorMessage= p.getErrorMessage();
         }
 
@@ -1966,7 +1966,7 @@
     IContextInformationPresenter getContextInformationPresenter(ITextViewer viewer, int offset) {
         IContextInformationValidator validator= getContextInformationValidator(viewer, offset);
         if (validator instanceof IContextInformationPresenter)
-            return (IContextInformationPresenter) validator;
+            return cast(IContextInformationPresenter) validator;
         return null;
     }
 
@@ -1982,7 +1982,7 @@
     IContextInformationPresenter getContextInformationPresenter(IContentAssistSubjectControl contentAssistSubjectControl, int offset) {
         IContextInformationValidator validator= getContextInformationValidator(contentAssistSubjectControl, offset);
         if (validator instanceof IContextInformationPresenter)
-            return (IContextInformationPresenter) validator;
+            return cast(IContextInformationPresenter) validator;
         return null;
     }
 
@@ -2247,7 +2247,7 @@
             ContentAssistEvent event= new ContentAssistEvent(this, processor, isAutoActivated);
             Object[] listeners= fCompletionListeners.getListeners();
             for (int i= 0; i < listeners.length; i++) {
-                ICompletionListener listener= (ICompletionListener)listeners[i];
+                ICompletionListener listener= cast(ICompletionListener)listeners[i];
                 listener.assistSessionStarted(event);
             }
         }
@@ -2264,9 +2264,9 @@
             ContentAssistEvent event= new ContentAssistEvent(this, processor);
             Object[] listeners= fCompletionListeners.getListeners();
             for (int i= 0; i < listeners.length; i++) {
-                ICompletionListener listener= (ICompletionListener)listeners[i];
+                ICompletionListener listener= cast(ICompletionListener)listeners[i];
                 if (listener instanceof ICompletionListenerExtension)
-                    ((ICompletionListenerExtension)listener).assistSessionRestarted(event);
+                    (cast(ICompletionListenerExtension)listener).assistSessionRestarted(event);
             }
         }
     }
@@ -2282,7 +2282,7 @@
             ContentAssistEvent event= new ContentAssistEvent(this, processor);
             Object[] listeners= fCompletionListeners.getListeners();
             for (int i= 0; i < listeners.length; i++) {
-                ICompletionListener listener= (ICompletionListener)listeners[i];
+                ICompletionListener listener= cast(ICompletionListener)listeners[i];
                 listener.assistSessionEnded(event);
             }
         }
@@ -2391,7 +2391,7 @@
     void fireSelectionEvent(ICompletionProposal proposal, bool smartToggle) {
         Object[] listeners= fCompletionListeners.getListeners();
         for (int i= 0; i < listeners.length; i++) {
-            ICompletionListener listener= (ICompletionListener)listeners[i];
+            ICompletionListener listener= cast(ICompletionListener)listeners[i];
             listener.selectionChanged(proposal, smartToggle);
         }
     }
@@ -2443,7 +2443,7 @@
         if (fHandlers is null)
             throw new IllegalStateException();
 
-        IHandler handler= (IHandler)fHandlers.get(commandId);
+        IHandler handler= cast(IHandler)fHandlers.get(commandId);
         if (handler !is null)
             return handler;