com.izforge.izpack.panels.userinput.field
Class FieldHelper

java.lang.Object
  extended by com.izforge.izpack.panels.userinput.field.FieldHelper

public class FieldHelper
extends Object

Determines if a field is selected for display.

Author:
Tim Anderson

Constructor Summary
FieldHelper()
           
 
Method Summary
static boolean isRequired(Field field, InstallData installData, PlatformModelMatcher matcher)
          Determines if a field is required if the field is required for the current platform and selected packs.
static boolean isRequiredForPacks(List<String> packNames, List<Pack> selectedPacks)
          Determine if an item is required by any of the selected packs.
static boolean isRequiredForUnselectedPacks(List<String> packNames, List<Pack> selectedPacks)
          Determine if an item is required by any of the unselected packs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldHelper

public FieldHelper()
Method Detail

isRequired

public static boolean isRequired(Field field,
                                 InstallData installData,
                                 PlatformModelMatcher matcher)
Determines if a field is required if the field is required for the current platform and selected packs.

Parameters:
field - the field
installData - the installation data
matcher - the platform-model matcher
Returns:
true if the field is required for the current platform and selected packs

isRequiredForPacks

public static boolean isRequiredForPacks(List<String> packNames,
                                         List<Pack> selectedPacks)
Determine if an item is required by any of the selected packs.

An item is required if it has no pack constraints, or names one or more selected packs.

Parameters:
packNames - the item's pack constraints. Each name corresponds to a pack for which the item should be created if the pack is selected for installation
selectedPacks - the selected packs
Returns:
true if packs is empty, or one of the packs appears in selectedPacks

isRequiredForUnselectedPacks

public static boolean isRequiredForUnselectedPacks(List<String> packNames,
                                                   List<Pack> selectedPacks)
Determine if an item is required by any of the unselected packs.

An item is required if it has no pack constraints, or doesn't name any selected packs.

Parameters:
packNames - the item's pack constraints. Each name corresponds to a pack for which the item should be created if the pack is not selected for installation
selectedPacks - the selected packs
Returns:
true if packs is empty, or none of the packs appears in selectedPacks


Copyright © 2018. All rights reserved.