Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Newbe question on refresh things.(Try to remove one composite and refresh the view with another composite)
icon5.gif  Newbe question on refresh things. [message #532413] Sun, 09 May 2010 19:37 Go to next message
Chris  is currently offline Chris
Messages: 2
Registered: May 2010
Junior Member
Hello guy's,
Im kind of a newbe in swt development. What i'm trying to do would be probably simple for one of you but I just don't get it !

I have a view , that is destinated to the login of my application.

(my application connected on a server, and when the apps is connected i just want to put "connected successful with user : x )

Well ... Iv'e got my view and I got 2 composite .. one for the login and one for the message , say logout ... I created 2 classe one for each and named " loginPanel" and logoutPanel. .. well .. I know this is not really a panel but .. its a bad habbit from Swing.

So ... When the view is loaded I show the login window like this :
	public void createPartControl(Composite parent) {
		
		parentComposite = parent;
		setMainComposite(new Composite(parent, SWT.NULL));
		//panels = new HashMap<PanelID,IPanel>();
		GridLayout gridLayout = new GridLayout(1, false);
		mainComposite.setLayout(gridLayout);
		
		new LoginPanel(mainComposite, SWT.NULL);

	}


and this is work fine !!

When my user is connected successfully, iv'e got a listener and I want the listener to remove the content of the mainComposite and replace it with the logout panel.


I've try to dispose and refresh , this is not working well ...
The view is empty , but when I modify the mainComposite it still empty after the refresh Sad


Can somebody help me with that ?

Cheers,

--------------------
Christian Leclerc, CSSLP,SCJP,ZCE
Sphere 3 Solutions inc.
http://www.sphere3solutions.com

Re: Newbe question on refresh things. [message #532456 is a reply to message #532413] Mon, 10 May 2010 07:09 Go to previous messageGo to next message
Jens Mising name is currently offline Jens Mising name
Messages: 12
Registered: March 2010
Location: Berlin
Junior Member
Hi,
though I'm not completely sure if I fully understand what you're trying to accomplish mabye this helps:

Instead of disposing a composite you could use a stacklayout and then just show the logout view on top.

I think I once had the same issue (more or less) and stumpled upon this link:
http:// swik.net/Eclipse/Euxx/Don%27t+remove+controls+from+a+Composi te/b2w9d

Now, in my case using a stacklayout with two composites that contain the "logout" composite and the "mainComposite" works fine.

Regards, Jens
Re: Newbe question on refresh things. [message #532729 is a reply to message #532413] Tue, 11 May 2010 03:40 Go to previous message
Chris  is currently offline Chris
Messages: 2
Registered: May 2010
Junior Member
Yeah it seam to works !!!
THX a lot for the hint !



Previous Topic:HTTP ERROR 500
Next Topic:Reuse the save, new, print toolbar set
Goto Forum:
  


Current Time: Wed Oct 01 14:36:40 GMT 2014

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

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