|
2) Is there a way of defining multiple key actions or other "mini macros" without having to resort to Java? E.g. In code I have a key that maps to shift a block right 3 spaces. In jLpex I can map a key that shifts a block right one space, but I can't pass it the number of spaces to shift, and I can't work out how to repeat the "shift once" automatically.
1.- Edit a file ThreeRight.java: ====================================================================== import com.ibm.lpex.core.LpexAction; import com.ibm.lpex.core.LpexView;
public class ThreeRight implements LpexAction { public void doAction(LpexView lpexView) { int shift = lpexView.actionId("blockShiftRight"); lpexView.doAction(shift); lpexView.doAction(shift); lpexView.doAction(shift); } public boolean available(LpexView lpexView) { return lpexView.actionAvailable(lpexView.actionId("blockShiftRight")); } } ======================================================================
2.- Compile with: javac ThreeRight.java
Your classpath must include: <wdsc install root>\eclipse\plugins\com.ibm.lpex_1.3.8\lpex.jar
3.- Copy the resulting class to the LPEX plug-in directory: copy ThreeRight.class <wdsc_install_root>\eclipse\plugins\com.ibm.lpex_1.3.8\*.*
4.- In the LPEX "User Actions" preferences, define the new class: Name: threeRight Class name: ThreeRight
Now you can call this action from LPEX's command line: action threeRight
or bind it to a key from the "User Key Actions" preferences: Key: a-backSpace Action: threeRight
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.