1 package org.simantics.document.linking.report.evaluator;
3 import org.eclipse.jface.resource.ImageDescriptor;
4 import org.simantics.document.linking.Activator;
5 import org.simantics.document.linking.ontology.DocumentLink;
6 import org.simantics.document.linking.report.TableColumn.Alignment;
7 import org.simantics.objmap.graph.annotations.OrderedSetType;
8 import org.simantics.objmap.graph.annotations.RelatedGetValue;
9 import org.simantics.objmap.graph.annotations.RelatedSetValue;
11 @OrderedSetType(DocumentLink.URIs.EvaluatorTree_AligmentHint)
12 public class AlignmentHint extends HintNode implements EnumEditableNode{
17 public AlignmentHint() {
18 alignment = Alignment.LEFT;
21 public AlignmentHint(Alignment alignment) {
22 this.alignment = alignment;
26 public String toString() {
27 return alignment.toString();
30 @RelatedGetValue(DocumentLink.URIs.EvaluatorTree_HasValue)
32 public String getValue() {
33 return alignment.toString();
36 public AlignmentHint setAlignment(Alignment alignment) {
37 this.alignment = alignment;
41 @RelatedSetValue(DocumentLink.URIs.EvaluatorTree_HasValue)
43 public void setValue(String value) {
44 alignment = Alignment.valueOf(value);
48 public String[] getEnumearation() {
49 String values[] = new String[Alignment.values().length];
50 for (int i = 0; i < values.length; i++)
51 values[i] = Alignment.values()[i].toString();
56 public Object getHintValue() {
61 public Object getHintClass() {
62 return Alignment.class;
66 public EvaluatorItem copy() {
67 AlignmentHint a = new AlignmentHint(alignment);
73 public ImageDescriptor getImage() {
74 if (alignment == Alignment.LEFT) {
75 return Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/text_align_left.png");
76 } else if (alignment == Alignment.CENTER) {
77 return Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/text_align_center.png");
79 return Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/text_align_right.png");