LPEX
3.6.7

com.ibm.lpex.samples
Class Lpex

java.lang.Object
  extended by com.ibm.lpex.samples.Lpex

public final class Lpex
extends Object

Sample stand-alone editor built on the LPEX edit widget.

Here is the Lpex source code.

Syntax for running Lpex from the command line:

   java [java options] com.ibm.lpex.samples.Lpex [filename]
        [-encoding charEncoding] [-dt {documentType | none}] 
For example:
   java com.ibm.lpex.samples.Lpex \sample.props -dt properties 
A possible Windows batch program is:
   @start /b javaw com.ibm.lpex.samples.Lpex %1 %2 %3 %4 %5 %6 %7 %8 %9 
(use java instead of javaw to see the stack trace for exceptions). To disable the JIT compiler, run it with this java option:
   -Djava.compiler= 
You can run Lpex in a particular locale. For example, in order to run it in Simplified Chinese (zh_CN), use these two java options:
   -Duser.language=zh -Duser.region=CN 

Commands and actions defined in here:

Example user-defined editor action to open an additional document view with Lpex:

 
 lpexView.defineAction("openNewView", new LpexAction() {
  public void doAction(LpexView view)
  {
   Display display = getDisplay();
   display.asyncExec(new Runnable() {
    public void run() {
     try
      {
       Class cl = Class.forName("com.ibm.lpex.samples.Lpex");
       Constructor lpexConstructor = cl.getConstructor(new Class[]
        { LpexView.class, com.ibm.lpex.samples.Lpex.Delegate.class,
          Rectangle.class, Boolean.TYPE });
       lpexConstructor.newInstance(new Object[]
        { getView(), getDelegate(), new Rectangle(10, 10, 648, 711), 
          Boolean.valueOf(false) });
      }
     catch(Exception e) {}
     }});
  }
  public boolean available(LpexView view)
  { return true; }
 }); 

See Also:
All the samples

Nested Class Summary
static interface Lpex.Delegate
          This interface allows an external program to have actions and commands of secondary Lpex views that it creates, delegated to its own master view of the document.
 
Constructor Summary
Lpex(LpexView lpexView, Lpex.Delegate delegate, Rectangle bounds, boolean browse)
          Constructor for an external program to create a new (secondary) view on its existing document.
Lpex(String[] parms, Rectangle bounds, boolean browse, Shell papaShell)
          Constructor for opening a file.
 
Method Summary
static void main(String[] args)
          Entry point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lpex

public Lpex(String[] parms,
            Rectangle bounds,
            boolean browse,
            Shell papaShell)
Constructor for opening a file.

Parameters:
parms - file name and parameters
bounds - size and position for the window
browse - if true, enforce read-only mode
papaShell - Shell of the external program that started us, or null

Lpex

public Lpex(LpexView lpexView,
            Lpex.Delegate delegate,
            Rectangle bounds,
            boolean browse)
     throws LpexView.ViewInstantiationException
Constructor for an external program to create a new (secondary) view on its existing document.

Parameters:
lpexView - master LpexView of the document
delegate - optional Delegate object for the external program to handle actions and commands from this Lpex view
bounds - size and position for the window
browse - if true, enforce read-only mode
Throws:
LpexView.ViewInstantiationException
Method Detail

main

public static void main(String[] args)
Entry point.


LPEX
3.6.7

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.