aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2017-02-09 22:52:25 +0100
committerRoel Spilker <r.spilker@gmail.com>2017-02-09 22:52:38 +0100
commit3127930afa4866ad5e1b45e700045ad656cd2d9e (patch)
treec127cecd6cb583b2a11432746f374409c3358798 /src
parent70f77f928ac7a6edf3ef91a41399c9a79561c871 (diff)
downloadlombok-3127930afa4866ad5e1b45e700045ad656cd2d9e.tar.gz
lombok-3127930afa4866ad5e1b45e700045ad656cd2d9e.tar.bz2
lombok-3127930afa4866ad5e1b45e700045ad656cd2d9e.zip
Make it possible to copy from the release notes
Diffstat (limited to 'src')
-rw-r--r--src/installer/lombok/installer/InstallerGUI.java23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/installer/lombok/installer/InstallerGUI.java b/src/installer/lombok/installer/InstallerGUI.java
index 7a94d595..5c0efcb4 100644
--- a/src/installer/lombok/installer/InstallerGUI.java
+++ b/src/installer/lombok/installer/InstallerGUI.java
@@ -64,11 +64,12 @@ import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
+import javax.swing.JTextPane;
import javax.swing.Scrollable;
import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
import javax.swing.filechooser.FileFilter;
-import javax.swing.plaf.basic.BasicHTML;
-import javax.swing.text.View;
+import javax.swing.text.html.HTMLDocument;
import lombok.core.Version;
import lombok.installer.OsUtils.OS;
@@ -199,19 +200,23 @@ public class InstallerGUI {
constraints.gridy++;
constraints.fill = GridBagConstraints.BOTH;
- JLabel notes = new JLabel();
+ JTextPane notes = new JTextPane();
+ notes.setContentType("text/html");
notes.setText(readChangeLog());
+ notes.setEditable(false);
+ notes.setOpaque(false);
+ notes.setBorder(null);
+ notes.setSelectionStart(0);
+ notes.setSelectionEnd(0);
+
+ Font font = UIManager.getFont("Label.font");
+ String bodyRule = "body { font-family: " + font.getFamily() + "; font-size: " + font.getSize() + "pt; }";
+ ((HTMLDocument)notes.getDocument()).getStyleSheet().addRule(bodyRule);
JScrollPane scroller = new JScrollPane(notes);
container.add(scroller, constraints);
scroller.setPreferredSize(new Dimension(380, 240));
- View view = (View) notes.getClientProperty(BasicHTML.propertyKey);
- view.setSize(380, 0.0f);
- float w = view.getPreferredSpan(View.X_AXIS);
- float h = view.getPreferredSpan(View.Y_AXIS);
- notes.setSize((int) w, (int) h);
-
container.setPreferredSize(new Dimension(462, 415));
return container;
}