Java Doc for ContentViewer.java in  » IDE-Eclipse » jface » org » eclipse » jface » viewers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jface » org.eclipse.jface.viewers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.jface.viewers.Viewer
      org.eclipse.jface.viewers.ContentViewer

All known Subclasses:   org.eclipse.jface.viewers.StructuredViewer,
ContentViewer
abstract public class ContentViewer extends Viewer (Code)
A content viewer is a model-based adapter on a widget which accesses its model by means of a content provider and a label provider.

A viewer's model consists of elements, represented by objects. A viewer defines and implements generic infrastructure for handling model input, updates, and selections in terms of elements. Input is obtained by querying an IContentProvider which returns elements. The elements themselves are not displayed directly. They are mapped to labels, containing text and/or an image, using the viewer's ILabelProvider.

Implementing a concrete content viewer typically involves the following steps:

  • create SWT controls for viewer (in constructor) (optional)
  • initialize SWT controls from input (inputChanged)
  • define viewer-specific update methods
  • support selections (setSelection, getSelection)




Constructor Summary
protected  ContentViewer()
     Creates a content viewer with no input, no content provider, and a default label provider.

Method Summary
public  IContentProvidergetContentProvider()
     Returns the content provider used by this viewer, or null if this view does not yet have a content provider.

The ContentViewer implementation of this method returns the content provider recorded is an internal state variable.

public  ObjectgetInput()
     The ContentViewer implementation of this IInputProvider method returns the current input of this viewer, or null if none.
public  IBaseLabelProvidergetLabelProvider()
     Returns the label provider used by this viewer.
protected  voidhandleDispose(DisposeEvent event)
     Handles a dispose event on this viewer's control.
protected  voidhandleLabelProviderChanged(LabelProviderChangedEvent event)
     Handles a label provider changed event.

The ContentViewer implementation of this method calls labelProviderChanged() to cause a complete refresh of the viewer. Subclasses may reimplement or extend.

protected  voidhookControl(Control control)
     Adds event listener hooks to the given control.
protected  voidlabelProviderChanged()
     Notifies that the label provider has changed.
public  voidsetContentProvider(IContentProvider contentProvider)
     Sets the content provider used by this viewer.
public  voidsetInput(Object input)
     The ContentViewer implementation of this Viewer method invokes inputChanged on the content provider and then the inputChanged hook method.
public  voidsetLabelProvider(IBaseLabelProvider labelProvider)
     Sets the label provider for this viewer.


Constructor Detail
ContentViewer
protected ContentViewer()(Code)
Creates a content viewer with no input, no content provider, and a default label provider.




Method Detail
getContentProvider
public IContentProvider getContentProvider()(Code)
Returns the content provider used by this viewer, or null if this view does not yet have a content provider.

The ContentViewer implementation of this method returns the content provider recorded is an internal state variable. Overriding this method is generally not required; however, if overriding in a subclass, super.getContentProvider must be invoked.

the content provider, or null if none



getInput
public Object getInput()(Code)
The ContentViewer implementation of this IInputProvider method returns the current input of this viewer, or null if none. The viewer's input provides the "model" for the viewer's content.



getLabelProvider
public IBaseLabelProvider getLabelProvider()(Code)
Returns the label provider used by this viewer.

The ContentViewer implementation of this method returns the label provider recorded in an internal state variable; if none has been set (with setLabelProvider) a default label provider will be created, remembered, and returned. Overriding this method is generally not required; however, if overriding in a subclass, super.getLabelProvider must be invoked.

a label provider



handleDispose
protected void handleDispose(DisposeEvent event)(Code)
Handles a dispose event on this viewer's control.

The ContentViewer implementation of this method disposes of this viewer's label provider and content provider (if it has one). Subclasses should override this method to perform any additional cleanup of resources; however, overriding methods must invoke super.handleDispose.


Parameters:
  event - a dispose event



handleLabelProviderChanged
protected void handleLabelProviderChanged(LabelProviderChangedEvent event)(Code)
Handles a label provider changed event.

The ContentViewer implementation of this method calls labelProviderChanged() to cause a complete refresh of the viewer. Subclasses may reimplement or extend.


Parameters:
  event - the change event



hookControl
protected void hookControl(Control control)(Code)
Adds event listener hooks to the given control.

All subclasses must call this method when their control is first established.

The ContentViewer implementation of this method hooks dispose events for the given control. Subclasses may override if they need to add other control hooks; however, super.hookControl must be invoked.


Parameters:
  control - the control



labelProviderChanged
protected void labelProviderChanged()(Code)
Notifies that the label provider has changed.

The ContentViewer implementation of this method calls refresh(). Subclasses may reimplement or extend.




setContentProvider
public void setContentProvider(IContentProvider contentProvider)(Code)
Sets the content provider used by this viewer.

The ContentViewer implementation of this method records the content provider in an internal state variable. Overriding this method is generally not required; however, if overriding in a subclass, super.setContentProvider must be invoked.


Parameters:
  contentProvider - the content provider
See Also:   ContentViewer.getContentProvider



setInput
public void setInput(Object input)(Code)
The ContentViewer implementation of this Viewer method invokes inputChanged on the content provider and then the inputChanged hook method. This method fails if this viewer does not have a content provider. Subclassers are advised to override inputChanged rather than this method, but may extend this method if required.



setLabelProvider
public void setLabelProvider(IBaseLabelProvider labelProvider)(Code)
Sets the label provider for this viewer.

The ContentViewer implementation of this method ensures that the given label provider is connected to this viewer and the former label provider is disconnected from this viewer. Overriding this method is generally not required; however, if overriding in a subclass, super.setLabelProvider must be invoked.


Parameters:
  labelProvider - the label provider, or null if none



Fields inherited from org.eclipse.jface.viewers.Viewer
final protected static String WIDGET_DATA_KEY(Code)(Java Doc)

Methods inherited from org.eclipse.jface.viewers.Viewer
public void addHelpListener(HelpListener listener)(Code)(Java Doc)
public void addSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc)
protected void fireHelpRequested(HelpEvent event)(Code)(Java Doc)
protected void fireSelectionChanged(SelectionChangedEvent event)(Code)(Java Doc)
abstract public Control getControl()(Code)(Java Doc)
public Object getData(String key)(Code)(Java Doc)
abstract public Object getInput()(Code)(Java Doc)
abstract public ISelection getSelection()(Code)(Java Doc)
protected void handleHelpRequest(HelpEvent event)(Code)(Java Doc)
protected void inputChanged(Object input, Object oldInput)(Code)(Java Doc)
abstract public void refresh()(Code)(Java Doc)
public void removeHelpListener(HelpListener listener)(Code)(Java Doc)
public void removeSelectionChangedListener(ISelectionChangedListener listener)(Code)(Java Doc)
public Item scrollDown(int x, int y)(Code)(Java Doc)
public Item scrollUp(int x, int y)(Code)(Java Doc)
public void setData(String key, Object value)(Code)(Java Doc)
abstract public void setInput(Object input)(Code)(Java Doc)
public void setSelection(ISelection selection)(Code)(Java Doc)
abstract public void setSelection(ISelection selection, boolean reveal)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.