summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
378e608)
refs #7545
Change-Id: I921a8f43129cb9710f6c5db0842c174ee802ab81
import org.eclipse.jface.resource.ColorDescriptor;
import org.eclipse.jface.resource.FontDescriptor;
import org.eclipse.jface.resource.ColorDescriptor;
import org.eclipse.jface.resource.FontDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.simantics.browsing.ui.content.LabelDecorator;
import org.simantics.databoard.Bindings;
import org.eclipse.swt.graphics.RGB;
import org.simantics.browsing.ui.content.LabelDecorator;
import org.simantics.databoard.Bindings;
*/
public class ConstantLabelDecorationRule extends AbstractLabelDecorator implements LabelDecorationRule {
*/
public class ConstantLabelDecorationRule extends AbstractLabelDecorator implements LabelDecorationRule {
+ /**
+ * For headless instances where no Display is available
+ */
+ private static final FontDescriptor DEFAULT_FONT_DESCRIPTOR = FontDescriptor.createFrom(new FontData("Arial", 11, 0));
+
String prefix;
String postfix;
ColorDescriptor foregroundColor;
String prefix;
String postfix;
ColorDescriptor foregroundColor;
return font;
else {
FontDescriptor desc = (FontDescriptor)font;
return font;
else {
FontDescriptor desc = (FontDescriptor)font;
- if(desc == null) desc = FontDescriptor.createFrom(JFaceResources.getDialogFont().getFontData());
+ if(desc == null)
+ desc = DEFAULT_FONT_DESCRIPTOR;
return (Font)desc.withStyle(style);
}
}
return (Font)desc.withStyle(style);
}
}