I think your line that reads "view.doAction(view.actionId("c-delete"));" should read "view.doAction(view.actionId("truncate"));". The c-delete isn't an action, it is a keyAction (i.e. the key that causes the action to be executed).
-Paul.
-----Original Message-----
From: wdsci-l-bounces@xxxxxxxxxxxx [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Hammack, Ted
Sent: 23 August 2013 20:54
To: wdsci-l@xxxxxxxxxxxx
Subject: [WDSCI-L] Lpex Editor - Custom Profile Plugins
Thanks Paul, that second article was very helpful.
I managed to get a custom profile to run successfully, and have already set up several keyboard shortcuts.
However, some functions that I thought would work, simply don't. I tried setting up EraseEOF using a single keystroke (I'm too lazy to hit Ctrl-Delete), and have coded it the same way as the other user-defined actions I created, but it still doesn't like something. When I substitute "c-delete" for another action, it works fine, so I know it's not a problem with the rest of the code.
Can you shed any light on this? (no biggie if you don't have the time).
Thanks again (here is the code).....
package com.mbi.lpexextensions;
import com.ibm.lpex.core.LpexAction;
import com.ibm.lpex.core.LpexView;
public class UserProfile1 {
public static void userProfile(LpexView lpexView) {
lpexView.defineAction("EraseEOF", new LpexAction() {
public void doAction(LpexView view) {
view.doAction(view.actionId("c-delete"));
}
public boolean available(LpexView view) {
return view.currentElement() != 0 && !view.queryOn("readonly");
}
});
lpexView.doCommand("set keyAction.backQuote.secondary EraseEOF");
// set ispf as default editor style
lpexView.doDefaultCommand("set default.updateProfile.baseProfile ispf");
}
}
*Subject: Re: User Key Actions - RDi 9.0
*From: Paul Bailey <PaulBailey@xxxxxxxxxx>
*Date: Wed, 14 Aug 2013 16:22:27 +0100
*List-archive: <
http://archive.midrange.com/wdsci-l>
*List-help: <mailto:wdsci-l-request@xxxxxxxxxxxx?subject=help>
*List-id: Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries <wdsci-l.midrange.com>
*List-post: <mailto:wdsci-l@xxxxxxxxxxxx>
*List-subscribe: <
http://lists.midrange.com/mailman/listinfo/wdsci-l>,
<mailto:wdsci-l-request@xxxxxxxxxxxx?subject=subscribe>
*List-unsubscribe: <
http://lists.midrange.com/mailman/listinfo/wdsci-l>,
<mailto:wdsci-l-request@xxxxxxxxxxxx?subject=unsubscribe>
Have a look at this article:
http://www.ibm.com/developerworks/websphere/library/techarticles/0605_ca
sey/0605_casey.html
It's old, and is talking about RDz instead of RDi, but the majority of the steps are identical and it should be fairly clear what to do.
A hint for the final step, which appears to be different:
There are two locations that hold plugins, "plugins" in the SDP folder and "plugins" in the SDPShared folder. When exporting your plugin (or copying it, as suggested) do not copy into the shared folder as it just won't work.
There is also an article about creating a user profile for LPEX, which basically allows you to assign keys and run commands whenever an LPEX source editor is opened. If you look for com.ibm.lpex.samples in the RDP help, you should find an example user profile in there with source.
http://www.ibm.com/developerworks/websphere/library/techarticles/0607_ca
sey/0607_casey.html
-Paul.
+++ This email and related attachments may contain confidential information intended exclusively for the addressee. Unauthorized use, disclosure or distribution of this material is prohibited. If you received this message in error, please advise the sender and delete all copies of it. Content is provided by the individual sender and does not necessarily reflect the views of the Company. Though sender believes this transmission to be virus-free, it is the recipient's responsibility to ensure that it is.
--
This is the Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries (WDSCI-L) mailing list To post a message email: WDSCI-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/wdsci-l
or email: WDSCI-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/wdsci-l.
Scanned by MailDefender - managed email security from intY - www.maildefender.net
Important, this email transmission and any files with it are strictly confidential to the intended recipient and may be legally privileged. Any views or opinions presented are solely those of the author and do not necessarily represent those of BHSF. If you are not the intended recipient, you must not copy, disclose or distribute its contents in any way. If you have received this e-mail in error, please notify the sender and delete the e-mail from your system.
We have taken steps to ensure this email and attachments are free from any virus but do not accept any responsibility once this e-mail has been transmitted. You should scan any attachments for viruses. No contract may be concluded on behalf of BHSF Limited by e-mail.
Registered Office: BHSF Limited, Gamgee House, 2 Darnley Road, Birmingham, B16 8TE. www.bhsf.co.uk Registered in England number 35500. BHSF is authorised and regulated by the Financial Services Authority.
As an Amazon Associate we earn from qualifying purchases.