Revision 2399 tmp/org.txm.practically.rcp/doc/macroEdit.html

macroEdit.html (revision 2399)
1 1
<html>
2
From the edit dialog, you can:<br>
3
<ul>reorder commands in the macro</ul>
4
<ul>remove commands</ul>
5
<ul>add new commands</ul>
6
<ul>edit commands that have data associated with them (ex. the Find command).</ul>
7
<br>The Edit dialog also allows you to add a new macro id to a command that didn't previously have an associated id (thus turning it into a persistent command), or alter (or remove) the id of an existing command.
8
<br>Adding new commands to the macro requires that you have some knowledge of the commands.  There is a filter above the <bold>Available Commands</bold> list that defaults to showing only edit commands (based on looking at categories).  Some commands are not appropriate to a macro, but it's impossible for me to tell what they are, so you may have to experiment.
2
From the edit dialog, you can:
3
<br>
4
<ul>reorder commands in the macro
5
</ul>
6
<ul>remove commands
7
</ul>
8
<ul>add new commands
9
</ul>
10
<ul>edit commands that have data associated with them (ex. the Find
11
	command).
12
</ul>
13
<br>The Edit dialog also allows you to add a new macro id to a
14
command that didn't previously have an associated id (thus turning it
15
into a persistent command), or alter (or remove) the id of an existing
16
command.
17
<br>Adding new commands to the macro requires that you have some
18
knowledge of the commands. There is a filter above the
19
<bold>Available Commands</bold>
20
list that defaults to showing only edit commands (based on looking at
21
categories). Some commands are not appropriate to a macro, but it's
22
impossible for me to tell what they are, so you may have to experiment.
9 23
<h3>Special macro helper commands</h3>
10
<ul>Mark selection start - set a 'mark' at the current selection start, or at the caret pos if no selection</ul>
11
<ul>Mark selection end - set a 'mark' at the current selection end, or at the caret pos if no selection</ul>
12
<ul>Move cursor to mark - Set the editor cursor to the current mark position</ul>
13
<ul>Insert string - this is the workhorse command used to add text. Can contain carriage returns.</ul>
14
<ul>Find - perform various kinds of text searching</ul>
15
<ul>Styled Text commands - These are commands I've added to the system since they aren't commands by default.  Actions like "move cursor right" are supported by the StyledText widget but aren't mapped as key bindings.</ul>
16
<ul>Macro script - You can write whatever scripts you'd like using beanshell.  I pass in several variables for the editor that should be useful.</ul>
17
<br>
18
The Mark commands are provided as a way to maintain some state while other operations are performed without requiring scripting.  
19
For example, to comment a selected area, you could record a sequence of commands like:
20
<ol>mark selection start</ol>
21
<ol>move cursor right (puts cursor at end of selection</ol>
22
<ol>insert string "*/"</ol>
23
<ol>move cursor to mark</ol>
24
<ol>insert string "/*"</ol>
24
<ul>Mark selection start - set a 'mark' at the current selection
25
	start, or at the caret pos if no selection
26
</ul>
27
<ul>Mark selection end - set a 'mark' at the current selection end,
28
	or at the caret pos if no selection
29
</ul>
30
<ul>Move cursor to mark - Set the editor cursor to the current mark
31
	position
32
</ul>
33
<ul>Insert string - this is the workhorse command used to add text.
34
	Can contain carriage returns.
35
</ul>
36
<ul>Find - perform various kinds of text searching
37
</ul>
38
<ul>Styled Text commands - These are commands I've added to the
39
	system since they aren't commands by default. Actions like "move cursor
40
	right" are supported by the StyledText widget but aren't mapped as key
41
	bindings.
42
</ul>
43
<ul>Macro script - You can write whatever scripts you'd like using
44
	beanshell. I pass in several variables for the editor that should be
45
	useful.
46
</ul>
47
<br> The Mark commands are provided as a way to maintain some state
48
while other operations are performed without requiring scripting. For
49
example, to comment a selected area, you could record a sequence of
50
commands like:
51
<ol>mark selection start
52
</ol>
53
<ol>move cursor right (puts cursor at end of selection
54
</ol>
55
<ol>insert string "*/"
56
</ol>
57
<ol>move cursor to mark
58
</ol>
59
<ol>insert string "/*"
60
</ol>
25 61

  
26 62
</html>

Also available in: Unified diff