KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > IWorkbenchPart3


1 /*******************************************************************************
2  * Copyright (c) 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  ******************************************************************************/

11
12 package org.eclipse.ui;
13
14 import java.util.Map JavaDoc;
15
16 import org.eclipse.jface.util.IPropertyChangeListener;
17
18 /**
19  * A part can provide arbitrary properties. The properties will be persisted
20  * between sessions by the part reference, and will be available from the part
21  * reference as well as the part. The properties can only be set on a part, not
22  * on the reference. The properties will be available to the IPresentablePart.
23  * <p>
24  * Setting a property must fire a PropertyChangeEvent.
25  * </p>
26  *
27  * @since 3.3
28  */

29 public interface IWorkbenchPart3 extends IWorkbenchPart2 {
30     /**
31      * Add a listener for changes in the arbitrary properties set.
32      * <p>
33      * <b>Note:</b> this is a different set of properties than the ones covered
34      * by the IWorkbenchPartConstants.PROP_* constants.
35      * </p>
36      *
37      * @param listener
38      * Must not be <code>null</code>.
39      */

40     public void addPartPropertyListener(IPropertyChangeListener listener);
41
42     /**
43      * Remove a change listener from the arbitrary properties set.
44      * <p>
45      * <b>Note:</b> this is a different set of properties than the ones covered
46      * by the IWorkbenchPartConstants.PROP_* constants.
47      * </p>
48      *
49      * @param listener
50      * Must not be <code>null</code>.
51      */

52     public void removePartPropertyListener(IPropertyChangeListener listener);
53
54     /**
55      * Return the value for the arbitrary property key, or <code>null</code>.
56      *
57      * @param key
58      * the arbitrary property. Must not be <code>null</code>.
59      * @return the property value, or <code>null</code>.
60      */

61     public String JavaDoc getPartProperty(String JavaDoc key);
62
63     /**
64      * Set an arbitrary property on the part. It is the implementor's
65      * responsibility to fire the corresponding PropertyChangeEvent.
66      * <p>
67      * A default implementation has been added to WorkbenchPart.
68      * </p>
69      *
70      * @param key
71      * the arbitrary property. Must not be <code>null</code>.
72      * @param value
73      * the property value. A <code>null</code> value will remove
74      * that property.
75      */

76     public void setPartProperty(String JavaDoc key, String JavaDoc value);
77
78     /**
79      * Return an unmodifiable map of the arbitrary properties. This method can
80      * be used to save the properties during workbench save/restore.
81      *
82      * @return A Map of the properties. Must not be <code>null</code>.
83      */

84     public Map JavaDoc getPartProperties();
85 }
86
Popular Tags