|
@@ -22,9 +22,11 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.ui.messages;
|
24
|
24
|
|
|
25
|
+import com.dmdirc.events.DisplayProperty;
|
25
|
26
|
import com.dmdirc.events.DisplayPropertyMap;
|
26
|
27
|
|
27
|
28
|
import java.util.Arrays;
|
|
29
|
+import java.util.Optional;
|
28
|
30
|
|
29
|
31
|
/**
|
30
|
32
|
* Represents a line of text in IRC.
|
|
@@ -129,10 +131,10 @@ public class Line {
|
129
|
131
|
* @return AttributedString representing the specified StyledDocument
|
130
|
132
|
*/
|
131
|
133
|
public <T> T getStyled(final StyledMessageMaker<T> maker) {
|
132
|
|
- maker.clear();
|
133
|
134
|
maker.setDefaultFont(fontName, fontSize);
|
134
|
135
|
final T styledString = styliser.getStyledString(getLineParts(), maker);
|
135
|
136
|
fontSize = maker.getMaximumFontSize();
|
|
137
|
+ maker.clear();
|
136
|
138
|
return styledString;
|
137
|
139
|
}
|
138
|
140
|
|
|
@@ -146,4 +148,8 @@ public class Line {
|
146
|
148
|
return Arrays.hashCode(getLineParts());
|
147
|
149
|
}
|
148
|
150
|
|
|
151
|
+ public <T> Optional<T> getDisplayableProperty(final DisplayProperty<T> property) {
|
|
152
|
+ return displayProperties.get(property);
|
|
153
|
+ }
|
|
154
|
+
|
149
|
155
|
}
|