Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Scout Preferences Implementation(Implementing a PreferencePage in Scout)
Scout Preferences Implementation [message #1228180] Mon, 06 January 2014 15:37 Go to next message
André Morais is currently offline André MoraisFriend
Messages: 9
Registered: December 2013
Junior Member
Hi,

I was trying to collect information for building a demo in scout with a Preference Page in Scout.

However the only information I've found was the existence of a API org.eclipse.scout.sdk.ui.extensions.preferences.

I've tried extending the ScoutSdkPreferencePage class and calling it in a menu.



@Override
public void execAction() throws ProcessingException {
ScoutSdkPreferencePage pp = new ScoutSdkPreferencePage();
pp.createFieldEditors();
}


But I get a lot of NoClassDefFoundError's and the bundle org.eclipse.scout.sdk.ui.internal.ScoutSdkUi is not started.


Does someone implemented a working example? I believe this is a dependency/'target platform' issue however I would like to know if someone was able to implement a Scout PreferencePage.


Regards,

André

Re: Scout Preferences Implementation [message #1228442 is a reply to message #1228180] Tue, 07 January 2014 08:42 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Hi Andre,

Thanks for your question.

Keep in mind that the scout project consists of two parts:
- Scout Runtime (embedded in your Scout Application): all the mechanism you can use in the scout application (model of the application, rendering module, convenience functions like Utilities...)
- Scout SDK (included in the Eclipse Distribution "Eclipse for Scout developers"): tools to develop your eclipse application (wizards, explorer and properties view, ...)

The code snippet you have found belongs to the scout SDK. You cannot use it in your Scout Application.

As for your question: "how to implement preference pages like in RCP" in a scout application... The simple answer is you can't, because we consider that each scout application will provide its own preference Form (depending on the use case). There is an IUserPreferencesStorageService but this is more for caching UI settings. (See this discussion: Table columns order hidden cache??)

Now if you are using Eclipse Scout with the SWT Renderer, you are in an Eclipse RCP project... You can mix your scout application with other RCP concepts like perspective and preference pages. But this is not a main use case for Eclipse Scout and you might need to do a lot by yourself.

Hi hope this helps. Do not hesitate to continue the discussion if not.
Re: Scout Preferences Implementation [message #1228454 is a reply to message #1228442] Tue, 07 January 2014 09:11 Go to previous messageGo to next message
André Morais is currently offline André MoraisFriend
Messages: 9
Registered: December 2013
Junior Member
Hi Jeremie,

Thanks for the quick answer.

I wasn't sure if there was a native scout preferences page, now I understand that it is only possible mixing it up with a SWT implementation which provides the RCP concepts.

From what I understood from your answer For implementing something like a preferences page in native scout it would be like a Scout Form with my own storing service implementation correct?


Thank you,

André

Re: Scout Preferences Implementation [message #1228633 is a reply to message #1228454] Tue, 07 January 2014 17:01 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
André Morais wrote on Tue, 07 January 2014 10:11
From what I understood from your answer For implementing something like a preferences page in native scout it would be like a Scout Form with my own storing service implementation correct?


Yes, this is what I mean.

If you have a lot of preferences, you can of course build something that is generic or reusable...
Re: Scout Preferences Implementation [message #1234325 is a reply to message #1228633] Tue, 21 January 2014 17:47 Go to previous messageGo to next message
Daniel Branco is currently offline Daniel BrancoFriend
Messages: 14
Registered: January 2014
Junior Member
Hi Jeremie,

I have a doubt about preferences and user states. In this post "http://www.eclipse.org/forums/index.php/mv/msg/639245/1233881/#msg_1233881" I explain my questions.

I have checked the posts "Table columns order hidden cache??" and this one, but don get how I can extend the FileSystemUserPreferencesStorageService and use it in my app instead the default one.

Any idea about this?

Thanks and kind regards.
Re: Scout Preferences Implementation [message #1234561 is a reply to message #1234325] Wed, 22 January 2014 09:05 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Daniel Branco wrote on Tue, 21 January 2014 18:47
how I can extend the FileSystemUserPreferencesStorageService and use it in my app instead the default one.


It is not different from a service registration that the SDK creates for a form. But you need to do it by hand.

You will need:
* a class that implements IUserPreferencesStorageService: MyUserPrefService
* a service registration in plugin.xml:
    <service
          class="<absolute path to your MyUserPrefService>"
          createImmediately="false"
          factory="org.eclipse.scout.rt.client.services.ClientServiceFactory"
          ranking="10"
          session="org.eclipse.scout.rt.client.IClientSession">
    </service>


Notice the ranking: needs to be > -1 (which is the default ranking)

When you call: SERVICES.getService(IUserPreferencesStorageService.class).loadPreferences(), your implementation will be called.

I hope this helps.
Re: Scout Preferences Implementation [message #1234988 is a reply to message #1234561] Thu, 23 January 2014 09:42 Go to previous message
Daniel Branco is currently offline Daniel BrancoFriend
Messages: 14
Registered: January 2014
Junior Member
Hi Jeremie,

First of all thanks for your answer, your suggestion only solves one of my problems. But I'm still having problems to understand how to centralized the preferences, once again my goal is what it is explained in this post Preferences and states per User.

Someone seems to achieve more or less what I want in this post and he has other problems, can you have a look at User preferences implementation?, also in that post I pasted what I implement in the My Storage Service.

Kind regards and thanks in advance.
Previous Topic:Modify the node in a TreeField
Next Topic:Preferences and states per User
Goto Forum:
  


Current Time: Tue Mar 19 06:53:38 GMT 2024

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

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

Back to the top