com.github.dandelion.datatables.core.extension
Class AbstractExtension

java.lang.Object
  extended by com.github.dandelion.datatables.core.extension.AbstractExtension
All Implemented Interfaces:
Extension
Direct Known Subclasses:
AbstractFilteringFeature, AjaxFeature, AjaxReloadFeature, AppearFeature, Bootstrap2ResponsiveTheme, Bootstrap2Theme, Bootstrap3ResponsiveTheme, Bootstrap3Theme, ColReorderPlugin, ExportFeature, ExtraHtmlFeature, ExtraJsFeature, FixedHeaderPlugin, JQueryUITheme, MultiFilterFeature, PaginationTypeBootstrapFeature, PaginationTypeBootstrapFourButtonFeature, PaginationTypeBootstrapFullNumbersFeature, PaginationTypeExtJsFeature, PaginationTypeFourButtonFeature, PaginationTypeInputFeature, PaginationTypeListboxFeature, PaginationTypeScrollingFeature, PipeliningFeature, ScrollerPlugin, ServerSideFeature, SortingFeature

public abstract class AbstractExtension
extends Object
implements Extension

Abstract superclass for all extensions.

Lots of utilities are available in this class, allowing you to:

Author:
Thibault Duchateau

Constructor Summary
AbstractExtension()
           
 
Method Summary
 void addBundle(DatatableBundles bundle)
          Updates the current HttpServletRequest with the passed DatatableBundles.
 void addBundleParameter(String assetName, String paramName, Object paramValue)
           
 void addCallback(CallbackType callbackType, String javascript)
           Adds a Callback to the DataTables generated configuration.
 void addCallback(CallbackType callbackType, String javascript, Parameter.Mode mode)
           Adds a Callback to the DataTables generated configuration, specifying a method of updating if the CallbackType already exists in the configuration.
 void addParameter(Parameter parameter)
           Adds the passed Parameter to a temporary list.
 void addParameter(String parameterName, Object parameterValue)
           Adds a new DataTables parameter to the generated configuration.
 void addParameter(String parameterName, Object parameterValue, Parameter.Mode mode)
           Adds a new DataTables parameter to the generated configuration, using a custom method of updating.
 void appendToAfterAll(String afterAll)
           
 void appendToAfterStartDocumentReady(String afterStartDocumentReady)
           
 void appendToBeforeAll(String beforeAll)
           
 void appendToBeforeEndDocumentReady(String beforeEndDocumentReady)
           
 void appendToBeforeStartDocumentReady(String beforeStartDocumentReady)
           
 boolean equals(Object obj)
           
 StringBuilder getAfterAll()
           
 StringBuilder getAfterStartDocumentReady()
           
 StringBuilder getBeforeAll()
           
 StringBuilder getBeforeEndDocumentReady()
           
 StringBuilder getBeforeStartDocumentReady()
           
 AbstractConfigurationGenerator getConfigGenerator()
           
 com.github.dandelion.core.Context getContext()
           
 Map<String,String> getDynamicAttributes()
           
 String getFunction()
           
 List<Parameter> getParameters()
           
 int hashCode()
           
 boolean isEnabled(ConfigToken<Boolean> configToken)
           
 boolean isNotNull(ConfigToken<?> configToken)
           
 void setConfigGenerator(AbstractConfigurationGenerator configGenerator)
           
 void setConfs(List<Parameter> confs)
           
 void setFunction(String function)
           
abstract  void setup(HtmlTable table)
           
 void setupWrapper(HtmlTable table)
           Set the extension up.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.github.dandelion.datatables.core.extension.Extension
getName
 

Constructor Detail

AbstractExtension

public AbstractExtension()
Method Detail

setupWrapper

public void setupWrapper(HtmlTable table)
Description copied from interface: Extension

Set the extension up.

The HtmlTable object is available if a particular configuration is needed.

Specified by:
setupWrapper in interface Extension
Parameters:
table - The HTML table.

setup

public abstract void setup(HtmlTable table)

getBeforeAll

public StringBuilder getBeforeAll()
Specified by:
getBeforeAll in interface Extension
Returns:
the Javascript code to be inserted at the InsertMode.BEFOREALL placeholder.

getAfterAll

public StringBuilder getAfterAll()
Specified by:
getAfterAll in interface Extension
Returns:
the Javascript code to be inserted at the InsertMode.AFTERALL placeholder.

getBeforeStartDocumentReady

public StringBuilder getBeforeStartDocumentReady()
Specified by:
getBeforeStartDocumentReady in interface Extension
Returns:
the Javascript code to be inserted at the InsertMode.BEFORESTARTDOCUMENTREADY placeholder.

getAfterStartDocumentReady

public StringBuilder getAfterStartDocumentReady()
Specified by:
getAfterStartDocumentReady in interface Extension
Returns:
the Javascript code to be inserted at the InsertMode.AFTERSTARTDOCUMENTREADY placeholder.

getBeforeEndDocumentReady

public StringBuilder getBeforeEndDocumentReady()
Specified by:
getBeforeEndDocumentReady in interface Extension
Returns:
the Javascript code to be inserted at the InsertMode.BEFOREENDDOCUMENTREADY placeholder.

getParameters

public List<Parameter> getParameters()
Specified by:
getParameters in interface Extension

setConfs

public void setConfs(List<Parameter> confs)
Specified by:
setConfs in interface Extension

addParameter

public void addParameter(Parameter parameter)

Adds the passed Parameter to a temporary list.

Later this list is processed and all Parameters are added to the DataTables generated configuration.

Specified by:
addParameter in interface Extension
Parameters:
parameter - The param to add.

addParameter

public void addParameter(String parameterName,
                         Object parameterValue)

Adds a new DataTables parameter to the generated configuration.

If the parameter already exists, it will be overriden.

Parameters:
parameterName - Name of the parameter.
parameterValue - Value of the parameter.

addParameter

public void addParameter(String parameterName,
                         Object parameterValue,
                         Parameter.Mode mode)

Adds a new DataTables parameter to the generated configuration, using a custom method of updating.

Parameters:
parameterName - Name of the parameter.
parameterValue - Value of the parameter.
mode - Method of updating used for this parameter.

addBundle

public void addBundle(DatatableBundles bundle)
Updates the current HttpServletRequest with the passed DatatableBundles.

Parameters:
bundle - The DatatableBundles to add.

addBundleParameter

public void addBundleParameter(String assetName,
                               String paramName,
                               Object paramValue)

addCallback

public void addCallback(CallbackType callbackType,
                        String javascript)

Adds a Callback to the DataTables generated configuration.

By default, if the CallbackType already exists in the configuration, the code will be appended to the existing code.

Parameters:
callbackType - The type of the callback.
javascript - The Javascript code to execute in the callback.

addCallback

public void addCallback(CallbackType callbackType,
                        String javascript,
                        Parameter.Mode mode)

Adds a Callback to the DataTables generated configuration, specifying a method of updating if the CallbackType already exists in the configuration.

Parameters:
callbackType - The type of the callback.
javascript - The Javascript code to execute in the callback.
mode - Method of updating used for this parameter.

getConfigGenerator

public AbstractConfigurationGenerator getConfigGenerator()
Specified by:
getConfigGenerator in interface Extension

setConfigGenerator

public void setConfigGenerator(AbstractConfigurationGenerator configGenerator)
Specified by:
setConfigGenerator in interface Extension

appendToBeforeAll

public void appendToBeforeAll(String beforeAll)
Specified by:
appendToBeforeAll in interface Extension

appendToBeforeStartDocumentReady

public void appendToBeforeStartDocumentReady(String beforeStartDocumentReady)
Specified by:
appendToBeforeStartDocumentReady in interface Extension

appendToAfterStartDocumentReady

public void appendToAfterStartDocumentReady(String afterStartDocumentReady)
Specified by:
appendToAfterStartDocumentReady in interface Extension

appendToBeforeEndDocumentReady

public void appendToBeforeEndDocumentReady(String beforeEndDocumentReady)
Specified by:
appendToBeforeEndDocumentReady in interface Extension

appendToAfterAll

public void appendToAfterAll(String afterAll)
Specified by:
appendToAfterAll in interface Extension

getFunction

public String getFunction()
Specified by:
getFunction in interface Extension

setFunction

public void setFunction(String function)
Specified by:
setFunction in interface Extension

getDynamicAttributes

public Map<String,String> getDynamicAttributes()

isEnabled

public boolean isEnabled(ConfigToken<Boolean> configToken)

isNotNull

public boolean isNotNull(ConfigToken<?> configToken)

getContext

public com.github.dandelion.core.Context getContext()
Returns:
the Dandelion Context.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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