Community
Participate
Working Groups
TextEditor exposes getOrientation but not setOrientation. There's a workaround involving using getAdapter to retrieve the Control, casting the control to StyledText, and then you can its orientation. Ideally, there should even be UI gestures by default for this, but I'd settle for a cleaner API.
IWorkbenchPartOrientation.getOrientation() is defined and used by Platform UI. Allowing a part to set the orientation might be useful for clients. Asking Platform UI to consider. >There's a workaround >involving using getAdapter to retrieve the Control, casting the control to >StyledText, and then you can its orientation. It would be much easier to simply subclass the text editor and overwrite getOrientation().
At the moment, I'm focused on building action contibutions to the default text editor. I will eventually subclass the TextEditor, yes. In the mean time, I submitted this to save someone else some trouble some day.
Subclassing the part and overriding getOrientation() is the correct way to assign a specific orientation to a part - this is how the workbench layout, presentation, etc is currently implemented to work. Adding a setOrientation() method would require changing a lot of other code and implies support for changing orientation of workbench parts on the fly, which is not (and will not be) supported.