@@ -31,16 +31,16 @@ protected void initDefaultView() {
31
31
32
32
public String sID ;
33
33
34
- public boolean isToolbar (FormEntity entity ) {
34
+ public boolean isToolbar () {
35
35
if (forceViewType != null )
36
36
return forceViewType .isToolbar ();
37
37
38
- GroupObjectEntity toDraw = getToDraw (entity );
38
+ GroupObjectEntity toDraw = getToDraw ();
39
39
return toDraw != null && toDraw .initClassView .isToolbar ();
40
40
}
41
41
42
- public boolean isGrid (FormEntity entity ) {
43
- GroupObjectEntity toDraw = getToDraw (entity );
42
+ public boolean isGrid () {
43
+ GroupObjectEntity toDraw = getToDraw ();
44
44
return toDraw != null && toDraw .initClassView .isGrid () && (forceViewType == null || forceViewType .isGrid ());
45
45
}
46
46
@@ -53,9 +53,6 @@ public boolean isGrid(FormEntity entity) {
53
53
54
54
public Project project ;
55
55
56
- public boolean askConfirm ;
57
- public String askConfirmMessage ;
58
-
59
56
public String canonicalName = "" ;
60
57
public String declText ;
61
58
public String declLocation ;
@@ -111,12 +108,11 @@ public PropertyDrawEntity(String alias, String propertyName, List<ObjectEntity>
111
108
forceViewType = ClassViewType .PANEL ;
112
109
}
113
110
111
+ LSFNonEmptyActionOptions actionOptions = null ;
114
112
LSFNonEmptyPropertyOptions propertyOptions = null ;
115
113
if (propDeclaration != null ) {
114
+ actionOptions = propDeclaration .getNonEmptyActionOptions ();
116
115
propertyOptions = propDeclaration .getNonEmptyPropertyOptions ();
117
- // if (caption == null) {
118
- // caption = propertyStatement.getDeclName();
119
- // }
120
116
declText = propDeclaration .getText ();
121
117
declLocation = propDeclaration .getLocationString ();
122
118
List <LSFClassSet > paramClasses = propDeclaration .resolveParamClasses ();
@@ -132,47 +128,48 @@ public PropertyDrawEntity(String alias, String propertyName, List<ObjectEntity>
132
128
}
133
129
}
134
130
135
- if (propertyOptions != null ) {
136
- for (LSFViewTypeSetting viewType : propertyOptions .getViewTypeSettingList ())
137
- forceViewType = valueOf (viewType .getClassViewType ().getText ());
131
+ if (actionOptions != null )
132
+ applyOptions (actionOptions .getViewTypeSettingList (), actionOptions .getFlexCharWidthSettingList (),
133
+ actionOptions .getCharWidthSettingList (), actionOptions .getImageSettingList (),
134
+ actionOptions .getChangeKeySettingList (), actionOptions .getInSettingList ());
138
135
139
- List < LSFFlexCharWidthSetting > fixedCharWidthSettings = propertyOptions . getFlexCharWidthSettingList ();
140
- if (! fixedCharWidthSettings . isEmpty ()) {
141
- fixedCharWidth = Integer . parseInt ( fixedCharWidthSettings . get ( fixedCharWidthSettings . size () - 1 ). getIntLiteral (). getText ());
142
- }
136
+ if ( propertyOptions != null )
137
+ applyOptions ( propertyOptions . getViewTypeSettingList (), propertyOptions . getFlexCharWidthSettingList (),
138
+ propertyOptions . getCharWidthSettingList (), propertyOptions . getImageSettingList (),
139
+ propertyOptions . getChangeKeySettingList (), propertyOptions . getInSettingList ());
143
140
144
- List <LSFCharWidthSetting > minCharWidthSettings = propertyOptions .getCharWidthSettingList ();
145
- if (!minCharWidthSettings .isEmpty ()) {
146
- charWidth = Integer .parseInt (minCharWidthSettings .get (minCharWidthSettings .size () - 1 ).getIntLiteral ().getText ());
147
- }
141
+ applyFormOptions (commonFormOptions , form );
142
+ applyFormOptions (propertyFormOptions , form );
143
+ }
148
144
149
- List <LSFImageSetting > imageSettings = propertyOptions .getImageSettingList ();
150
- if (!imageSettings .isEmpty ()) {
151
- iconPath = imageSettings .get (imageSettings .size () - 1 ).getStringLiteral ().getValue ();
152
- }
145
+ private void applyOptions (List <LSFViewTypeSetting > viewTypeSettingList , List <LSFFlexCharWidthSetting > flexCharWidthSettingList ,
146
+ List <LSFCharWidthSetting > charWidthSettingList , List <LSFImageSetting > imageSettingList ,
147
+ List <LSFChangeKeySetting > changeKeySettingList , List <LSFInSetting > inSettingList ) {
148
+ for (LSFViewTypeSetting viewType : viewTypeSettingList )
149
+ forceViewType = valueOf (viewType .getClassViewType ().getText ());
153
150
154
- List <LSFChangeKeySetting > editKeySettings = propertyOptions .getChangeKeySettingList ();
155
- if (!editKeySettings .isEmpty ()) {
156
- LSFChangeKeySetting editKeySetting = editKeySettings .get (editKeySettings .size () - 1 );
157
- changeKey = KeyStroke .getKeyStroke (editKeySetting .getStringLiteral ().getValue ());
158
- if (editKeySetting .getHideEditKey () != null ) {
159
- showChangeKey = false ;
160
- }
161
- }
151
+ if (!flexCharWidthSettingList .isEmpty ())
152
+ fixedCharWidth = Integer .parseInt (flexCharWidthSettingList .get (flexCharWidthSettingList .size () - 1 ).getIntLiteral ().getText ());
162
153
163
- getAbstractGroup ( propertyOptions );
164
- }
154
+ if (! charWidthSettingList . isEmpty ())
155
+ charWidth = Integer . parseInt ( charWidthSettingList . get ( charWidthSettingList . size () - 1 ). getIntLiteral (). getText ());
165
156
166
- applyFormOptions (commonFormOptions , form );
167
- applyFormOptions (propertyFormOptions , form );
168
- }
157
+ if (!imageSettingList .isEmpty ()) {
158
+ LSFStringLiteral imageLiteral = imageSettingList .get (imageSettingList .size () - 1 ).getStringLiteral ();
159
+ if (imageLiteral != null )
160
+ iconPath = imageLiteral .getValue ();
161
+ }
169
162
170
- private void getAbstractGroup (LSFNonEmptyPropertyOptions propertyOptions ) {
171
- List <LSFGroupUsage > groupUsageList = propertyOptions .getGroupUsageList ();
172
- if (!groupUsageList .isEmpty ()) {
173
- LSFGroupUsage groupUsage = groupUsageList .get (groupUsageList .size () - 1 );
174
- parent = addAbstractGroup (groupUsage );
163
+ if (!changeKeySettingList .isEmpty ()) {
164
+ LSFChangeKeySetting editKeySetting = changeKeySettingList .get (changeKeySettingList .size () - 1 );
165
+ changeKey = KeyStroke .getKeyStroke (editKeySetting .getStringLiteral ().getValue ());
166
+ if (editKeySetting .getHideEditKey () != null ) {
167
+ showChangeKey = false ;
168
+ }
175
169
}
170
+
171
+ if (!inSettingList .isEmpty ())
172
+ parent = addAbstractGroup (inSettingList .get (inSettingList .size () - 1 ).getGroupUsage ());
176
173
}
177
174
178
175
private AbstractGroup addAbstractGroup (LSFGroupUsage groupUsage ) {
@@ -205,14 +202,13 @@ private void applyFormOptions(LSFFormPropertyOptionsList optionList, FormEntity
205
202
List <LSFFormOptionForce > formOptionForceList = optionList .getFormOptionForceList ();
206
203
if (!formOptionForceList .isEmpty ()) {
207
204
LSFFormOptionForce forceOption = formOptionForceList .get (formOptionForceList .size () - 1 );
208
- if (forceOption .getClassViewType () != null ) {
209
- String forceText = forceOption .getClassViewType ().getText ();
210
- forceViewType = ClassViewType .valueOf (forceText );
211
- }
205
+ forceOption .getClassViewType ();
206
+ String forceText = forceOption .getClassViewType ().getText ();
207
+ forceViewType = ClassViewType .valueOf (forceText );
212
208
}
213
209
}
214
210
215
- public GroupObjectEntity getToDraw (FormEntity form ) {
211
+ public GroupObjectEntity getToDraw () {
216
212
return toDraw ;
217
213
}
218
214
0 commit comments