|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.gui.components.link.LinkFactory
public class LinkFactory
Description:
offer convenience methods to create and add buttons/links to Velocity Containers quick and easy
Typical usage (see also GuiDemoLinksController.java):
mainVC = createVelocityContainer("guidemo-links");button = LinkFactory.createButton("button", mainVC, this);
$r.render("button")listeningController.event(UserRequest ureq, Component source, Event event)public void event(UserRequest ureq, Component source, Event event) {
if (source == button){
// do something
}
}
| Constructor Summary | |
|---|---|
LinkFactory()
|
|
| Method Summary | |
|---|---|
static Link |
createButton(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
add a button to the vc Velocity Container and make the listeningController listen to this button. |
static Link |
createButtonSmall(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
add a small button to the vc Velocity Container and make the listeningController listen to this small button. |
static Link |
createButtonXSmall(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
add a xsmall button to the vc Velocity Container and make the listeningController listen to this xsmall button. |
static Link |
createCustomLink(java.lang.String name,
java.lang.String cmd,
java.lang.String key,
int presentation,
VelocityContainer vc,
Controller listeningController)
add a customized link to the vc Velocity Container and make the listeningController listen to this link. |
static Link |
createIconClose(java.lang.String title,
VelocityContainer vc,
Controller listeningController)
add a close icon to the vc Velocity Container and make the listeningController listen to the user's click on the close icon. |
static Link |
createLink(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
add a link to the vc Velocity Container and make the listeningController listen to this link. |
static Link |
createLinkBack(VelocityContainer vc,
Controller listeningController)
add a back link to the vc Velocity Container and make the listeningController listen to this back link. |
static Link |
deAjaxify(Link link)
|
static Link |
markDownloadLink(Link link)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LinkFactory()
| Method Detail |
|---|
public static Link createLinkBack(VelocityContainer vc,
Controller listeningController)
vc Velocity Container and make the listeningController listen to this back link.Follow these instructions to show the back link and catch its events:
$r.render("backLink") in your velocity page, that the link shows up.myBackLinklisteningController.event(UserRequest ureq, Component source, Event event) you catch the back link byif(source == myBackLink){..your stuff here..}
vc - the VelocityContainer within you put this linklisteningController -
public static Link createIconClose(java.lang.String title,
VelocityContainer vc,
Controller listeningController)
vc Velocity Container and make the listeningController listen to the user's click on the close icon.Follow these instructions to show the close icon and catch its events:
$r.render("closeIcon") in your velocity page, that the link shows up.myCloseIconlisteningController.event(UserRequest ureq, Component source, Event event) you catch the close icon byif(source == close icon){..your stuff here..}
title - - displayed on hovering over the icon
- can be null, then no title is displayedvc - listeningController -
public static Link createLink(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
vc Velocity Container and make the listeningController listen to this link.Follow these instructions to show the link and catch its events:
$r.render("myLink") in your velocity page, that the link shows up.myLinklisteningController.event(UserRequest ureq, Component source, Event event) you catch the back link byif(source == myLink){..your stuff here..}
one - string for name of component, command and i18n keyvc - the VelocityContainer within you put this linklisteningController -
public static Link createCustomLink(java.lang.String name,
java.lang.String cmd,
java.lang.String key,
int presentation,
VelocityContainer vc,
Controller listeningController)
vc Velocity Container and make the listeningController listen to this link. A customized link means that you can
configure everything by yourself using the constants of the link component e.g. Link.NONTRANSLATEDFollow these instructions to show the customized link and catch its events:
$r.render("myCustomizedLink") in your velocity page, that the link shows up.myCustomizedLinklisteningController.event(UserRequest ureq, Component source, Event event) you catch the back link byif(source == myLink){..your stuff here..}
name - of the link componentcmd - command, null or empty string are not allowedkey - if it's already translated, use at the next parameter Link.NONTRANSLATED, null is allowedpresentation - vc - the VelocityContainer within you put this linklisteningController -
public static Link createButton(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
vc Velocity Container and make the listeningController listen to this button.Follow these instructions to show the button and catch its events:
$r.render("myButton") in your velocity page, that the button shows up.myButtonlisteningController.event(UserRequest ureq, Component source, Event event) you catch the button byif(source == myButton){..your stuff here..}
one - string for name of component, command and i18n keyvc - the VelocityContainer within you put this linklisteningController -
public static Link createButtonSmall(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
vc Velocity Container and make the listeningController listen to this small button.Follow these instructions to show the small button and catch its events:
$r.render("mySmallButton") in your velocity page, that the small button shows up.mySmallButtonlisteningController.event(UserRequest ureq, Component source, Event event) you catch the small button byif(source == mySmallButton){..your stuff here..}
one - string for name of component, command and i18n keyvc - the VelocityContainer within you put this linklisteningController -
public static Link createButtonXSmall(java.lang.String name,
VelocityContainer vc,
Controller listeningController)
vc Velocity Container and make the listeningController listen to this xsmall button.Follow these instructions to show the xsmall button and catch its events:
$r.render("myXSmallButton") in your velocity page, that the xsmall button shows up.myXSmallButtonlisteningController.event(UserRequest ureq, Component source, Event event) you catch the xsmall button byif(source == myXSmallButton){..your stuff here..}
one - string for name of component, command and i18n keyvc - the VelocityContainer within you put this linklisteningController -
public static Link deAjaxify(Link link)
link - the Link to be deajaxified
public static Link markDownloadLink(Link link)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||