Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2013-09-06 14:48:39 +0000
committerDani Megert2013-09-06 14:48:39 +0000
commitf52fcfb7ad23781706e80efd2e74f064d36edf56 (patch)
tree8e65aeb593e6a4f230e21fa6d630d3a765afa218
parentee6146d56273ea37a0626233aabf999048eb264a (diff)
downloadeclipse.platform.text-f52fcfb7ad23781706e80efd2e74f064d36edf56.tar.gz
eclipse.platform.text-f52fcfb7ad23781706e80efd2e74f064d36edf56.tar.xz
eclipse.platform.text-f52fcfb7ad23781706e80efd2e74f064d36edf56.zip
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java4
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java29
2 files changed, 28 insertions, 5 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java
index 3216f8e2afe..cff9634b1ff 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLTextPresenter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -124,7 +124,7 @@ public class HTMLTextPresenter implements DefaultInformationControl.IInformation
int maxNumberOfLines= Math.round(maxHeight / gc.getFontMetrics().getHeight());
fCounter= 0;
- LineBreakingReader reader= new LineBreakingReader(createReader(hoverInfo, presentation), gc, maxWidth);
+ LineBreakingReader reader= new LineBreakingReader(createReader(hoverInfo, presentation), hoverInfo.length(), gc, maxWidth);
boolean lastLineFormatted= false;
String lastLineIndent= null;
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java
index 480591cf73b..4bfebf2ac8c 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/LineBreakingReader.java
@@ -36,13 +36,36 @@ public class LineBreakingReader {
/**
* Creates a reader that breaks an input text to fit in a given width.
- *
- * @param reader Reader of the input text
+ *
+ * @param reader reader for the input text
* @param gc The graphic context that defines the currently used font sizes
* @param maxLineWidth The max width (pixels) where the text has to fit in
*/
public LineBreakingReader(Reader reader, GC gc, int maxLineWidth) {
- fReader= new BufferedReader(reader);
+ this(new BufferedReader(reader), gc, maxLineWidth);
+ }
+
+ /**
+ * Creates a reader that breaks an input text to fit in a given width.
+ *
+ * @param reader the reader for the input text
+ * @param bufferSize the buffer size
+ * @param gc The graphic context that defines the currently used font sizes
+ * @param maxLineWidth The max width (pixels) where the text has to fit in
+ */
+ public LineBreakingReader(Reader reader, int bufferSize, GC gc, int maxLineWidth) {
+ this(new BufferedReader(reader, bufferSize), gc, maxLineWidth);
+ }
+
+ /**
+ * Creates a reader that breaks an input text to fit in a given width.
+ *
+ * @param reader the buffered reader for the input text
+ * @param gc The graphic context that defines the currently used font sizes
+ * @param maxLineWidth The max width (pixels) where the text has to fit in
+ */
+ private LineBreakingReader(BufferedReader reader, GC gc, int maxLineWidth) {
+ fReader= reader;
fGC= gc;
fMaxWidth= maxLineWidth;
fOffset= 0;

Back to the top