Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "JFaceSnippets"

(Viewers)
(Viewers)
Line 20: Line 20:
  
 
[[Image:Snippet004.png]]
 
[[Image:Snippet004.png]]
 +
 +
===[http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet005TreeCustomMenu.java?view=markup 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
 +
 +
[[Image:Snippet005.png]]

Revision as of 19:52, 23 January 2007

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

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

Back to the top