103 |
/** |
/** |
104 |
* Whether line wrapping is enabled or not. |
* Whether line wrapping is enabled or not. |
105 |
*/ |
*/ |
106 |
private boolean wrapping; |
private boolean lineWrap; |
107 |
|
|
108 |
/** |
/** |
109 |
* The number of characters equal to a tab within the text. |
* The number of characters equal to a tab within the text. |
110 |
*/ |
*/ |
111 |
private int tabSize = 8; |
private int tabSize = 8; |
112 |
|
|
113 |
|
private boolean wrapStyleWord; |
114 |
|
|
115 |
/** |
/** |
116 |
* Creates a new <code>JTextArea</code> object. |
* Creates a new <code>JTextArea</code> object. |
117 |
*/ |
*/ |
223 |
*/ |
*/ |
224 |
public boolean getScrollableTracksViewportWidth() |
public boolean getScrollableTracksViewportWidth() |
225 |
{ |
{ |
226 |
return wrapping ? true : super.getScrollableTracksViewportWidth(); |
return lineWrap ? true : super.getScrollableTracksViewportWidth(); |
227 |
} |
} |
228 |
|
|
229 |
/** |
/** |
289 |
/** |
/** |
290 |
* Checks whether line wrapping is enabled. |
* Checks whether line wrapping is enabled. |
291 |
* |
* |
292 |
* @return true if line wrapping is enabled, false otherwise |
* @return <code>true</code> if line wrapping is enabled, |
293 |
|
* <code>false</code> otherwise |
294 |
*/ |
*/ |
295 |
public boolean getLineWrap() |
public boolean getLineWrap() |
296 |
{ |
{ |
297 |
return wrapping; |
return lineWrap; |
298 |
} |
} |
299 |
|
|
300 |
/** |
/** |
301 |
* Enables/disables line wrapping. |
* Enables/disables line wrapping. |
302 |
* |
* |
303 |
* @param wrapping true to enable line wrapping, false otherwise |
* @param wrapping <code>true</code> to enable line wrapping, |
304 |
|
* <code>false</code> otherwise |
305 |
*/ |
*/ |
306 |
public void setLineWrap(boolean flag) |
public void setLineWrap(boolean flag) |
307 |
{ |
{ |
308 |
if (wrapping == flag) |
if (lineWrap == flag) |
309 |
return; |
return; |
310 |
|
|
311 |
boolean oldValue = wrapping; |
boolean oldValue = lineWrap; |
312 |
wrapping = flag; |
lineWrap = flag; |
313 |
firePropertyChange("lineWrap", oldValue, wrapping); |
firePropertyChange("lineWrap", oldValue, lineWrap); |
314 |
} |
} |
315 |
|
|
316 |
/** |
/** |
317 |
|
* Checks whether word style wrapping is enabled. |
318 |
|
* |
319 |
|
* @return <code>true</code> if word style wrapping is enabled, |
320 |
|
* <code>false</code> otherwise |
321 |
|
*/ |
322 |
|
public boolean getWrapStyleWord() |
323 |
|
{ |
324 |
|
return wrapStyleWord; |
325 |
|
} |
326 |
|
|
327 |
|
/** |
328 |
|
* Enables/Disables word style wrapping. |
329 |
|
* |
330 |
|
* @param flag <code>true</code> to enable word style wrapping, |
331 |
|
* <code>false</code> otherwise |
332 |
|
*/ |
333 |
|
public void setWrapStyleWord(boolean flag) |
334 |
|
{ |
335 |
|
if (wrapStyleWord == flag) |
336 |
|
return; |
337 |
|
|
338 |
|
boolean oldValue = wrapStyleWord; |
339 |
|
wrapStyleWord = flag; |
340 |
|
firePropertyChange("wrapStyleWord", oldValue, wrapStyleWord); |
341 |
|
} |
342 |
|
|
343 |
|
/** |
344 |
* Returns the number of characters used for a tab. |
* Returns the number of characters used for a tab. |
345 |
* This defaults to 8. |
* This defaults to 8. |
346 |
* |
* |