KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > components > framework > NonDisposingHandle


1 /*******************************************************************************
2  * Copyright (c) 2005 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 package org.eclipse.ui.internal.components.framework;
12
13 import org.eclipse.ui.internal.components.NullDisposable;
14
15 /**
16  * A component handle that does not dispose the object it points to.
17  * This is typically used for:
18  *
19  * <ul>
20  * <li>Handles to singleton objects, where the owner of the handle does not own the component</li>
21  * <li>Handles to temporary objects, where the object does not require any explicit disposal and could safely
22  * be discarded and recreated if necessary</li>
23  * </ul>
24  *
25  * <p>EXPERIMENTAL: The components framework is currently under active development. All
26  * aspects of this class including its existence, name, and public interface are likely
27  * to change during the development of Eclipse 3.1</p>
28  *
29  * @since 3.1
30  */

31 public final class NonDisposingHandle extends ComponentHandle {
32
33     /**
34      * Creates a handle that will reference the given component but will
35      * not clean up after it.
36      *
37      * @param component component being referenced
38      */

39     public NonDisposingHandle(Object JavaDoc component) {
40         super(component);
41     }
42     
43     /* (non-javadoc)
44      *
45      */

46     public IDisposable getDisposable() {
47         return NullDisposable.instance;
48     }
49     
50     /* (non-javadoc)
51      *
52      */

53     public boolean requiresDisposal() {
54         return false;
55     }
56 }
57
Popular Tags