File: Compose_Tag.bsh

package info (click to toggle)
jedit 5.3.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 14,252 kB
  • ctags: 11,190
  • sloc: java: 98,480; xml: 94,070; makefile: 52; sh: 42; cpp: 6; python: 6
file content (37 lines) | stat: -rw-r--r-- 933 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Localization
final static String NotEditableMessage = jEdit.getProperty("macro.rs.general.ErrorNotEditableDialog.message", "Buffer is not editable");

void composeTag()
{
	caret = textArea.getCaretPosition();

	text = textArea.getSelectedText();
	if(text == null || text.length()==0 )
    {
        textArea.selectWord();
        text = textArea.getSelectedText();
        if(text == null || text.length()==0 )
            return;
    }

	sb = new StringBuffer();
	sb.append("<").append(text).append(">");
	sb.append("</").append(text).append(">");
	textArea.setSelectedText(sb.toString());
    textArea.setCaretPosition(caret + text.length() + 2);
}

	composeTag();

/*
	Macro index data (in DocBook format)

<listitem>
    <para><filename>Compose_Tag.bsh</filename></para>
    <abstract><para>
		Creates an HTML tag from the selected text or select current word and then creates the tag.
    </para></abstract>
</listitem>

*/