com.github.dandelion.datatables.core.configuration
Class TableConfiguration

java.lang.Object
  extended by com.github.dandelion.datatables.core.configuration.TableConfiguration

public class TableConfiguration
extends Object

Contains all the table configuration.

Since:
0.9.0
Author:
Thibault Duchateau

Constructor Summary
TableConfiguration(Map<ConfigToken<?>,Object> userConf, MessageResolver messageResolver, javax.servlet.http.HttpServletRequest request)
          FOR INTERNAL USE ONLY
 
Method Summary
 TableConfiguration addCssClass(String cssClass)
           
 TableConfiguration addCssStyle(String cssStyle)
           
 void addExtraHtmlSnippet(ExtraHtml extraHtml)
           
 TableConfiguration addExtraJs(ExtraJs extraJs)
           
 void addStagingConf(ConfigToken<?> configToken, Object value)
           
 Callback getCallback(CallbackType callbackType)
           
 List<Callback> getCallbacks()
           
 Map<ConfigToken<?>,Object> getConfigurations()
           
 String getCurrentExportFormat()
           
 ExportConf getExportConf(String format)
           
 Map<String,ExportConf> getExportConfiguration()
           
 Boolean getExporting()
           
 List<ExtraHtml> getExtraHtmlSnippets()
           
 Set<ExtraJs> getExtraJs()
           
static TableConfiguration getInstance(String tableId, javax.servlet.http.HttpServletRequest request)
          Return an instance of TableConfiguration for the DEFAULT_GROUP_NAME (global), i.e. containing all global configurations.
static TableConfiguration getInstance(String tableId, javax.servlet.http.HttpServletRequest request, String groupName)
           Return an instance of TableConfiguration for the given groupName.
 Set<Extension> getInternalExtensions()
           
 String getMessage(String key)
           
 MessageResolver getMessageResolver()
           
 Properties getMessages()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 Map<ConfigToken<?>,Object> getStagingConfiguration()
           
 String getTableId()
           
 Boolean hasCallback(CallbackType callbackType)
           
 Boolean isExportable()
           
 TableConfiguration registerCallback(Callback callback)
           
 TableConfiguration registerExtension(Extension extension)
          Register an extension in the TableConfiguration.
 void set(ConfigToken<?> configToken, Object object)
           
 void set(String exportFormat, ExportConf exportConf)
           
 void setCallbacks(List<Callback> callbacks)
           
 void setConfig(Map<ConfigToken<?>,Object> configurations2)
           
 void setCurrentExportFormat(String currentExport)
           
 void setExportConfiguration(Map<String,ExportConf> exports)
           
 void setExporting(Boolean exporting)
           
 TableConfiguration setExportTypes(String exportTypes)
           
 void setExtraHtmlSnippets(List<ExtraHtml> linkGroups)
           
 void setExtraJs(Set<ExtraJs> extraJs)
           
 TableConfiguration setInternalExtensions(Set<Extension> extensions)
           
 void setIsExportable(Boolean isExportable)
           
 void setMessageResolver(MessageResolver messageResolver)
           
 void setMessages(Properties messages)
           
 void setStagingConfiguration(Map<ConfigToken<?>,Object> stagingConfiguration)
           
 void setTableId(String tableId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableConfiguration

public TableConfiguration(Map<ConfigToken<?>,Object> userConf,
                          MessageResolver messageResolver,
                          javax.servlet.http.HttpServletRequest request)
FOR INTERNAL USE ONLY

Parameters:
userConf -
Method Detail

getInstance

public static TableConfiguration getInstance(String tableId,
                                             javax.servlet.http.HttpServletRequest request)
Return an instance of TableConfiguration for the DEFAULT_GROUP_NAME (global), i.e. containing all global configurations.

Parameters:
request - The request is not used yet but will to work with Locale.
Returns:
an instance of TableConfiguration that contains all the table configuration.

getInstance

public static TableConfiguration getInstance(String tableId,
                                             javax.servlet.http.HttpServletRequest request,
                                             String groupName)

Return an instance of TableConfiguration for the given groupName. The instance is retrieved from the ConfigurationStore.

If the passed group name doesn't exist, the DEFAULT_GROUP_NAME (global) will be used.

Parameters:
request -
groupName - Name of the configuration group to load.
Returns:
an instance of TableConfiguration that contains all the table configuration.

set

public void set(String exportFormat,
                ExportConf exportConf)

getExportConfiguration

public Map<String,ExportConf> getExportConfiguration()

setExportConfiguration

public void setExportConfiguration(Map<String,ExportConf> exports)

set

public void set(ConfigToken<?> configToken,
                Object object)

getConfigurations

public Map<ConfigToken<?>,Object> getConfigurations()

setConfig

public void setConfig(Map<ConfigToken<?>,Object> configurations2)

registerExtension

public TableConfiguration registerExtension(Extension extension)
Register an extension in the TableConfiguration.

Parameters:
extension - The extension to register.

getExtraJs

public Set<ExtraJs> getExtraJs()

addExtraJs

public TableConfiguration addExtraJs(ExtraJs extraJs)

setExtraJs

public void setExtraJs(Set<ExtraJs> extraJs)

getInternalExtensions

public Set<Extension> getInternalExtensions()

setInternalExtensions

public TableConfiguration setInternalExtensions(Set<Extension> extensions)

getCallbacks

public List<Callback> getCallbacks()

setCallbacks

public void setCallbacks(List<Callback> callbacks)

registerCallback

public TableConfiguration registerCallback(Callback callback)

hasCallback

public Boolean hasCallback(CallbackType callbackType)

getCallback

public Callback getCallback(CallbackType callbackType)

getExporting

public Boolean getExporting()

setExporting

public void setExporting(Boolean exporting)

isExportable

public Boolean isExportable()

setIsExportable

public void setIsExportable(Boolean isExportable)

setExportTypes

public TableConfiguration setExportTypes(String exportTypes)

getTableId

public String getTableId()

setTableId

public void setTableId(String tableId)

addCssStyle

public TableConfiguration addCssStyle(String cssStyle)

addCssClass

public TableConfiguration addCssClass(String cssClass)

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getResponse

public javax.servlet.http.HttpServletResponse getResponse()

getExportConf

public ExportConf getExportConf(String format)

getMessages

public Properties getMessages()

getMessageResolver

public MessageResolver getMessageResolver()

setMessageResolver

public void setMessageResolver(MessageResolver messageResolver)

setMessages

public void setMessages(Properties messages)

getMessage

public String getMessage(String key)

getExtraHtmlSnippets

public List<ExtraHtml> getExtraHtmlSnippets()

setExtraHtmlSnippets

public void setExtraHtmlSnippets(List<ExtraHtml> linkGroups)

addExtraHtmlSnippet

public void addExtraHtmlSnippet(ExtraHtml extraHtml)

getCurrentExportFormat

public String getCurrentExportFormat()

setCurrentExportFormat

public void setCurrentExportFormat(String currentExport)

getStagingConfiguration

public Map<ConfigToken<?>,Object> getStagingConfiguration()

setStagingConfiguration

public void setStagingConfiguration(Map<ConfigToken<?>,Object> stagingConfiguration)

addStagingConf

public void addStagingConf(ConfigToken<?> configToken,
                           Object value)


Copyright © 2013–2014 Dandelion Project. All rights reserved.