All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.install.products.LocaleDependency

java.lang.Object
   |
   +----com.sun.install.products.InstallComponent
           |
           +----com.sun.install.products.InstallNode
                   |
                   +----com.sun.install.products.LocaleDependency

public class LocaleDependency
extends InstallNode
This is a sample of a locale dependency that depends on the runtime locale selections of the wizard.

LocaleDependency is a generic InstallNode that you can insert into a product tree to affect what is visible below it. Calling upon the refresh() method with a target of "nodeIsActive" will make the dependency enforce its rules by checking its dependency, and turning on or off its children.


Constructor Index

 o LocaleDependency()
Creates a new LocaleDependency.
 o LocaleDependency(boolean)
Constructs a new locale dependency.
 o LocaleDependency(Locale, boolean)
Constructs a new locale dependency with required information, including inversion.
 o LocaleDependency(Locale[], boolean)
Constructs a new locale dependency with required information, including inversion.

Method Index

 o addRuntimeResources(Vector)
Add the runtime resources required by this class.
 o getInvert()
Gets the invert state of this InstallComponent
 o initialize(WizardState)
Initialize this object.
 o refresh(Vector, String)
Update this dependency.
 o setInvert(boolean)
Sets the invert state of this InstallComponent

Constructors

 o LocaleDependency
 public LocaleDependency()
Creates a new LocaleDependency.

 o LocaleDependency
 public LocaleDependency(boolean inverted)
Constructs a new locale dependency. This flavor of LocaleDependency configures itself at runtime to check for all possible locales that its children know about (by checking the "locales" property of all its children). This can be used if you want the children to control which locales this dependency is dependent on.

Parameters:
inverted - A flag indicating this dependency should invert its results. If this is false, the dependency does not allow participation of its children if the runtime locale does not match the supplied locale
 o LocaleDependency
 public LocaleDependency(Locale locale,
                         boolean inverted)
Constructs a new locale dependency with required information, including inversion.

Parameters:
locale - The locale this dependency depends on. Children of this node will not be allowed to participate in installs if this locale is not the runtime locale, unless inverted is true.
inverted - A flag indicating this dependency should invert its results. If this is false, the dependency does not allow participation of its children if the runtime locale does not match the supplied locale
 o LocaleDependency
 public LocaleDependency(Locale locale[],
                         boolean inverted)
Constructs a new locale dependency with required information, including inversion.

Parameters:
locale - The locale this dependency depends on. Children of this node will not be allowed to participate in installs if this locale is not the runtime locale, unless inverted is true.
inverted - A flag indicating this dependency should invert its results. If this is false, the dependency does not allow participation of its children if the runtime locale does not match the supplied locale

Methods

 o getInvert
 public boolean getInvert()
Gets the invert state of this InstallComponent

Returns:
The invert state of this component
 o setInvert
 public void setInvert(boolean invert)
Sets the invert state of this InstallComponent

Parameters:
invert - The new invert state
 o refresh
 public boolean refresh(Vector targets,
                        String sharedPoolKey)
Update this dependency. For example, if we are on a Windows-based locale and this InstallComponent has some children that should only be installed on SPARC-based locales, this would omit the inactive InstallComponent's information (Destination table, whether it will install or not). In effect, it halts any data-gathering operation that might otherwise be passed down to its children. For a SoftwareComponent, this method searches for it being "selected" by the user, and turns itself "off" if it is not selected.

Parameters:
targets - The target properties (set via setProperty()) to update.
sharedPoolKey - the key used to access the shared pool to keep track of shared components.
Returns:
true if the refresh was sucessful, falseotherwise.
Overrides:
refresh in class InstallNode
 o initialize
 public boolean initialize(WizardState state)
Initialize this object. For Locale Dependencies, all we have to do is check the dependency in order to initialize.

Parameters:
state - The WizardState this object belongs to.
Returns:
Whether the initialization was successful or not.
Overrides:
initialize in class InstallNode
 o addRuntimeResources
 public void addRuntimeResources(Vector resourceVector)
Add the runtime resources required by this class.

Parameters:
resourceVector - The vector containing all of the required resources for this class
Overrides:
addRuntimeResources in class InstallNode

All Packages  Class Hierarchy  This Package  Previous  Next  Index