close
我正在看 jEdit 的 manual,因為我想寫它的 plug-in。
目的是,想要把它改成符合工作使用的 text-edit。
例如:快速找變數定義 in 某個 case (這不能講), 使用自己的 parser 來 mark 字串。
會選用 jEdit 的原因是:跨平台,因為它是跑在 java platform。(不知道 .Net framework 能不能讓它執行?)
因為我現在會用到的 OS 有包含 windows,Mac OS X, gentoo Linux。
當然還有其他跨平面的 editor,在哪些 editor 寫 plug-in 的 language 大部份是 php or perl。
我不想再學了。我也找不到用 python 的,看到 jedit 是使用 beanshell,是 java 語法,
也使用 java 物件。於是就選它了。當然,程式開啟速度(不開文件、第一次。第二次開啟就快很多,
應該是 static 物件都 load 完了吧,詳細要問 java VM),是我看到最慢的。
就忍一下囉。
以下是,我看到一些,跟 VB 不一樣的字眼,先節錄下來,免得忘記了。
同樣,這不是我寫的,是 jedit 的 manual,不要說是我寫的。
1 string literal - a sequence of characters of fixed length and content.
2 However, both Java and BeanShell let you use a string literal anytime a method's parameter calls for a String.
3 You can think of a BeanShell script as an implicit definition of a main() method in an anonymous class.
4 Java and BeanShell do not have pointers and deal with memory management automatically.
5 Another missing item from a Java perspective is a package statement. Packages are not part of BeanShell, and you don't need to know anything about them to write
BeanShell macros.
BeanShell macros.
6 BeanShell allows you to place import statements anywhere in a script, including inside a block of statements.
7 buffer - a Buffer object represents the contents of the currently visible open text file.
8 view - A View represents the current top-level editor window, extending Java's JFrame class, that contains the various visible components of the program, including the text area, menu bar, toolbar, and any docked windows.
9 editPane - an EditPane object contains a text area and buffer switcher. A view can be split to display edit panes. Among other things, the EditPane class contains methods for selecting the buffer to edit. Most of the time your macros will manipulate the buffer or the textArea. call. You will probably only need to use editPane if your macros work with split views.
10 textArea - a JEditTextArea is the visible component that displays the current buffer.
11 wm - a DockableWindowManager is the visible component that manages dockable windows in the current view.
12 scriptPath - set to the full path of the script currently being executed.
13 For those without Java experience, it is important to know that null is not the same as an empty, “zero-length” String. It is Java's way of saying that there is no object ssociated with this variable.
14 BeanShell does not permit a script to create derived classes. However, BeanShell offers a useful substitute: a method can be used as a scripted object that can include nested methods implementing a number of Java interfaces.
本篇內容會不定時更新。
全站熱搜