com.izforge.izpack
Class Pack

java.lang.Object
  extended by com.izforge.izpack.Pack
All Implemented Interfaces:
java.io.Serializable

public class Pack
extends java.lang.Object
implements java.io.Serializable

Represents a Pack.

Author:
Julien Ponge
See Also:
Serialized Form

Field Summary
static int BLACK
          black colour
 int color
          The color of the node.
private  java.lang.String condition
          Condition for this pack *
 java.util.List<java.lang.String> dependencies
          The list of packs this pack depends on
 java.lang.String description
          The pack description.
 java.lang.String excludeGroup
          All packs in the same excludeGroup are mutually exclusive.
private static java.text.DecimalFormat formatter
          Used of conversions.
private static double GIGABYTES
          Used of conversions.
static int GREY
          grey colour
 java.lang.String group
          The group the pack is associated with.
 java.lang.String id
          The langpack id
 java.util.Set<java.lang.String> installGroups
          An association of this pack to zero or more installation groups.
private static double KILOBYTES
          Used of conversions.
 boolean loose
          Flag for store files of this pack outside the installation jar file
private static double MEGABYTES
          Used of conversions.
 java.lang.String name
          The pack name.
 long nbytes
          The bumber of bytes contained in the pack.
 java.util.List<OsConstraint> osConstraints
          The target operation system of this pack
 java.lang.String packImgId
          The id to use if we want to obtain this pack's image resource
 java.lang.String parent
          Parent pack name to display it in the TreePacksPanel (optional)
 boolean preselected
          Whether this pack is suggested (preselected for installation).
 boolean required
          True if the pack is required.
 java.util.List<java.lang.String> revDependencies
          Reverse dependencies(childs)
(package private) static long serialVersionUID
           
 boolean uninstall
          If true, all files of the pack will be deleted during uninstallation, if false they are only removed if uninstaller force delete option is activated.
static int WHITE
          white colour
 
Constructor Summary
Pack(java.lang.String name, java.lang.String id, java.lang.String description, java.util.List<OsConstraint> osConstraints, java.util.List<java.lang.String> dependencies, boolean required, boolean preselected, boolean loose, java.lang.String excludegroup, boolean uninstall)
          The constructor.
 
Method Summary
 void addRevDep(java.lang.String name0)
          This adds a reverse dependency.
 java.lang.String depString()
          Creates a text list of all the packs it depend on
 java.lang.String getCondition()
           
 java.util.List<java.lang.String> getDependencies()
          getter method for dependencies
 boolean hasCondition()
           
 void setCondition(java.lang.String condition)
           
static java.lang.String toByteUnitsString(long bytes)
          Convert bytes into appropiate mesaurements.
 java.lang.String toString()
          To a String (usefull for JLists).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

loose

public boolean loose
Flag for store files of this pack outside the installation jar file


uninstall

public boolean uninstall
If true, all files of the pack will be deleted during uninstallation, if false they are only removed if uninstaller force delete option is activated.


name

public java.lang.String name
The pack name.


id

public java.lang.String id
The langpack id


installGroups

public java.util.Set<java.lang.String> installGroups
An association of this pack to zero or more installation groups. An installation group is just a named collection of packs to allow for different pack collections to be selected, for example: minimal, default, all.


excludeGroup

public java.lang.String excludeGroup
All packs in the same excludeGroup are mutually exclusive. The excludeGroup is a string and serves are key identifying each group of mutually exclusive packs.


group

public java.lang.String group
The group the pack is associated with. The pack group identifies packs with common functionality to allow for grouping of packs in a tree in the TargetPanel for example.


description

public java.lang.String description
The pack description.


osConstraints

public java.util.List<OsConstraint> osConstraints
The target operation system of this pack


condition

private java.lang.String condition
Condition for this pack *


dependencies

public java.util.List<java.lang.String> dependencies
The list of packs this pack depends on


revDependencies

public java.util.List<java.lang.String> revDependencies
Reverse dependencies(childs)


required

public boolean required
True if the pack is required.


nbytes

public long nbytes
The bumber of bytes contained in the pack.


preselected

public boolean preselected
Whether this pack is suggested (preselected for installation).


parent

public java.lang.String parent
Parent pack name to display it in the TreePacksPanel (optional)


color

public int color
The color of the node. This is used for the dependency graph algorithms


packImgId

public java.lang.String packImgId
The id to use if we want to obtain this pack's image resource


WHITE

public static final int WHITE
white colour

See Also:
Constant Field Values

GREY

public static final int GREY
grey colour

See Also:
Constant Field Values

BLACK

public static final int BLACK
black colour

See Also:
Constant Field Values

KILOBYTES

private static final double KILOBYTES
Used of conversions.

See Also:
Constant Field Values

MEGABYTES

private static final double MEGABYTES
Used of conversions.

See Also:
Constant Field Values

GIGABYTES

private static final double GIGABYTES
Used of conversions.

See Also:
Constant Field Values

formatter

private static final java.text.DecimalFormat formatter
Used of conversions.

Constructor Detail

Pack

public Pack(java.lang.String name,
            java.lang.String id,
            java.lang.String description,
            java.util.List<OsConstraint> osConstraints,
            java.util.List<java.lang.String> dependencies,
            boolean required,
            boolean preselected,
            boolean loose,
            java.lang.String excludegroup,
            boolean uninstall)
The constructor.

Parameters:
name - The pack name.
id - The id of the pack which is used e.g. for I18N
description - The pack description.
osConstraints - the OS constraint (or null for any OS)
dependencies - dependencies of this pack
required - Indicates wether the pack is required or not.
preselected - This pack will be selected automatically.
loose - Flag for store files of this pack outside the installation jar file
excludegroup - associated exclude group
uninstall - If true, pack must be uninstalled.
Method Detail

toString

public java.lang.String toString()
To a String (usefull for JLists).

Overrides:
toString in class java.lang.Object
Returns:
The String representation of the pack.

getDependencies

public java.util.List<java.lang.String> getDependencies()
getter method for dependencies

Returns:
the dependencies list

addRevDep

public void addRevDep(java.lang.String name0)
This adds a reverse dependency. With a reverse dependency we imply a child dependency or the dependents on this pack

Parameters:
name0 - The name of the pack that depents to this pack

depString

public java.lang.String depString()
Creates a text list of all the packs it depend on

Returns:
the created text

toByteUnitsString

public static java.lang.String toByteUnitsString(long bytes)
Convert bytes into appropiate mesaurements.

Parameters:
bytes - A number of bytes to convert to a String.
Returns:
The String-converted value.

getCondition

public java.lang.String getCondition()
Returns:
the condition

setCondition

public void setCondition(java.lang.String condition)
Parameters:
condition - the condition to set

hasCondition

public boolean hasCondition()