Java Doc for IPropertySource.java in  » IDE-Eclipse » ui » org » eclipse » ui » views » properties » 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 » ui » org.eclipse.ui.views.properties 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.eclipse.ui.views.properties.IPropertySource

All known Subclasses:   org.eclipse.ui.tests.views.properties.tabbed.dynamic.model.DynamicTestsElement,
IPropertySource
public interface IPropertySource (Code)
Interface to an object which is capable of supplying properties for display by the standard property sheet page implementation (PropertySheetPage).

This interface should be implemented by clients. PropertySheetPage discovers the properties to display from currently selected elements. Elements that implement IPropertySource directly are included, as are elements that implement IAdaptable and have an IPropertySource adapter. Clients should implement this interface for any newly-defined elements that are to have properties displayable by PropertySheetPage. Note that in the latter case, the client will also need to register a suitable adapter factory with the platform's adapter manager (Platform.getAdapterManager).


See Also:   org.eclipse.core.runtime.IAdaptable
See Also:   org.eclipse.core.runtime.Platform.getAdapterManager
See Also:   org.eclipse.ui.views.properties.PropertySheetPage
See Also:   org.eclipse.ui.views.properties.IPropertySource2




Method Summary
public  ObjectgetEditableValue()
     Returns a value for this property source that can be edited in a property sheet.

This value is used when this IPropertySource is appearing in the property sheet as the value of a property of some other IPropertySource

This value is passed as the input to a cell editor opening on an IPropertySource.

This value is also used when an IPropertySource is being used as the value in a setPropertyValue message.

public  IPropertyDescriptor[]getPropertyDescriptors()
     Returns the list of property descriptors for this property source.
public  ObjectgetPropertyValue(Object id)
     Returns the value of the property with the given id if it has one.
public  booleanisPropertySet(Object id)
     Returns whether the value of the property with the given id has changed from its default value.
public  voidresetPropertyValue(Object id)
     Resets the property with the given id to its default value if possible.
public  voidsetPropertyValue(Object id, Object value)
     Sets the property with the given id if possible.



Method Detail
getEditableValue
public Object getEditableValue()(Code)
Returns a value for this property source that can be edited in a property sheet.

This value is used when this IPropertySource is appearing in the property sheet as the value of a property of some other IPropertySource

This value is passed as the input to a cell editor opening on an IPropertySource.

This value is also used when an IPropertySource is being used as the value in a setPropertyValue message. The reciever of the message would then typically use the editable value to update the original property source or construct a new instance.

For example an email address which is a property source may have an editable value which is a string so that it can be edited in a text cell editor. The email address would also have a constructor or setter that takes the edited string so that an appropriate instance can be created or the original instance modified when the edited value is set.

This behavior is important for another reason. When the property sheet is showing properties for more than one object (multiple selection), a property sheet entry will display and edit a single value (typically coming from the first selected object). After a property has been edited in a cell editor, the same value is set as the property value for all of the objects. This is fine for primitive types but otherwise all of the objects end up with a reference to the same value. Thus by creating an editable value and using it to update the state of the original property source object, one is able to edit several property source objects at once (multiple selection). a value that can be edited




getPropertyDescriptors
public IPropertyDescriptor[] getPropertyDescriptors()(Code)
Returns the list of property descriptors for this property source. The getPropertyValue and setPropertyValue methods are used to read and write the actual property values by specifying the property ids from these property descriptors.

Implementors should cache the descriptors as they will be asked for the descriptors with any edit/update. Since descriptors provide cell editors, returning the same descriptors if possible allows for efficient updating.

the property descriptors



getPropertyValue
public Object getPropertyValue(Object id)(Code)
Returns the value of the property with the given id if it has one. Returns null if the property's value is null value or if this source does not have the specified property.
See Also:   IPropertySource.setPropertyValue
Parameters:
  id - the id of the property being set the value of the property, or null



isPropertySet
public boolean isPropertySet(Object id)(Code)
Returns whether the value of the property with the given id has changed from its default value. Returns false if this source does not have the specified property.

If the notion of default value is not meaningful for the specified property then false is returned.


Parameters:
  id - the id of the property true if the value of the specified property haschanged from its original default value, false ifthe specified property does not have a meaningful default value,and false if this source does not have thespecified property
See Also:   IPropertySource2.isPropertyResettable(Object)
See Also:   IPropertySource.resetPropertyValue(Object)



resetPropertyValue
public void resetPropertyValue(Object id)(Code)
Resets the property with the given id to its default value if possible.

Does nothing if the notion of a default value is not meaningful for the specified property, or if the property's value cannot be changed, or if this source does not have the specified property.

Callers will check if this IPropertySource implements IPropertySource2 and this method will only be called if IPropertySource2#isPropertyResettable(Object) returns true for the property with the given id.


Parameters:
  id - the id of the property being reset
See Also:   IPropertySource.isPropertySet(Object)
See Also:   IPropertySource2.isPropertyResettable(Object)



setPropertyValue
public void setPropertyValue(Object id, Object value)(Code)
Sets the property with the given id if possible. Does nothing if the property's value cannot be changed or if this source does not have the specified property.

In general, a property source should not directly reference the value parameter unless it is an atomic object that can be shared, such as a string.

An important reason for this is that several property sources with compatible descriptors could be appearing in the property sheet at the same time. An editor produces a single edited value which is passed as the value parameter of this message to all the property sources. Thus to avoid a situation where all of the property sources reference the same value they should use the value parameter to create a new instance of the real value for the given property.

There is another reason why a level of indirection is useful. The real value of property may be a type that cannot be edited with a standard cell editor. However instead of returning the real value in getPropertyValue, the value could be converted to a String which could be edited with a standard cell editor. The edited value will be passed to this method which can then turn it back into the real property value.

Another variation on returning a value other than the real property value in getPropertyValue is to return a value which is an IPropertySource (or for which the property sheet can obtain an IPropertySource). In this case the value to edit is obtained from the child property source using getEditableValue. It is this editable value that will be passed back via this method when it has been editted


See Also:   IPropertySource.getPropertyValue
See Also:   IPropertySource.getEditableValue
Parameters:
  id - the id of the property being set
Parameters:
  value - the new value for the property; null is allowed



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