Mercurial > projects > dwt-samples
annotate jface/snippets/Snippet040TableViewerSorting.d @ 88:9ed020f0c2a5
Fix the snippet040 example
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 19 May 2008 14:30:49 +0200 |
parents | 604fa1feb76a |
children |
rev | line source |
---|---|
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
1 /******************************************************************************* |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
2 * Copyright (c) 2006 Tom Schindl and others. |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
3 * All rights reserved. This program and the accompanying materials |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
4 * are made available under the terms of the Eclipse Public License v1.0 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
5 * which accompanies this distribution, and is available at |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
6 * http://www.eclipse.org/legal/epl-v10.html |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
7 * |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
8 * Contributors: |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
9 * Tom Schindl - initial API and implementation |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
10 * Port to the D programming language: |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
11 * yidabu at gmail dot com ( D China http://www.d-programming-language-china.org/ ) |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
12 *******************************************************************************/ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
13 module jface.snippets.Snippet040TableViewerSorting; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
14 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
15 // http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet040TableViewerSorting.java?view=markup |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
16 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
17 import dwtx.jface.viewers.CellEditor; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
18 import dwtx.jface.viewers.ColumnLabelProvider; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
19 import dwtx.jface.viewers.ColumnViewer; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
20 import dwtx.jface.viewers.EditingSupport; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
21 import dwtx.jface.viewers.IStructuredContentProvider; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
22 import dwtx.jface.viewers.TableViewer; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
23 import dwtx.jface.viewers.TableViewerColumn; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
24 import dwtx.jface.viewers.TextCellEditor; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
25 import dwtx.jface.viewers.Viewer; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
26 import dwtx.jface.viewers.ViewerComparator; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
27 import dwt.DWT; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
28 import dwt.events.SelectionAdapter; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
29 import dwt.events.SelectionEvent; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
30 import dwt.layout.FillLayout; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
31 import dwt.widgets.Display; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
32 import dwt.widgets.Shell; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
33 import dwt.dwthelper.utils; |
88 | 34 |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
35 /** |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
36 * Example usage of ViewerComparator in tables to allow sorting |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
37 * |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
38 * @author Tom Schindl <tom.schindl@bestsolution.at> |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
39 * |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
40 */ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
41 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
42 void main(String[] args) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
43 Snippet040TableViewerSorting.main(args); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
44 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
45 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
46 private class MyContentProvider : IStructuredContentProvider { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
47 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
48 public Object[] getElements(Object inputElement) { |
88 | 49 return (cast(ArrayWrapperT!(Person)) inputElement).array; |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
50 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
51 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
52 public void dispose() { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
53 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
54 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
55 public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
56 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
57 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
58 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
59 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
60 public class Person { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
61 public String givenname; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
62 public String surname; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
63 public String email; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
64 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
65 public this(String givenname, String surname, String email) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
66 this.givenname = givenname; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
67 this.surname = surname; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
68 this.email = email; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
69 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
70 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
71 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
72 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
73 protected abstract class AbstractEditingSupport : EditingSupport { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
74 private TextCellEditor editor; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
75 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
76 public this(TableViewer viewer) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
77 super(viewer); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
78 this.editor = new TextCellEditor(viewer.getTable()); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
79 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
80 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
81 protected bool canEdit(Object element) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
82 return true; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
83 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
84 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
85 protected CellEditor getCellEditor(Object element) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
86 return editor; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
87 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
88 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
89 protected void setValue(Object element, Object value) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
90 doSetValue(element, value); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
91 getViewer().update(element, null); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
92 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
93 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
94 protected abstract void doSetValue(Object element, Object value); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
95 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
96 |
88 | 97 private abstract class ColumnViewerSorter : ViewerComparator { |
98 public static final int ASC = 1; | |
99 | |
100 public static final int NONE = 0; | |
101 | |
102 public static final int DESC = -1; | |
103 | |
104 private int direction = 0; | |
105 | |
106 private TableViewerColumn column; | |
107 | |
108 private ColumnViewer viewer; | |
109 | |
110 public this(ColumnViewer viewer_, TableViewerColumn column_) { | |
111 this.column = column_; | |
112 this.viewer = viewer_; | |
113 this.column.getColumn().addSelectionListener(new class() SelectionAdapter { | |
114 public void widgetSelected(SelectionEvent e) { | |
115 this.outer.widgetSelected(e); | |
116 } | |
117 }); | |
118 } | |
119 | |
120 private void widgetSelected(SelectionEvent e){ | |
121 if( viewer.getComparator() !is null ) { | |
122 if( viewer.getComparator() is this ) { | |
123 int tdirection = direction; | |
124 | |
125 if( tdirection is ASC ) { | |
126 setSorter(this, DESC); | |
127 } else if( tdirection is DESC ) { | |
128 setSorter(this, NONE); | |
129 } | |
130 } else { | |
131 setSorter(this, ASC); | |
132 } | |
133 } else { | |
134 setSorter(this, ASC); | |
135 } | |
136 } | |
137 public void setSorter(ColumnViewerSorter sorter, int direction) { | |
138 if( direction is NONE ) { | |
139 column.getColumn().getParent().setSortColumn(null); | |
140 column.getColumn().getParent().setSortDirection(DWT.NONE); | |
141 viewer.setComparator(null); | |
142 } else { | |
143 column.getColumn().getParent().setSortColumn(column.getColumn()); | |
144 sorter.direction = direction; | |
145 | |
146 if( direction is ASC ) { | |
147 column.getColumn().getParent().setSortDirection(DWT.DOWN); | |
148 } else { | |
149 column.getColumn().getParent().setSortDirection(DWT.UP); | |
150 } | |
151 | |
152 if( viewer.getComparator() is sorter ) { | |
153 viewer.refresh(); | |
154 } else { | |
155 viewer.setComparator(sorter); | |
156 } | |
157 | |
158 } | |
159 } | |
160 | |
161 public int compare(Viewer viewer, Object e1, Object e2) { | |
162 return direction * doCompare(viewer, e1, e2); | |
163 } | |
164 | |
165 protected abstract int doCompare(Viewer viewer, Object e1, Object e2); | |
166 } | |
167 | |
168 public class Snippet040TableViewerSorting { | |
169 | |
170 | |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
171 public this(Shell shell) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
172 TableViewer v = new TableViewer(shell, DWT.BORDER | DWT.FULL_SELECTION); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
173 v.setContentProvider(new MyContentProvider()); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
174 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
175 TableViewerColumn column = new TableViewerColumn(v, DWT.NONE); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
176 column.getColumn().setWidth(200); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
177 column.getColumn().setText("Givenname"); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
178 column.getColumn().setMoveable(true); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
179 column.setLabelProvider(new class() ColumnLabelProvider { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
180 public String getText(Object element) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
181 return (cast(Person) element).givenname; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
182 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
183 }); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
184 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
185 column.setEditingSupport(new class(v) AbstractEditingSupport { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
186 public this(TableViewer t ){ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
187 super(t); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
188 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
189 protected Object getValue(Object element) { |
88 | 190 return new ArrayWrapperString((cast(Person) element).givenname); |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
191 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
192 protected void doSetValue(Object element, Object value) { |
88 | 193 (cast(Person) element).givenname = stringcast(value); |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
194 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
195 }); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
196 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
197 ColumnViewerSorter cSorter = new class(v,column) ColumnViewerSorter { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
198 this(TableViewer t, TableViewerColumn c ){ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
199 super(t,c); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
200 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
201 protected int doCompare(Viewer viewer, Object e1, Object e2) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
202 Person p1 = cast(Person) e1; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
203 Person p2 = cast(Person) e2; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
204 return p1.givenname.compareToIgnoreCase(p2.givenname); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
205 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
206 }; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
207 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
208 column = new TableViewerColumn(v, DWT.NONE); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
209 column.getColumn().setWidth(200); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
210 column.getColumn().setText("Surname"); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
211 column.getColumn().setMoveable(true); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
212 column.setLabelProvider(new class() ColumnLabelProvider { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
213 public String getText(Object element) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
214 return (cast(Person) element).surname; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
215 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
216 }); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
217 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
218 column.setEditingSupport(new class(v) AbstractEditingSupport { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
219 this(TableViewer t ){ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
220 super(t); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
221 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
222 protected Object getValue(Object element) { |
88 | 223 return stringcast((cast(Person) element).surname); |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
224 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
225 protected void doSetValue(Object element, Object value) { |
88 | 226 (cast(Person) element).surname = stringcast(value); |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
227 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
228 }); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
229 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
230 new class(v,column) ColumnViewerSorter { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
231 this(TableViewer t, TableViewerColumn c ){ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
232 super(t,c); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
233 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
234 protected int doCompare(Viewer viewer, Object e1, Object e2) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
235 Person p1 = cast(Person) e1; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
236 Person p2 = cast(Person) e2; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
237 return p1.surname.compareToIgnoreCase(p2.surname); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
238 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
239 }; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
240 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
241 column = new TableViewerColumn(v, DWT.NONE); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
242 column.getColumn().setWidth(200); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
243 column.getColumn().setText("E-Mail"); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
244 column.getColumn().setMoveable(true); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
245 column.setLabelProvider(new class() ColumnLabelProvider { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
246 public String getText(Object element) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
247 return (cast(Person) element).email; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
248 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
249 }); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
250 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
251 column.setEditingSupport(new class(v) AbstractEditingSupport { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
252 this(TableViewer t ){ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
253 super(t); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
254 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
255 protected Object getValue(Object element) { |
88 | 256 return stringcast((cast(Person) element).email); |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
257 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
258 protected void doSetValue(Object element, Object value) { |
88 | 259 (cast(Person) element).email = stringcast(value); |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
260 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
261 }); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
262 new class(v,column) ColumnViewerSorter { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
263 this(TableViewer t, TableViewerColumn c ){ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
264 super(t,c); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
265 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
266 protected int doCompare(Viewer viewer, Object e1, Object e2) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
267 Person p1 = cast(Person) e1; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
268 Person p2 = cast(Person) e2; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
269 return p1.email.compareToIgnoreCase(p2.email); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
270 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
271 }; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
272 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
273 Person[] model = createModel(); |
88 | 274 v.setInput( new ArrayWrapperT!(Person)(model)); |
87
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
275 v.getTable().setLinesVisible(true); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
276 v.getTable().setHeaderVisible(true); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
277 cSorter.setSorter(cSorter, ColumnViewerSorter.ASC); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
278 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
279 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
280 private Person[] createModel() { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
281 Person[] elements = new Person[4]; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
282 elements[0] = new Person("Tom", "Schindl", |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
283 "tom.schindl@bestsolution.at"); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
284 elements[1] = new Person("Boris", "Bokowski", |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
285 "Boris_Bokowski@ca.ibm.com"); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
286 elements[2] = new Person("Tod", "Creasey", "Tod_Creasey@ca.ibm.com"); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
287 elements[3] = new Person("Wayne", "Beaton", "wayne@eclipse.org"); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
288 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
289 return elements; |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
290 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
291 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
292 /** |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
293 * @param args |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
294 */ |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
295 public static void main(String[] args) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
296 Display display = new Display(); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
297 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
298 Shell shell = new Shell(display); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
299 shell.setLayout(new FillLayout()); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
300 new Snippet040TableViewerSorting(shell); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
301 shell.open(); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
302 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
303 while (!shell.isDisposed()) { |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
304 if (!display.readAndDispatch()) |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
305 display.sleep(); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
306 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
307 display.dispose(); |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
308 } |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
309 |
604fa1feb76a
Added jface snippet040, thanks to yidabu. It still has compile problems, that need further examination.
Frank Benoit <benoit@tionex.de>
parents:
diff
changeset
|
310 } |