LPEX
3.6.5

com.ibm.lpex.samples
Class TestAction

java.lang.Object
  extended by com.ibm.lpex.samples.TestAction
All Implemented Interfaces:
LpexAction

public class TestAction
extends Object
implements LpexAction

Sample action deleteBlockDelete - delete any selection. This action is similar to the delete default editor action, but it will delete any current selection in the current view (even though the cursor is not anchored to it), not just a stream selection.

Here is the TestAction source code.

To run this sample:

A user action is a Java class that implements the com.ibm.lpex.core.LpexAction interface. Several actions are also defined in TestUserProfile.

See Also:
All the samples

Constructor Summary
TestAction()
           
 
Method Summary
 boolean available(LpexView lpexView)
          This method in the defined action will be called to query its availability.
 void doAction(LpexView lpexView)
          This method in the defined action will be called to run it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestAction

public TestAction()
Method Detail

doAction

public void doAction(LpexView lpexView)
Description copied from interface: LpexAction
This method in the defined action will be called to run it.

An action may be run (for example, from the LPEX command line) with the action editor command, by selecting an associated menu item, or by activating the key or the mouse event to which the action is assigned.

Specified by:
doAction in interface LpexAction
Parameters:
lpexView - the document view in which the action is issued

available

public boolean available(LpexView lpexView)
Description copied from interface: LpexAction
This method in the defined action will be called to query its availability.

When this method returns false, menu items associated with this user action will be disabled, the key or mouse event to which this action is assigned will not run it, and neither will the action command.

Specified by:
available in interface LpexAction
Parameters:
lpexView - the document view for which the action availability is queried

LPEX
3.6.5

Copyright © 2012 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.