KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > components > DependencyOnlyFactory


1 /*******************************************************************************
2  * Copyright (c) 2004, 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;
12
13 import java.util.Collection JavaDoc;
14
15 import org.eclipse.ui.internal.components.framework.ComponentException;
16 import org.eclipse.ui.internal.components.framework.ComponentHandle;
17 import org.eclipse.ui.internal.components.framework.IServiceProvider;
18 import org.eclipse.ui.internal.components.framework.ServiceFactory;
19
20 /**
21  * Service factory that exposes the dependencies, but nothing else, from another
22  * factory.
23  *
24  * @since 3.1
25  */

26 public class DependencyOnlyFactory extends ServiceFactory {
27     
28     public ServiceFactory otherFactory;
29     
30     public DependencyOnlyFactory(ServiceFactory other) {
31         this.otherFactory = other;
32     }
33     
34     /* (non-Javadoc)
35      * @see org.eclipse.core.components.AbstractServiceFactory#createHandle(java.lang.Object, org.eclipse.core.components.IServiceProvider)
36      */

37     public ComponentHandle createHandle(Object JavaDoc key,
38             IServiceProvider services) throws ComponentException {
39         return null;
40     }
41     
42     /* (non-Javadoc)
43      * @see org.eclipse.core.components.AbstractServiceFactory#getMissingDependencies()
44      */

45     public Collection JavaDoc getMissingDependencies() {
46         return otherFactory.getMissingDependencies();
47     }
48     
49     /* (non-Javadoc)
50      * @see org.eclipse.core.components.AbstractServiceFactory#hasService(java.lang.Object)
51      */

52     public boolean hasService(Object JavaDoc componentKey) {
53         return false;
54     }
55
56 }
57
Popular Tags