Class FileSettings
- java.lang.Object
-
- com.jalios.jcms.taglib.settings.BasicSettings<FileSettings>
-
- com.jalios.jcms.taglib.settings.impl.FileSettings
-
- All Implemented Interfaces:
ControlSettings<FileSettings>
,java.lang.Cloneable
public class FileSettings extends BasicSettings<FileSettings>
File Settings- Author:
- Nicolas Dos Santos
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileSettings.FileFilter
Enumeration of available file filters.static class
FileSettings.Mode
Enumeration of File Mode (standard input file, ajax input file).
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AJAX_TOKEN
static int
DEFAULT_IMAGE_MAX_HEIGHT
static int
DEFAULT_IMAGE_MAX_WIDTH
static int
DEFAULT_IMAGE_QUALITY
static java.lang.String
FILTER
static java.lang.String
IMAGE_QUALITY
static java.lang.String
MAX_IMAGE_HEIGHT
static java.lang.String
MAX_IMAGE_WIDTH
static java.lang.String
MODE
static java.lang.String
SELECTED_FILE_LABEL
static java.lang.String
SINGLE_FILE
-
Fields inherited from class com.jalios.jcms.taglib.settings.BasicSettings
APPEND, ARIA_ATTR_PREFIX, ARIA_ATTRIBUTES, AUTOFOCUS, CLEAR_BUTTON, CSS, DATA_ATTR_PREFIX, DATA_ATTRIBUTES, DISABLED, HIDE_CLEAR_BUTTON, HTML_ATTRIBUTES, ID, LANGUAGE_CHOOSER, MAX_LENGTH, NAME, PLACEHOLDER, PREPEND, READONLY, REQUIRED, TITLE, TRIGGER_ACTION, TRIGGER_EVENT, VALUE
-
-
Constructor Summary
Constructors Constructor Description FileSettings()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileSettings
ajaxToken(java.lang.String token)
Specify the Ajax token.FileSettings
filter(FileSettings.FileFilter filter)
Specify theFileSettings.FileFilter
to apply on the input file.FileSettings
filter(java.lang.String filter)
Specify theFileSettings.FileFilter
to apply on the input file.
the String represents a FileFilter and it's resolved withFileSettings.FileFilter.getFilter(String)
.protected FileSettings
getThis()
Returns the exact type of the this reference.
It's a way to recover the type of thethis
object in a class hierarchy (cf.ControlType
getType()
Returns theControlType
related to the currentControlSettings
implementation.FileSettings
mode(FileSettings.Mode mode)
Specify the FileFileSettings.Mode
.FileSettings
resizeImage(int maxWidth, int maxHeight)
Specify the size to which the images to upload are resized.FileSettings
resizeImage(int maxWidth, int maxHeight, int quality)
Specify the size to which the images to upload are resized.FileSettings
resizeImage(java.lang.String resizeImage)
Resize images from the given parameter at format"{maxWidth}x{maxHeight}x{quality}"
FileSettings
selectedFileLabel(java.lang.String[] labels)
Specify the labels of the files already selected.FileSettings
selectedFileLabel(java.lang.String label, java.lang.String... otherLabels)
Specify the labels of the files already selected.FileSettings
singleFile()
Specify the current control accepts only one file.-
Methods inherited from class com.jalios.jcms.taglib.settings.BasicSettings
addOption, append, aria, aria, autofocus, clearOption, clone, css, dataAttribute, dataAttributes, disable, getOption, getOptionNames, htmlAttributes, htmlAttributes, id, isChannelReady, maxLength, merge, name, onChange, onFocusOut, placeholder, prepend, readonly, removeOption, require, resolveOptions, showLanguageChooser, sortSet, title, toStringArray, toStringArray, toStringArray, toStringArray, toStringArray, trigger, value
-
-
-
-
Field Detail
-
MODE
public static final java.lang.String MODE
- See Also:
- Constant Field Values
-
SINGLE_FILE
public static final java.lang.String SINGLE_FILE
- See Also:
- Constant Field Values
-
MAX_IMAGE_WIDTH
public static final java.lang.String MAX_IMAGE_WIDTH
- See Also:
- Constant Field Values
-
MAX_IMAGE_HEIGHT
public static final java.lang.String MAX_IMAGE_HEIGHT
- See Also:
- Constant Field Values
-
IMAGE_QUALITY
public static final java.lang.String IMAGE_QUALITY
- See Also:
- Constant Field Values
-
AJAX_TOKEN
public static final java.lang.String AJAX_TOKEN
- See Also:
- Constant Field Values
-
FILTER
public static final java.lang.String FILTER
- See Also:
- Constant Field Values
-
SELECTED_FILE_LABEL
public static final java.lang.String SELECTED_FILE_LABEL
- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_MAX_WIDTH
public static final int DEFAULT_IMAGE_MAX_WIDTH
- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_MAX_HEIGHT
public static final int DEFAULT_IMAGE_MAX_HEIGHT
- See Also:
- Constant Field Values
-
DEFAULT_IMAGE_QUALITY
public static final int DEFAULT_IMAGE_QUALITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public ControlType getType()
Description copied from interface:ControlSettings
Returns theControlType
related to the currentControlSettings
implementation.- Returns:
ControlType
-
getThis
protected FileSettings getThis()
Description copied from class:BasicSettings
Returns the exact type of the this reference.
It's a way to recover the type of thethis
object in a class hierarchy (cf. getThis "trick").- Specified by:
getThis
in classBasicSettings<FileSettings>
- Returns:
- The exact type of the this reference
-
mode
public FileSettings mode(FileSettings.Mode mode)
Specify the FileFileSettings.Mode
.- Parameters:
mode
-FileSettings.Mode
- Returns:
- a reference to this object - used to chain calls
- See Also:
FileSettings.Mode
-
singleFile
public FileSettings singleFile()
Specify the current control accepts only one file.- Returns:
- a reference to this object - used to chain calls
-
resizeImage
public FileSettings resizeImage(int maxWidth, int maxHeight)
Specify the size to which the images to upload are resized.- Parameters:
maxWidth
- Maximum widthmaxHeight
- Maximum height- Returns:
- a reference to this object - used to chain calls
-
resizeImage
public FileSettings resizeImage(int maxWidth, int maxHeight, int quality)
Specify the size to which the images to upload are resized.- Parameters:
maxWidth
- Maximum widthmaxHeight
- Maximum heightquality
- quality of the image to resize- Returns:
- a reference to this object - used to chain calls
-
resizeImage
public FileSettings resizeImage(java.lang.String resizeImage)
Resize images from the given parameter at format"{maxWidth}x{maxHeight}x{quality}"
- Parameters:
resizeImage
- defines how to resize images using the following format:"{maxWidth}x{maxHeight}x{quality}"
- Returns:
- a reference to this object - used to chain calls
-
ajaxToken
public FileSettings ajaxToken(java.lang.String token)
Specify the Ajax token. Append a input hidden with name is plupload-token and value is the given token.- Parameters:
token
- Ajax token- Returns:
- a reference to this object - used to chain calls
-
filter
public FileSettings filter(FileSettings.FileFilter filter)
Specify theFileSettings.FileFilter
to apply on the input file.- Parameters:
filter
-FileSettings.FileFilter
- Returns:
- a reference to this object - used to chain calls
-
filter
public FileSettings filter(java.lang.String filter)
Specify theFileSettings.FileFilter
to apply on the input file.
the String represents a FileFilter and it's resolved withFileSettings.FileFilter.getFilter(String)
.- Parameters:
filter
-FileSettings.FileFilter
- Returns:
- a reference to this object - used to chain calls
-
selectedFileLabel
public FileSettings selectedFileLabel(java.lang.String label, java.lang.String... otherLabels)
Specify the labels of the files already selected.- Parameters:
label
- The first file labelotherLabels
- The other file labels- Returns:
- a reference to this object - used to chain calls
-
selectedFileLabel
public FileSettings selectedFileLabel(java.lang.String[] labels)
Specify the labels of the files already selected.- Parameters:
labels
- Array of file labels- Returns:
- a reference to this object - used to chain calls
-
-