SWT LPEX
v3.0.5

com.ibm.lpex.samples
Class Lpex

java.lang.Object
  extended bycom.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 java com.ibm.lpex.samples.Lpex %1 %2 %3 %4 %5 %6 %7 %8 %9 
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, java.lang.Boolean.TYPE });
       lpexConstructor.newInstance(new Object[]
        { getView(), getDelegate(), new Rectangle(10, 10, 648, 711), 
          new java.lang.Boolean(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, open the view in 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, open the view in read-only mode
Method Detail

main

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


SWT LPEX
v3.0.5

(C) Copyright IBM Corporation 1998, 2005.  All Rights Reserved.