Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Getting the Window preferences programmatically
Getting the Window preferences programmatically [message #629556] Tue, 28 September 2010 16:55 Go to next message
Alex Molochnikov is currently offline Alex Molochnikov
Messages: 25
Registered: July 2009
Junior Member
I need to find out the single/double click option setting for opening an
editor. The following code works:

IWorkbench workbench = PlatformUI.getWorkbench();
IPreferenceStore pStore = workbench.getPreferenceStore();
boolean openOnSingleClick = pStore.getBoolean("OPEN_ON_SINGLE_CLICK");

but there are a couple of problems:

1. IWorkbench.getPreferenceStore() is deprecated
2. "OPEN_ON_SINGLE_CLICK" is a String, and a constant for it is in
org.eclipse.ui.internal.IPreferenceConstants ("internal" suggests not to
use it for the app development).

Does anyone know a better way of getting at the preference?

Thanks,
Alex Molochnikov
Kelman Technologies Inc.
Re: Getting the Window preferences programmatically [message #629657 is a reply to message #629556] Wed, 29 September 2010 07:22 Go to previous messageGo to next message
Dani Megert is currently offline Dani Megert
Messages: 3801
Registered: July 2009
Senior Member
Alex Molochnikov wrote:
> I need to find out the single/double click option setting for opening
> an editor. The following code works:
>
> IWorkbench workbench = PlatformUI.getWorkbench();
> IPreferenceStore pStore = workbench.getPreferenceStore();
> boolean openOnSingleClick = pStore.getBoolean("OPEN_ON_SINGLE_CLICK");
>
> but there are a couple of problems:
>
> 1. IWorkbench.getPreferenceStore() is deprecated
> 2. "OPEN_ON_SINGLE_CLICK" is a String, and a constant for it is in
> org.eclipse.ui.internal.IPreferenceConstants ("internal" suggests not
> to use it for the app development).
>
> Does anyone know a better way of getting at the preference?
This might help:
- org.eclipse.ui.OpenAndLinkWithEditorHelper
- org.eclipse.jface.util.OpenStrategy

Dani
>
> Thanks,
> Alex Molochnikov
> Kelman Technologies Inc.
Re: Getting the Window preferences programmatically [message #629888 is a reply to message #629657] Wed, 29 September 2010 20:37 Go to previous message
Alex Molochnikov is currently offline Alex Molochnikov
Messages: 25
Registered: July 2009
Junior Member
OpenStrategy was the answer.

Thank you.

Daniel Megert wrote:
> This might help:
> - org.eclipse.ui.OpenAndLinkWithEditorHelper
> - org.eclipse.jface.util.OpenStrategy
>
> Dani
Previous Topic:MANIFEST.MF : Adding a platform specific required bundle
Next Topic:Seems to have no indexing
Goto Forum:
  


Current Time: Tue Sep 16 19:35:31 GMT 2014

Powered by FUDForum. Page generated in 0.03013 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software