Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-text-dev] How to get a hold of the Generic Editor's ITextEditor object?

On Sun, Aug 26, 2018 at 6:19 AM, Nathan Ridge <zeratul976@xxxxxxxxxxx> wrote:
Hi,

Hi,

If I'm writing a plugin that makes use of the Generic Editor (for example, by configuring that files of a certain content type should open in the Generic Editor), how can I get a hold of the ITextEditor object for the Generic Editor?
For example, suppose I want to perform additional setup using ITextEditor's public APIs when setting up the editor.

On that matter, the Generic Editor is no different from any text editor.
Something like workbenchPage.getActiveEditor() or HandlerUtil.getActiveEditor(...) -or any other way to get the editor you're interested in according to your context- will return you an instance of ExtensionBasedEditor (the generic editor) which implements and can be cast to ITextEditor.

HTH
--
Mickael Istria
Eclipse IDE developer, for Red Hat Developers

Back to the top