Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Show/hide view declararively
Show/hide view declararively [message #333117] Wed, 26 November 2008 08:02 Go to next message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hy.

Is there a way to declare the visibility of a view declaratively?
Background: My RCP app uses a database for storing the whole data. If
the app is not connected to the database, then instead of the normal
views a hint should be presented to the user, that he should connect to
the database first.
As there is no glasspane in SWT (which would be the best option for this
task), I added another view with a "Please connect to database" message
on it and shift between this view and the normal views dependent on the
database connection. (Any better ideas for such a case?)
At the moment I do this fully programmatically, but I wonder if there is
a way to do this declaratively. Perhaps with the use of conditional
property testers, like the declaration for enabling/disabling handlers.

Best regards,
Kai
Re: Show/hide view declararively [message #333129 is a reply to message #333117] Wed, 26 November 2008 12:25 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Kai Schlamp wrote:
> Is there a way to declare the visibility of a view declaratively?
> Background: My RCP app uses a database for storing the whole data. If
> the app is not connected to the database, then instead of the normal
> views a hint should be presented to the user, that he should connect to
> the database first.
> As there is no glasspane in SWT (which would be the best option for this
> task), I added another view with a "Please connect to database" message
> on it and shift between this view and the normal views dependent on the
> database connection. (Any better ideas for such a case?)

What about the *same* view, but with different top composite, depending
on the situation? The "error-case" composite could have a totally
different look-and-feel (including a message or some such).

Alternatively, you could do the same thing via your own extension point.
This extension point could also reuse the core-expression's (There
exists a programmer API for that), so you could define (run-time)
conditions under which the corresponding composite is instantiated.

HTH & Greetings from Bremen,

Daniel Krügler
Re: Show/hide view declararively [message #333150 is a reply to message #333129] Wed, 26 November 2008 22:31 Go to previous message
Kai Schlamp is currently offline Kai SchlampFriend
Messages: 344
Registered: July 2009
Senior Member
Hello Daniel.

Thanks for the help.
I think I will go with your first alternative, even if it is not so nice
as there are minimum three views per perspective, and every view will
then have an error-case composite.
I also thought about implementing your second alternative with views.
Like a "view visible when" extension point. But this is also a bit
cumbersome.
I really hope there will be one day something like a glasspane for SWT.

Greetings from Mainz to Bremen :-)

Kai




Daniel Krügler wrote:
> Kai Schlamp wrote:
>> Is there a way to declare the visibility of a view declaratively?
>> Background: My RCP app uses a database for storing the whole data. If
>> the app is not connected to the database, then instead of the normal
>> views a hint should be presented to the user, that he should connect
>> to the database first.
>> As there is no glasspane in SWT (which would be the best option for
>> this task), I added another view with a "Please connect to database"
>> message on it and shift between this view and the normal views
>> dependent on the database connection. (Any better ideas for such a case?)
>
> What about the *same* view, but with different top composite, depending
> on the situation? The "error-case" composite could have a totally
> different look-and-feel (including a message or some such).
>
> Alternatively, you could do the same thing via your own extension point.
> This extension point could also reuse the core-expression's (There
> exists a programmer API for that), so you could define (run-time)
> conditions under which the corresponding composite is instantiated.
>
> HTH & Greetings from Bremen,
>
> Daniel Krügler
Previous Topic:Where to put log4j.properties
Next Topic:Disable tabs in JSP editor?
Goto Forum:
  


Current Time: Thu Nov 14 09:07:07 GMT 2024

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

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

Back to the top