Java Doc for Viewer.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

All known Subclasses:   org.eclipse.jface.text.TextViewer,  org.eclipse.jface.viewers.ContentViewer,
Viewer
abstract public class Viewer implements IInputSelectionProvider(Code)
A viewer is a model-based adapter on a widget.

A viewer can be created as an adapter on a pre-existing control (e.g., creating a ListViewer on an existing List control). All viewers also provide a convenience constructor for creating the control.

Implementing a concrete 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)



Field Summary
final protected static  StringWIDGET_DATA_KEY
     Unique key for associating element data with widgets.

Constructor Summary
protected  Viewer()
     Creates a new viewer.

Method Summary
public  voidaddHelpListener(HelpListener listener)
     Adds a listener for help requests in this viewer.
public  voidaddSelectionChangedListener(ISelectionChangedListener listener)
    
protected  voidfireHelpRequested(HelpEvent event)
     Notifies any help listeners that help has been requested.
protected  voidfireSelectionChanged(SelectionChangedEvent event)
     Notifies any selection changed listeners that the viewer's selection has changed.
abstract public  ControlgetControl()
     Returns the primary control associated with this viewer.
public  ObjectgetData(String key)
     Returns the value of the property with the given name, or null if the property is not found.

The default implementation performs a (linear) search of an internal table.

abstract public  ObjectgetInput()
    
abstract public  ISelectiongetSelection()
    
protected  voidhandleHelpRequest(HelpEvent event)
     Handles a help request from the underlying SWT control.
protected  voidinputChanged(Object input, Object oldInput)
     Internal hook method called when the input to this viewer is initially set or subsequently changed.

The default implementation does nothing.

abstract public  voidrefresh()
     Refreshes this viewer completely with information freshly obtained from this viewer's model.
public  voidremoveHelpListener(HelpListener listener)
     Removes the given help listener from this viewer.
public  voidremoveSelectionChangedListener(ISelectionChangedListener listener)
    
public  ItemscrollDown(int x, int y)
     Scrolls the viewer's control down by one item from the given display-relative coordinates.
public  ItemscrollUp(int x, int y)
     Scrolls the viewer's control up by one item from the given display-relative coordinates.
public  voidsetData(String key, Object value)
     Sets the value of the property with the given name to the given value, or to null if the property is to be removed.
abstract public  voidsetInput(Object input)
     Sets or clears the input for this viewer.
public  voidsetSelection(ISelection selection)
     The viewer implementation of this ISelectionProvider method make the new selection for this viewer without making it visible.
abstract public  voidsetSelection(ISelection selection, boolean reveal)
     Sets a new selection for this viewer and optionally makes it visible.

Field Detail
WIDGET_DATA_KEY
final protected static String WIDGET_DATA_KEY(Code)
Unique key for associating element data with widgets.
See Also:   org.eclipse.swt.widgets.Widget.setData(StringObject)




Constructor Detail
Viewer
protected Viewer()(Code)
Creates a new viewer.




Method Detail
addHelpListener
public void addHelpListener(HelpListener listener)(Code)
Adds a listener for help requests in this viewer. Has no effect if an identical listener is already registered.
Parameters:
  listener - a help listener



addSelectionChangedListener
public void addSelectionChangedListener(ISelectionChangedListener listener)(Code)



fireHelpRequested
protected void fireHelpRequested(HelpEvent event)(Code)
Notifies any help listeners that help has been requested. Only listeners registered at the time this method is called are notified.
Parameters:
  event - a help event
See Also:   HelpListener.helpRequested(org.eclipse.swt.events.HelpEvent)



fireSelectionChanged
protected void fireSelectionChanged(SelectionChangedEvent event)(Code)
Notifies any selection changed listeners that the viewer's selection has changed. Only listeners registered at the time this method is called are notified.
Parameters:
  event - a selection changed event
See Also:   ISelectionChangedListener.selectionChanged



getControl
abstract public Control getControl()(Code)
Returns the primary control associated with this viewer. the SWT control which displays this viewer's content



getData
public Object getData(String key)(Code)
Returns the value of the property with the given name, or null if the property is not found.

The default implementation performs a (linear) search of an internal table. Overriding this method is generally not required if the number of different keys is small. If a more efficient representation of a viewer's properties is required, override both getData and setData.


Parameters:
  key - the property name the property value, or null ifthe property is not found



getInput
abstract public Object getInput()(Code)



getSelection
abstract public ISelection getSelection()(Code)



handleHelpRequest
protected void handleHelpRequest(HelpEvent event)(Code)
Handles a help request from the underlying SWT control. The default behavior is to fire a help request, with the event's data modified to hold this viewer.
Parameters:
  event - the event



inputChanged
protected void inputChanged(Object input, Object oldInput)(Code)
Internal hook method called when the input to this viewer is initially set or subsequently changed.

The default implementation does nothing. Subclassers may override this method to do something when a viewer's input is set. A typical use is populate the viewer.


Parameters:
  input - the new input of this viewer, or null if none
Parameters:
  oldInput - the old input element or null if therewas previously no input



refresh
abstract public void refresh()(Code)
Refreshes this viewer completely with information freshly obtained from this viewer's model.



removeHelpListener
public void removeHelpListener(HelpListener listener)(Code)
Removes the given help listener from this viewer. Has no affect if an identical listener is not registered.
Parameters:
  listener - a help listener



removeSelectionChangedListener
public void removeSelectionChangedListener(ISelectionChangedListener listener)(Code)



scrollDown
public Item scrollDown(int x, int y)(Code)
Scrolls the viewer's control down by one item from the given display-relative coordinates. Returns the newly revealed Item, or null if no scrolling occurred or if the viewer doesn't represent an item-based widget.
Parameters:
  x - horizontal coordinate
Parameters:
  y - vertical coordinate the item scrolled down to



scrollUp
public Item scrollUp(int x, int y)(Code)
Scrolls the viewer's control up by one item from the given display-relative coordinates. Returns the newly revealed Item, or null if no scrolling occurred or if the viewer doesn't represent an item-based widget.
Parameters:
  x - horizontal coordinate
Parameters:
  y - vertical coordinate the item scrolled up to



setData
public void setData(String key, Object value)(Code)
Sets the value of the property with the given name to the given value, or to null if the property is to be removed. If this viewer has such a property, its value is replaced; otherwise a new property is added.

The default implementation records properties in an internal table which is searched linearly. Overriding this method is generally not required if the number of different keys is small. If a more efficient representation of a viewer's properties is required, override both getData and setData.


Parameters:
  key - the property name
Parameters:
  value - the property value, or null ifthe property is not found



setInput
abstract public void setInput(Object input)(Code)
Sets or clears the input for this viewer.
Parameters:
  input - the input of this viewer, or null if none



setSelection
public void setSelection(ISelection selection)(Code)
The viewer implementation of this ISelectionProvider method make the new selection for this viewer without making it visible.

This method is equivalent to setSelection(selection,false).

Note that some implementations may not be able to set the selection without also revealing it, for example (as of 3.3) TreeViewer.




setSelection
abstract public void setSelection(ISelection selection, boolean reveal)(Code)
Sets a new selection for this viewer and optionally makes it visible.

Subclasses must implement this method.


Parameters:
  selection - the new selection
Parameters:
  reveal - true if the selection is to be madevisible, and false otherwise



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.