Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "JFaceSnippets"
(→Wizard) |
|||
(18 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
− | JFace-Snippets are small easy understandable programming example how to use JFace API. | + | JFace-Snippets are small easy understandable programming example how to use JFace API. To browse the examples, navigate to the [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets examples GIT repository]. |
− | + | == Dialogs == | |
− | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/dialogs/Snippet012DialogWithImageButtons.java Dialog with Image Buttons] === | |
− | ===[http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/dialogs/Snippet012DialogWithImageButtons.java | + | |
− | + | ||
− | + | Demonstrates usage of Icons in Buttons of Dialogs | |
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/layout/Snippet013GridLayoutFactory.java | + | == Layout == |
+ | |||
+ | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/layout/Snippet013GridLayoutFactory.java Grid Layout Factory] === | ||
Demonstrates usage of the GridLayoutFactory to make more readable | Demonstrates usage of the GridLayoutFactory to make more readable | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/layout/Snippet016TableLayout.java Snippet016TableLayout] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/layout/Snippet016TableLayout.java Snippet016TableLayout] === |
Demonstrates (dynamic)layout support for TableColumns available as of JFace 3.3 | Demonstrates (dynamic)layout support for TableColumns available as of JFace 3.3 | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/layout/Snippet027TreeLayout.java Snippet027TreeLayout] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/layout/Snippet027TreeLayout.java Snippet027TreeLayout] === |
− | Demonstrates (dynamic)layout support for TreeColumns available as of JFace 3.3 | + | Demonstrates (dynamic)layout support for TreeColumns available as of JFace 3.3 |
− | == Viewers == | + | == Viewers == |
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet001TableViewer.java Snippet001TableViewer] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet001TableViewer.java Snippet001TableViewer] === |
Demonstrates a simply TableViewer with one column. It holds all important classes used for all Table-like JFace-Viewers (''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/LabelProvider.html LabelProvider]'',''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/IStructuredContentProvider.html IStructuredContentProvider]'') | Demonstrates a simply TableViewer with one column. It holds all important classes used for all Table-like JFace-Viewers (''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/LabelProvider.html LabelProvider]'',''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/IStructuredContentProvider.html IStructuredContentProvider]'') | ||
Line 29: | Line 29: | ||
[[Image:Snippet1.png]] | [[Image:Snippet1.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet002TreeViewer.java Snippet002TreeViewer] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet002TreeViewer.java Snippet002TreeViewer] === |
Demonstrates a simply TreeViewer with one column. It describes all important classes used for all Tree-like JFace-Viewers (''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/LabelProvider.html LabelProvider]'',''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/ITreeContentProvider.html ITreeContentProvider]'') | Demonstrates a simply TreeViewer with one column. It describes all important classes used for all Tree-like JFace-Viewers (''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/LabelProvider.html LabelProvider]'',''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/ITreeContentProvider.html ITreeContentProvider]'') | ||
Line 35: | Line 35: | ||
[[Image:Snippet2.png]] | [[Image:Snippet2.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet003TableLabelProvider.java Snippet003TableLabelProvider] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet003TableLabelProvider.java Snippet003TableLabelProvider] === |
Demonstrates tables with more than one column and the usage of ''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/ITableLabelProvider.html ITableLabelProvider]'' | Demonstrates tables with more than one column and the usage of ''[http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/viewers/ITableLabelProvider.html ITableLabelProvider]'' | ||
Line 41: | Line 41: | ||
[[Image:Snippet3.png]] | [[Image:Snippet3.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet004HideSelection.java Snippet004HideSelection] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet004HideSelection.java Snippet004HideSelection] === |
Demonstrates how the selection can be hidden when the user click in a tablerow/column which doesn't hold any information. The standard behaviour of SWT-Table is to leave the selection on the last column. This snippet removes the selection if the user clicks in an area not selectable | Demonstrates how the selection can be hidden when the user click in a tablerow/column which doesn't hold any information. The standard behaviour of SWT-Table is to leave the selection on the last column. This snippet removes the selection if the user clicks in an area not selectable | ||
Line 47: | Line 47: | ||
[[Image:Snippet004.png]] | [[Image:Snippet004.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet005TreeCustomMenu.java Snippet005TreeCustomMenu] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet005TreeCustomMenu.java Snippet005TreeCustomMenu] === |
Demonstrates how to create a different context menu depending on which item in the tree is currently selected this can also be used with a table of course | Demonstrates how to create a different context menu depending on which item in the tree is currently selected this can also be used with a table of course | ||
Line 53: | Line 53: | ||
[[Image:Snippet005.png]] | [[Image:Snippet005.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet006TableMultiLineCells.java Snippet006TableMultiLineCells] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet006TableMultiLineCells.java Snippet006TableMultiLineCells] === |
Demonstrates first use case for the new OwnerDraw-Support added to JFace in 3.3 (available at SWT-Level since 3.2). This example uses the new Viewers API in this special case the ''OwnerDrawLabelProvider'' to make items with more than one line of text. | Demonstrates first use case for the new OwnerDraw-Support added to JFace in 3.3 (available at SWT-Level since 3.2). This example uses the new Viewers API in this special case the ''OwnerDrawLabelProvider'' to make items with more than one line of text. | ||
Line 59: | Line 59: | ||
[[Image:Snippet006.png]] | [[Image:Snippet006.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet007FullSelection.java Snippet007FullSelection] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet007FullSelection.java Snippet007FullSelection] === |
Demonstrates how you can use a use inline editing in tables with multiple columns which requires to use SWT.FULL_SELECTION but hiding the selection from the user. | Demonstrates how you can use a use inline editing in tables with multiple columns which requires to use SWT.FULL_SELECTION but hiding the selection from the user. | ||
Line 65: | Line 65: | ||
[[Image:Snippet007.png]] | [[Image:Snippet007.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet008RevealElement.java Snippet008RevealElement] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet008RevealElement.java Snippet008RevealElement] === |
Demonstrates how you can scroll a TableViewer to the specific model element using TableViewer#reveal(Object) | Demonstrates how you can scroll a TableViewer to the specific model element using TableViewer#reveal(Object) | ||
Line 71: | Line 71: | ||
[[Image:Snippet008.png]] | [[Image:Snippet008.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet009CellEditors.java Snippet009CellEditors] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet009CellEditors.java Snippet009CellEditors] === |
Demonstrates minimal example when trying to add inline editing to tables to get familiar with the various classes needed (3.2 API) | Demonstrates minimal example when trying to add inline editing to tables to get familiar with the various classes needed (3.2 API) | ||
Line 77: | Line 77: | ||
[[Image:Snippet009.png]] | [[Image:Snippet009.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet010OwnerDraw.java Snippet010OwnerDraw] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet010OwnerDraw.java Snippet010OwnerDraw] === |
Demonstrates usage of new OwnerDraw-Support feature provided by JFace in 3.3(available in SWT since 3.2). This example uses the new Viewers API in this special case the ''OwnerDrawLabelProvider''. | Demonstrates usage of new OwnerDraw-Support feature provided by JFace in 3.3(available in SWT since 3.2). This example uses the new Viewers API in this special case the ''OwnerDrawLabelProvider''. | ||
Line 83: | Line 83: | ||
[[Image:Snippet010.png]] | [[Image:Snippet010.png]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet011CustomTooltips.java Snippet011CustomTooltips] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet011CustomTooltips.java Snippet011CustomTooltips] === |
Demonstrates usage of new custom tooltip support in 3.3 used to provide a tooltip for each cell in TableViewer | Demonstrates usage of new custom tooltip support in 3.3 used to provide a tooltip for each cell in TableViewer | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet013TableViewerNoMandatoryLabelProvider.java Snippet013TableViewerNoMandatoryLabelProvider] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet013TableViewerNoMandatoryLabelProvider.java Snippet013TableViewerNoMandatoryLabelProvider] === |
Demonstrates usage of none mandatory LabelProviders in TableViewers to set colors and fonts with 3.2-API | Demonstrates usage of none mandatory LabelProviders in TableViewers to set colors and fonts with 3.2-API | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet014TreeViewerNoMandatoryLabelProvider.java Snippet014TreeViewerNoMandatoryLabelProvider] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet014TreeViewerNoMandatoryLabelProvider.java Snippet014TreeViewerNoMandatoryLabelProvider] === |
Demonstrates usage of none mandatory LabelProviders in TreeViewers to set colors and font with 3.2-API | Demonstrates usage of none mandatory LabelProviders in TreeViewers to set colors and font with 3.2-API | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet015CustomTooltipsForTree.java Snippet015CustomTooltipsForTree] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet015CustomTooltipsForTree.java Snippet015CustomTooltipsForTree] === |
Demonstrates usage of new custom tooltip support in 3.3 used to provide a tooltip for each cell in a TreeViewer | Demonstrates usage of new custom tooltip support in 3.3 used to provide a tooltip for each cell in a TreeViewer | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet017TableViewerHideShowColumns.java Snippet017TableViewerHideShowColumns] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet017TableViewerHideShowColumns.java Snippet017TableViewerHideShowColumns] === |
Demonstrates hiding and showing of columns (animated) | Demonstrates hiding and showing of columns (animated) | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet018TableViewerAddRemoveColumnsWithEditing.java Snippet018TableViewerAddRemoveColumnsWithEditing] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet018TableViewerAddRemoveColumnsWithEditing.java Snippet018TableViewerAddRemoveColumnsWithEditing] === |
Demonstrates adding/removing of columns in conjunction with inline editing which makes this a bit tougher than without it (using 3.2 API) | Demonstrates adding/removing of columns in conjunction with inline editing which makes this a bit tougher than without it (using 3.2 API) | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet019TableViewerAddRemoveColumnsWithEditingNewAPI.java Snippet019TableViewerAddRemoveColumnsWithEditingNewAPI] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet019TableViewerAddRemoveColumnsWithEditingNewAPI.java Snippet019TableViewerAddRemoveColumnsWithEditingNewAPI] === |
Demonstrates adding/removing of columns in conjunction with the inline editing but with the new JFace-API who makes this a much easier and less error prone | Demonstrates adding/removing of columns in conjunction with the inline editing but with the new JFace-API who makes this a much easier and less error prone | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet021CellEditorsOnDoubleClick.java Snippet021CellEditorsOnDoubleClick] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet021CellEditorsOnDoubleClick.java Snippet021CellEditorsOnDoubleClick] === |
Demonstrates editor activation on double-click with the 3.2 API which makes this fairly complex | Demonstrates editor activation on double-click with the 3.2 API which makes this fairly complex | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet022TableViewerRefreshNoScroll.java Snippet022TableViewerRefreshNoScroll] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet022TableViewerRefreshNoScroll.java Snippet022TableViewerRefreshNoScroll] === |
Demonstrates how to refresh and viewer without scrolling the selection into after the refresh with 3.2 API. In 3.3 a special refresh-API for TableViewers is added. | Demonstrates how to refresh and viewer without scrolling the selection into after the refresh with 3.2 API. In 3.3 a special refresh-API for TableViewers is added. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet024TableViewerExploreNewAPI.java Snippet024TableViewerExploreNewAPI] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet024TableViewerExploreNewAPI.java Snippet024TableViewerExploreNewAPI] === |
Demonstrates the base classes of 3.3 API | Demonstrates the base classes of 3.3 API | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet025TabEditing.java Snippet025TabEditing] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet025TabEditing.java Snippet025TabEditing] === |
Demonstrates how one can use the new 3.3 API to add tab-editing support to your viewer | Demonstrates how one can use the new 3.3 API to add tab-editing support to your viewer | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet026TreeViewerTabEditing.java Snippet026TreeViewerTabEditing] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet026TreeViewerTabEditing.java Snippet026TreeViewerTabEditing] === |
Demonstrates all fancy things one can do with new 3.3 API (Tab-Editing, Keyboard-Navigation from Cell to Cell, Editor-Activation with the Keyboard) | Demonstrates all fancy things one can do with new 3.3 API (Tab-Editing, Keyboard-Navigation from Cell to Cell, Editor-Activation with the Keyboard) | ||
Line 133: | Line 133: | ||
[[Image:Snippet026TreeViewerTabEditing.gif]] | [[Image:Snippet026TreeViewerTabEditing.gif]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet027ComboBoxCellEditors.java Snippet027ComboBoxCellEditors] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet027ComboBoxCellEditors.java Snippet027ComboBoxCellEditors] === |
Demonstrates usage of the ComboBoxCellEditor in JFace-Viewers | Demonstrates usage of the ComboBoxCellEditor in JFace-Viewers | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet029VirtualTableViewer.java Snippet029VirtualTableViewer] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet029VirtualTableViewer.java Snippet029VirtualTableViewer] === |
Demonstrates usage of JFace-Viewers in virtual mode with an ordinary content provider (often the bottel neck is not the model but the UI). Using this Virtual viewers in conjunction with an ordinary content provider has the advantage that Sorting and Filtering is supported in 3.3. | Demonstrates usage of JFace-Viewers in virtual mode with an ordinary content provider (often the bottel neck is not the model but the UI). Using this Virtual viewers in conjunction with an ordinary content provider has the advantage that Sorting and Filtering is supported in 3.3. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet030VirtualLazyTableViewer.java Snippet030VirtualLazyTableViewer] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet030VirtualLazyTableViewer.java Snippet030VirtualLazyTableViewer] === |
Demonstrates usage of JFace-Viewer virtual mode with a lazy content provider | Demonstrates usage of JFace-Viewer virtual mode with a lazy content provider | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.java Snippet031TableViewerCustomTooltipsMultiSelection] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet031TableViewerCustomTooltipsMultiSelection.java Snippet031TableViewerCustomTooltipsMultiSelection] === |
Demonstrates creation of tooltips for cells for pre 3.3 users | Demonstrates creation of tooltips for cells for pre 3.3 users | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/ | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet034CellEditorPerRow.java Snippet034CellEditorPerRowNewAPI] === |
− | Demonstrates | + | Demonstrates different CellEditor-Types in one COLUMN of JFace-Viewers |
− | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet035TableCursorCellHighlighter.java Snippet035TableCursorCellHighlighter] === | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet035TableCursorCellHighlighter.java Snippet035TableCursorCellHighlighter] === | + | |
Demonstrates keyboard navigation in TableViewers using a TableCursor showing the flexibility of the new cell navigation support | Demonstrates keyboard navigation in TableViewers using a TableCursor showing the flexibility of the new cell navigation support | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet036FocusBorderCellHighlighter.java Snippet036FocusBorderCellHighlighter] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet036FocusBorderCellHighlighter.java Snippet036FocusBorderCellHighlighter] === |
Demonstrates keyboard navigation by highlighting the currently selected cell with a focus border showing once more the flexibility of the new cell navigation support | Demonstrates keyboard navigation by highlighting the currently selected cell with a focus border showing once more the flexibility of the new cell navigation support | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet037FancyCustomTooltips.java Snippet037FancyCustomTooltips] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet037FancyCustomTooltips.java Snippet037FancyCustomTooltips] === |
Demonstrates customizability of the 3.3 JFace-Support for cell tooltips using the Browser-Widget and presenting HTML | Demonstrates customizability of the 3.3 JFace-Support for cell tooltips using the Browser-Widget and presenting HTML | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet038TreeViewerInlinelEditingOldAPI.java Snippet038TreeViewerInlinelEditingOldAPI] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet038TreeViewerInlinelEditingOldAPI.java Snippet038TreeViewerInlinelEditingOldAPI] === |
Demonstrates editing support as of 3.2 for TreeViewers | Demonstrates editing support as of 3.2 for TreeViewers | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet039ListViewer.java Snippet039ListViewer] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet039ListViewer.java Snippet039ListViewer] === |
Demonstrates a very simple usage of ListViewer | Demonstrates a very simple usage of ListViewer | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet040TableViewerSorting.java Snippet040TableViewerSorting] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet040TableViewerSorting.java Snippet040TableViewerSorting] === |
Demonstrates sorting(asc/desc) in TableViewers by clicking the column header. This snippet uses classes from JFace 3.3 but can be easily adopted to work with JFace from 3.2 | Demonstrates sorting(asc/desc) in TableViewers by clicking the column header. This snippet uses classes from JFace 3.3 but can be easily adopted to work with JFace from 3.2 | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet041TableViewerAlternatingColors.java Snippet041TableViewerAlternatingColors] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet041TableViewerAlternatingColors.java Snippet041TableViewerAlternatingColors] === |
Demonstrates how to achieve alternating row-colors with TableViewer and the new JFace 3.3 API which allows for faster algorithms and can be used in conjunction with virtual-bits to even work with big tables (e.g. 100,000 rows in this example). | Demonstrates how to achieve alternating row-colors with TableViewer and the new JFace 3.3 API which allows for faster algorithms and can be used in conjunction with virtual-bits to even work with big tables (e.g. 100,000 rows in this example). | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet042ToolTipSupportFor32API.java Snippet042ToolTipSupportFor32API] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet042ToolTipSupportFor32API.java Snippet042ToolTipSupportFor32API] === |
Because ColumnViewerToolTipSupport forces one to use the new 3.3 CellLabelProvider-API it is of no use for people stuck with the old LabelProvider API. This snippet shows how a potential class for 3.2 API could look like. | Because ColumnViewerToolTipSupport forces one to use the new 3.3 CellLabelProvider-API it is of no use for people stuck with the old LabelProvider API. This snippet shows how a potential class for 3.2 API could look like. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet043NoColumnTreeViewerKeyboardEditing.java Snippet043NoColumnTreeViewerKeyboardEditing] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet043NoColumnTreeViewerKeyboardEditing.java Snippet043NoColumnTreeViewerKeyboardEditing] === |
Demonstrates the JFace 3.3 keyboard editing support for Trees without columns. Tabbing from editor to editor is supported since 3.4. | Demonstrates the JFace 3.3 keyboard editing support for Trees without columns. Tabbing from editor to editor is supported since 3.4. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet044NoColumnTableViewerKeyboardEditing.java Snippet044NoColumnTableViewerKeyboardEditing] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet044NoColumnTableViewerKeyboardEditing.java Snippet044NoColumnTableViewerKeyboardEditing] === |
Demonstrates the JFace 3.3 keyboard editing support for Tables without columns. Tabbing from editor to editor is supported since 3.4. | Demonstrates the JFace 3.3 keyboard editing support for Tables without columns. Tabbing from editor to editor is supported since 3.4. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet045TableViewerFillFromBackgroundThread.java Snippet045TableViewerFillFromBackgroundThread] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet045TableViewerFillFromBackgroundThread.java Snippet045TableViewerFillFromBackgroundThread] === |
Demonstrates how a TableViewer with a sorter can be filled from a NON-UI thread | Demonstrates how a TableViewer with a sorter can be filled from a NON-UI thread | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet046UpdateViewerFromBackgroundThread.java Snippet046UpdateViewerFromBackgroundThread] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet046UpdateViewerFromBackgroundThread.java Snippet046UpdateViewerFromBackgroundThread] === |
Demonstrates how to update a viewer from a long running task (which is executed in a thread) and calls back to the UI-Thread using asyncExec | Demonstrates how to update a viewer from a long running task (which is executed in a thread) and calls back to the UI-Thread using asyncExec | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java Snippet047VirtualLazyTreeViewer] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java Snippet047VirtualLazyTreeViewer] === |
Demonstrates the usage of ILazyContentProvider in conjunction with a Virtual-TreeViewer | Demonstrates the usage of ILazyContentProvider in conjunction with a Virtual-TreeViewer | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet048TreeViewerTabWithCheckboxFor3_3.java Snippet048TreeViewerTabWithCheckboxFor3_3] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet048TreeViewerTabWithCheckboxFor3_3.java Snippet048TreeViewerTabWithCheckboxFor3_3] === |
Demonstrates how to overcome a limitation when it comes to key-navigation and CheckBoxEditors in 3.3.1. | Demonstrates how to overcome a limitation when it comes to key-navigation and CheckBoxEditors in 3.3.1. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java Snippet049StyledCellLabelProvider] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java Snippet049StyledCellLabelProvider] === |
Demonstrates a new LabelProvider-Type which uses StyleRanges. This Snippet requires SWT/JFace 3.4. | Demonstrates a new LabelProvider-Type which uses StyleRanges. This Snippet requires SWT/JFace 3.4. | ||
Line 225: | Line 215: | ||
[[Image:Snippet050DelegatingStyledCellLabelProvider.gif]] | [[Image:Snippet050DelegatingStyledCellLabelProvider.gif]] | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java Snippet050DelegatingStyledCellLabelProvider] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet050DelegatingStyledCellLabelProvider.java Snippet050DelegatingStyledCellLabelProvider] === |
Demonstrates how you can add styled text by wrapping an existing label provider. This Snippet requires SWT/JFace 3.4. | Demonstrates how you can add styled text by wrapping an existing label provider. This Snippet requires SWT/JFace 3.4. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet051TableCenteredImage.java Snippet051TableCenteredImage] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet051TableCenteredImage.java Snippet051TableCenteredImage] === |
Demonstrate how to center an image using owner draw. This snippet requires SWT/JFace 3.3. | Demonstrate how to center an image using owner draw. This snippet requires SWT/JFace 3.3. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/ | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet052DoubleClickCellEditor.java Snippet052DoubleClickCellEditor] === |
− | Demonstrate how to start cell-editors on double click. This snippet requires SWT/JFace 3.3 | + | Demonstrate how to start cell-editors on double click. This snippet requires SWT/JFace 3.3 |
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet053StartEditorWithContextMenu.java Snippet053StartEditorWithContextMenu] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet053StartEditorWithContextMenu.java Snippet053StartEditorWithContextMenu] === |
Demonstrate how to start up an editor with a context menu and not with mouse clicking on the cell. | Demonstrate how to start up an editor with a context menu and not with mouse clicking on the cell. | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet055HideShowColumn.java Snippet055HideShowColumn] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet055HideShowColumn.java Snippet055HideShowColumn] === |
Demonstrate hiding and showing columns | Demonstrate hiding and showing columns | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet056BooleanCellEditor.java Snippet056BooleanCellEditor] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet056BooleanCellEditor.java Snippet056BooleanCellEditor] === |
Demonstrate a custom cell-editor which uses a real Checkbox-Button | Demonstrate a custom cell-editor which uses a real Checkbox-Button | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet057TableViewerSkipHiddenCells.java Snippet057TableViewerSkipHiddenCells] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet057TableViewerSkipHiddenCells.java Snippet057TableViewerSkipHiddenCells] === |
Example of showing how easy cell-navigation with hidden cells is in 3.4 | Example of showing how easy cell-navigation with hidden cells is in 3.4 | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet058CellNavigationIn34.java Snippet058CellNavigationIn34] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet058CellNavigationIn34.java Snippet058CellNavigationIn34] === |
Example for full feature cell navigation until bug 230955 is fixed | Example for full feature cell navigation until bug 230955 is fixed | ||
− | |||
− | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet060TextCellEditorWithContentProposal.java Snippet060TextCellEditorWithContentProposal] === | |
− | + | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet060TextCellEditorWithContentProposal.java Snippet060TextCellEditorWithContentProposal] === | + | |
Show how to use content-proposal inside a CellEditor | Show how to use content-proposal inside a CellEditor | ||
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet061FakedNativeCellEditor.java Snippet061FakedNativeCellEditor] === | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet061FakedNativeCellEditor.java Snippet061FakedNativeCellEditor] === |
− | Full featured native looking viewer with checkboxes in an arbitary column | + | Full featured native looking viewer with checkboxes in an arbitary column |
− | == | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet062TextAndDialogCellEditor.java Snippet062TextAndDialogCellEditor] === |
− | + | Demonstrates usage of TextAndDialogCellEditor. The email column uses the TextAndDialogCellEditor; othe columns use ordinary TextCellEditor. | |
− | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet063ComboViewer.java Snippet063ComboViewer] === | |
− | + | Show how to use ComboViewer and set a inital selection | |
− | + | == Window == | |
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/window/ | + | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/window/Snippet020CustomizedControlTooltips.java Snippet020CustomizedControlTooltips] === |
+ | |||
+ | Demonstrates usage of new JFace 3.3 to show really cool ToolTips for your controls | ||
+ | |||
+ | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/window/Snippet031TableStaticTooltip.java Snippet031TableStaticTooltip] === | ||
Demonstrates creation of ToolTips for Tables without using the JFace-Viewers API but only JFace-Tooltips | Demonstrates creation of ToolTips for Tables without using the JFace-Viewers API but only JFace-Tooltips | ||
− | ==Wizard== | + | == Wizard == |
− | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.java | + | |
+ | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/wizard/Snippet047WizardWithLongRunningOperation.java Wizard with Long Running Operation from Page] === | ||
Demonstrates how to work with JFace-Wizards and fill a TableViewer from a Background-Thread without blocking the UI showing a progress bar in the meanwhile | Demonstrates how to work with JFace-Wizards and fill a TableViewer from a Background-Thread without blocking the UI showing a progress bar in the meanwhile | ||
+ | |||
+ | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/wizard/Snippet071WizardWithProgressAndCancel.java Wizard with Progress and Cancel] === | ||
+ | |||
+ | Demonstrates a wizard with internal progress. | ||
+ | |||
+ | === [http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/wizard/Snippet072WizardWithProgressSubtasksAndCancel.java Wizard with Progress Subtasks and Cancel] === | ||
+ | |||
+ | Demonstrates a wizard with internal progress using SubMonitor and subtasks. | ||
+ | |||
[[Category:Snippets]] [[Category:RCP]] [[Category:Platform_UI]] | [[Category:Snippets]] [[Category:RCP]] [[Category:Platform_UI]] |
Revision as of 20:00, 4 November 2016
JFace-Snippets are small easy understandable programming example how to use JFace API. To browse the examples, navigate to the examples GIT repository.
Contents
- 1 Dialogs
- 2 Layout
- 3 Viewers
- 3.1 Snippet001TableViewer
- 3.2 Snippet002TreeViewer
- 3.3 Snippet003TableLabelProvider
- 3.4 Snippet004HideSelection
- 3.5 Snippet005TreeCustomMenu
- 3.6 Snippet006TableMultiLineCells
- 3.7 Snippet007FullSelection
- 3.8 Snippet008RevealElement
- 3.9 Snippet009CellEditors
- 3.10 Snippet010OwnerDraw
- 3.11 Snippet011CustomTooltips
- 3.12 Snippet013TableViewerNoMandatoryLabelProvider
- 3.13 Snippet014TreeViewerNoMandatoryLabelProvider
- 3.14 Snippet015CustomTooltipsForTree
- 3.15 Snippet017TableViewerHideShowColumns
- 3.16 Snippet018TableViewerAddRemoveColumnsWithEditing
- 3.17 Snippet019TableViewerAddRemoveColumnsWithEditingNewAPI
- 3.18 Snippet021CellEditorsOnDoubleClick
- 3.19 Snippet022TableViewerRefreshNoScroll
- 3.20 Snippet024TableViewerExploreNewAPI
- 3.21 Snippet025TabEditing
- 3.22 Snippet026TreeViewerTabEditing
- 3.23 Snippet027ComboBoxCellEditors
- 3.24 Snippet029VirtualTableViewer
- 3.25 Snippet030VirtualLazyTableViewer
- 3.26 Snippet031TableViewerCustomTooltipsMultiSelection
- 3.27 Snippet034CellEditorPerRowNewAPI
- 3.28 Snippet035TableCursorCellHighlighter
- 3.29 Snippet036FocusBorderCellHighlighter
- 3.30 Snippet037FancyCustomTooltips
- 3.31 Snippet038TreeViewerInlinelEditingOldAPI
- 3.32 Snippet039ListViewer
- 3.33 Snippet040TableViewerSorting
- 3.34 Snippet041TableViewerAlternatingColors
- 3.35 Snippet042ToolTipSupportFor32API
- 3.36 Snippet043NoColumnTreeViewerKeyboardEditing
- 3.37 Snippet044NoColumnTableViewerKeyboardEditing
- 3.38 Snippet045TableViewerFillFromBackgroundThread
- 3.39 Snippet046UpdateViewerFromBackgroundThread
- 3.40 Snippet047VirtualLazyTreeViewer
- 3.41 Snippet048TreeViewerTabWithCheckboxFor3_3
- 3.42 Snippet049StyledCellLabelProvider
- 3.43 Snippet050DelegatingStyledCellLabelProvider
- 3.44 Snippet051TableCenteredImage
- 3.45 Snippet052DoubleClickCellEditor
- 3.46 Snippet053StartEditorWithContextMenu
- 3.47 Snippet055HideShowColumn
- 3.48 Snippet056BooleanCellEditor
- 3.49 Snippet057TableViewerSkipHiddenCells
- 3.50 Snippet058CellNavigationIn34
- 3.51 Snippet060TextCellEditorWithContentProposal
- 3.52 Snippet061FakedNativeCellEditor
- 3.53 Snippet062TextAndDialogCellEditor
- 3.54 Snippet063ComboViewer
- 4 Window
- 5 Wizard
Dialogs
Dialog with Image Buttons
Demonstrates usage of Icons in Buttons of Dialogs
Layout
Grid Layout Factory
Demonstrates usage of the GridLayoutFactory to make more readable
Snippet016TableLayout
Demonstrates (dynamic)layout support for TableColumns available as of JFace 3.3
Snippet027TreeLayout
Demonstrates (dynamic)layout support for TreeColumns available as of JFace 3.3
Viewers
Snippet001TableViewer
Demonstrates a simply TableViewer with one column. It holds all important classes used for all Table-like JFace-Viewers (LabelProvider,IStructuredContentProvider)
Snippet002TreeViewer
Demonstrates a simply TreeViewer with one column. It describes all important classes used for all Tree-like JFace-Viewers (LabelProvider,ITreeContentProvider)
Snippet003TableLabelProvider
Demonstrates tables with more than one column and the usage of ITableLabelProvider
Snippet004HideSelection
Demonstrates how the selection can be hidden when the user click in a tablerow/column which doesn't hold any information. The standard behaviour of SWT-Table is to leave the selection on the last column. This snippet removes the selection if the user clicks in an area not selectable
Snippet005TreeCustomMenu
Demonstrates how to create a different context menu depending on which item in the tree is currently selected this can also be used with a table of course
Snippet006TableMultiLineCells
Demonstrates first use case for the new OwnerDraw-Support added to JFace in 3.3 (available at SWT-Level since 3.2). This example uses the new Viewers API in this special case the OwnerDrawLabelProvider to make items with more than one line of text.
Snippet007FullSelection
Demonstrates how you can use a use inline editing in tables with multiple columns which requires to use SWT.FULL_SELECTION but hiding the selection from the user.
Snippet008RevealElement
Demonstrates how you can scroll a TableViewer to the specific model element using TableViewer#reveal(Object)
Snippet009CellEditors
Demonstrates minimal example when trying to add inline editing to tables to get familiar with the various classes needed (3.2 API)
Snippet010OwnerDraw
Demonstrates usage of new OwnerDraw-Support feature provided by JFace in 3.3(available in SWT since 3.2). This example uses the new Viewers API in this special case the OwnerDrawLabelProvider.
Snippet011CustomTooltips
Demonstrates usage of new custom tooltip support in 3.3 used to provide a tooltip for each cell in TableViewer
Snippet013TableViewerNoMandatoryLabelProvider
Demonstrates usage of none mandatory LabelProviders in TableViewers to set colors and fonts with 3.2-API
Snippet014TreeViewerNoMandatoryLabelProvider
Demonstrates usage of none mandatory LabelProviders in TreeViewers to set colors and font with 3.2-API
Snippet015CustomTooltipsForTree
Demonstrates usage of new custom tooltip support in 3.3 used to provide a tooltip for each cell in a TreeViewer
Snippet017TableViewerHideShowColumns
Demonstrates hiding and showing of columns (animated)
Snippet018TableViewerAddRemoveColumnsWithEditing
Demonstrates adding/removing of columns in conjunction with inline editing which makes this a bit tougher than without it (using 3.2 API)
Snippet019TableViewerAddRemoveColumnsWithEditingNewAPI
Demonstrates adding/removing of columns in conjunction with the inline editing but with the new JFace-API who makes this a much easier and less error prone
Snippet021CellEditorsOnDoubleClick
Demonstrates editor activation on double-click with the 3.2 API which makes this fairly complex
Snippet022TableViewerRefreshNoScroll
Demonstrates how to refresh and viewer without scrolling the selection into after the refresh with 3.2 API. In 3.3 a special refresh-API for TableViewers is added.
Snippet024TableViewerExploreNewAPI
Demonstrates the base classes of 3.3 API
Snippet025TabEditing
Demonstrates how one can use the new 3.3 API to add tab-editing support to your viewer
Snippet026TreeViewerTabEditing
Demonstrates all fancy things one can do with new 3.3 API (Tab-Editing, Keyboard-Navigation from Cell to Cell, Editor-Activation with the Keyboard)
Snippet027ComboBoxCellEditors
Demonstrates usage of the ComboBoxCellEditor in JFace-Viewers
Snippet029VirtualTableViewer
Demonstrates usage of JFace-Viewers in virtual mode with an ordinary content provider (often the bottel neck is not the model but the UI). Using this Virtual viewers in conjunction with an ordinary content provider has the advantage that Sorting and Filtering is supported in 3.3.
Snippet030VirtualLazyTableViewer
Demonstrates usage of JFace-Viewer virtual mode with a lazy content provider
Snippet031TableViewerCustomTooltipsMultiSelection
Demonstrates creation of tooltips for cells for pre 3.3 users
Snippet034CellEditorPerRowNewAPI
Demonstrates different CellEditor-Types in one COLUMN of JFace-Viewers
Snippet035TableCursorCellHighlighter
Demonstrates keyboard navigation in TableViewers using a TableCursor showing the flexibility of the new cell navigation support
Snippet036FocusBorderCellHighlighter
Demonstrates keyboard navigation by highlighting the currently selected cell with a focus border showing once more the flexibility of the new cell navigation support
Snippet037FancyCustomTooltips
Demonstrates customizability of the 3.3 JFace-Support for cell tooltips using the Browser-Widget and presenting HTML
Snippet038TreeViewerInlinelEditingOldAPI
Demonstrates editing support as of 3.2 for TreeViewers
Snippet039ListViewer
Demonstrates a very simple usage of ListViewer
Snippet040TableViewerSorting
Demonstrates sorting(asc/desc) in TableViewers by clicking the column header. This snippet uses classes from JFace 3.3 but can be easily adopted to work with JFace from 3.2
Snippet041TableViewerAlternatingColors
Demonstrates how to achieve alternating row-colors with TableViewer and the new JFace 3.3 API which allows for faster algorithms and can be used in conjunction with virtual-bits to even work with big tables (e.g. 100,000 rows in this example).
Snippet042ToolTipSupportFor32API
Because ColumnViewerToolTipSupport forces one to use the new 3.3 CellLabelProvider-API it is of no use for people stuck with the old LabelProvider API. This snippet shows how a potential class for 3.2 API could look like.
Snippet043NoColumnTreeViewerKeyboardEditing
Demonstrates the JFace 3.3 keyboard editing support for Trees without columns. Tabbing from editor to editor is supported since 3.4.
Snippet044NoColumnTableViewerKeyboardEditing
Demonstrates the JFace 3.3 keyboard editing support for Tables without columns. Tabbing from editor to editor is supported since 3.4.
Snippet045TableViewerFillFromBackgroundThread
Demonstrates how a TableViewer with a sorter can be filled from a NON-UI thread
Snippet046UpdateViewerFromBackgroundThread
Demonstrates how to update a viewer from a long running task (which is executed in a thread) and calls back to the UI-Thread using asyncExec
Snippet047VirtualLazyTreeViewer
Demonstrates the usage of ILazyContentProvider in conjunction with a Virtual-TreeViewer
Snippet048TreeViewerTabWithCheckboxFor3_3
Demonstrates how to overcome a limitation when it comes to key-navigation and CheckBoxEditors in 3.3.1.
Snippet049StyledCellLabelProvider
Demonstrates a new LabelProvider-Type which uses StyleRanges. This Snippet requires SWT/JFace 3.4.
Snippet050DelegatingStyledCellLabelProvider
Demonstrates how you can add styled text by wrapping an existing label provider. This Snippet requires SWT/JFace 3.4.
Snippet051TableCenteredImage
Demonstrate how to center an image using owner draw. This snippet requires SWT/JFace 3.3.
Snippet052DoubleClickCellEditor
Demonstrate how to start cell-editors on double click. This snippet requires SWT/JFace 3.3
Snippet053StartEditorWithContextMenu
Demonstrate how to start up an editor with a context menu and not with mouse clicking on the cell.
Snippet055HideShowColumn
Demonstrate hiding and showing columns
Snippet056BooleanCellEditor
Demonstrate a custom cell-editor which uses a real Checkbox-Button
Snippet057TableViewerSkipHiddenCells
Example of showing how easy cell-navigation with hidden cells is in 3.4
Example for full feature cell navigation until bug 230955 is fixed
Snippet060TextCellEditorWithContentProposal
Show how to use content-proposal inside a CellEditor
Snippet061FakedNativeCellEditor
Full featured native looking viewer with checkboxes in an arbitary column
Snippet062TextAndDialogCellEditor
Demonstrates usage of TextAndDialogCellEditor. The email column uses the TextAndDialogCellEditor; othe columns use ordinary TextCellEditor.
Snippet063ComboViewer
Show how to use ComboViewer and set a inital selection
Window
Snippet020CustomizedControlTooltips
Demonstrates usage of new JFace 3.3 to show really cool ToolTips for your controls
Snippet031TableStaticTooltip
Demonstrates creation of ToolTips for Tables without using the JFace-Viewers API but only JFace-Tooltips
Wizard
Wizard with Long Running Operation from Page
Demonstrates how to work with JFace-Wizards and fill a TableViewer from a Background-Thread without blocking the UI showing a progress bar in the meanwhile
Wizard with Progress and Cancel
Demonstrates a wizard with internal progress.
Wizard with Progress Subtasks and Cancel
Demonstrates a wizard with internal progress using SubMonitor and subtasks.