Package resources
Enum CoreComponents
- java.lang.Object
-
- java.lang.Enum<CoreComponents>
-
- resources.CoreComponents
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<CoreComponents>
public enum CoreComponents extends java.lang.Enum<CoreComponents>
The set of named core components that can be loaded and installed on demand. This class also provides static methods that can be used to install other bundles on demand.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CoreComponents.MissingCoreComponentException
The exception that is thrown when a requested core component is missing and cannot be installed due to an error or the user cancelling the installation.
-
Enum Constant Summary
Enum Constants Enum Constant Description CORE_TYPEFACES
Core typefaces for body text and last resort glyphs.PDF_OUTPUT_SUPPORT
Library needed to enable PDF output viaPDFPrintSupport
.SPELLING_COMPONENTS
Resources required to perform live spelling checking.SVG_IMAGE_SUPPORT
Library needed to load SVG image files usingSVGVectorImage
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CatalogID
getCatalogID()
Returns the catalog ID that identifies this core component.Catalog.VersioningState
getInstallationState()
Returns an installation state for the core component.static Catalog.VersioningState
getInstallationState(CatalogID id)
Returns an installation state for an arbitrary catalog ID.void
validate()
Ensures that this core component is installed and up to date.static void
validateCoreComponents(java.lang.Object descriptor)
Check for the presence of core or other required plug-ins, and install them if required.static CoreComponents
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static CoreComponents[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CORE_TYPEFACES
public static final CoreComponents CORE_TYPEFACES
Core typefaces for body text and last resort glyphs.
-
SPELLING_COMPONENTS
public static final CoreComponents SPELLING_COMPONENTS
Resources required to perform live spelling checking.
-
PDF_OUTPUT_SUPPORT
public static final CoreComponents PDF_OUTPUT_SUPPORT
Library needed to enable PDF output viaPDFPrintSupport
.
-
SVG_IMAGE_SUPPORT
public static final CoreComponents SVG_IMAGE_SUPPORT
Library needed to load SVG image files usingSVGVectorImage
.
-
-
Method Detail
-
values
public static CoreComponents[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CoreComponents c : CoreComponents.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CoreComponents valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
getCatalogID
public CatalogID getCatalogID()
Returns the catalog ID that identifies this core component.- Returns:
- the ID of the core component
-
getInstallationState
public Catalog.VersioningState getInstallationState()
Returns an installation state for the core component. The return value will be one of:VersioningState.NOT_INSTALLED VersioningState.OUT_OF_DATE VersioningState.UP_TO_DATE
- Returns:
- the current installation state of the core component
-
getInstallationState
public static Catalog.VersioningState getInstallationState(CatalogID id)
Returns an installation state for an arbitrary catalog ID. The return value will be one of:VersioningState.NOT_INSTALLED VersioningState.OUT_OF_DATE (installed version is older than id) VersioningState.UP_TO_DATE (installed version is newer/same date)
- Returns:
- the installation state of the requested component
-
validate
public void validate()
Ensures that this core component is installed and up to date. If not, the user is prompted to download the missing component. If the user refuses, aCoreComponents.MissingCoreComponentException
is thrown.
-
validateCoreComponents
public static void validateCoreComponents(java.lang.Object descriptor)
Check for the presence of core or other required plug-ins, and install them if required. Ifdescriptor
is aCoreComponents
identifier, that component is checked for. Otherwise the value is converted to a string and parsed as follows:- The string is split into tokens by breaking at newlines; each token represents one required plug-in bundle.
- Each token must contain a catalog ID. This ID identifies the plug-in.
- The ID may optionally follow a URL ending in a '/'. This URL is taken to be the location of the catalog that lists the bundle. If no URL is present, the standard SE catalog is implied. Example: http://somewhere.tld/CATALOGUEID{...}.
- Parameters:
descriptor
- aCoreComponent
or an object describing the component to install (see above)- Throws:
java.lang.NullPointerException
- ifdescriptor
isnull
CoreComponents.MissingCoreComponentException
- if any component is missing or out of date and the user refuses to install it, or if installation fails
-
-