Changeset 145:161f7698cfb8
- Timestamp:
- 08/08/08 08:40:21
(4 months ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- branch:
- default
- Message:
Moved jface snippets to viewers subpackage, there are more with conflicting numbers for other packages
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r143 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet001TableViewer; |
|---|
| | 14 | module snippets.viewers.Snippet001TableViewer; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import dwtx.jface.viewers.IStructuredContentProvider; |
|---|
| r89 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet002TreeViewer; |
|---|
| | 14 | module snippets.viewers.Snippet002TreeViewer; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import dwt.DWT; |
|---|
| … | … | |
| 29 | 29 | /** |
|---|
| 30 | 30 | * A simple TreeViewer to demonstrate usage |
|---|
| 31 | | * |
|---|
| | 31 | * |
|---|
| 32 | 32 | * @author Tom Schindl <tom.schindl@bestsolution.at> |
|---|
| 33 | 33 | * |
|---|
| … | … | |
| 35 | 35 | class Snippet002TreeViewer { |
|---|
| 36 | 36 | private class MyContentProvider : ITreeContentProvider { |
|---|
| 37 | | |
|---|
| | 37 | |
|---|
| 38 | 38 | /* (non-Javadoc) |
|---|
| 39 | 39 | * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) |
|---|
| … | … | |
| 47 | 47 | */ |
|---|
| 48 | 48 | public void dispose() { |
|---|
| 49 | | |
|---|
| | 49 | |
|---|
| 50 | 50 | } |
|---|
| 51 | 51 | |
|---|
| … | … | |
| 54 | 54 | */ |
|---|
| 55 | 55 | public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
|---|
| 56 | | |
|---|
| | 56 | |
|---|
| 57 | 57 | } |
|---|
| 58 | 58 | |
|---|
| … | … | |
| 71 | 71 | return null; |
|---|
| 72 | 72 | } |
|---|
| 73 | | |
|---|
| | 73 | |
|---|
| 74 | 74 | return (cast(MyModel)element).parent; |
|---|
| 75 | 75 | } |
|---|
| … | … | |
| 81 | 81 | return (cast(MyModel)element).child.length > 0; |
|---|
| 82 | 82 | } |
|---|
| 83 | | |
|---|
| | 83 | |
|---|
| 84 | 84 | } |
|---|
| 85 | | |
|---|
| | 85 | |
|---|
| 86 | 86 | public class MyModel { |
|---|
| 87 | 87 | public MyModel parent; |
|---|
| 88 | 88 | public MyModel[] child; |
|---|
| 89 | 89 | public int counter; |
|---|
| 90 | | |
|---|
| | 90 | |
|---|
| 91 | 91 | public this(int counter, MyModel parent) { |
|---|
| 92 | 92 | this.parent = parent; |
|---|
| 93 | 93 | this.counter = counter; |
|---|
| 94 | 94 | } |
|---|
| 95 | | |
|---|
| | 95 | |
|---|
| 96 | 96 | public String toString() { |
|---|
| 97 | 97 | String rv = "Item "; |
|---|
| … | … | |
| 99 | 99 | rv = parent.toString() ~ "."; |
|---|
| 100 | 100 | } |
|---|
| 101 | | |
|---|
| | 101 | |
|---|
| 102 | 102 | rv ~= to!(char[])(counter); |
|---|
| 103 | | |
|---|
| | 103 | |
|---|
| 104 | 104 | return rv; |
|---|
| 105 | 105 | } |
|---|
| 106 | 106 | } |
|---|
| 107 | | |
|---|
| | 107 | |
|---|
| 108 | 108 | public this(Shell shell) { |
|---|
| 109 | 109 | TreeViewer v = new TreeViewer(shell); |
|---|
| … | … | |
| 112 | 112 | v.setInput(createModel()); |
|---|
| 113 | 113 | } |
|---|
| 114 | | |
|---|
| | 114 | |
|---|
| 115 | 115 | private MyModel createModel() { |
|---|
| 116 | 116 | MyModel root = new MyModel(0,null); |
|---|
| 117 | 117 | root.counter = 0; |
|---|
| 118 | | |
|---|
| | 118 | |
|---|
| 119 | 119 | MyModel tmp; |
|---|
| 120 | 120 | for( int i = 1; i < 10; i++ ) { |
|---|
| … | … | |
| 125 | 125 | } |
|---|
| 126 | 126 | } |
|---|
| 127 | | |
|---|
| | 127 | |
|---|
| 128 | 128 | return root; |
|---|
| 129 | 129 | } |
|---|
| 130 | | |
|---|
| | 130 | |
|---|
| 131 | 131 | } |
|---|
| 132 | 132 | |
|---|
| … | … | |
| 138 | 138 | new Snippet002TreeViewer(shell); |
|---|
| 139 | 139 | shell.open (); |
|---|
| 140 | | |
|---|
| | 140 | |
|---|
| 141 | 141 | while (!shell.isDisposed ()) { |
|---|
| 142 | 142 | if (!display.readAndDispatch ()) display.sleep (); |
|---|
| 143 | 143 | } |
|---|
| 144 | | |
|---|
| | 144 | |
|---|
| 145 | 145 | display.dispose (); |
|---|
| 146 | 146 | } |
|---|
| r143 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet004HideSelection; |
|---|
| | 14 | module snippets.viewers.Snippet004HideSelection; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import dwtx.jface.viewers.IStructuredContentProvider; |
|---|
| r89 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet005TreeCustomMenu; |
|---|
| | 14 | module snippets.viewers.Snippet005TreeCustomMenu; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import dwtx.jface.action.Action; |
|---|
| … | … | |
| 35 | 35 | /** |
|---|
| 36 | 36 | * Customized context menu based on TreeItem-Selection |
|---|
| 37 | | * |
|---|
| | 37 | * |
|---|
| 38 | 38 | * @author Tom Schindl <tom.schindl@bestsolution.at> |
|---|
| 39 | 39 | * |
|---|
| r88 |
r145 |
|
| 11 | 11 | * yidabu at gmail dot com ( D China http://www.d-programming-language-china.org/ ) |
|---|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | | module jface.snippets.Snippet006TableMultiLineCells; |
|---|
| | 13 | module snippets.viewers.Snippet006TableMultiLineCells; |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | |
|---|
| r143 |
r145 |
|
| 10 | 10 | *******************************************************************************/ |
|---|
| 11 | 11 | |
|---|
| 12 | | module jface.snippets.Snippet007FullSelection; |
|---|
| | 12 | module snippets.viewers.Snippet007FullSelection; |
|---|
| 13 | 13 | |
|---|
| 14 | 14 | import dwtx.jface.viewers.CellEditor; |
|---|
| r97 |
r145 |
|
| 12 | 12 | * yidabu at gmail dot com ( D China http://www.d-programming-language-china.org/ ) |
|---|
| 13 | 13 | *******************************************************************************/ |
|---|
| 14 | | module jface.snippets.Snippet010OwnerDraw.d; |
|---|
| | 14 | module snippets.viewers.Snippet010OwnerDraw.d; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import dwtx.jface.resource.JFaceResources; |
|---|
| r143 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet014TreeViewerNoMandatoryLabelProvider; |
|---|
| | 14 | module snippets.viewers.Snippet014TreeViewerNoMandatoryLabelProvider; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | |
|---|
| r106 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet016TableLayout; |
|---|
| | 14 | module snippets.viewers.Snippet016TableLayout; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | |
|---|
| r143 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet026TreeViewerTabEditing; |
|---|
| | 14 | module snippets.viewers.Snippet026TreeViewerTabEditing; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | |
|---|
| r143 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet031TableViewerCustomTooltipsMultiSelection; |
|---|
| | 14 | module snippets.viewers.Snippet031TableViewerCustomTooltipsMultiSelection; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | // http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.java?view=markup |
|---|
| r88 |
r145 |
|
| 11 | 11 | * yidabu at gmail dot com ( D China http://www.d-programming-language-china.org/ ) |
|---|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | | module jface.snippets.Snippet040TableViewerSorting; |
|---|
| | 13 | module snippets.viewers.Snippet040TableViewerSorting; |
|---|
| 14 | 14 | |
|---|
| 15 | 15 | // http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet040TableViewerSorting.java?view=markup |
|---|
| r143 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module dwtx.jface.snippets.Snippet043NoColumnTreeViewerKeyboardEditing; |
|---|
| | 14 | module snippets.viewers.Snippet043NoColumnTreeViewerKeyboardEditing; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import dwtx.jface.viewers.CellEditor; |
|---|
| r143 |
r145 |
|
| 12 | 12 | *******************************************************************************/ |
|---|
| 13 | 13 | |
|---|
| 14 | | module jface.snippets.Snippet047VirtualLazyTreeViewer; |
|---|
| | 14 | module snippets.viewers.Snippet047VirtualLazyTreeViewer; |
|---|
| 15 | 15 | |
|---|
| 16 | 16 | import dwtx.jface.viewers.ILazyTreeContentProvider; |
|---|