Difference between revisions of "JFaceSnippets"

From Eclipsepedia

Jump to: navigation, search
(/* [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/window/Snippet020CustomizedControlTooltips.java?view=markup Snippet020Cust)
(/* [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/window/Snippet023TreeViewerCustomTooltips.java?view=markup Snippet023TreeV)
Line 149: Line 149:
 
Demonstrates creation of ToolTips for users pre 3.3.
 
Demonstrates creation of ToolTips for users pre 3.3.
  
===[http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/window/Snippet031TableStaticTooltip.java?view=markup Snippet031TableStaticTooltip.java]
+
===[http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/window/Snippet031TableStaticTooltip.java?view=markup Snippet031TableStaticTooltip.java]===
 
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
  
  
 
[[Category:Snippets]]
 
[[Category:Snippets]]

Revision as of 13:27, 21 June 2007

JFace-Snippets are small easy understandable programming example how to use JFace API. You can find them in CVS JFace code snippets:

Contents

Dialogs

Snippet012DialogWithImageButtons

Demonstrates usage of Icons in Buttons of Dialogs

Layout

Snippet013GridLayoutFactory

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

Snippet1.png

Snippet002TreeViewer

Demonstrates a simply TreeViewer with one column. It describes all important classes used for all Tree-like JFace-Viewers (LabelProvider,ITreeContentProvider)

Snippet2.png

Snippet003TableLabelProvider

Demonstrates tables with more than one column and the usage of ITableLabelProvider

File:Snippet3.png

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

Snippet004.png

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

Snippet005.png

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.

Snippet006.png

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.

Snippet007.png

Snippet008RevealElement

Demonstrates how you can scroll a TableViewer to the specific model element using TableViewer#reveal(Object)

Snippet008.png

Snippet009CellEditors

Demonstrates minimal example when trying to add inline editing to tables to get familiar with the various classes needed (3.2 API)

Snippet009.png

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.

Snippet010.png

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

Snippet032TableTreeViewer

Demonstrates a JFace-Viewer ontop of the old TableTree-Widget. DO NOT USE THIS VIEWER ANY MORE IT'S ONLY KEEP FOR BACKWARDS COMPILANCE USE TREEVIEWER instead

Snippet033CellEditorPerRowPre33

Demonstrates how one can handel different CellEditors-Types in one COLUMN before 3.3 and how difficult this has been.

Snippet034CellEditorPerRowNewAPI

Demonstrates different CellEditor-Types in one COLUMN with 3.3-API 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

Window

Snippet020CustomizedControlTooltips

Demonstrates usage of new JFace 3.3 to show really cool ToolTips for your controls

Snippet023TreeViewerCustomTooltips

Demonstrates creation of ToolTips for users pre 3.3.

Snippet031TableStaticTooltip.java

Demonstrates creation of ToolTips for Tables without using the JFace-Viewers API but only JFace-Tooltips