LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.info
Class LyPreference

java.lang.Object
  extended by leon.info.LyTag
      extended by leon.info.LyInfo
          extended by leon.info.LyObjectInfo
              extended by leon.info.LyPreference
All Implemented Interfaces:
java.lang.Cloneable, LyExtraInfoInterface, LyCommentInterface

public final class LyPreference
extends LyObjectInfo
implements LyExtraInfoInterface

This class represents a preference. It contains the following attributes : - the action on which the preference is performed, - the filter used by the preference, - the sort used by the preference, - a name that may be displayed, - the fielInfo corresponding to the fixed column, - the owner of this preference.

See Also:
LyObjectInfo, LyFilter, LySort

Nested Class Summary
static class LyPreference.ShowAs
           
 
Nested classes/interfaces inherited from class leon.info.LyTag
LyTag.Model
 
Field Summary
static java.lang.String __VERSION
           
 
Fields inherited from class leon.info.LyObjectInfo
NULL, PART_ALL, PART_BIND, PART_DATA, PART_GUI, PART_LABEL
 
Constructor Summary
LyPreference(java.lang.String id, LyObjectInfo objectInfo, java.lang.String name, LyFieldInfo fixedColumn, int nbObjects, java.lang.String user, boolean defaultPref)
          Constructor for a preference.
 
Method Summary
 LyPreference clonePreference()
          Clone a preference.
 LyPreference clonePreference(java.lang.String id)
          Clone a preference.
 boolean deleteFile()
          Method for deleting preference file.
 void free()
          Method for freeing extra info (and sub-infos).
 java.lang.String getColumnSizes()
          Get size of columns of this preference.
 LyInfoList<LyFieldInfo> getFieldInfos()
          Gets list of field infos of this preference.
 LyFilter getFilter()
          Get filter used by this preference.
 LyFieldInfo getFixedColumn()
          Get the field info for which its column is fixed in this preference.
 java.lang.String getLastFileName()
          This method return the name of the last open file name (only for import).
 int getNbObjects()
          Get the number of displayed objects.
 LyObjectInfo getObjectInfo()
          Get object info referred by this preference.
 java.lang.String getObjectInfoId()
          Get object info referred by this preference.
 LyPreference.ShowAs getShowAs()
          Get the display mode of this preference.
 LySort getSort()
          Get sort used by this preference.
 java.lang.String getUser()
          Get owner of this preference.
 boolean isDefault()
          Checks if this preference is the default one or not.
 boolean isDefaultForMobile()
          Checks if this preference is the default one or not for mobile view.
 boolean isForPortlet()
          Checks if this preference is for portlet only.
 boolean isReadOnly()
          Checks if this preference can be changed or not.
 boolean saveFile(LyXmlWriterInterface writer)
          Method for saving preference file.
 void setColumnSizes(java.lang.String columnSizes)
          Sets the size of the columns for this preference.
 void setDefault(boolean defaultPref)
          Sets whether this preference is the default one or not.
 void setDefaultForMobile(boolean defaultForMobile)
          Sets whether this preference is the default one or not for mobile view.
 void setFieldInfos(LyInfoList<LyFieldInfo> fieldInfos)
          Sets list of field infos of this preference.
 void setFilter(LyFilter filter)
          Get filter used by this preference.
 void setFixedColumn(LyFieldInfo fixedColumn)
          set the field info for which its column is fixed in this preference.
 void setForPortlet(boolean forPortlet)
          Sets whether this preference is for portlet only.
 void setLastFileName(java.lang.String fileName)
          This method set the name of the last open file name (only for import).
 void setNbObjects(int nbObjects)
          Set the number of displayed objects.
 void setObjectInfo(LyObjectInfo objectInfo)
          Sets the object info referred by this preference.
 void setReadOnly(boolean readOnly)
          Sets whether this preference can be changed or not.
 void setShowAs(LyPreference.ShowAs showAs)
          Sets the display mode of this preference.
 void setSort(LySort sort)
          Get sort used by this preference.
 void writeXml(java.io.PrintWriter pw)
          Writes XML corresponding to this filter element.
 void writeXml(java.io.PrintWriter pw, boolean header, boolean body)
          Method to rewrite XML corresponding to this component.
 
Methods inherited from class leon.info.LyObjectInfo
clone, getAlias, getData, getDataList, getDatas, getFilePrefix, getGroup, getInternalAlias, getInternalFilePrefix, getInternalName, getMarks, getName, getTemplate, getTip, getUserData, hasMark, hasMarks, hasTemplate, isTemplate, putData, putData, removeData, toName
 
Methods inherited from class leon.info.LyInfo
getApplication, getFile, getId, getInclude, isIncluded, isInternal, isInternal, isLoaded, isLocked, load, setApplication, setFile, toString
 
Methods inherited from class leon.info.LyTag
getCommentsEnd, getCommentsStart, getEnvironment, getModelType, getParent, getRootProject, hasAncestor, isExtern, setCommentsEnd, setCommentsStart, wasCloned
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface leon.info.infointerface.LyExtraInfoInterface
getFile, setFile
 
Methods inherited from interface leon.parser.LyCommentInterface
getCommentsEnd, getCommentsStart, setCommentsEnd, setCommentsStart
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values
Constructor Detail

LyPreference

public LyPreference(java.lang.String id,
                    LyObjectInfo objectInfo,
                    java.lang.String name,
                    LyFieldInfo fixedColumn,
                    int nbObjects,
                    java.lang.String user,
                    boolean defaultPref)
Constructor for a preference.

Parameters:
id - the identifier of the preference.
classInfo - the concerned object info.
name - the name of the preference.
fixedColumn - field info for which its column is fixed for the preference.
nbObjects - number of displayed objects.
user - the id of the user that owns the preference.
defaultPref - indicates if this preference is the default one.
Method Detail

clonePreference

public LyPreference clonePreference()
Clone a preference.


clonePreference

public LyPreference clonePreference(java.lang.String id)
Clone a preference.

Parameters:
id - identifier of the cloned preference.

free

public void free()
Method for freeing extra info (and sub-infos).

Specified by:
free in interface LyExtraInfoInterface

saveFile

public boolean saveFile(LyXmlWriterInterface writer)
Method for saving preference file.

Specified by:
saveFile in interface LyExtraInfoInterface
Returns:
True if successful.

deleteFile

public boolean deleteFile()
Method for deleting preference file.

Specified by:
deleteFile in interface LyExtraInfoInterface
Returns:
True if successful.

writeXml

public void writeXml(java.io.PrintWriter pw,
                     boolean header,
                     boolean body)
Method to rewrite XML corresponding to this component.

Specified by:
writeXml in interface LyExtraInfoInterface
Parameters:
pw - The printWriter on which the XML is written.
header - Boolean indicating if header must be written.
header - Boolean indicating if body must be written.

writeXml

public void writeXml(java.io.PrintWriter pw)
Writes XML corresponding to this filter element.

Specified by:
writeXml in interface LyExtraInfoInterface
Parameters:
pw - PrintWriter on which the XML is written.

getObjectInfo

public LyObjectInfo getObjectInfo()
Get object info referred by this preference.

Returns:
The concerned object info id (action or classInfo).

getObjectInfoId

public java.lang.String getObjectInfoId()
Get object info referred by this preference.

Returns:
The concerned object info id (action or classInfo).

getFilter

public LyFilter getFilter()
Get filter used by this preference.

Returns:
The concerned filter.

getSort

public LySort getSort()
Get sort used by this preference.

Returns:
The concerned sort.

getFixedColumn

public LyFieldInfo getFixedColumn()
Get the field info for which its column is fixed in this preference.

Returns:
Field info for which its column is fixed in this preference.

getNbObjects

public int getNbObjects()
Get the number of displayed objects.

Returns:
number of displayed objects, 0 if not set.

isDefault

public boolean isDefault()
Checks if this preference is the default one or not.

Returns:
True if default preference, false otherwise.

isDefaultForMobile

public boolean isDefaultForMobile()
Checks if this preference is the default one or not for mobile view.

Returns:
True if default preference for mobile, false otherwise.

isForPortlet

public boolean isForPortlet()
Checks if this preference is for portlet only.

Returns:
True if preference for portlet, false otherwise.

isReadOnly

public boolean isReadOnly()
Checks if this preference can be changed or not.

Returns:
True if this preference can't be changed, false otherwise.

getFieldInfos

public LyInfoList<LyFieldInfo> getFieldInfos()
Gets list of field infos of this preference.

Returns:
List of field infos, may be null.

getUser

public java.lang.String getUser()
Get owner of this preference.

Specified by:
getUser in interface LyExtraInfoInterface
Returns:
The owner of this preference.

getColumnSizes

public java.lang.String getColumnSizes()
Get size of columns of this preference.

Returns:
The sizes of columns of this preference.

getShowAs

public LyPreference.ShowAs getShowAs()
Get the display mode of this preference.

Returns:
Display mode chose for this preference.

setObjectInfo

public void setObjectInfo(LyObjectInfo objectInfo)
Sets the object info referred by this preference.

Parameters:
action - Object info concerned by this preference.

setFixedColumn

public void setFixedColumn(LyFieldInfo fixedColumn)
set the field info for which its column is fixed in this preference.

Parameters:
fixedColumn - Field info for which its column is fixed in this preference.

setNbObjects

public void setNbObjects(int nbObjects)
Set the number of displayed objects.

Parameters:
nbObjects - number of displayed objects, 0 if not set.

setDefault

public void setDefault(boolean defaultPref)
Sets whether this preference is the default one or not.

Parameters:
defaultPref - True if default preference, false otherwise.

setDefaultForMobile

public void setDefaultForMobile(boolean defaultForMobile)
Sets whether this preference is the default one or not for mobile view.

Parameters:
defaultPref - True if default preference for mobile, false otherwise.

setForPortlet

public void setForPortlet(boolean forPortlet)
Sets whether this preference is for portlet only.

Parameters:
forPortlet - True if preference for portlet only, false otherwise.

setReadOnly

public void setReadOnly(boolean readOnly)
Sets whether this preference can be changed or not.

Parameters:
readOnly - True if this preference can't be nor changed neither deleted, false otherwise.

setColumnSizes

public void setColumnSizes(java.lang.String columnSizes)
Sets the size of the columns for this preference.

Parameters:
columnSizes - the size of the columns for this preference.

setFilter

public void setFilter(LyFilter filter)
Get filter used by this preference.


setSort

public void setSort(LySort sort)
Get sort used by this preference.


setFieldInfos

public void setFieldInfos(LyInfoList<LyFieldInfo> fieldInfos)
Sets list of field infos of this preference.

Parameters:
fieldInfos - List of field infos, may be null.

getLastFileName

public java.lang.String getLastFileName()
This method return the name of the last open file name (only for import).

Returns:
_lastFileName

setLastFileName

public void setLastFileName(java.lang.String fileName)
This method set the name of the last open file name (only for import).

Parameters:
fileName -

setShowAs

public void setShowAs(LyPreference.ShowAs showAs)
Sets the display mode of this preference.

Parameters:
showAs - Display mode chose for this preference.

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com