Package resources

Enum 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
    • 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.
    • 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 name
        java.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, a CoreComponents.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. If descriptor is a CoreComponents identifier, that component is checked for. Otherwise the value is converted to a string and parsed as follows:
        1. The string is split into tokens by breaking at newlines; each token represents one required plug-in bundle.
        2. Each token must contain a catalog ID. This ID identifies the plug-in.
        3. 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 - a CoreComponent or an object describing the component to install (see above)
        Throws:
        java.lang.NullPointerException - if descriptor is null
        CoreComponents.MissingCoreComponentException - if any component is missing or out of date and the user refuses to install it, or if installation fails