Mercurial > projects > dwt-addons
diff dwtx/jface/text/source/DefaultAnnotationHover.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 | b6bad70d540a |
line wrap: on
line diff
--- a/dwtx/jface/text/source/DefaultAnnotationHover.d Sun Aug 24 01:29:22 2008 +0200 +++ b/dwtx/jface/text/source/DefaultAnnotationHover.d Sun Aug 24 01:46:20 2008 +0200 @@ -133,7 +133,7 @@ if (javaAnnotations.size() is 1) { // optimization - Annotation annotation= (Annotation) javaAnnotations.get(0); + Annotation annotation= cast(Annotation) javaAnnotations.get(0); String message= annotation.getText(); if (message !is null && message.trim().length() > 0) return formatSingleMessage(message); @@ -144,14 +144,14 @@ Iterator e= javaAnnotations.iterator(); while (e.hasNext()) { - Annotation annotation= (Annotation) e.next(); + Annotation annotation= cast(Annotation) e.next(); String message= annotation.getText(); if (message !is null && message.trim().length() > 0) messages.add(message.trim()); } if (messages.size() is 1) - return formatSingleMessage((String)messages.get(0)); + return formatSingleMessage(cast(String)messages.get(0)); if (messages.size() > 1) return formatMultipleMessages(messages); @@ -206,7 +206,7 @@ Iterator e= messages.iterator(); while (e.hasNext()) { buffer.append('\n'); - String listItemText= (String) e.next(); + String listItemText= cast(String) e.next(); buffer.append(JFaceTextMessages.getFormattedString("DefaultAnnotationHover.listItem", new String[] { listItemText })); //$NON-NLS-1$ } return buffer.toString(); @@ -224,7 +224,7 @@ private IAnnotationModel getAnnotationModel(ISourceViewer viewer) { if (viewer instanceof ISourceViewerExtension2) { - ISourceViewerExtension2 extension= (ISourceViewerExtension2) viewer; + ISourceViewerExtension2 extension= cast(ISourceViewerExtension2) viewer; return extension.getVisualAnnotationModel(); } return viewer.getAnnotationModel(); @@ -237,7 +237,7 @@ return true; if (value instanceof List) { - List messages= (List)value; + List messages= cast(List)value; if (messages.contains(message)) return true; @@ -272,7 +272,7 @@ Iterator iterator= model.getAnnotationIterator(); while (iterator.hasNext()) { - Annotation annotation= (Annotation) iterator.next(); + Annotation annotation= cast(Annotation) iterator.next(); Position position= model.getPosition(annotation); if (position is null) @@ -282,10 +282,10 @@ continue; if (annotation instanceof AnnotationBag) { - AnnotationBag bag= (AnnotationBag) annotation; + AnnotationBag bag= cast(AnnotationBag) annotation; Iterator e= bag.iterator(); while (e.hasNext()) { - annotation= (Annotation) e.next(); + annotation= cast(Annotation) e.next(); position= model.getPosition(annotation); if (position !is null && includeAnnotation(annotation, position, messagesAtPosition)) javaAnnotations.add(annotation);