[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/hover PyAnnotationHover.java, 1.1, 1.2 PyT
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-06-14 22:14:49
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hover In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27940/src/org/python/pydev/editor/hover Modified Files: PyAnnotationHover.java PyTextHover.java Log Message: Using faster version of StringBuffer: FastStrintgBuffer / Better icons for auto-import. Index: PyTextHover.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hover/PyTextHover.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyTextHover.java 24 Mar 2007 20:44:02 -0000 1.3 --- PyTextHover.java 14 Jun 2008 22:14:55 -0000 1.4 *************** *** 15,24 **** import org.eclipse.jface.text.source.ISourceViewer; import org.python.pydev.core.IPythonPartitions; import org.python.pydev.editor.codefolding.PySourceViewer; - import org.python.pydev.plugin.PydevPlugin; public class PyTextHover implements ITextHover{ private boolean pythonCommentOrMultiline; public PyTextHover(ISourceViewer sourceViewer, String contentType) { --- 15,25 ---- import org.eclipse.jface.text.source.ISourceViewer; import org.python.pydev.core.IPythonPartitions; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codefolding.PySourceViewer; public class PyTextHover implements ITextHover{ private boolean pythonCommentOrMultiline; + private FastStringBuffer buf = new FastStringBuffer(); public PyTextHover(ISourceViewer sourceViewer, String contentType) { *************** *** 32,37 **** } ! public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { ! StringBuffer buf = new StringBuffer(); if(!pythonCommentOrMultiline){ if(textViewer instanceof PySourceViewer){ --- 33,41 ---- } ! /** ! * Synchronized because of buffer access. ! */ ! public synchronized String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { ! buf.clear(); if(!pythonCommentOrMultiline){ if(textViewer instanceof PySourceViewer){ *************** *** 48,52 **** buf.append("\n"); } ! buf.append(marker.getAttribute(IMarker.MESSAGE)); } } --- 52,56 ---- buf.append("\n"); } ! buf.appendObject(marker.getAttribute(IMarker.MESSAGE)); } } Index: PyAnnotationHover.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hover/PyAnnotationHover.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyAnnotationHover.java 2 Aug 2005 17:24:19 -0000 1.1 --- PyAnnotationHover.java 14 Jun 2008 22:14:55 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.jface.text.source.IAnnotationHover; import org.eclipse.jface.text.source.ISourceViewer; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.editor.codefolding.PySourceViewer; import org.python.pydev.plugin.PydevPlugin; *************** *** 20,24 **** public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { ! StringBuffer buf = new StringBuffer(); if(sourceViewer instanceof PySourceViewer){ --- 21,25 ---- public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { ! FastStringBuffer buf = new FastStringBuffer(); if(sourceViewer instanceof PySourceViewer){ *************** *** 32,36 **** buf.append("\n"); } ! buf.append(marker.getAttribute(IMarker.MESSAGE)); } } --- 33,37 ---- buf.append("\n"); } ! buf.appendObject(marker.getAttribute(IMarker.MESSAGE)); } } |