Skip to content
Giorgio Garofalo edited this page Feb 9, 2021 · 5 revisions

When the user changes tab, the onTabSwitch(tab) event is called.
When a tab is opened, onTabOpen(tab) is called, along with the previous event.
Once you have the tab instance, it's possible to access its name (tab.getName()), editor area (tab.getArea()) and file (tab.getFile()).

Note that getFile() returns a ChorusFile, not a regular Java File.

Outside of the events, tabs are accessible by calling getTabs(). The current/active tab is returned by getActiveTab().

The openFile(file) function allows opening a new local file in the editor (if it already exists it just sets it focused) and returns the new tab itself.
file can be either an absolute path as a string or a File instance.

A tab can be closed by calling tab.close().