JFace-Snippets are small easy understandable programming example how to use JFace API. You can find them in CVS [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/ JFace code snippets]:

+

JFace-Snippets are small easy understandable programming example how to use JFace API.

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 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 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]''

+

−

[[Image:Snippet3.png]]

+

Demonstrates (dynamic)layout support for TableColumns available as of JFace 3.3

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

+

−

[[Image:Snippet004.png]]

+

Demonstrates (dynamic)layout support for TreeColumns available as of JFace 3.3

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 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 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.

+

−

[[Image:Snippet007.png]]

+

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 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 minimal example when trying to add inline editing to tables to get familiar with the various classes needed (3.2 API)

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''.

+

−

[[Image:Snippet010.png]]

+

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 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 adding/removing of columns in conjunction with inline editing which makes this a bit tougher than without it (using 3.2 API)

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.

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).

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.

Example for full feature cell navigation in 3.3. This snippet uses internal API by reflection so its not guaranteed to work for ever. The problem of invisible cells is fixed in 3.4. The problem with horizontal scrolling is going to be fixed in 3.5.

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 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 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 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).

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.

Example for full feature cell navigation in 3.3. This snippet uses internal API by reflection so its not guaranteed to work for ever. The problem of invisible cells is fixed in 3.4. The problem with horizontal scrolling is going to be fixed in 3.5.