info.magnolia.ui.workbench.column.definition
Class AbstractColumnDefinition

java.lang.Object
  extended by info.magnolia.ui.workbench.column.definition.AbstractColumnDefinition
All Implemented Interfaces:
ColumnDefinition
Direct Known Subclasses:
MetaDataColumnDefinition, PropertyColumnDefinition, PropertyTypeColumnDefinition, StatusColumnDefinition, TemplateColumnDefinition, UserNameColumnDefinition

public abstract class AbstractColumnDefinition
extends Object
implements ColumnDefinition

Base implementation for all special ColumnDefinitions. Some subclass do not add additional behavior but still are required because in jcr we configure ColumnDefinition to Column mappings and only with specific Definitions we know what Column-Type to map to.


Constructor Summary
AbstractColumnDefinition()
           
 
Method Summary
 float getExpandRatio()
          Expand ratios can be defined to customize the way how excess space is divided among columns.
 Class<? extends ColumnFormatter> getFormatterClass()
           
 String getLabel()
           
 String getName()
           
 String getPropertyName()
           
 Class<? extends ColumnAvailabilityRule> getRuleClass()
          Returns the AvailabilityRule object for this subject.
 Class<?> getType()
          The concrete type represented in this column, ie Long, Double, Date, etc.
 int getWidth()
          Sets columns width (in pixels).
 boolean isDisplayInChooseDialog()
          By default returns true.
 boolean isEditable()
          Returns whether this column should be editable if workbench uses inplace editing.
 boolean isEnabled()
          If false - the column will not be displayed.
 boolean isSearchable()
          Returns whether this column and therefore the underlying JCR property it represents is to be included in searches.
 boolean isSortable()
           
 void setDisplayInChooseDialog(boolean displayInChooseDialog)
           
 void setEditable(boolean editable)
           
 void setEnabled(boolean enabled)
           
 void setExpandRatio(float expandRatio)
           
 void setFormatterClass(Class<? extends ColumnFormatter> formatterClass)
           
 void setLabel(String label)
           
 void setName(String name)
           
 void setPropertyName(String propertyName)
           
 void setRuleClass(Class<? extends ColumnAvailabilityRule> ruleClass)
           
 void setSearchable(boolean searchable)
           
 void setSortable(boolean sortable)
           
 void setWidth(int width)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractColumnDefinition

public AbstractColumnDefinition()
Method Detail

getPropertyName

public String getPropertyName()
Specified by:
getPropertyName in interface ColumnDefinition

setPropertyName

public void setPropertyName(String propertyName)

getName

public String getName()
Specified by:
getName in interface ColumnDefinition

setName

public void setName(String name)

getWidth

public int getWidth()
Sets columns width (in pixels). See ColumnDefinition.getExpandRatio().

Default value is -1, meaning no explicit width assigned.

Specified by:
getWidth in interface ColumnDefinition

setWidth

public void setWidth(int width)

getLabel

public String getLabel()
Specified by:
getLabel in interface ColumnDefinition

setLabel

public void setLabel(String label)

isSortable

public boolean isSortable()
Specified by:
isSortable in interface ColumnDefinition

setSortable

public void setSortable(boolean sortable)

getFormatterClass

public Class<? extends ColumnFormatter> getFormatterClass()
Specified by:
getFormatterClass in interface ColumnDefinition

setFormatterClass

public void setFormatterClass(Class<? extends ColumnFormatter> formatterClass)

getType

public Class<?> getType()
The concrete type represented in this column, ie Long, Double, Date, etc. By default, it assumes a String (which should be a good match in most cases). Subclasses are responsible for returning the actual type.

Specified by:
getType in interface ColumnDefinition

isDisplayInChooseDialog

public boolean isDisplayInChooseDialog()
By default returns true.

Specified by:
isDisplayInChooseDialog in interface ColumnDefinition

setDisplayInChooseDialog

public void setDisplayInChooseDialog(boolean displayInChooseDialog)

getExpandRatio

public float getExpandRatio()
Expand ratios can be defined to customize the way how excess space is divided among columns. A table can have excess space if it has its width defined and there is horizontally more space than columns consume naturally. Excess space is the space that is not used by columns with explicit width (see ColumnDefinition.getWidth()) or with natural width (no width nor expand ratio).

Default value is 1.0.

Specified by:
getExpandRatio in interface ColumnDefinition

setExpandRatio

public void setExpandRatio(float expandRatio)

isSearchable

public boolean isSearchable()
Returns whether this column and therefore the underlying JCR property it represents is to be included in searches. Its value is true by default.

By default returns true.

Specified by:
isSearchable in interface ColumnDefinition

setSearchable

public void setSearchable(boolean searchable)

isEditable

public boolean isEditable()
Description copied from interface: ColumnDefinition
Returns whether this column should be editable if workbench uses inplace editing.

Specified by:
isEditable in interface ColumnDefinition
Returns:
true, if column is editable
See Also:
WorkbenchDefinition.isEditable()

setEditable

public void setEditable(boolean editable)

isEnabled

public boolean isEnabled()
Description copied from interface: ColumnDefinition
If false - the column will not be displayed. useful for turning a column off when extending a columns configuration.

Specified by:
isEnabled in interface ColumnDefinition
Returns:

setEnabled

public void setEnabled(boolean enabled)

getRuleClass

public Class<? extends ColumnAvailabilityRule> getRuleClass()
Description copied from interface: ColumnDefinition
Returns the AvailabilityRule object for this subject.

Specified by:
getRuleClass in interface ColumnDefinition

setRuleClass

public void setRuleClass(Class<? extends ColumnAvailabilityRule> ruleClass)


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.