File tree 16 files changed +200
-12
lines changed
src/main/java/org/krypsis/gwt/store/example/client
modctrl-api/src/main/java/modbus/control/api/gwtbp
java/modbus/control/client
16 files changed +200
-12
lines changed Original file line number Diff line number Diff line change 50
50
51
51
<build >
52
52
<resources >
53
+ <resource >
54
+ <directory >${pom.basedir} /src/main/java</directory >
55
+ <includes >
56
+ <include >**/*.java</include >
57
+ <include >**/*.xml</include >
58
+ </includes >
59
+ </resource >
60
+ </resources >
61
+ <!-- <resources>
53
62
<resource>
54
63
<directory>src/main/java</directory>
55
64
<includes>
64
73
<include>**/*.xml</include>
65
74
</includes>
66
75
</resource>
67
- </resources >
76
+ </resources> -->
68
77
<plugins >
69
78
<plugin >
70
79
<groupId >org.apache.maven.plugins</groupId >
75
84
<id >attach-sources</id >
76
85
<phase >verify</phase >
77
86
<goals >
78
- <goal >jar</goal >
87
+ <goal >jar-no-fork </goal >
79
88
</goals >
80
89
</execution >
81
90
</executions >
Original file line number Diff line number Diff line change 1
1
package org .krypsis .gwt .store .example .client ;
2
2
3
- import com .google .gwt .user .client .rpc .AsyncCallback ;
4
3
import com .google .gwt .core .client .GWT ;
4
+ import com .google .gwt .user .client .rpc .AsyncCallback ;
5
5
6
6
public abstract class SuccessCallback <T > implements AsyncCallback <T > {
7
- public void onFailure (Throwable caught ) {
8
- GWT .log ("Error: " , caught );
9
- }
7
+
8
+ @ Override
9
+ public void onFailure (Throwable caught ) {
10
+ GWT .log ("Error: " , caught );
11
+ }
10
12
}
Original file line number Diff line number Diff line change
1
+ package modbus .control .api .gwtbp ;
2
+
3
+ /**
4
+ * The name Command is taken
5
+ */
6
+ public interface Action <T extends Response > {
7
+ }
Original file line number Diff line number Diff line change
1
+ package modbus .control .api .gwtbp ;
2
+
3
+ import java .util .ArrayList ;
4
+
5
+ public class Contact {
6
+
7
+ String name ;
8
+ ArrayList <ContactDetailId > detailIds ;
9
+
10
+ ArrayList <ContactDetailId > getDetailIds () {
11
+ return detailIds ;
12
+ }
13
+
14
+ String getName () {
15
+ return name ;
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+ package modbus .control .api .gwtbp ;
6
+
7
+ /**
8
+ *
9
+ * @author ag
10
+ */
11
+ public class ContactDetail {
12
+
13
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+ package modbus .control .api .gwtbp ;
6
+
7
+ /**
8
+ *
9
+ * @author ag
10
+ */
11
+ class ContactDetailId {
12
+
13
+ }
Original file line number Diff line number Diff line change
1
+ package modbus .control .api .gwtbp ;
2
+
3
+ import com .google .gwt .user .client .rpc .RemoteService ;
4
+
5
+ public interface ContactsService extends RemoteService {
6
+
7
+ public <T extends Response > T execute (Action <T > action );
8
+ }
Original file line number Diff line number Diff line change
1
+ package modbus .control .api .gwtbp ;
2
+
3
+ import com .google .gwt .user .client .rpc .AsyncCallback ;
4
+
5
+ public interface ContactsServiceAsync {
6
+
7
+ public <T extends Response > void execute (Action <T > action , AsyncCallback <T > callback );
8
+ }
Original file line number Diff line number Diff line change
1
+ package modbus .control .api .gwtbp ;
2
+
3
+ import java .util .ArrayList ;
4
+
5
+ public class GetDetails implements Action <GetDetailsResponse > {
6
+ private final ArrayList <ContactDetailId > ids ;
7
+ public GetDetails (ArrayList <ContactDetailId > ids ) {
8
+ this .ids = ids ;
9
+ }
10
+ public ArrayList <ContactDetailId > getIds () {
11
+ return ids ;
12
+ }
13
+ }
14
+
Original file line number Diff line number Diff line change
1
+ package modbus .control .api .gwtbp ;
2
+
3
+ import java .util .ArrayList ;
4
+
5
+
6
+ class GetDetailsResponse implements Response {
7
+ private final ArrayList <ContactDetail > details ;
8
+ public GetDetailsResponse (ArrayList <ContactDetail > details ) {
9
+ this .details = details ;
10
+ }
11
+ public ArrayList <ContactDetail > getDetails () {
12
+ return new ArrayList <ContactDetail >(details );
13
+ }
14
+ }
15
+
Original file line number Diff line number Diff line change
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+ package modbus .control .api .gwtbp ;
6
+
7
+ import com .google .gwt .user .client .rpc .AsyncCallback ;
8
+ import java .util .ArrayList ;
9
+
10
+ abstract class GotDetails implements
11
+ AsyncCallback <GetDetailsResponse > {
12
+
13
+ @ Override
14
+ public void onFailure (Throwable oops ) {
15
+ /*
16
+ * default appwide failure handling
17
+ */
18
+ }
19
+
20
+ @ Override
21
+ public void onSuccess (GetDetailsResponse result ) {
22
+ got (result .getDetails ());
23
+ }
24
+
25
+ public abstract void got (ArrayList <ContactDetail > details );
26
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * To change this template, choose Tools | Templates
3
+ * and open the template in the editor.
4
+ */
5
+ package modbus .control .api .gwtbp ;
6
+
7
+ import com .google .gwt .core .client .EntryPoint ;
8
+ import java .util .ArrayList ;
9
+
10
+ /**
11
+ *
12
+ * @author ag
13
+ */
14
+ public class MyEntryPoint implements EntryPoint {
15
+
16
+ @ Override
17
+ public void onModuleLoad () {
18
+ showContact (null );
19
+ }
20
+
21
+ void showContact (final Contact contact ) {
22
+ // service.execute(new GetDetails(contact.getDetailIds()),
23
+ // new GotDetails() {
24
+ //
25
+ // public void got(ArrayList<ContactDetail> details) {
26
+ // renderContact(contact);
27
+ // renderDetails(details);
28
+ // }
29
+ // });
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ package modbus .control .api .gwtbp ;
2
+
3
+ public interface Response {
4
+ }
5
+
Original file line number Diff line number Diff line change 202
202
<fileset dir =" ${basedir}/../modctrl-api/src/main/resources/db" />
203
203
</copy >
204
204
<mkdir dir =" ${staging.dir}/ModbusControl/logs" />
205
- <!--
205
+ <!-- -->
206
206
<copy todir =" C:/ModbusControl" >
207
207
<fileset dir =" ${staging.dir}/ModbusControl" />
208
- </copy>
209
- -->
208
+ </copy >
210
209
</tasks >
211
210
</configuration >
212
211
</execution >
Original file line number Diff line number Diff line change @@ -64,7 +64,29 @@ public ModbusControl() {
64
64
@ Override
65
65
public void onModuleLoad () {
66
66
final ListBox select = new ListBox ();
67
- final Label errorLabel = new Label ();
67
+
68
+ // Beispielcode:
69
+ //
70
+ final Label airportLabel = new Label ();
71
+ // Airport ap = new Airport();
72
+ // ap.setCountry("Germany");
73
+ // ap.setId("FRA");
74
+ //
75
+ // airportService.save(ap, new SuccessCallback<Airport>() {
76
+ //
77
+ // @Override
78
+ // public void onSuccess(Airport result) {
79
+ // airportLabel.setText(result.toString());
80
+ // }
81
+ // });
82
+ //
83
+ // airportService.load("FRA", new SuccessCallback<Airport>() {
84
+ //
85
+ // @Override
86
+ // public void onSuccess(Airport result) {
87
+ // airportLabel.setText(result.toString());
88
+ // }
89
+ // });
68
90
69
91
select .setVisibleItemCount (1 );
70
92
@@ -103,7 +125,7 @@ public void onSuccess(List<Category> result) {
103
125
104
126
// Add the Control Elements to the RootPanel
105
127
// Use RootPanel.get() to get the entire body element
106
- RootPanel .get ("errorLabelContainer" ).add (errorLabel );
128
+ RootPanel .get ("errorLabelContainer" ).add (airportLabel );
107
129
RootPanel .get ("selectContainer" ).add (select );
108
130
}
109
131
Original file line number Diff line number Diff line change 37
37
<!-- Default page to serve -->
38
38
<welcome-file-list >
39
39
<welcome-file >ModbusControl.html</welcome-file >
40
- <welcome-file >Example.html</welcome-file >
41
40
</welcome-file-list >
42
41
</web-app >
You can’t perform that action at this time.
0 commit comments