|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.CommandHyperlinkListener
public class CommandHyperlinkListener
A HyperlinkListener implementation that will use the href attribute of the
link to lookup and activate the associated command. The following anchor syntax is
supported:
command://command-id?parameterName1=value,paramterName2=ValueA simple command would be specified using
command://command-idIf the command is an
ActionCommand it will be invoked, otherwise if it is a
CommandGroup then a popup will be displayed using the Face.HTML_POPUP
context.
The buildAnchorString(Command) methods can be used to create a correctly formatted anchor
strings from a given command.
The command:// protocol is not registered with the standard URL infrastructure.
| Nested Class Summary | |
|---|---|
static class |
CommandHyperlinkListener.CommandContainerLocator
A locator that locates commands from a CommandContainer. |
static class |
CommandHyperlinkListener.CommandListLocator
A locator built from a simple list of commands. |
| Constructor Summary | |
|---|---|
CommandHyperlinkListener(Command... commands)
Creates a new HyperlinkListener that will use the specified list of
commands. |
|
CommandHyperlinkListener(CommandContainer container)
Creates a new HyperlinkListener that will search for commands using the
specified container. |
|
CommandHyperlinkListener(com.pietschy.command.CommandHyperlinkListener.CommandLocator commandLocator)
Creates a new HyperlinkListener that will search for commands using the
specified command source. |
|
| Method Summary | |
|---|---|
static java.lang.String |
buildAnchorString(ActionCommand command,
java.util.Map<java.lang.String,java.lang.String> parameters)
Builds an <a> tag for the specified command using the commands text attribute to populate the link text and the short description to populate the tooltip. |
static java.lang.String |
buildAnchorString(ActionCommand command,
java.util.Map parameters,
java.lang.String text,
java.lang.String tooltip)
Builds an anchor string for the specified command using the specified parameters, text and tooltip. |
static java.lang.String |
buildAnchorString(Command command)
Builds an <a> tag for the specified command using the commands text attribute to populate the links text and the short description to populate the tooltip. |
static java.lang.String |
buildAnchorString(Command command,
java.lang.String text,
java.lang.String tooltip)
Builds an anchor string for the specified command using the specified text and tooltip. |
(package private) java.lang.String |
extractCommandId(java.lang.String url)
Extracts the command id from urls of the form "command://command-id?param=value" |
(package private) java.util.Map<java.lang.Object,java.lang.Object> |
extractParameters(java.lang.String url)
Extracts the command paramters from urls of the form "command://command-id?param=value" |
protected Command |
getCommand(java.lang.String commandId)
|
void |
hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
Handles a hyperlink update event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandHyperlinkListener(CommandContainer container)
HyperlinkListener that will search for commands using the
specified container.
container - the container used to locate commands.public CommandHyperlinkListener(Command... commands)
HyperlinkListener that will use the specified list of
commands.
commands - a list of commands for the listener to use.public CommandHyperlinkListener(com.pietschy.command.CommandHyperlinkListener.CommandLocator commandLocator)
HyperlinkListener that will search for commands using the
specified command source.
commandLocator - the locator for retriving commands from an id.| Method Detail |
|---|
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
hyperlinkUpdate in interface javax.swing.event.HyperlinkListenere - the event.protected Command getCommand(java.lang.String commandId)
java.lang.String extractCommandId(java.lang.String url)
url - the url.java.util.Map<java.lang.Object,java.lang.Object> extractParameters(java.lang.String url)
url - the url.
public static java.lang.String buildAnchorString(ActionCommand command,
java.util.Map parameters,
java.lang.String text,
java.lang.String tooltip)
<a href="command-id?param=value" title="tooltip">text<a>
command - the commandparameters - the parameterstext - the text to displaytooltip - the tooltip to display
public static java.lang.String buildAnchorString(Command command,
java.lang.String text,
java.lang.String tooltip)
<a href="command-id" title="tooltip">text<a>
command - the commandtext - the text to displaytooltip - the tooltip to displaypublic static java.lang.String buildAnchorString(Command command)
command - the command to be activated by the link
public static java.lang.String buildAnchorString(ActionCommand command,
java.util.Map<java.lang.String,java.lang.String> parameters)
command - the command to be activated by the linkparameters - a map of hints to be specified to the command when it executes.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||