public abstract class AbstractExtension extends Object implements Extension
Abstract superclass for all extensions.
Lots of utilities are available in this class, allowing you to:
TODOParameter to the generated DataTables configuration,
thanks to addParameter(Parameter),
addParameter(String, Object) and
#addParameter(String, Object, Mode) methodsCallback to the generated DataTables configuration
Also note that you can access the Dandelion Context using the
getContext().
In order to use the extension mechanism, you should:
AbstractExtension. You could directly
create a class that directly implements Extension but this is not
recommended.META - INF / services / com.github.dandelion.datatables.core.extension.Extension
package com.company.extension;
public class MyExtension extends AbstractExtension {
...
}
The file
com.github.dandelion.datatables.core.extension.Extension should
contain: com.company.extension.MyExtension
Extension.getExtensionName() method.| Constructor and Description |
|---|
AbstractExtension() |
| Modifier and Type | Method and Description |
|---|---|
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 |
appendToAfterEndDocumentReady(String afterEndDocumentReady) |
void |
appendToAfterStartDocumentReady(String afterStartDocumentReady) |
void |
appendToBeforeAll(String beforeAll) |
void |
appendToBeforeEndDocumentReady(String beforeEndDocumentReady) |
void |
appendToBeforeStartDocumentReady(String beforeStartDocumentReady) |
void |
appendToComponentConfiguration(String componentConfiguration) |
boolean |
equals(Object obj) |
StringBuilder |
getAfterAll() |
StringBuilder |
getAfterStartDocumentReady() |
StringBuilder |
getBeforeAll() |
StringBuilder |
getBeforeEndDocumentReady() |
StringBuilder |
getBeforeStartDocumentReady() |
com.github.dandelion.core.Context |
getContext() |
Map<String,String> |
getDynamicAttributes() |
List<Parameter> |
getParameters() |
int |
hashCode() |
abstract void |
setup(HtmlTable table) |
void |
setupWrapper(HtmlTable table)
Sets up the extension.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetExtensionNamepublic void setupWrapper(HtmlTable table)
ExtensionSets up the extension.
The HtmlTable object is available if a particular configuration is needed.
setupWrapper in interface Extensiontable - The HTML table.public abstract void setup(HtmlTable table)
public StringBuilder getBeforeAll()
getBeforeAll in interface ExtensionInsertMode#BEFOREALL placeholder.public StringBuilder getAfterAll()
getAfterAll in interface ExtensionInsertMode#AFTERALL placeholder.public StringBuilder getBeforeStartDocumentReady()
getBeforeStartDocumentReady in interface ExtensionInsertMode#BEFORESTARTDOCUMENTREADY placeholder.public StringBuilder getAfterStartDocumentReady()
getAfterStartDocumentReady in interface ExtensionInsertMode#AFTERSTARTDOCUMENTREADY placeholder.public StringBuilder getBeforeEndDocumentReady()
getBeforeEndDocumentReady in interface ExtensionInsertMode#BEFOREENDDOCUMENTREADY placeholder.public List<Parameter> getParameters()
getParameters in interface Extensionpublic 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.
addParameter in interface Extensionparameter - The param to add.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.
parameterName - Name of the parameter.parameterValue - Value of the parameter.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.
parameterName - Name of the parameter.parameterValue - Value of the parameter.mode - Method of updating used for this parameter.public void addBundle(DatatableBundles bundle)
HttpServletRequest with the passed
DatatableBundles.bundle - The DatatableBundles to add.public void addBundleParameter(String assetName, String paramName, Object paramValue)
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.
callbackType - The type of the callback.javascript - The Javascript code to execute in the callback.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.
callbackType - The type of the callback.javascript - The Javascript code to execute in the callback.mode - Method of updating used for this parameter.public void appendToBeforeAll(String beforeAll)
appendToBeforeAll in interface Extensionpublic void appendToBeforeStartDocumentReady(String beforeStartDocumentReady)
appendToBeforeStartDocumentReady in interface Extensionpublic void appendToAfterStartDocumentReady(String afterStartDocumentReady)
appendToAfterStartDocumentReady in interface Extensionpublic void appendToBeforeEndDocumentReady(String beforeEndDocumentReady)
appendToBeforeEndDocumentReady in interface Extensionpublic void appendToAfterEndDocumentReady(String afterEndDocumentReady)
public void appendToComponentConfiguration(String componentConfiguration)
public void appendToAfterAll(String afterAll)
appendToAfterAll in interface Extensionpublic com.github.dandelion.core.Context getContext()
Context.Copyright © 2013–2015 Dandelion Project. All rights reserved.