1
1
/*-
2
2
* ========================LICENSE_START=================================
3
- * JSoagger
3
+ * JSoagger
4
4
* %%
5
5
* Copyright (C) 2019 JSOAGGER
6
6
* %%
21
21
package io .github .jsoagger .jfxcore .engine .client .apiimpl ;
22
22
23
23
24
- import io .github .jsoagger .jfxcore .engine .client .utils .NodeHelper ;
25
24
import io .github .jsoagger .core .bridge .operation .IOperation ;
26
25
import io .github .jsoagger .core .bridge .operation .IOperationResult ;
27
26
import io .github .jsoagger .core .bridge .result .OperationData ;
32
31
import io .github .jsoagger .jfxcore .api .IActionResult ;
33
32
import io .github .jsoagger .jfxcore .api .IRSHeaderHolder ;
34
33
import io .github .jsoagger .jfxcore .api .services .Services ;
34
+ import io .github .jsoagger .jfxcore .engine .client .utils .NodeHelper ;
35
35
import io .github .jsoagger .jfxcore .engine .controller .AbstractViewController ;
36
36
import io .github .jsoagger .jfxcore .engine .controller .main .RootStructureController ;
37
37
import io .github .jsoagger .jfxcore .engine .controller .roostructure .content .StructureContentController ;
38
38
import io .github .jsoagger .jfxcore .engine .controller .roostructure .content .event .SetCurrentLocationEvent ;
39
-
40
39
import javafx .application .Platform ;
41
40
import javafx .beans .property .SimpleObjectProperty ;
42
41
import javafx .scene .Node ;
48
47
*/
49
48
public abstract class AbstractAction implements IAction {
50
49
51
- protected SimpleObjectProperty <IActionResult > resultProperty = new SimpleObjectProperty <IActionResult >();
50
+ protected SimpleObjectProperty <IActionResult > resultProperty =
51
+ new SimpleObjectProperty <IActionResult >();
52
52
53
53
protected String id ;
54
54
protected OperationData data ;
55
- protected AbstractViewController controller ;
55
+ protected AbstractViewController controller ;
56
56
57
57
58
58
/**
@@ -106,27 +106,22 @@ public IOperation getOperation(IActionRequest actionRequest) {
106
106
}
107
107
108
108
109
- /**
110
- * @param actionRequest
111
- * @return
112
- */
113
109
public boolean isForwardAndReplaceView (IActionRequest actionRequest ) {
114
110
boolean isForwardAndReplaceView = false ;
115
111
final String isForwardAndReplaceViewString = (String ) actionRequest .getProperty ("replace" );
116
- isForwardAndReplaceView = StringUtils .hasText (isForwardAndReplaceViewString ) && "true" .equalsIgnoreCase (isForwardAndReplaceViewString );
112
+ isForwardAndReplaceView = StringUtils .hasText (isForwardAndReplaceViewString )
113
+ && "true" .equalsIgnoreCase (isForwardAndReplaceViewString );
117
114
return isForwardAndReplaceView ;
118
115
}
119
116
120
117
121
- /**
122
- * Show general error message
123
- */
124
118
public void onActionGeneralError (Throwable ex ) {
125
119
final ActionResult ar = new ActionResult .ActionResultBuilder ()
126
120
.message ("Oups, your request can not be processed due to internal error." )
127
121
.status (ActionResultStatus .ERROR ).build ();
128
122
resultProperty .set (ar );
129
- NodeHelper .showHeaderErrorMessage (controller , "Oups, your request can not be processed due to internal error." );
123
+ NodeHelper .showHeaderErrorMessage (controller ,
124
+ "Oups, your request can not be processed due to internal error." );
130
125
}
131
126
132
127
@@ -161,9 +156,8 @@ protected void createSuccess(IOperationResult operationResult) {
161
156
resultProperty .set (ActionResult .success ());
162
157
NodeHelper .showHeaderSuccessCreateMessage (controller );
163
158
} else {
164
- ActionResult ar = new ActionResult
165
- .ActionResultBuilder ()
166
- .operationMessage (operationResult != null ? operationResult .getMessages (): null )
159
+ ActionResult ar = new ActionResult .ActionResultBuilder ()
160
+ .operationMessage (operationResult != null ? operationResult .getMessages () : null )
167
161
.status (ActionResultStatus .ERROR ).build ();
168
162
resultProperty .set (ar );
169
163
NodeHelper .showHeaderErrorCreateMessage (controller );
@@ -176,7 +170,8 @@ protected void createSuccess(IOperationResult operationResult) {
176
170
* @param rsc
177
171
* @param currentContent
178
172
*/
179
- protected void updateRSCHeader (RootStructureController rsc , StructureContentController currentContent ) {
173
+ protected void updateRSCHeader (RootStructureController rsc ,
174
+ StructureContentController currentContent ) {
180
175
AbstractViewController c = currentContent .getCurrentContent ();
181
176
if (c instanceof IRSHeaderHolder ) {
182
177
Node ident = ((IRSHeaderHolder ) c ).getDisplayIdentity ();
0 commit comments