01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Gunnar Wagenknecht - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.views.properties;
11:
12: /**
13: * Extension to the standard <code>IPropertySource</code> interface.
14: * <p>
15: * This interface provides extended API to <code>IPropertySource</code> to
16: * allow an easier indication of properties that have a default value and can be
17: * resetted.
18: * </p>
19: *
20: * @since 3.0
21: * @see org.eclipse.ui.views.properties.IPropertySource
22: */
23: public interface IPropertySource2 extends IPropertySource {
24:
25: /**
26: * Returns whether the value of the property with the specified id is
27: * resettable to a default value.
28: *
29: * @param id
30: * the id of the property
31: * @return <code>true</code> if the property with the specified id has a
32: * meaningful default value to which it can be resetted, and
33: * <code>false</code> otherwise
34: * @see IPropertySource#resetPropertyValue(Object)
35: * @see IPropertySource#isPropertySet(Object)
36: */
37: boolean isPropertyResettable(Object id);
38:
39: /**
40: * <code>IPropertySource2</code> overrides the specification of this <code>IPropertySource</code>
41: * method to return <code>true</code> instead of <code>false</code> if the specified
42: * property does not have a meaningful default value.
43: * <code>isPropertyResettable</code> will only be called if <code>isPropertySet</code> returns
44: * <code>true</code>.
45: * <p>
46: * Returns whether the value of the property with the given id has changed
47: * from its default value. Returns <code>false</code> if this source does
48: * not have the specified property.
49: * </p>
50: * <p>
51: * If the notion of default value is not meaningful for the specified
52: * property then <code>true</code> is returned.
53: * </p>
54: *
55: * @param id
56: * the id of the property
57: * @return <code>true</code> if the value of the specified property has
58: * changed from its original default value, <code>true</code> if
59: * the specified property does not have a meaningful default value,
60: * and <code>false</code> if this source does not have the
61: * specified property
62: * @see IPropertySource2#isPropertyResettable(Object)
63: * @see #resetPropertyValue(Object)
64: * @since 3.1
65: */
66: public boolean isPropertySet(Object id);
67: }
|