X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fadapters%2FSCLLabelBackgroundColorRule.java;fp=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fadapters%2FSCLLabelBackgroundColorRule.java;h=04b1e1873438f21d3e37032d99a15e4210d80ad5;hb=67918d39fd9a67b659dcb118412fe0313a8fc0e8;hp=0000000000000000000000000000000000000000;hpb=b8862851106d0d6b351aff8f46acd421e650a12b;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelBackgroundColorRule.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelBackgroundColorRule.java new file mode 100644 index 000000000..04b1e1873 --- /dev/null +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/SCLLabelBackgroundColorRule.java @@ -0,0 +1,26 @@ +package org.simantics.modeling.adapters; + +import org.simantics.browsing.ui.content.LabelDecorator; +import org.simantics.browsing.ui.model.labeldecorators.AbstractLabelDecorator; +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.modeling.ModelingResources; + +public class SCLLabelBackgroundColorRule extends SCLLabelColorRule { + + public SCLLabelBackgroundColorRule(ReadGraph graph, Resource rule) { + super(graph, rule, ModelingResources.getInstance(graph).SCLLabelBackgroundColorRule_getColor); + } + + @Override + public LabelDecorator getLabelDecorator(ReadGraph graph, Object content) throws DatabaseException { + return new AbstractLabelDecorator() { + + @Override + public Color decorateBackground(Color color, String column, int itemIndex) { + return decorateColor(graph, content, color, column, itemIndex); + } + }; + } +} \ No newline at end of file