× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Craig,

When you are done reading those wiki's go back to RDi and open the main help contents. Type this into the search " com.ibm.lpex.sample", select the link "Overview (LPEX API Reference)". You will see a list of LPEX packages. At the bottom of the list is the " com.ibm.lpex.samples" package. Select this link.

You will see another list. Each of these samples has source code which you can review. In the ComposeAction class there is an example of collecting input. You can use this class as a starting point to create your own plugin for coloring source. Essentially, the same as what Buck shown at the end of his message but now you can roll it into a plugin that simplifies putting in color codes.

To collect the codes for colors you would want to open a member with coloring, position the cursor to the color attribute, Alt+Shift+H to open the hex editor, record the Unicode value of that color. You would then update your plug in to map it to a character sequence.


Thanks, Matt


-----Original Message-----
From: WDSCI-L [mailto:wdsci-l-bounces@xxxxxxxxxxxx] On Behalf Of Buck Calabro
Sent: Friday, August 12, 2016 7:53 AM
To: wdsci-l@xxxxxxxxxxxx
Subject: Re: [WDSCI-L] Inserting specific text with an Editor Action or Command


On 12 August 2016 at 04:59, Craig Richards <craig@xxxxxxxxxxxxxxxx> wrote:
I think last time I looked at User Key Actions ( which is where you
can define key shortcuts to call RDi actions )
- I have already set some of
those up for "splitAndShift" and "pasteOverlay".

But I think with regard to my current requirement I couldn't see how
that would work as IIRC the actions don't allow you to pass
parameters, the "paste" action for example just pastes from the
clipboard, you can't provide a string as a parameter.

I'm trying to be concise vs my typical long windedness. Wish us luck!
What I know about plug-ins is strictly the result of getting scratched whilst walking through the pricker bushes. You are right: Actions don't take parameters per se. Commands can.

I did have an attempt at creating my own er, I think it was a user
action, but I didn't manage to get it to work, I think I found much of
the literature on the subject to be a bit confusing and potentially
out of date.

Like subfiles, there are several moving parts which need to be developed together with the end in mind. I managed it (ish) and that gives me honest hope that anyone reading these words can too. Did you check the wiki?

http://wiki.midrange.com/index.php/Plugin_development
http://wiki.midrange.com/index.php/RDP_ToPrefixArea

That said, I have seen posts in this forum, possibly around the
subject of converting source to free-format, where there were links to
working examples. Maybe I need to dig those out if I can and use them
as a start - I have done a small amount of java programming, so I
guess I could muddle through it.

I'm the trouble-maker responsible for most of that noise.

Going back to Actions, they cannot accept parameters, but they can read editor settings (called Parameters). You can see how this works if you press Escape (to get to the RDi command line), type query version and press Enter. RDi shows the Lpex version. Press Escape to get back to editing. The point of this is that you could set a Parameter ahead of time and then retrieve it in an Action.

The main reason I make note of this is to show you that RDi supports Commands and Actions performed /on the command line/. This may be germane to your initial request (hey, I'm on topic!)

Imagine an SQL statement that you want to mark for later work.
exec sql
select column
from table
where where_clause;

Position the cursor at the end of the 'exec sql' line, Press Escape to get to the command line, insertText -- eyecatcher -- Press Enter
-> RDi inserts the text at the cursor position
Press Escape
-> Now you are editing again

--
--buck

Visit wiki.midrange.com and register for an account. Edit a page that helps you, and because it's public, you'll help someone else, too!

--
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.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.