Skip to content

Commit 761261a

Browse files
committed
swt example updated
1 parent 007e973 commit 761261a

15 files changed

Lines changed: 210 additions & 55 deletions

File tree

de.vogella.gae.java.donat/.project

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<projectDescription>
3-
<name>de.vogella.gae.java.donat</name>
4-
<comment></comment>
5-
<projects>
6-
</projects>
7-
<buildSpec>
8-
<buildCommand>
9-
<name>org.eclipse.jdt.core.javabuilder</name>
10-
<arguments>
11-
</arguments>
12-
</buildCommand>
13-
<buildCommand>
14-
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
15-
<arguments>
16-
</arguments>
17-
</buildCommand>
18-
<buildCommand>
19-
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
20-
<arguments>
21-
</arguments>
22-
</buildCommand>
23-
<buildCommand>
24-
<name>com.google.appengine.eclipse.core.projectValidator</name>
25-
<arguments>
26-
</arguments>
27-
</buildCommand>
28-
</buildSpec>
29-
<natures>
30-
<nature>org.eclipse.jdt.core.javanature</nature>
31-
<nature>com.google.appengine.eclipse.core.gaeNature</nature>
32-
</natures>
33-
</projectDescription>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>de.vogella.gae.java.donat</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>com.google.appengine.eclipse.core.projectValidator</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.jdt.core.javanature</nature>
31+
<nature>com.google.appengine.eclipse.core.gaeNature</nature>
32+
</natures>
33+
</projectDescription>

de.vogella.gae.java.tendering/src/de/vogella/gae/java/tendering/GetStatusServlet.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp)
1414
throws IOException {
1515
String id = req.getParameter("id");
1616
Order order = Dao.get(id);
17-
order.setCarrier("Declined by Carrier Joe the helpful trucker");
18-
order.setResponded(true);
19-
Dao.save(order);
2017
resp.setContentType("text/plain");
2118
resp.getWriter().println("Carrier status: " + order.getCarrier());
2219
}

de.vogella.gae.java.tendering/war/WEB-INF/appengine-web.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
3-
<application>vogellatest</application>
3+
<application>myvogella</application>
44
<version>1</version>
55

66
<!-- Configure java.util.logging -->
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<classpath>
3-
<classpathentry kind="src" path="src"/>
4-
<classpathentry kind="src" path="test"/>
5-
<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
6-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
7-
<classpathentry kind="output" path="war/WEB-INF/classes"/>
8-
</classpath>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6+
<classpathentry kind="output" path="war/WEB-INF/classes"/>
7+
</classpath>

de.vogella.gae.java.todo/.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
</arguments>
1717
</buildCommand>
1818
<buildCommand>
19-
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
19+
<name>com.google.appengine.eclipse.core.projectValidator</name>
2020
<arguments>
2121
</arguments>
2222
</buildCommand>
2323
<buildCommand>
24-
<name>com.google.appengine.eclipse.core.projectValidator</name>
24+
<name>com.google.appengine.eclipse.core.enhancerbuilder</name>
2525
<arguments>
2626
</arguments>
2727
</buildCommand>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
#Tue Sep 14 17:49:39 CEST 2010
2-
eclipse.preferences.version=1
3-
filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.3.7.jar|appengine-jsr107cache-1.3.7.jar|datanucleus-jpa-1.1.5.jar|datanucleus-core-1.1.5.jar|datanucleus-appengine-1.0.7.final.jar|geronimo-jta_1.1_spec-1.1.1.jar|geronimo-jpa_3.0_spec-1.1.1.jar|jdo2-api-2.3-eb.jar|jsr107cache-1.1.jar|appengine-api-labs-1.3.7.jar
1+
#Fri Nov 19 00:56:22 CET 2010
2+
eclipse.preferences.version=1
3+
filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.3.8.jar|appengine-api-labs-1.3.8.jar|appengine-jsr107cache-1.3.8.jar|jsr107cache-1.1.jar|datanucleus-appengine-1.0.7.final.jar|datanucleus-core-1.1.5.jar|datanucleus-jpa-1.1.5.jar|geronimo-jpa_3.0_spec-1.1.1.jar|geronimo-jta_1.1_spec-1.1.1.jar|jdo2-api-2.3-eb.jar

de.vogella.gae.java.todo/war/WEB-INF/lib/appengine-api-1.0-sdk-1.3.7.jar renamed to de.vogella.gae.java.todo/war/WEB-INF/lib/appengine-api-1.0-sdk-1.3.8.jar

10 MB
Binary file not shown.

de.vogella.gae.java.todo/war/WEB-INF/lib/appengine-api-labs-1.3.7.jar renamed to de.vogella.gae.java.todo/war/WEB-INF/lib/appengine-api-labs-1.3.8.jar

1.27 MB
Binary file not shown.

de.vogella.gae.java.todo/war/WEB-INF/lib/appengine-jsr107cache-1.3.7.jar renamed to de.vogella.gae.java.todo/war/WEB-INF/lib/appengine-jsr107cache-1.3.8.jar

15 KB
Binary file not shown.

de.vogella.jface.tableviewer/src/de/vogella/jface/tableviewer/View.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55

66
import org.eclipse.jface.viewers.ArrayContentProvider;
77
import org.eclipse.jface.viewers.ColumnLabelProvider;
8+
import org.eclipse.jface.viewers.ColumnViewerEditor;
9+
import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
10+
import org.eclipse.jface.viewers.ColumnViewerEditorActivationStrategy;
11+
import org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter;
812
import org.eclipse.jface.viewers.StyledCellLabelProvider;
913
import org.eclipse.jface.viewers.TableViewer;
1014
import org.eclipse.jface.viewers.TableViewerColumn;
15+
import org.eclipse.jface.viewers.TableViewerEditor;
16+
import org.eclipse.jface.viewers.TableViewerFocusCellManager;
1117
import org.eclipse.jface.viewers.ViewerCell;
1218
import org.eclipse.swt.SWT;
1319
import org.eclipse.swt.custom.StyleRange;
@@ -80,6 +86,28 @@ public void keyReleased(KeyEvent ke) {
8086
private void createViewer(Composite parent) {
8187
viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
8288
| SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
89+
90+
ColumnViewerEditorActivationStrategy actStrategy = new ColumnViewerEditorActivationStrategy(
91+
viewer) {
92+
protected boolean isEditorActivationEvent(
93+
ColumnViewerEditorActivationEvent event) {
94+
return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
95+
|| event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
96+
// || event.eventType ==
97+
// ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION
98+
|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED);
99+
}
100+
101+
};
102+
103+
final TableViewerFocusCellManager focusCellMgr = new TableViewerFocusCellManager(
104+
viewer, new FocusCellOwnerDrawHighlighter(viewer));
105+
106+
TableViewerEditor.create(viewer, focusCellMgr, actStrategy,
107+
ColumnViewerEditor.TABBING_HORIZONTAL
108+
| ColumnViewerEditorActivationEvent.TRAVERSAL
109+
| ColumnViewerEditor.KEYBOARD_ACTIVATION);
110+
83111
createColumns(parent, viewer);
84112
final Table table = viewer.getTable();
85113
table.setHeaderVisible(true);
@@ -164,6 +192,7 @@ public String getText(Object element) {
164192
return p.getGender();
165193
}
166194
});
195+
167196
col.setEditingSupport(new GenderEditingSupport(viewer));
168197

169198
// // Now the status married

0 commit comments

Comments
 (0)