1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
package com.sun.tools.javafx.tree; |
27 | |
|
28 | |
import com.sun.javafx.api.tree.JavaFXTree.JavaFXKind; |
29 | |
import com.sun.javafx.api.tree.JavaFXTreeVisitor; |
30 | |
import com.sun.javafx.api.tree.OnReplaceTree; |
31 | |
import com.sun.javafx.api.tree.JavaFXExpressionTree; |
32 | |
import com.sun.javafx.api.tree.TriggerTree; |
33 | |
import com.sun.tools.javac.code.Symbol.VarSymbol; |
34 | |
import com.sun.tools.javac.tree.JCTree.JCIdent; |
35 | |
import com.sun.javafx.api.JavafxBindStatus; |
36 | |
import com.sun.source.tree.ExpressionTree; |
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
public class JFXOverrideAttribute extends JFXStatement implements TriggerTree { |
44 | |
private final JCIdent expr; |
45 | |
private final JCExpression init; |
46 | |
private final JavafxBindStatus bindStatus; |
47 | |
private final JFXOnReplace onReplace; |
48 | |
|
49 | |
public VarSymbol sym; |
50 | |
|
51 | |
protected JFXOverrideAttribute(JCIdent expr, |
52 | |
JCExpression init, |
53 | |
JavafxBindStatus bindStat, |
54 | |
JFXOnReplace onReplace, |
55 | 9 | VarSymbol sym) { |
56 | 9 | this.expr = expr; |
57 | 9 | this.init = init; |
58 | 9 | this.bindStatus = bindStat == null ? JavafxBindStatus.UNBOUND : bindStat; |
59 | 9 | this.onReplace = onReplace; |
60 | 9 | this.sym = sym; |
61 | 9 | } |
62 | |
|
63 | 60 | public void accept(JavafxVisitor v) { v.visitOverrideAttribute(this); } |
64 | |
|
65 | |
public JCIdent getId() { |
66 | 69 | return expr; |
67 | |
} |
68 | |
|
69 | |
public JCExpression getInitializer() { |
70 | 87 | return init; |
71 | |
} |
72 | |
|
73 | |
public ExpressionTree getExpressionTree() { |
74 | 0 | return (ExpressionTree)expr; |
75 | |
} |
76 | |
|
77 | |
public JavafxBindStatus getBindStatus() { |
78 | 9 | return bindStatus; |
79 | |
} |
80 | |
|
81 | |
public boolean isBound() { |
82 | 0 | return bindStatus.isBound(); |
83 | |
} |
84 | |
|
85 | |
public boolean isUnidiBind() { |
86 | 0 | return bindStatus.isUnidiBind(); |
87 | |
} |
88 | |
|
89 | |
public boolean isBidiBind() { |
90 | 0 | return bindStatus.isBidiBind(); |
91 | |
} |
92 | |
|
93 | |
public boolean isLazy() { |
94 | 0 | return bindStatus.isLazy(); |
95 | |
} |
96 | |
|
97 | |
public OnReplaceTree getOnReplaceTree() { |
98 | 0 | return (OnReplaceTree) onReplace; |
99 | |
} |
100 | |
|
101 | |
public JFXOnReplace getOnReplace() { |
102 | 69 | return onReplace; |
103 | |
} |
104 | |
|
105 | |
public JavaFXKind getJavaFXKind() { |
106 | 0 | return JavaFXKind.TRIGGER_WRAPPER; |
107 | |
} |
108 | |
|
109 | |
@Override |
110 | |
public int getTag() { |
111 | 456 | return JavafxTag.OVERRIDE_ATTRIBUTE_DEF; |
112 | |
} |
113 | |
|
114 | |
public <R, D> R accept(JavaFXTreeVisitor<R, D> visitor, D data) { |
115 | 0 | return visitor.visitTrigger(this, data); |
116 | |
} |
117 | |
} |