net.sourceforge.squirrel_sql.plugins.sqlbookmark
Class RunBookmarkCommand

java.lang.Object
  extended by net.sourceforge.squirrel_sql.plugins.sqlbookmark.RunBookmarkCommand
All Implemented Interfaces:
ICommand

public class RunBookmarkCommand
extends Object
implements ICommand

Runs a bookmark.

Author:
Joseph Mocker

Constructor Summary
RunBookmarkCommand(Frame frame, ISession session, Bookmark bookmark, SQLBookmarkPlugin plugin, ISQLEntryPanel sqlEntryPanel)
          Ctor.
 
Method Summary
 void execute()
          Load the Bookmark into the SQL Edit buffer.
protected  String parseAndLoadSql(String sql)
          Parse the SQL and prompt the user for entry values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunBookmarkCommand

public RunBookmarkCommand(Frame frame,
                          ISession session,
                          Bookmark bookmark,
                          SQLBookmarkPlugin plugin,
                          ISQLEntryPanel sqlEntryPanel)
                   throws IllegalArgumentException
Ctor.

Parameters:
frame - Parent Frame.
session - The session that we are saving a script for.
bookmark - The bookmark to run.
plugin - The current plugin.
sqlEntryPanel -
Throws:
IllegalArgumentException - Thrown if a null ISession or IPlugin passed.
Method Detail

execute

public void execute()
Load the Bookmark into the SQL Edit buffer.

Specified by:
execute in interface ICommand

parseAndLoadSql

protected String parseAndLoadSql(String sql)
Parse the SQL and prompt the user for entry values. Bookmarked SQL strings can have replaceable parameters. At the time the bookmark is loaded, the user is asked to enter values for any of the parameters. The parameters come in three forms: ${prompt[, tip]} - simple anonymous parameter ${id=name, prompt[, tip]} - named parameter, allows it to be reused ${ref=name} - use the value of an already named parameter. where prompt is the string to display in the popup prompt tip is the optional tooltip to display on the popup prompt name is the "variable" name of the parameter.

Parameters:
sql - The SQL to parse and load.
Returns:
the post-processed SQL.


Copyright © 2001-2010. All Rights Reserved.