public class PrototipBehaviour
extends org.apache.wicket.behavior.Behavior
Modifier and Type | Field and Description |
---|---|
protected boolean |
onLoad |
protected boolean |
overrideHeaderContributor |
protected static JS_TYPE |
selectedJsType
Made this static as it is very unlikely that you would want different versions of prototip.js
across your site
|
protected PrototipSettings |
settings |
protected org.apache.wicket.Component |
source |
protected String |
title |
protected String |
tooltip |
protected org.apache.wicket.Component |
tooltipComponent |
Constructor and Description |
---|
PrototipBehaviour()
Default constructor If you use this then you must set either a string, or a component
manually
|
PrototipBehaviour(org.apache.wicket.Component panel)
Provide a component to show as the tool tip (eg a panel)
|
PrototipBehaviour(String tooltip)
Provide a simple string as a tooltip
|
Modifier and Type | Method and Description |
---|---|
void |
bind(org.apache.wicket.Component component)
override bind so that the component you add this behavior to becomes the component the
tooltip applies to
|
static JS_TYPE |
getSelectedJsType() |
PrototipSettings |
getSettings() |
org.apache.wicket.Component |
getSource() |
String |
getTitle() |
String |
getTooltip() |
org.apache.wicket.Component |
getTooltipComponent() |
void |
hide(org.apache.wicket.ajax.AjaxRequestTarget target)
Given an ajax request target, hide this tip on the page
|
boolean |
isOnLoad()
Is the javascript set to load 'onload' if false then it will be 'ondomready'
|
boolean |
isOverrideHeaderContributor() |
void |
remove(org.apache.wicket.ajax.AjaxRequestTarget target)
Given an ajax request target, remove this tip from the page
|
void |
renderHead(org.apache.wicket.Component c,
org.apache.wicket.markup.head.IHeaderResponse response)
Add the required css and js files to the page Permission to distribute prototip files given
by prototip creator Nick Stakenburg (http://www.nickstakenburg.com)
Also add the javascript to create the tooltip
|
void |
setOnLoad(boolean onLoad)
Is the javascript set to load 'onload' if false then it will be 'ondomready'
|
PrototipBehaviour |
setOverrideHeaderContributor(boolean overrideHeaderContributor)
If you do not want this behavour to add the required javascript and css files to the header
set this to true (default false)
|
static void |
setSelectedJsType(JS_TYPE selectedJsType)
There are 3 different js files which can be included: a normal uncompressed one a minified
one a minified and gziped one
To override the default (the minified one) set this parameter
This is a static method and as such affects all PrototipBehaviour in the system, this is so
that you do not have to set the type for every PrototipBehaviour that you use (which is
tedious)
|
PrototipBehaviour |
setSettings(PrototipSettings settings) |
PrototipBehaviour |
setSource(org.apache.wicket.Component source) |
PrototipBehaviour |
setTitle(String title) |
PrototipBehaviour |
setTooltip(String tooltip) |
PrototipBehaviour |
setTooltipComponent(org.apache.wicket.Component tooltipComponent) |
protected String |
toJavascript()
Get string to add the prototip to the page
|
protected org.apache.wicket.Component source
protected String tooltip
protected org.apache.wicket.Component tooltipComponent
protected PrototipSettings settings
protected boolean overrideHeaderContributor
protected String title
protected boolean onLoad
protected static JS_TYPE selectedJsType
public PrototipBehaviour()
public PrototipBehaviour(String tooltip)
tooltip
- public PrototipBehaviour(org.apache.wicket.Component panel)
panel
- public void renderHead(org.apache.wicket.Component c, org.apache.wicket.markup.head.IHeaderResponse response)
renderHead
in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
renderHead
in class org.apache.wicket.behavior.Behavior
public void bind(org.apache.wicket.Component component)
bind
in class org.apache.wicket.behavior.Behavior
public void remove(org.apache.wicket.ajax.AjaxRequestTarget target)
target
- public void hide(org.apache.wicket.ajax.AjaxRequestTarget target)
target
- protected String toJavascript()
public org.apache.wicket.Component getSource()
public PrototipBehaviour setSource(org.apache.wicket.Component source)
source
- the source to setpublic String getTooltip()
public PrototipBehaviour setTooltip(String tooltip)
tooltip
- the tooltip to setpublic org.apache.wicket.Component getTooltipComponent()
public PrototipBehaviour setTooltipComponent(org.apache.wicket.Component tooltipComponent)
panel
- the panel to setpublic PrototipSettings getSettings()
public PrototipBehaviour setSettings(PrototipSettings settings)
settings
- the settings to setpublic boolean isOverrideHeaderContributor()
public PrototipBehaviour setOverrideHeaderContributor(boolean overrideHeaderContributor)
overrideHeaderContributor
- the overrideHeaderContributor to setpublic String getTitle()
public PrototipBehaviour setTitle(String title)
title
- the title to setpublic static JS_TYPE getSelectedJsType()
public static void setSelectedJsType(JS_TYPE selectedJsType)
selectedJsType
- the selectedJsType to setpublic boolean isOnLoad()
public void setOnLoad(boolean onLoad)
onLoad
- Copyright © 2015. All rights reserved.