LPEX
4.4.0

com.ibm.lpex.core
Interface LpexCommand

All Known Implementing Classes:
ClockCommand, DetabCommand, EntabCommand, ExecCommand, FindsCommand, FindTextContextCommand, HairlineCommand, HtmlSource, LongestCommand, MatchesCommand, NestingCommand, SetDateAction.SetDate, SyncCommand, TestCommand, WordsCommand

public interface LpexCommand

Interface LpexCommand can be implemented to define a user command.

The code sample below defines a quit editor command in an LPEX-based application:

 
 lpexView.defineCommand("quit", new LpexCommand() {
  public boolean doCommand(LpexView view, String parameters)
  {
   view.dispose(); // dispose of the LPEX view
   dispose();      // dispose of the frame window and its resources 
   return true;
  }
 }); 

The user command may be a new editor command, or it may redefine or extend a default editor command.

See Also:
LpexView.defineCommand(java.lang.String, com.ibm.lpex.core.LpexCommand), TestCommand, DetabCommand

Method Summary
 boolean doCommand(LpexView lpexView, String parameters)
          This method in the defined command will be called to run the command.
 

Method Detail

doCommand

boolean doCommand(LpexView lpexView,
                  String parameters)
This method in the defined command will be called to run the command.

The defined command should return false if the command syntax was incorrect (for example, missing or incorrect parameters), and true otherwise. When false is returned, an appropriate error message should preferably be displayed on the LPEX message line (using the set messageText editor command).

Parameters:
lpexView - the document view in which the command was issued
parameters - the command parameters

LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.