Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Access the Global Preferences of Eclipse
Access the Global Preferences of Eclipse [message #330720] Mon, 11 August 2008 21:12 Go to next message
Nikola Borisov is currently offline Nikola BorisovFriend
Messages: 10
Registered: July 2009
Junior Member
Hi All,

I'm developing an plug-in for Eclipse and at some point of it I want to
read some peace of the Eclipse Preferences. In particular I want to know
if the user wants a external or internal browser.


On the other hand I wouldn't need to do this if there was a programmatic
way to open a internal browser in Eclipse in a new editor or view but side
by side with the editors. My big goal was to have a browser launched side
by side with editors but couldn't achieve this so I created my own view
and i nest the browser inside it.

Any help of advice would be appreciated.

Nikola Borisov
Re: Access the Global Preferences of Eclipse [message #330756 is a reply to message #330720] Tue, 12 August 2008 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Nikola Borisov wrote:
> Hi All,
>
> I'm developing an plug-in for Eclipse and at some point of it I want to
> read some peace of the Eclipse Preferences. In particular I want to know
> if the user wants a external or internal browser.

You'll have to find the plugin that owns that particular preference and
investigate its preferences store and the right key to look up. Plug-in
Spy can help you in that investigation:
http://www.eclipse.org/pde/incubator/spy/ (it is included in Eclipse 3.4
Ganyemde)


> On the other hand I wouldn't need to do this if there was a programmatic
> way to open a internal browser in Eclipse in a new editor or view but
> side by side with the editors. My big goal was to have a browser
> launched side by side with editors but couldn't achieve this so I
> created my own view and i nest the browser inside it.

The Web Tools Project does this when you right-click on a JSP and choose
Run on server... so if you can find where in their code they are doing
that you might be able to adapt it to your needs. Perhaps asking about
that on the eclipse.webtools newsgroup would yield some guidance.

Hope this helps,
Eric
Re: Access the Global Preferences of Eclipse [message #330901 is a reply to message #330756] Fri, 15 August 2008 17:27 Go to previous message
Nikola Borisov is currently offline Nikola BorisovFriend
Messages: 10
Registered: July 2009
Junior Member
Thank you for the help Eric.

So on the browser preferences... I found the plug-in that contributes them:

<code>org.eclipse.ui.browser</code>

I also found the source of it's preference page:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.ui.brow ser/src/org/eclipse/ui/internal/browser/WebBrowserPreference .java?view=markup

I see that they have there this really good public method.
<code>public static int getBrowserChoice()</code>
but the class that provides this is internal... Is there a way for me to
call this method from my code? I thought may be not so i tried the
following code:
<code>
int b = PreferencesService.getDefault().getInt("org.eclipse.ui.browser ",
"browser-choice", -7, null);
System.out.println(b);
</code>
When i choose external browser b is 1.
When i choose internal browser b is -7.... A little strange.

I don't know what to do now... Is what I'm doing right? Is there a better
way?

Thanks Nikola
Previous Topic:CVS Synchonization - files with no conficts are shown as having conflicts
Next Topic:How to persist large objects?
Goto Forum:
  


Current Time: Sat Nov 09 23:10:44 GMT 2024

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

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

Back to the top