Eclipse Platform
2.0

org.eclipse.update.core
Class Feature

java.lang.Object
  |
  +--org.eclipse.core.runtime.PlatformObject
        |
        +--org.eclipse.update.core.model.ModelObject
              |
              +--org.eclipse.update.core.model.FeatureModel
                    |
                    +--org.eclipse.update.core.Feature
All Implemented Interfaces:
IAdaptable, IFeature

public class Feature
extends FeatureModel
implements IFeature

Convenience implementation of a feature.

This class may be instantiated or subclassed by clients.

Since:
2.0
See Also:
IFeature, FeatureModel

Field Summary
static String FEATURE_FILE
          Simple file name of the default feature manifest file
static String FEATURE_XML
          File extension of the default feature manifest file
 
Fields inherited from interface org.eclipse.update.core.IFeature
STATUS_AMBIGUOUS, STATUS_HAPPY, STATUS_UNHAPPY
 
Constructor Summary
Feature()
          Feature default constructor
 
Method Summary
 boolean equals(Object object)
          Compares two features for equality
 IURLEntry getCopyright()
          Returns the copyright information for the feature.
 IURLEntry getDescription()
          Returns the feature description.
 IURLEntry[] getDiscoverySiteEntries()
          Return an array of information entries referencing locations of other update sites.
 long getDownloadSize()
          Returns the download size of the feature, if it can be determined.
 IFeatureContentConsumer getFeatureContentConsumer()
          Returns the content consumer for this feature.
 IFeatureContentProvider getFeatureContentProvider()
          Returns the content provider for this feature.
 URL getImage()
          Return optional image for the feature.
 IImport[] getImports()
          Return a list of plug-in dependencies for this feature.
 IFeatureReference[] getIncludedFeatureReferences()
          Returns an array of feature references included by this feature
 IInstallHandlerEntry getInstallHandlerEntry()
          Returns and optional custom install handler entry.
 long getInstallSize()
          Returns the install size of the feature, if it can be determined.
 IURLEntry getLicense()
          Returns the license information for the feature.
 INonPluginEntry[] getNonPluginEntries()
          Returns an array of non-plug-in entries referenced by this feature
 int getNonPluginEntryCount()
          Returns the count of referenced non-plug-in entries.
 IPluginEntry[] getPluginEntries()
          Returns an array of plug-in entries referenced by this feature
 int getPluginEntryCount()
          Returns the count of referenced plug-in entries.
 ISite getSite()
          Returns the site this feature is associated with.
 IURLEntry getUpdateSiteEntry()
          Returns an information entry referencing the location of the feature update site.
 URL getURL()
          Returns the feature URL.
 VersionedIdentifier getVersionedIdentifier()
          Returns the feature identifier.
 IFeatureReference install(IFeature targetFeature, IVerificationListener verificationListener, IProgressMonitor progress)
          Install the contents of this feature into the specified target feature.
 void setFeatureContentProvider(IFeatureContentProvider featureContentProvider)
          Sets the content provider for this feature.
 void setSite(ISite site)
          Sets the site for this feature.
 String toString()
          Return the string representation of this fetaure
 
Methods inherited from class org.eclipse.update.core.model.FeatureModel
addDiscoverySiteEntryModel, addImportModel, addIncludesFeatureIdentifier, addNonPluginEntryModel, addPluginEntryModel, getAffinityFeature, getApplication, getArch, getCopyrightModel, getDescriptionModel, getDiscoverySiteEntryModels, getFeatureIdentifier, getFeatureIncludeVersionedIdentifier, getFeatureVersion, getImageURL, getImageURLString, getImportModels, getInstallHandlerModel, getLabel, getLabelNonLocalized, getLicenseModel, getNL, getNonPluginEntryModels, getOS, getPluginEntryModels, getProvider, getProviderNonLocalized, getUpdateSiteEntryModel, getWS, isPrimary, isPrimary, markReadOnly, removeDiscoverySiteEntryModel, removeImportModel, removeNonPluginEntryModel, removePluginEntryModel, resolve, setAffinityFeature, setApplication, setArch, setCopyrightModel, setDescriptionModel, setDiscoverySiteEntryModels, setFeatureIdentifier, setFeatureVersion, setImageURLString, setImportModels, setInstallHandlerModel, setLabel, setLicenseModel, setNL, setNonPluginEntryModels, setOS, setPluginEntryModels, setProvider, setUpdateSiteEntryModel, setWS
 
Methods inherited from class org.eclipse.update.core.model.ModelObject
arrayTypeFor, arrayTypeFor, assertIsWriteable, isReadOnly, markListReferenceReadOnly, markReferenceReadOnly, resolveListReference, resolveNLString, resolveReference, resolveURL
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.update.core.IFeature
getAffinityFeature, getApplication, getArch, getLabel, getNL, getOS, getProvider, getWS, isPrimary
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

FEATURE_FILE

public static final String FEATURE_FILE
Simple file name of the default feature manifest file

Since:
2.0
See Also:
Constant Field Values

FEATURE_XML

public static final String FEATURE_XML
File extension of the default feature manifest file

Since:
2.0
See Also:
Constant Field Values
Constructor Detail

Feature

public Feature()
Feature default constructor

Since:
2.0
Method Detail

equals

public boolean equals(Object object)
Compares two features for equality

Overrides:
equals in class FeatureModel
Parameters:
object - feature object to compare with
Returns:
true if the two features are equal, false otherwise
Since:
2.0

getVersionedIdentifier

public VersionedIdentifier getVersionedIdentifier()
Returns the feature identifier.

Specified by:
getVersionedIdentifier in interface IFeature
Returns:
the feature identifier.
Since:
2.0
See Also:
IFeature.getVersionedIdentifier()

getSite

public ISite getSite()
Returns the site this feature is associated with.

Specified by:
getSite in interface IFeature
Returns:
the site for this feature
Since:
2.0
See Also:
IFeature.getSite()

getURL

public URL getURL()
Returns the feature URL.

Specified by:
getURL in interface IFeature
Returns:
feature URL
Since:
2.0
See Also:
IFeature.getURL()

getUpdateSiteEntry

public IURLEntry getUpdateSiteEntry()
Returns an information entry referencing the location of the feature update site.

Specified by:
getUpdateSiteEntry in interface IFeature
Returns:
update site entry, or null.
Since:
2.0
See Also:
IFeature.getUpdateSiteEntry()

getDiscoverySiteEntries

public IURLEntry[] getDiscoverySiteEntries()
Return an array of information entries referencing locations of other update sites.

Specified by:
getDiscoverySiteEntries in interface IFeature
Returns:
an array of site entries, or an empty array.
Since:
2.0
See Also:
IFeature.getDiscoverySiteEntries()

getInstallHandlerEntry

public IInstallHandlerEntry getInstallHandlerEntry()
Returns and optional custom install handler entry.

Specified by:
getInstallHandlerEntry in interface IFeature
Returns:
install handler entry, or null if none was specified
Since:
2.0
See Also:
IFeature.getInstallHandlerEntry()

getDescription

public IURLEntry getDescription()
Returns the feature description.

Specified by:
getDescription in interface IFeature
Returns:
feature rescription, or null.
Since:
2.0
See Also:
IFeature.getDescription()

getCopyright

public IURLEntry getCopyright()
Returns the copyright information for the feature.

Specified by:
getCopyright in interface IFeature
Returns:
copyright information, or null.
Since:
2.0
See Also:
IFeature.getCopyright()

getLicense

public IURLEntry getLicense()
Returns the license information for the feature.

Specified by:
getLicense in interface IFeature
Returns:
feature license, or null.
Since:
2.0
See Also:
IFeature.getLicense()

getImage

public URL getImage()
Return optional image for the feature.

Specified by:
getImage in interface IFeature
Returns:
the URL pointing to the image, , or null.
Since:
2.0
See Also:
IFeature.getImage()

getImports

public IImport[] getImports()
Return a list of plug-in dependencies for this feature.

Specified by:
getImports in interface IFeature
Returns:
the list of required plug-in dependencies, or an empty array.
Since:
2.0
See Also:
IFeature.getImports()

install

public IFeatureReference install(IFeature targetFeature,
                                 IVerificationListener verificationListener,
                                 IProgressMonitor progress)
                          throws InstallAbortedException,
                                 CoreException
Install the contents of this feature into the specified target feature. This method is a reference implementation of the feature installation protocol. Other concrete feature implementation that override this method need to implement this protocol.

Specified by:
install in interface IFeature
Parameters:
targetFeature -
verificationListener -
progress -
Throws:
InstallAbortedException - when the user cancels the install
CoreException
Since:
2.0
See Also:
IFeature.install(IFeature, IVerificationListener, IProgressMonitor)

getPluginEntries

public IPluginEntry[] getPluginEntries()
Returns an array of plug-in entries referenced by this feature

Specified by:
getPluginEntries in interface IFeature
Returns:
an erray of plug-in entries, or an empty array.
Since:
2.0
See Also:
IFeature.getPluginEntries()

getPluginEntryCount

public int getPluginEntryCount()
Returns the count of referenced plug-in entries.

Specified by:
getPluginEntryCount in interface IFeature
Returns:
plug-in entry count
Since:
2.0
See Also:
IFeature.getPluginEntryCount()

getNonPluginEntries

public INonPluginEntry[] getNonPluginEntries()
Returns an array of non-plug-in entries referenced by this feature

Specified by:
getNonPluginEntries in interface IFeature
Returns:
an erray of non-plug-in entries, or an empty array.
Since:
2.0
See Also:
IFeature.getNonPluginEntries()

getNonPluginEntryCount

public int getNonPluginEntryCount()
Returns the count of referenced non-plug-in entries.

Specified by:
getNonPluginEntryCount in interface IFeature
Returns:
non-plug-in entry count
Since:
2.0
See Also:
IFeature.getNonPluginEntryCount()

getIncludedFeatureReferences

public IFeatureReference[] getIncludedFeatureReferences()
                                                 throws CoreException
Returns an array of feature references included by this feature

Specified by:
getIncludedFeatureReferences in interface IFeature
Returns:
an erray of feature references, or an empty array.
CoreException
Since:
2.0

getDownloadSize

public long getDownloadSize()
Returns the download size of the feature, if it can be determined.

Specified by:
getDownloadSize in interface IFeature
Returns:
download size of the feature in KiloBytes, or an indication the size could not be determined
Since:
2.0
See Also:
IFeature.getDownloadSize()

getInstallSize

public long getInstallSize()
Returns the install size of the feature, if it can be determined.

Specified by:
getInstallSize in interface IFeature
Returns:
install size of the feature in KiloBytes, or an indication the size could not be determined
Since:
2.0
See Also:
IFeature.getInstallSize()

getFeatureContentProvider

public IFeatureContentProvider getFeatureContentProvider()
                                                  throws CoreException
Returns the content provider for this feature.

Specified by:
getFeatureContentProvider in interface IFeature
Returns:
feature content provider
CoreException
Since:
2.0
See Also:
IFeature.getFeatureContentProvider()

getFeatureContentConsumer

public IFeatureContentConsumer getFeatureContentConsumer()
                                                  throws CoreException
Returns the content consumer for this feature.

Specified by:
getFeatureContentConsumer in interface IFeature
Returns:
feature content consumer
Throws:
CoreException
Since:
2.0
See Also:
IFeature.getFeatureContentConsumer()

setSite

public void setSite(ISite site)
             throws CoreException
Sets the site for this feature.

Specified by:
setSite in interface IFeature
Parameters:
site - the site
Throws:
CoreException - site for this feature is already set
Since:
2.0
See Also:
IFeature.setSite(ISite)

setFeatureContentProvider

public void setFeatureContentProvider(IFeatureContentProvider featureContentProvider)
Sets the content provider for this feature.

Specified by:
setFeatureContentProvider in interface IFeature
Parameters:
featureContentProvider - content provider
Since:
2.0
See Also:
IFeature.setFeatureContentProvider(IFeatureContentProvider)

toString

public String toString()
Return the string representation of this fetaure

Overrides:
toString in class Object
Returns:
feature as string
Since:
2.0

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.