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 10225 Details for
Bug 21756
[PropertiesView] incorrect SetPropertyValueCommand#undo implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Proposed patch with fixed JavaDoc and new interface
org_eclipse_ui_views_fix_21756 .txt (text/plain), 16.33 KB, created by
Gunnar Wagenknecht
on 2004-05-03 13:24:46 EDT
(
hide
)
Description:
Proposed patch with fixed JavaDoc and new interface
Filename:
MIME Type:
Creator:
Gunnar Wagenknecht
Created:
2004-05-03 13:24:46 EDT
Size:
16.33 KB
patch
obsolete
>Index: src/org/eclipse/ui/views/properties/IPropertySheetEntry.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySheetEntry.java,v >retrieving revision 1.3 >diff -u -r1.3 IPropertySheetEntry.java >--- src/org/eclipse/ui/views/properties/IPropertySheetEntry.java 10 Mar 2003 22:09:05 -0000 1.3 >+++ src/org/eclipse/ui/views/properties/IPropertySheetEntry.java 3 May 2004 17:03:41 -0000 >@@ -13,135 +13,158 @@ > import org.eclipse.jface.viewers.CellEditor; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.widgets.Composite; >+ > /** > * <code>IPropertySheetEntry</code> describes the model interface for the > * property sheet. > * <p> >- * May be implemented when supplying a custom root entry >- * to a property page. >+ * May be implemented when supplying a custom root entry to a property page. > * </p> > */ > public interface IPropertySheetEntry { >- /** >- * The filter id for expert properties >- */ >- public String FILTER_ID_EXPERT = "org.eclipse.ui.views.properties.expert"; //$NON-NLS-1$ >-/** >- * Adds the given listener to this entry's collection >- * of listeners. >- * >- * @param listener the listener to add >- */ >-public void addPropertySheetEntryListener(IPropertySheetEntryListener listener); >-/** >- * Apply the current cell editor value. >- */ >-public void applyEditorValue(); >-/** >- * Called when the entry is no longer needed >- */ >-public void dispose(); >-/** >- * Returns the entry's category. >- * >- * @return the entry's category >- */ >-public String getCategory(); >-/** >- * Returns the child entries for this entry. >- * >- * @return the child entries for this entry >- */ >-public IPropertySheetEntry[] getChildEntries(); >-/** >- * Return a short description of the property sheet entry. >- * Typically this description is shown in a status line >- * when the entry is selected. >- * >- * @return the entry's description >- */ >-public String getDescription(); >-/** >- * Returns the name used to display the property. >- * >- * @return the name used to display the property >- */ >-public String getDisplayName(); >-/** >- * Return the <code>CellEditor</code> used to edit the property. >- * >- * @param parent the parent widget for the editor >- * @return the <code>CellEditor</code> used to edit the property >- */ >-CellEditor getEditor(Composite parent); >-/** >- * Returns the error text to display if the value is invalid. >- * >- * @return the error text to display when the value is invalid >- * or <code>null</code> >- */ >-public String getErrorText(); >-/** >- * Return the filter ids used to group entries into levels such as Expert. >- * Valid values are defined as constants on this interface. >- * >- * @return the filter ids used to group entries into levels such as Expert. >- */ >-public String[] getFilters(); >-/** >- * Returns the help context id for this entry, >- * or <code>null</code> if this entry has no help context id. >- * <p> >- * NOTE: Help support system API's changed since 2.0 and arrays >- * of contexts are no longer supported. >- * </p> >- * <p> >- * Thus the only valid non-<code>null</code> return type for this method >- * is a <code>String</code> representing a context id. The previously >- * valid return types are deprecated. The plural name for this method >- * is unfortunate. >- * </p> >- * >- * @return the help context id for this entry >- */ >-public Object getHelpContextIds(); >-/** >- * Returns the image for the property value, if there is one. >- * This image is managed by the entry it came from. Callers >- * of this method must never dispose the returned image. >- * >- * @return the image for this property value or <code>null</code> >- */ >-public Image getImage(); >-/** >- * Returns the value of the objects expressed as a String. >- * >- * @return the value of the objects expressed as a String >- */ >-public String getValueAsString(); >-/** >- * Returns <code>true</code> if the entry has children. >- * >- * @return <code>true</code> if the entry has children >- */ >-public boolean hasChildEntries(); >-/** >- * Removes the given listener from this entry's collection >- * of listeners. >- * >- * @param listener the listener to remove >- */ >-public void removePropertySheetEntryListener(IPropertySheetEntryListener listener); >-/** >- * Resets the property value to its default value if it has been changed. >- */ >-void resetPropertyValue(); >-/* >- * Sets the objects which represent the property values for >- * this entry. In the case of the root entry these objects >- * are the input to the viewer. >- * >- * @param values the values for this entry >- */ >-public void setValues(Object[] values); >-} >+ >+ /** >+ * The filter id for expert properties >+ */ >+ public String FILTER_ID_EXPERT = "org.eclipse.ui.views.properties.expert"; //$NON-NLS-1$ >+ >+ /** >+ * Adds the given listener to this entry's collection of listeners. >+ * >+ * @param listener >+ * the listener to add >+ */ >+ public void addPropertySheetEntryListener( >+ IPropertySheetEntryListener listener); >+ >+ /** >+ * Apply the current cell editor value. >+ */ >+ public void applyEditorValue(); >+ >+ /** >+ * Called when the entry is no longer needed >+ */ >+ public void dispose(); >+ >+ /** >+ * Returns the entry's category. >+ * >+ * @return the entry's category >+ */ >+ public String getCategory(); >+ >+ /** >+ * Returns the child entries for this entry. >+ * >+ * @return the child entries for this entry >+ */ >+ public IPropertySheetEntry[] getChildEntries(); >+ >+ /** >+ * Return a short description of the property sheet entry. Typically this >+ * description is shown in a status line when the entry is selected. >+ * >+ * @return the entry's description >+ */ >+ public String getDescription(); >+ >+ /** >+ * Returns the name used to display the property. >+ * >+ * @return the name used to display the property >+ */ >+ public String getDisplayName(); >+ >+ /** >+ * Return the <code>CellEditor</code> used to edit the property. >+ * >+ * @param parent >+ * the parent widget for the editor >+ * @return the <code>CellEditor</code> used to edit the property >+ */ >+ CellEditor getEditor(Composite parent); >+ >+ /** >+ * Returns the error text to display if the value is invalid. >+ * >+ * @return the error text to display when the value is invalid or >+ * <code>null</code> >+ */ >+ public String getErrorText(); >+ >+ /** >+ * Return the filter ids used to group entries into levels such as Expert. >+ * Valid values are defined as constants on this interface. >+ * >+ * @return the filter ids used to group entries into levels such as Expert. >+ */ >+ public String[] getFilters(); >+ >+ /** >+ * Returns the help context id for this entry, or <code>null</code> if >+ * this entry has no help context id. >+ * <p> >+ * NOTE: Help support system API's changed since 2.0 and arrays of contexts >+ * are no longer supported. >+ * </p> >+ * <p> >+ * Thus the only valid non- <code>null</code> return type for this method >+ * is a <code>String</code> representing a context id. The previously >+ * valid return types are deprecated. The plural name for this method is >+ * unfortunate. >+ * </p> >+ * >+ * @return the help context id for this entry >+ */ >+ public Object getHelpContextIds(); >+ >+ /** >+ * Returns the image for the property value, if there is one. This image is >+ * managed by the entry it came from. Callers of this method must never >+ * dispose the returned image. >+ * >+ * @return the image for this property value or <code>null</code> >+ */ >+ public Image getImage(); >+ >+ /** >+ * Returns the value of the objects expressed as a String. >+ * >+ * @return the value of the objects expressed as a String >+ */ >+ public String getValueAsString(); >+ >+ /** >+ * Returns <code>true</code> if the entry has children. >+ * >+ * @return <code>true</code> if the entry has children >+ */ >+ public boolean hasChildEntries(); >+ >+ /** >+ * Removes the given listener from this entry's collection of listeners. >+ * >+ * @param listener >+ * the listener to remove >+ */ >+ public void removePropertySheetEntryListener( >+ IPropertySheetEntryListener listener); >+ >+ /** >+ * Resets the property value to its default value if it has been changed. >+ * <p> >+ * Does nothing if the notion of a default value is not meaningful for >+ * the property. >+ * </p> >+ */ >+ void resetPropertyValue(); >+ >+ /** >+ * Sets the objects which represent the property values for this entry. In >+ * the case of the root entry these objects are the input to the viewer. >+ * >+ * @param values the values for this entry >+ */ >+ public void setValues(Object[] values); >+} >\ No newline at end of file >Index: src/org/eclipse/ui/views/properties/IPropertySource.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/IPropertySource.java,v >retrieving revision 1.6 >diff -u -r1.6 IPropertySource.java >--- src/org/eclipse/ui/views/properties/IPropertySource.java 24 Jun 2003 14:52:54 -0000 1.6 >+++ src/org/eclipse/ui/views/properties/IPropertySource.java 3 May 2004 17:03:41 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2003 IBM Corporation and others. >+ * Copyright (c) 2000, 2004 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Common Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Gunnar Wagenknecht - fix for bug 21756 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=21756) > *******************************************************************************/ > package org.eclipse.ui.views.properties; > >@@ -29,6 +30,7 @@ > * @see org.eclipse.core.runtime.IAdaptable > * @see org.eclipse.core.runtime.Platform#getAdapterManager() > * @see org.eclipse.ui.views.properties.PropertySheetPage >+ * @see org.eclipse.ui.views.properties.IPropertySource2 > */ > public interface IPropertySource { > >@@ -99,22 +101,38 @@ > public Object getPropertyValue(Object id); > /** > * Returns whether the value of the property with the given id has changed from >- * its default value. Returns <code>false</code> if the notion of default value >- * is not meaningful for the specified property, or if this source does not have >+ * its default value. Returns <code>false</code> if this source does not have > * the specified property. >+ * <p> >+ * If the notion of default value is not meaningful for the specified property >+ * than <code>true</code> is returned. >+ * </p> > * > * @param id the id of the property > * @return <code>true</code> if the value of the specified property has changed >- * from its original default value, and <code>false</code> otherwise >+ * from its original default value or if the specified property does not have >+ * a meaningfull default value, and <code>false</code> otherwise >+ * @see IPropertySource2#isPropertyResettable(Object) >+ * @see #resetPropertyValue(Object) > */ > public boolean isPropertySet(Object id); > /** > * Resets the property with the given id to its default value if possible. >- * Does nothing if the notion of default value is not meaningful for >+ * <p> >+ * 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. >+ * </p> >+ * <p> >+ * Callers will check if this <code>IPropertySource</code> >+ * implements <code>IPropertySource2</code> and this method will >+ * only be called if <code>IPropertySource2#isPropertyResettable(Object)</code> >+ * returns <code>true</code> for the property with the given id. >+ * </p> > * > * @param id the id of the property being reset >+ * @see #isPropertySet(Object) >+ * @see IPropertySource2#isPropertyResettable(Object) > */ > public void resetPropertyValue(Object id); > /** >Index: src/org/eclipse/ui/views/properties/PropertySheetEntry.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.views/src/org/eclipse/ui/views/properties/PropertySheetEntry.java,v >retrieving revision 1.7 >diff -u -r1.7 PropertySheetEntry.java >--- src/org/eclipse/ui/views/properties/PropertySheetEntry.java 10 Mar 2003 22:09:05 -0000 1.7 >+++ src/org/eclipse/ui/views/properties/PropertySheetEntry.java 3 May 2004 17:03:49 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2003 IBM Corporation and others. >+ * Copyright (c) 2000, 2004 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Common Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Gunnar Wagenknecht - fix for bug 21756 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=21756) > *******************************************************************************/ > > package org.eclipse.ui.views.properties; >@@ -512,6 +513,13 @@ > for (int i = 0; i < objects.length; i++){ > IPropertySource source = getPropertySource(objects[i]); > if (source.isPropertySet(descriptor.getId())) { >+ // fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=21756 >+ if(source instanceof IPropertySource2) { >+ IPropertySource2 extendedSource = (IPropertySource2) source; >+ // continue with next if property is not resettable >+ if (!extendedSource.isPropertyResettable(descriptor.getId())) >+ continue; >+ } > source.resetPropertyValue(descriptor.getId()); > change = true; > } >Index: src/org/eclipse/ui/views/properties/IPropertySource2.java >=================================================================== >RCS file: src/org/eclipse/ui/views/properties/IPropertySource2.java >diff -N src/org/eclipse/ui/views/properties/IPropertySource2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/views/properties/IPropertySource2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,39 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * Gunnar Wagenknecht - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.ui.views.properties; >+ >+/** >+ * Extension to the standard <code>IPropertySource</code> interface. >+ * <p> >+ * This interface provides extended API to <code>IPropertySource</code> to >+ * allow an easier indication of properties that have a default value and can be >+ * resetted. >+ * </p> >+ * >+ * @since 3.0 >+ * @see org.eclipse.ui.views.properties.IPropertySource >+ */ >+public interface IPropertySource2 extends IPropertySource { >+ >+ /** >+ * Returns whether the value of the property with the specified id is >+ * resettable to a default value. >+ * >+ * @param id >+ * the id of the property >+ * @return <code>true</code> if the property with the specified id has a >+ * meaningfull default value to which it can be resetted to, and >+ * <code>false</code> otherwise >+ * @see IPropertySource#resetPropertyValue(Object) >+ * @see IPropertySource#isPropertySet(Object) >+ */ >+ boolean isPropertyResettable(Object id); >+}
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 21756
:
8452
|
8453
| 10225 |
20599