KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > update > internal > core > TargetFeature


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.update.internal.core;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.osgi.util.NLS;
15 import org.eclipse.update.core.Feature;
16 import org.eclipse.update.core.IFeatureContentConsumer;
17 import org.eclipse.update.core.Utilities;
18
19 /**
20  *
21  */

22 public class TargetFeature extends Feature {
23
24
25     /**
26      * The content consumer of the DefaultFeature
27      */

28     private IFeatureContentConsumer contentConsumer;
29     
30
31     /**
32      * Constructor for TargetFeature.
33      */

34     public TargetFeature() {
35         super();
36     }
37
38     /**
39      * Sets the content Consumer
40      */

41     public void setContentConsumer(IFeatureContentConsumer contentConsumer) {
42         this.contentConsumer = contentConsumer;
43         contentConsumer.setFeature(this);
44     }
45
46     /*
47      * @see IFeature#getFeatureContentConsumer()
48      */

49     public IFeatureContentConsumer getFeatureContentConsumer() throws CoreException {
50         if (this.contentConsumer == null) {
51             throw Utilities.newCoreException( NLS.bind(Messages.Feature_NoFeatureContentConsumer, (new String JavaDoc[] { getURL().toExternalForm() })), null);
52         }
53         return contentConsumer;
54     }
55
56 }
57
Popular Tags