com.izforge.izpack.panels.userinput.field.file
Class MultipleFileField

java.lang.Object
  extended by com.izforge.izpack.panels.userinput.field.Field
      extended by com.izforge.izpack.panels.userinput.field.file.AbstractFileField
          extended by com.izforge.izpack.panels.userinput.field.file.MultipleFileField

public class MultipleFileField
extends AbstractFileField

Multiple file field.

Author:
Tim Anderson

Field Summary
 
Fields inherited from class com.izforge.izpack.panels.userinput.field.file.AbstractFileField
allowEmptyValue, mustExist
 
Constructor Summary
MultipleFileField(MultipleFileFieldConfig config, InstallData installData)
          Constructs a MultipleFileField.
 
Method Summary
 boolean getCreateMultipleVariables()
          Determines if multiple variables should be created to hold the selected files.
 int getPreferredHeight()
          Returns the preferred width of the field.
 int getPreferredWidth()
          Returns the preferred width of the field.
 int getVisibleRows()
          Returns the number of visible rows.
 void setValues(List<String> values)
          Sets the values.
 
Methods inherited from class com.izforge.izpack.panels.userinput.field.file.AbstractFileField
getAbsoluteFile, getAllowEmptyValue, getFileExtension, getFileExtensionDescription, isMustExist
 
Methods inherited from class com.izforge.izpack.panels.userinput.field.Field
getDefaultValue, getDescription, getDescription, getInitialValue, getInstallData, getLabel, getLabel, getOmitFromAuto, getOsModels, getPacks, getProcessors, getSize, getSummaryKey, getTooltip, getValue, getVariable, isConditionTrue, isEffectiveDisplayHidden, isEffectiveReadonly, replaceVariables, setSaving, setValue, setVariable, validate, validate, wrapDefaultValue, wrapInitialValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleFileField

public MultipleFileField(MultipleFileFieldConfig config,
                         InstallData installData)
Constructs a MultipleFileField.

Parameters:
config - the field configuration
installData - the installation data
Throws:
IzPackException - if the field cannot be read
Method Detail

setValues

public void setValues(List<String> values)
Sets the values. If multiple variables are being used, this creates a variable for each value, using the naming convention: name, name_1, name_2.... If a single variable is being used, the values are concatenated together separated by ';'. If values is empty or doesn't exist, don't so anything.

Parameters:
values - the file names

getVisibleRows

public int getVisibleRows()
Returns the number of visible rows.

Returns:
the number of visible rows, or -1 if none is specified

getPreferredWidth

public int getPreferredWidth()
Returns the preferred width of the field.

Returns:
the preferred width, or -1 if none is specified

getPreferredHeight

public int getPreferredHeight()
Returns the preferred width of the field.

Returns:
the preferred height, or -1 if none is specified

getCreateMultipleVariables

public boolean getCreateMultipleVariables()
Determines if multiple variables should be created to hold the selected files.

Returns:
true if multiple variables should be created; false if a single variable should be used


Copyright © 2018. All rights reserved.