Lines 41-46
Link Here
|
41 |
*/ |
41 |
*/ |
42 |
package org.netbeans.modules.uihandler; |
42 |
package org.netbeans.modules.uihandler; |
43 |
|
43 |
|
|
|
44 |
import java.awt.Color; |
44 |
import java.awt.Cursor; |
45 |
import java.awt.Cursor; |
45 |
import java.awt.Dimension; |
46 |
import java.awt.Dimension; |
46 |
import java.awt.event.MouseAdapter; |
47 |
import java.awt.event.MouseAdapter; |
Lines 206-213
Link Here
|
206 |
break; |
207 |
break; |
207 |
case LINK: |
208 |
case LINK: |
208 |
// use lighter blue for dark themes |
209 |
// use lighter blue for dark themes |
209 |
String linkColor = UIManager.getBoolean("nb.dark.theme") ? "#A4A4FF" : "#0000FF"; |
210 |
Color htmlLinkForeground = UIManager.getColor("nb.html.link.foreground") == null ? Color.BLUE : UIManager.getColor("nb.html.link.foreground"); |
210 |
c = new JLabel("<html><u><font color=\""+ linkColor + "\">"+segment.text+"</font></u></html>"); // NOI18N |
211 |
c = new JLabel("<html><u><font color=\""+ toRgbText(htmlLinkForeground.getRGB()) + "\">"+segment.text+"</font></u></html>"); // NOI18N |
211 |
preferredSize = c.getPreferredSize(); |
212 |
preferredSize = c.getPreferredSize(); |
212 |
c.setMinimumSize(preferredSize); |
213 |
c.setMinimumSize(preferredSize); |
213 |
c.setMaximumSize(preferredSize); |
214 |
c.setMaximumSize(preferredSize); |
Lines 239-244
Link Here
|
239 |
FIELD, // A non-editable field with a text, which is possible to copy |
240 |
FIELD, // A non-editable field with a text, which is possible to copy |
240 |
} |
241 |
} |
241 |
|
242 |
|
|
|
243 |
private String toRgbText(int rgb) { |
244 |
if (rgb > 0xFFFFFF) { |
245 |
rgb = 0xFFFFFF; |
246 |
} |
247 |
if (rgb < 0) { |
248 |
rgb = 0; |
249 |
} |
250 |
String str = "000000" + Integer.toHexString(rgb); //NOI18N |
251 |
return "#" + str.substring(str.length() - 6); //NOI18N |
252 |
} |
253 |
|
242 |
static final class Segment { |
254 |
static final class Segment { |
243 |
|
255 |
|
244 |
final SegmentKind kind; |
256 |
final SegmentKind kind; |