Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsRe: how do i set an orientation specifically to views and editors?
https://www.eclipse.org/forums/index.php/mv/msg/163969/519115/#msg_519115
Probably IPartListener2 will be useful.
elhanan wrote:
> hi..
>
> i would like to create a small plugin that used on startup and listens
> to views and editors being opened.
>
> when they are opened i wanna set certain views and editors to be Right
> to left.
>
> i've implemented earlyStartUP, but i still need to get a listener to
> the editors and somehow get it's formToolkit, i don't even know how to
> do it with views.]]>Ed Merks2010-03-06T12:22:07-00:00how do i set an orientation specifically to views and editors?
https://www.eclipse.org/forums/index.php/mv/msg/163969/519112/#msg_519112
i would like to create a small plugin that used on startup and listens to views and editors being opened.
when they are opened i wanna set certain views and editors to be Right to left.
i've implemented earlyStartUP, but i still need to get a listener to the editors and somehow get it's formToolkit, i don't even know how to do it with views.]]>elhanan Maayan2010-03-06T17:05:53-00:00Re: how do i set an orientation specifically to views and editors?
https://www.eclipse.org/forums/index.php/mv/msg/163969/519116/#msg_519116
to create a plugin that will enable the user to define for each view and editor a screen if it should be Right ToLeft or viceversa. this plugin would have a preference page listing them all.
this would be a good learning point for me (i believe) on how to develop eclipse
the original motivation for this , was that mylyn task editors should be RightToleft (because of hebrew ) while the rest of the workbench would remain the same (programing doesn't go well with Right To left orientation).
i figured if it goes well , i might open source it, and contribute it to the foundation. (or just open source it).
so far i have no idea how to plug-in something that listens to every window opening. this is becouse on startup i get null for the workbench reference (it's documented in the sdk).]]>elhanan Maayan2010-03-06T17:33:31-00:00Re: how do i set an orientation specifically to views and editors?
https://www.eclipse.org/forums/index.php/mv/msg/163969/519403/#msg_519403
on either -dir rtl or the locale (iw will switch to RTL mode).
An individual view can support this by creating its composite in a
certain mode and doing the work itself. But the views that come with
eclipse don't support anything like that, they're just not coded to do it.
You mean how would you code this into your own editors? Contributed
editors that you don't write will work the same way as contributed views
you don't write ... they won't support this.
But then what? IEditorPart does not offer you any methods for accessing
the orientation or even the SWT controls within the editor.
AFAIK eclipse switches to RTL mode if the locale is RTL (like iw, eg) or
if the command line contains -dir rtl. That orientation is set at
startup, and is used when creating shells and composites (and every
child control inherits this flag).
In theory if you wrote an editor you could deliberately set the
direction in your createPartControl(*) method on your Composite ... but
that means you cannot effect editors you didn't write, and by the time
the IEditorPart becomes available that editor's createPartControl(*) has
already been called.
PW
--
Paul Webster http://wiki.eclipse.org/Platform_Command_Framework http://wiki.eclipse.org/Command_Core_Expressions http://wiki.eclipse.org/Menu_Contributions http://wiki.eclipse.org/Menus_Extension_Mapping http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm]]>Paul Webster2010-03-10T14:11:26-00:00Re: how do i set an orientation specifically to views and editors?
https://www.eclipse.org/forums/index.php/mv/msg/163969/539895/#msg_539895
> You can use IPartListener2 to listen for new editor open events. You
> can use org.eclipse.ui.IWorkbenchPage.getEditorReferences() to get the
> list of currently open editors, and editorReference.getPart(false) to
> actually get the IEditorPart.
>
> But then what? IEditorPart does not offer you any methods for
> accessing the orientation or even the SWT controls within the editor.
>
> AFAIK eclipse switches to RTL mode if the locale is RTL (like iw, eg)
> or if the command line contains -dir rtl. That orientation is set at
> startup, and is used when creating shells and composites (and every
> child control inherits this flag).
>
> In theory if you wrote an editor you could deliberately set the
> direction in your createPartControl(*) method on your Composite ...
> but that means you cannot effect editors you didn't write, and by the
> time the IEditorPart becomes available that editor's
> createPartControl(*) has already been called.
As Paul said: you can only control this for parts that you own and in
that case see
org.eclipse.ui.part.IWorkbenchPartOrientation.getOrientation ().