public class ImageParameter extends AbstractSkinParameter
AbstractSkinParameter
for an imageModifier and Type | Class and Description |
---|---|
static class |
ImageParameter.FileValue
Class representing a file value
|
AbstractSkinParameter.SkinParameterType, AbstractSkinParameter.Widget
Modifier and Type | Field and Description |
---|---|
private String |
_iconGlyph |
private String |
_iconLarge |
private String |
_iconSmall |
private String |
_imagePath |
private boolean |
_localUploadEnabled |
_description, _id, _label
Constructor and Description |
---|
ImageParameter(String relPath,
I18nizableText label,
I18nizableText description)
Constructor
|
ImageParameter(String relPath,
I18nizableText label,
I18nizableText description,
String iconGlyph,
String iconSmall,
String iconLarge)
Constructor
|
Modifier and Type | Method and Description |
---|---|
private void |
_copyFile(File srcFile,
File targetFile) |
private File |
_getLibraryFile(File tempDir,
File modelDir,
boolean uploaded) |
private boolean |
_isImage(File file) |
private List<File> |
_listCSSFiles(File file) |
void |
apply(File tempDir,
File modelDir,
Object value,
String lang)
Apply parameter to the skin
|
ImageParameter.FileValue |
getDefaultValue(SkinModel model)
Get the default value
|
ImageParameter.FileValue |
getDefaultValue(SkinModel model,
String lang)
Get the default value
|
String |
getIconGlyph()
Get the CSS icon
|
String |
getIconLarge()
Get the large icon
|
String |
getIconSmall()
Get the small icon
|
String |
getLibraryPath()
Get relative path of images
|
AbstractSkinParameter.SkinParameterType |
getType()
Get type
|
boolean |
isLocalUploadEnabled()
Determines if local upload is enabled
|
void |
setIconGlyph(String iconGlyph)
Set the CSS icon
|
void |
setIconLarge(String iconLarge)
Set the large icon relative path
|
void |
setIconSmall(String iconSmall)
Set the small icon relative path
|
Map<String,Object> |
toJson(String modelName)
Transform the parameter into a JSON object
|
void |
toSAX(ContentHandler contentHandler,
String modelName)
SAX the parameter
|
getDescription, getId, getLabel, setDescription, setLabel
private String _iconGlyph
private String _iconSmall
private String _iconLarge
private boolean _localUploadEnabled
private String _imagePath
public ImageParameter(String relPath, I18nizableText label, I18nizableText description)
relPath
- the relative path of the target imagelabel
- the labeldescription
- the descriptionpublic ImageParameter(String relPath, I18nizableText label, I18nizableText description, String iconGlyph, String iconSmall, String iconLarge)
relPath
- the relative path of the target imagelabel
- the labeldescription
- the descriptioniconGlyph
- The CSS classe for icon, to use instead of small and large iconiconSmall
- The small iconiconLarge
- The large iconpublic AbstractSkinParameter.SkinParameterType getType()
AbstractSkinParameter
getType
in class AbstractSkinParameter
public boolean isLocalUploadEnabled()
public String getLibraryPath()
public void setIconGlyph(String iconGlyph)
iconGlyph
- the CSS iconpublic String getIconGlyph()
public void setIconSmall(String iconSmall)
iconSmall
- the relative path of the small iconpublic String getIconSmall()
public void setIconLarge(String iconLarge)
iconLarge
- the relative path of the large iconpublic String getIconLarge()
public void apply(File tempDir, File modelDir, Object value, String lang)
AbstractSkinParameter
apply
in class AbstractSkinParameter
tempDir
- the work directorymodelDir
- the model directoryvalue
- the valuelang
- The language. Can be null.private List<File> _listCSSFiles(File file)
private File _getLibraryFile(File tempDir, File modelDir, boolean uploaded)
public void toSAX(ContentHandler contentHandler, String modelName) throws SAXException
AbstractSkinParameter
toSAX
in class AbstractSkinParameter
contentHandler
- The content handler to SAX intomodelName
- The model nameSAXException
- if an error occurred while SAXingpublic Map<String,Object> toJson(String modelName)
AbstractSkinParameter
toJson
in class AbstractSkinParameter
modelName
- The model namepublic ImageParameter.FileValue getDefaultValue(SkinModel model)
AbstractSkinParameter
getDefaultValue
in class AbstractSkinParameter
model
- The modelpublic ImageParameter.FileValue getDefaultValue(SkinModel model, String lang)
AbstractSkinParameter
getDefaultValue
in class AbstractSkinParameter
model
- The modellang
- The language