[gui] Patch: javx.swing.text - text field highlighting
Michael Koch
konqueror@gmx.de
Mon Aug 30 18:38:00 GMT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I just commited the attached patch to implement text field
highlighting in javax.swing.text.JTextField. This feature is also
known as text selection. The visual part works now. you can actually
select text in a JTextField, its displayed with wrong colors but
works.
Michael
2004-08-30 Michael Koch <konqueror@gmx.de>
* javax/swing/plaf/basic/BasicLookAndFeel.java
(initComponentDefaults): Add keybindings for selection.backward and
selection-forward for text components.
* javax/swing/plaf/basic/BasicTextUI.java
(paintSafely): Paint highlight only when something is actually
selected.
* javax/swing/text/DefaultCaret.java
(handleHighlight): New method.
(setSelectionVisible): Don't do anything when nothing changes.
Handle highlight.
(moveDot): Reimplemented. Handle highlight.
(setDot): Set mark too. Handle highlight.
(getSelectionPainter): New method.
* javax/swing/text/DefaultEditorKit.java
(defaultActions): Added new actions for text selection.
* javax/swing/text/DefaultHighlighter.java
(DefaultHighlightPainter): New inner class.
(DefaultPainter): New field.
(paint): Implemented.
* javax/swing/text/PlainView.java
(paint): Don't draw background here again.
* javax/swing/text/Utilities.java
(getTabbedTextWidth): Use width of ' ' instead of 'm' for tabsize.
(drawTabbedText): Likewise.
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBMxqqWSOgCCdjSDsRApEpAJ4rDI+W5FH1v/oSyJZRirzaDEAh9wCfb8rr
JVy3irV5M2XiqOCYvw46bE0=
=4NZ+
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: highlighting.diff
Type: text/x-diff
Size: 10628 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040830/0ee9d48d/attachment.bin>
More information about the Java-patches
mailing list