|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pietschy.command.CommandHyperlinkListener
public class CommandHyperlinkListener
A HyperlinkListener
that will interogate the href of the
link and fire the appropriate command. Commands can be specified in the
anchor using the following syntax
command://my.command.id?hintName1=hintValue,hintName2=hintVale
A simple command would be specified using
command://my.command.name
The command:// protocol is not registered with the standard URL infrastructure.
The buildAnchorString(org.pietschy.command.ActionCommand, java.util.Map, java.lang.String, java.lang.String)
method can be used to create a correctly formatted URL
string from a specified command.
Constructor Summary | |
---|---|
CommandHyperlinkListener()
Creates a new HyperlinkListener that will search for commands using the
specified default CommandManager instance. |
|
CommandHyperlinkListener(CommandManager commandManager)
Creates a new HyperlinkListener that will search for commands using the
specified CommandManager . |
Method Summary | |
---|---|
static java.lang.String |
buildAnchorString(ActionCommand 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(ActionCommand command,
java.util.Map hints)
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(ActionCommand command,
java.util.Map hints,
java.lang.String text)
|
static java.lang.String |
buildAnchorString(ActionCommand command,
java.util.Map hints,
java.lang.String text,
java.lang.String toolTip)
|
static java.lang.String |
buildAnchorString(ActionCommand command,
java.lang.String text)
Builds an <a> tag for the specified command but that uses the specified text instead of the Commands normal text. |
protected java.lang.String |
getCommandIdFromUrl(java.lang.String url)
|
protected java.util.Map |
getHints(java.lang.String url)
|
protected javax.swing.JPopupMenu |
getPopupFor(CommandGroup group)
|
void |
hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandHyperlinkListener(CommandManager commandManager)
HyperlinkListener
that will search for commands using the
specified CommandManager
.
commandManager
- the container used to locate commands.public CommandHyperlinkListener()
HyperlinkListener
that will search for commands using the
specified default CommandManager
instance. It is equivalent to calling
CommandHyperlinkListener(org.pietschy.command.CommandManager)
with CommandManager.defaultInstance
as the argument.
Method Detail |
---|
public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
hyperlinkUpdate
in interface javax.swing.event.HyperlinkListener
protected java.lang.String getCommandIdFromUrl(java.lang.String url)
protected java.util.Map getHints(java.lang.String url)
protected javax.swing.JPopupMenu getPopupFor(CommandGroup group)
public static java.lang.String buildAnchorString(ActionCommand command, java.util.Map hints, java.lang.String text, java.lang.String toolTip)
command
- hints
- text
-
public static java.lang.String buildAnchorString(ActionCommand command, java.util.Map hints, java.lang.String text)
public static java.lang.String buildAnchorString(ActionCommand command, java.lang.String text)
command
- the command to be activated by the linktext
- the text to display
public static java.lang.String buildAnchorString(ActionCommand command)
command
- the command to be activated by the link
public static java.lang.String buildAnchorString(ActionCommand command, java.util.Map hints)
command
- the command to be activated by the linkhints
- a map of hints to be specified to the command when it executes.
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |