Difference between revisions of "WDSC LPEX"
(→Remap keyboard shortcuts) |
Starbuck5250 (talk | contribs) (→Remap keyboard shortcuts) |
||
(21 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | {{AN}} - Tips for using | + | __TOC__ |
+ | {{AN}} - Tips for using LPEX (''Live Parsing eXtensible Editor'') | ||
+ | |||
+ | LPEX is a Java-based editor that 'knows' about System i code, especially in its accommodation of source members, sequence number and date stamp as well as parsers/syntax checkers for DDS, RPG and CL (among others.) | ||
+ | |||
+ | Some LPEX features: | ||
+ | *Syntax checking | ||
+ | *Colorised source | ||
+ | *Outline view | ||
+ | *Content assist | ||
+ | *Code templates | ||
+ | *RPG wizards | ||
+ | *Automatic FOR/DO completion | ||
+ | *[[Lpex context sensitive help | Context-sensitive help]] | ||
+ | *Context-sensitive editing | ||
+ | *Regular expression Find/replace | ||
+ | *50 visible lines of code | ||
+ | *Automatic indenting | ||
+ | *Side-by-side editing | ||
+ | *Filtering | ||
+ | *Subsetting | ||
+ | *Show block nesting | ||
+ | *Filters and filter pools | ||
+ | *Verify | ||
+ | *Bookmarks | ||
+ | *Tasks | ||
+ | *Reference manuals included | ||
+ | *[[Lpex Show Block Nesting | Show Block Nesting]] | ||
==Keyboard shortcuts== | ==Keyboard shortcuts== | ||
Line 8: | Line 35: | ||
In the LPEX command line type "?action", "?query", "?lpex" or "?seu" (in the full version of WDSC) and you are taken to the appropriate help page. Note on WDSC Lite V6 typing "?seu" brought up nothing. | In the LPEX command line type "?action", "?query", "?lpex" or "?seu" (in the full version of WDSC) and you are taken to the appropriate help page. Note on WDSC Lite V6 typing "?seu" brought up nothing. | ||
− | '''WDSC 7.x'''<br> | + | '''WDSC 7.x''', '''RDP 8.x'''<br> |
Anywhere in the workbench press Ctl+Shft+L. This brings up a window called "Key Assist", which can also be accessed via the Help menu. | Anywhere in the workbench press Ctl+Shft+L. This brings up a window called "Key Assist", which can also be accessed via the Help menu. | ||
+ | |||
+ | Keyboard shortcuts are formally known as User Key Actions. | ||
==Drilling into an "in source" subroutine or subprocedure (RPG)== | ==Drilling into an "in source" subroutine or subprocedure (RPG)== | ||
* Position cursor over subroutine or subprocedure name. | * Position cursor over subroutine or subprocedure name. | ||
− | * Press Ctrl-Q (set a quick mark | + | * Press Ctrl-Q (set a quick mark position). |
* Press F3 to move LPEX editor to that subroutine or subprocedure. | * Press F3 to move LPEX editor to that subroutine or subprocedure. | ||
* When you are finished with that subroutine or subprocedure and wish to return | * When you are finished with that subroutine or subprocedure and wish to return | ||
Line 19: | Line 48: | ||
[[User:Mattt|Mattt]] 13:56, 29 June 2007 (CDT) | [[User:Mattt|Mattt]] 13:56, 29 June 2007 (CDT) | ||
+ | |||
==Fonts== | ==Fonts== | ||
− | + | Some suggested fonts that don't come installed with Windows: | |
+ | * [http://www.proggyfonts.com/index.php?menu=download. Proggy Programming Fonts Download Area] | ||
+ | * [http://en.wikipedia.org/wiki/Liberation_fonts Liberation fonts] (Liberation Mono) | ||
+ | * [http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en Microsoft Consolas font] | ||
+ | |||
# Download your font of choice. | # Download your font of choice. | ||
Line 26: | Line 60: | ||
# <u>W</u>indow → <u>P</u>references → LPEX Editor → Appearance. | # <u>W</u>indow → <u>P</u>references → LPEX Editor → Appearance. | ||
# Click on the Font button to change the font to Proggy font you installed. | # Click on the Font button to change the font to Proggy font you installed. | ||
+ | |||
+ | To assign a font to the editor's printed output, you can use the set command from the command line: {{code|set default.print.font ProggyCleanTTSZBP-11}} or exit WDSC and edit the properties file located in {{code|[path to workspace]\.metadata\.plugins\com.ibm.lpex\Editor.properties}} | ||
+ | |||
+ | default.swt.print.font.fontData="1|ProggyCleanTTSZBP|11|0|WINDOWS|1|-15|0|0|0|0|0|0|0|1|0|0|0|0|ProggyCleanTTSZBP" | ||
+ | default.swt.print.font="ProggyCleanTTSZBP-regular-11" | ||
+ | |||
+ | {{code|set default.print.font "Courier New-8"}} seems like a decent fit for US 8-1/2 x 11 inch paper printed in portrait mode. | ||
+ | |||
+ | Tip o' the hat to Adrian over at the Lab in Toronto for the printing font tips. | ||
==Remap keyboard shortcuts== | ==Remap keyboard shortcuts== | ||
+ | |||
+ | Keyboard shortcuts are officially called User Key Actions. Eclipse itself supplies many actions and IBM supplies more of their own with Lpex. If you wish to assign different actions to a key, you'd use the Preference panel for User Key Actions. Help > LPEX Editor > User Key Actions. | ||
+ | |||
*The default action for Alt-S is to split the line and start the split at the left most position of the new line. | *The default action for Alt-S is to split the line and start the split at the left most position of the new line. | ||
*Many times it is desired to have it split and stay were it split within the new line. | *Many times it is desired to have it split and stay were it split within the new line. | ||
− | *From there you can move the new line text only a short | + | *From there you can move the new line text only a short distance. |
*To make Alt-S split and leave the starting position of the new text in the same place you want to run the --- | *To make Alt-S split and leave the starting position of the new text in the same place you want to run the --- | ||
Line 44: | Line 90: | ||
[[User:Mattt|Mattt]] 13:56, 29 June 2007 (CDT) | [[User:Mattt|Mattt]] 13:56, 29 June 2007 (CDT) | ||
+ | |||
+ | [[File:LPEX_User_Key_Actions.jpg]] | ||
+ | |||
+ | It's really important to Click the Set button on the right before clicking Apply or OK. | ||
+ | |||
+ | <br> | ||
+ | <b>Key mappings are stored in the following files:</b> | ||
+ | |||
+ | {| class="wikitable" class=sortable style="position:relative; margin: 0 0 0.5em 1em; border-collapse: collapse; background:white; clear:right; text-align:left;" border="1" cellpadding="3" | ||
+ | |- | ||
+ | ! IDE version | ||
+ | ! File name | ||
+ | |- | ||
+ | | 7.0 | ||
+ | | <workspace>.metadata/.plugins/com.ibm.lpex/Editor.properties | ||
+ | |- | ||
+ | | 8.5 | ||
+ | | <workspace>.metadata/.plugins/com.ibm.lpex/Editor.properties | ||
+ | |- | ||
+ | | 9.0 | ||
+ | | <workspace>.metadata/.plugins/org.eclipse.core.runtime/.settings/com.ibm.lpex.prefs | ||
+ | |} | ||
==LPEX command line== | ==LPEX command line== | ||
Line 54: | Line 122: | ||
#Goto into the command line by pressing Esc (if not already there). | #Goto into the command line by pressing Esc (if not already there). | ||
#key (without quotes) "query actionKey.ACTION" where ACTION is the LPEX editor action. | #key (without quotes) "query actionKey.ACTION" where ACTION is the LPEX editor action. | ||
− | #* Example, "query | + | #* Example, "query actionKey.showSourcePromptView" reports back in default situations "f4.t". |
In the LPEX command line type "?action", "?query", "?lpex" or "?seu" (in the full version of WDSC) and you are taken to the appropriate help page. Note on WDSC Lite V6 typing "?seu" brought up nothing. | In the LPEX command line type "?action", "?query", "?lpex" or "?seu" (in the full version of WDSC) and you are taken to the appropriate help page. Note on WDSC Lite V6 typing "?seu" brought up nothing. | ||
Line 61: | Line 129: | ||
You can add new actions you find by default in the system or one you develop. There are some sample actions that are useful to a degree. Two of them seem the most useful. They are composeAction and setDateAction. | You can add new actions you find by default in the system or one you develop. There are some sample actions that are useful to a degree. Two of them seem the most useful. They are composeAction and setDateAction. | ||
− | Map these to any keyboard shortcut you wish, I | + | Map these to any keyboard shortcut you wish, I just choose Alt-F1 and Alt-F2 since they were not used. |
+ | |||
+ | <B>IMPORTANT</b> text case is very important here. | ||
+ | |||
+ | These actions were obtained from the online help by searching for "lpex samples". | ||
+ | [[User:Mattt|Mattt]] 13:56, 29 June 2007 (CDT) | ||
+ | |||
+ | The basic idea is to register an action with Lpex and then to assign a key sequence to that action. When registering the action, you get to choose the name; it isn't necessarily related to the actual class. For instance, below, we chose the action name to be {{code|compose}}. The class name must be exactly copied from the documentation <b>-case matters-</b> in order to associate the Java class to the action name you chose. Here, that class is {{code|com.ibm.lpex.samples.ComposeAction}}. | ||
+ | |||
+ | You can test these assignments from the command line if you wish. From the editor pane, press {{keypress|Esc}} to get to the command line. Press Enter to execute a command, then {{keypress|Esc}} to return to editing. | ||
+ | * {{code|set actionClass.compose com.ibm.lpex.samples.ComposeAction}} | ||
+ | * {{code|action compose}} | ||
+ | * {{code|set keyAction.a-f1 compose}} | ||
+ | |||
+ | You can also find out if a key has an assignment or not: | ||
+ | * {{code|query keyAction.a-f1}} | ||
+ | |||
+ | You can also disassociate a key from an action: | ||
+ | * {{code|set keyAction.a-f1}} (note: no action name drops the assignment) | ||
+ | |||
+ | |||
+ | ===ComposeAction=== | ||
+ | This action allows you to enter characters that aren't on your keyboard, like â and é. | ||
+ | |||
+ | Register the action | ||
#<u>W</u>indow → <u>P</u>references → LPEX Editor → User Actions. | #<u>W</u>indow → <u>P</u>references → LPEX Editor → User Actions. | ||
# In the <u>N</u>ame entry box, key actionClass.compose | # In the <u>N</u>ame entry box, key actionClass.compose | ||
Line 67: | Line 159: | ||
# Press the <u>S</u>et button. | # Press the <u>S</u>et button. | ||
# Press the <u>A</u>pply button. | # Press the <u>A</u>pply button. | ||
+ | |||
+ | Assign a key | ||
#<u>W</u>indow → <u>P</u>references → LPEX Editor → User Key Actions. | #<u>W</u>indow → <u>P</u>references → LPEX Editor → User Key Actions. | ||
# In the <u>K</u>ey entry box, key a-F1 | # In the <u>K</u>ey entry box, key a-F1 | ||
Line 72: | Line 166: | ||
# Press the <u>S</u>et button. | # Press the <u>S</u>et button. | ||
# Press the <u>A</u>pply button. | # Press the <u>A</u>pply button. | ||
− | |||
− | |||
− | |||
− | [[User: | + | ===SetDateAction=== |
+ | This action allows you to set the date value for a selected group of lines. This is similar to [[SEU]]s F13 action to set the date. | ||
+ | |||
+ | Register the action | ||
+ | #<u>W</u>indow → <u>P</u>references → LPEX Editor → User Actions. | ||
+ | # In the <u>N</u>ame entry box, key actionClass.setDate (<strong>NOTE:</strong> <em>Some people have found it necessary to enter only "setDate" without the "actionClass." prefix.</em>) | ||
+ | # In the <u>C</u>lass name entry box, key com.ibm.lpex.samples.SetDateAction | ||
+ | # Press the <u>S</u>et button. | ||
+ | # Press the <u>A</u>pply button. | ||
+ | |||
+ | Assign a key | ||
+ | #<u>W</u>indow → <u>P</u>references → LPEX Editor → User Key Actions. | ||
+ | # In the <u>K</u>ey entry box, key a-F2 | ||
+ | # In the A<u>c</u>tion drop down, choose setDate action | ||
+ | # Press the <u>S</u>et button. | ||
+ | # Press the <u>A</u>pply button. | ||
+ | |||
+ | ==LPEX profile properties== | ||
+ | The various settings you change via the command line {{code|set}} command are stored in a text file called Editor.properties. The fastest way to look at the contents of that file is through another command: {{code|viewProfile}} | ||
+ | |||
+ | ==LPEX configuration== | ||
+ | Lpex is incredibly configurable, so much so that it's a very difficult task sometimes to find out where a particular option is configured. In 7.0.0, there is a search filter under {{code|Window->Preferences->}} but that filter only searches over the headings at the top of the configuration element. For instance, if you want to turn off control block auto-completion, you need to search for '''ILE RPG''', not ''code'', ''control'', ''completion'', ''for'', ''do'' or anything like that. | ||
+ | |||
+ | Hovering the mouse over the actual configuration item (in the right window) will give a summary explanation of what the option is for. | ||
+ | |||
+ | {| class="wikitable" class=sortable style="position:relative; margin: 0 0 0.5em 1em; border-collapse: collapse; background:white; clear:right; text-align:left;" border="1" cellpadding="3" | ||
+ | |- | ||
+ | ! Config item | ||
+ | ! What's it do? | ||
+ | ! Search filter | ||
+ | |- | ||
+ | | Automatic closure of control block | ||
+ | | When you type ''FOR'', ''SELECT'', ''DO'', etc., automatically supplies the matching ''ENDxx''. | ||
+ | | ILE RPG | ||
+ | |- | ||
+ | | Automatic indent | ||
+ | | When you create a control block like FOR, DO, etc., indents the following line automatically. | ||
+ | | ILE RPG | ||
+ | |} | ||
+ | |||
+ | ==Outline View export== | ||
+ | Outline View information can't officially be exported, but the XML files involved are stored at {{code|.metadata\.plugins\com.ibm.etools.iseries.edit\information}} | ||
+ | |||
+ | (Thanks to Xuan at the [http://www-949.ibm.com/software/rational/cafe/thread/3371 RPG Café]) | ||
+ | |||
+ | In WDSC 7.0, the XML files are in {{code|.metadata\.plugins\com.ibm.etools.iseries.core\information}} | ||
==Catgeories== | ==Catgeories== | ||
− | + | ||
[[Category:WDSC]] | [[Category:WDSC]] |
Latest revision as of 15:55, 18 July 2014
Contents
WDSC LPEX - Tips for using LPEX (Live Parsing eXtensible Editor)
LPEX is a Java-based editor that 'knows' about System i code, especially in its accommodation of source members, sequence number and date stamp as well as parsers/syntax checkers for DDS, RPG and CL (among others.)
Some LPEX features:
- Syntax checking
- Colorised source
- Outline view
- Content assist
- Code templates
- RPG wizards
- Automatic FOR/DO completion
- Context-sensitive help
- Context-sensitive editing
- Regular expression Find/replace
- 50 visible lines of code
- Automatic indenting
- Side-by-side editing
- Filtering
- Subsetting
- Show block nesting
- Filters and filter pools
- Verify
- Bookmarks
- Tasks
- Reference manuals included
- Show Block Nesting
Keyboard shortcuts
— or —
In the LPEX command line type "?action", "?query", "?lpex" or "?seu" (in the full version of WDSC) and you are taken to the appropriate help page. Note on WDSC Lite V6 typing "?seu" brought up nothing.
WDSC 7.x, RDP 8.x
Anywhere in the workbench press Ctl+Shft+L. This brings up a window called "Key Assist", which can also be accessed via the Help menu.
Keyboard shortcuts are formally known as User Key Actions.
Drilling into an "in source" subroutine or subprocedure (RPG)
- Position cursor over subroutine or subprocedure name.
- Press Ctrl-Q (set a quick mark position).
- Press F3 to move LPEX editor to that subroutine or subprocedure.
- When you are finished with that subroutine or subprocedure and wish to return
to the call of the subroutine or subprocedure press Alt-Q.
Mattt 13:56, 29 June 2007 (CDT)
Fonts
Some suggested fonts that don't come installed with Windows:
- Proggy Programming Fonts Download Area
- Liberation fonts (Liberation Mono)
- Microsoft Consolas font
- Download your font of choice.
- Install the font into your font folder (usually under the C:\Windows system folder).
- Window → Preferences → LPEX Editor → Appearance.
- Click on the Font button to change the font to Proggy font you installed.
To assign a font to the editor's printed output, you can use the set command from the command line: set default.print.font ProggyCleanTTSZBP-11
or exit WDSC and edit the properties file located in [path to workspace]\.metadata\.plugins\com.ibm.lpex\Editor.properties
default.swt.print.font.fontData="1|ProggyCleanTTSZBP|11|0|WINDOWS|1|-15|0|0|0|0|0|0|0|1|0|0|0|0|ProggyCleanTTSZBP" default.swt.print.font="ProggyCleanTTSZBP-regular-11"
set default.print.font "Courier New-8"
seems like a decent fit for US 8-1/2 x 11 inch paper printed in portrait mode.
Tip o' the hat to Adrian over at the Lab in Toronto for the printing font tips.
Remap keyboard shortcuts
Keyboard shortcuts are officially called User Key Actions. Eclipse itself supplies many actions and IBM supplies more of their own with Lpex. If you wish to assign different actions to a key, you'd use the Preference panel for User Key Actions. Help > LPEX Editor > User Key Actions.
- The default action for Alt-S is to split the line and start the split at the left most position of the new line.
- Many times it is desired to have it split and stay were it split within the new line.
- From there you can move the new line text only a short distance.
- To make Alt-S split and leave the starting position of the new text in the same place you want to run the ---
Split and Shift action.
Reassign a shortcut key for LPEX
- Window → Preferences → LPEX Editor → User Key Actions.
- In the Key entry box, key a-s
- In the Action drop down, choose splitAndShift action
- Press the Set button.
- Press the Apply button.
Mattt 13:56, 29 June 2007 (CDT)
It's really important to Click the Set button on the right before clicking Apply or OK.
Key mappings are stored in the following files:
IDE version | File name |
---|---|
7.0 | <workspace>.metadata/.plugins/com.ibm.lpex/Editor.properties |
8.5 | <workspace>.metadata/.plugins/com.ibm.lpex/Editor.properties |
9.0 | <workspace>.metadata/.plugins/org.eclipse.core.runtime/.settings/com.ibm.lpex.prefs |
LPEX command line
Search for the action of a keyboard shortcut.
- Goto into the command line by pressing Esc (if not already there).
- key (without quotes) "query keyAction.X-Y" where X is the keyboard shortcut in the form of a=Alt,c=Ctl or s=Shift and Y is any keyboard key.
- Example, "query keyAction.f4" reports back in default situations "showSourcePromptView".
Search for the keyboard shortcut of an action.
- Goto into the command line by pressing Esc (if not already there).
- key (without quotes) "query actionKey.ACTION" where ACTION is the LPEX editor action.
- Example, "query actionKey.showSourcePromptView" reports back in default situations "f4.t".
In the LPEX command line type "?action", "?query", "?lpex" or "?seu" (in the full version of WDSC) and you are taken to the appropriate help page. Note on WDSC Lite V6 typing "?seu" brought up nothing.
New actions
You can add new actions you find by default in the system or one you develop. There are some sample actions that are useful to a degree. Two of them seem the most useful. They are composeAction and setDateAction.
Map these to any keyboard shortcut you wish, I just choose Alt-F1 and Alt-F2 since they were not used.
IMPORTANT text case is very important here.
These actions were obtained from the online help by searching for "lpex samples". Mattt 13:56, 29 June 2007 (CDT)
The basic idea is to register an action with Lpex and then to assign a key sequence to that action. When registering the action, you get to choose the name; it isn't necessarily related to the actual class. For instance, below, we chose the action name to be compose
. The class name must be exactly copied from the documentation -case matters- in order to associate the Java class to the action name you chose. Here, that class is com.ibm.lpex.samples.ComposeAction
.
You can test these assignments from the command line if you wish. From the editor pane, press Esc to get to the command line. Press Enter to execute a command, then Esc to return to editing.
-
set actionClass.compose com.ibm.lpex.samples.ComposeAction
-
action compose
-
set keyAction.a-f1 compose
You can also find out if a key has an assignment or not:
-
query keyAction.a-f1
You can also disassociate a key from an action:
-
set keyAction.a-f1
(note: no action name drops the assignment)
ComposeAction
This action allows you to enter characters that aren't on your keyboard, like â and é.
Register the action
- Window → Preferences → LPEX Editor → User Actions.
- In the Name entry box, key actionClass.compose
- In the Class name entry box, key com.ibm.lpex.samples.ComposeAction
- Press the Set button.
- Press the Apply button.
Assign a key
- Window → Preferences → LPEX Editor → User Key Actions.
- In the Key entry box, key a-F1
- In the Action drop down, choose composeAction action
- Press the Set button.
- Press the Apply button.
SetDateAction
This action allows you to set the date value for a selected group of lines. This is similar to SEUs F13 action to set the date.
Register the action
- Window → Preferences → LPEX Editor → User Actions.
- In the Name entry box, key actionClass.setDate (NOTE: Some people have found it necessary to enter only "setDate" without the "actionClass." prefix.)
- In the Class name entry box, key com.ibm.lpex.samples.SetDateAction
- Press the Set button.
- Press the Apply button.
Assign a key
- Window → Preferences → LPEX Editor → User Key Actions.
- In the Key entry box, key a-F2
- In the Action drop down, choose setDate action
- Press the Set button.
- Press the Apply button.
LPEX profile properties
The various settings you change via the command line set
command are stored in a text file called Editor.properties. The fastest way to look at the contents of that file is through another command: viewProfile
LPEX configuration
Lpex is incredibly configurable, so much so that it's a very difficult task sometimes to find out where a particular option is configured. In 7.0.0, there is a search filter under Window->Preferences->
but that filter only searches over the headings at the top of the configuration element. For instance, if you want to turn off control block auto-completion, you need to search for ILE RPG, not code, control, completion, for, do or anything like that.
Hovering the mouse over the actual configuration item (in the right window) will give a summary explanation of what the option is for.
Config item | What's it do? | Search filter |
---|---|---|
Automatic closure of control block | When you type FOR, SELECT, DO, etc., automatically supplies the matching ENDxx. | ILE RPG |
Automatic indent | When you create a control block like FOR, DO, etc., indents the following line automatically. | ILE RPG |
Outline View export
Outline View information can't officially be exported, but the XML files involved are stored at .metadata\.plugins\com.ibm.etools.iseries.edit\information
(Thanks to Xuan at the RPG Café)
In WDSC 7.0, the XML files are in .metadata\.plugins\com.ibm.etools.iseries.core\information