Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-text-dev] Going from ITextEditor to ITextViewer andback

It is not a good practice to access the text widget unless you do it for your own editor. Please see org.eclipse.jface.text.ITextViewer.getTextWidget() for details.

Dani



From:        Nathan Ridge <zeratul976@xxxxxxxxxxx>
To:        "platform-text-dev@xxxxxxxxxxx" <platform-text-dev@xxxxxxxxxxx>
Date:        06.08.2018 23:01
Subject:        Re: [platform-text-dev] Going from ITextEditor to ITextViewer and        back
Sent by:        platform-text-dev-bounces@xxxxxxxxxxx




> Given an ITextEditor, is there a supported way to access its ITextViewer (if it has one)?

One of the reasons I wanted to do this, is to access the StyledText control via the text viewer.

Today I discovered that you can access the StyledText from the editor directly via getAdapter():

   StyledText textWidget = (StyledText) editor.getAdapter(Control.class);

Are these adapter relationships documented somewhere?

Thanks,
Nate
_______________________________________________
platform-text-dev mailing list
platform-text-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-text-dev





Back to the top