Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 17894 Details for
Bug 24694
[PropertiesView] Use factory method pattern in PropertySheetEntry (as in GEF)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to make PropertySheetEntry extensible
patch-24694-PropertySheetEntry.txt (text/plain), 4.46 KB, created by
Gunnar Wagenknecht
on 2005-02-12 04:55:55 EST
(
hide
)
Description:
Patch to make PropertySheetEntry extensible
Filename:
MIME Type:
Creator:
Gunnar Wagenknecht
Created:
2005-02-12 04:55:55 EST
Size:
4.46 KB
patch
obsolete
>Index: PropertySheetEntry.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetEntry.java,v >retrieving revision 1.11 >diff -u -r1.11 PropertySheetEntry.java >--- PropertySheetEntry.java 19 Aug 2004 20:37:02 -0000 1.11 >+++ PropertySheetEntry.java 12 Feb 2005 09:51:46 -0000 >@@ -232,12 +232,12 @@ > List descriptors = computeMergedPropertyDescriptors(); > > // rebuild child entries using old when possible >- childEntries = new PropertySheetEntry[descriptors.size()]; >- for (int i = 0; i < descriptors.size(); i++) { >+ childEntries = createChildEntriesArray(descriptors.size()); >+ for (int i = 0; i < descriptors.size(); i++) { > IPropertyDescriptor d = (IPropertyDescriptor) descriptors.get(i); > // create new entry >- PropertySheetEntry entry = new PropertySheetEntry(); >- entry.setDescriptor(d); >+ PropertySheetEntry entry = createChildEntry(); >+ entry.setDescriptor(d); > entry.setParent(this); > entry.setPropertySourceProvider(propertySourceProvider); > entry.refreshValues(); >@@ -245,6 +245,34 @@ > } > } > >+ /** >+ * Factory method to create a new array instance of >+ * <code>PropertySheetEntry</code>. >+ * <p> >+ * Subclasses may overwrite to create new array instance of their own class. >+ * </p> >+ * >+ * @param size >+ * @return a new array of <code>PropertySheetEntry</code> >+ */ >+ protected PropertySheetEntry[] createChildEntriesArray(int size) { >+ return new PropertySheetEntry[size]; >+ } >+ >+ /** >+ * Factory method to create a new child <code>PropertySheetEntry</code> >+ * instance. >+ * <p> >+ * Subclasses may overwrite to create new instances of their own class. >+ * </p> >+ * >+ * @return a new <code>PropertySheetEntry</code> instance for the >+ * descriptor passed in >+ */ >+ protected PropertySheetEntry createChildEntry() { >+ return new PropertySheetEntry(); >+ } >+ > /* (non-Javadoc) > * Method declared on IPropertySheetEntry. > */ >@@ -334,7 +362,7 @@ > * Returns the descriptor for this entry. > * @return IPropertyDescriptor > */ >- private IPropertyDescriptor getDescriptor() { >+ protected IPropertyDescriptor getDescriptor() { > return descriptor; > } > >@@ -411,13 +439,21 @@ > } > > /** >+ * Returns the parent of this entry. >+ * @return the parent entry >+ */ >+ protected PropertySheetEntry getParent() { >+ return parent; >+ } >+ >+ /** > * Returns an property source for the given object. > * > * @param object an object for which to obtain a property source or > * <code>null</code> if a property source is not available > * @return an property source for the given object > */ >- private IPropertySource getPropertySource(Object object) { >+ protected IPropertySource getPropertySource(Object object) { > if (sources.containsKey(object)) > return (IPropertySource) sources.get(object); > >@@ -453,7 +489,7 @@ > * Returns the value objects of this entry. > * @return Object[] > */ >- private Object[] getValues() { >+ public Object[] getValues() { > return values; > } > >@@ -492,7 +528,7 @@ > List entriesToDispose = new ArrayList(Arrays.asList(childEntries)); > > // rebuild child entries using old when possible >- childEntries = new PropertySheetEntry[descriptors.size()]; >+ childEntries = createChildEntriesArray(descriptors.size()); > boolean entriesChanged = descriptors.size() != entryCache.size(); > for (int i = 0; i < descriptors.size(); i++) { > IPropertyDescriptor d = (IPropertyDescriptor) descriptors.get(i); >@@ -505,7 +541,7 @@ > entriesToDispose.remove(entry); > } else { > // create new entry >- entry = new PropertySheetEntry(); >+ entry = createChildEntry(); > entry.setDescriptor(d); > entry.setParent(this); > entry.setPropertySourceProvider(propertySourceProvider); >@@ -527,7 +563,7 @@ > /** > * Refresh the entry tree from the root down > */ >- private void refreshFromRoot() { >+ protected void refreshFromRoot() { > if (parent == null) > refreshChildEntries(); > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24694
:
13944
|
17892
|
17893
| 17894