how to control the different view by input? [message #458748] |
Wed, 20 July 2005 15:49 |
Eclipse User |
|
|
|
Originally posted by: kahon.sohu.com
hi,
I write a class,which has a Shell represents my main UI.It is like below:
---------------------Shell--------------------------|
|
---MenuBar-------- |
---Toolbar-------- |
|
|--------SashForm(main)-------------------------| |
| | |
Tree |SashFormright| |
| | |
|
|------------------------------------------------
then I want to change the sashForm(main)'s Tree by my input of one's
menubar's
input(a menuitem's click will brings front a Dialog which accept some
user's input),and render the different Tree in the SashForm(main).I have
write the dialog and receive user's input,like this: dialog.open()(returns
String[] represent user's input),then I use the result to render different
Tree,but it does raise a "widgt is disposed" Exception.
All above suggest the shell should like a Access Control List's access,and
I'm guesting the wrong is I don't understand the event listner
machalism,then who can give me a right method to design the Framework? Or
give me any suggestions.
|
|
|
Re: how to control the different view by input? [message #458783 is a reply to message #458748] |
Thu, 21 July 2005 10:38 |
Eclipse User |
|
|
|
Originally posted by: kahon.sohu.com
I write two class.One is my main swt standalone main class.It showes a top
level shell,children:MenuBar,ToolBar below,then a main SashForm which has
a child Tree part,a child Right SashForm.the right SashForm is on the
right,it has two vertical children:a table,a composite.
A menu item named login will open a loginDialog.I use the dialog to get
user's role and make decisions to show different view,that is the Main
SashForm's left part:Tree(the tree will decide the right part of the Main
SashForm). When I write in the dialog's onOkButton's SelectionListener's
method to dispose the tree,but it can't render the new tree when I later
new it(I use a UserID from the dialog input to decide the tree
view).what's the wrong?
It will also throw exception when I use the login dialog twice or more.the
main Shell will interrupt at the statement:
if (! display.readAndDispatch()) display.sleep();
|
|
|
|
Re: how to control the different view by input? [message #458894 is a reply to message #458748] |
Mon, 25 July 2005 18:41 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Once a widget is disposed then it cannot be used again (trying to do so will
cause a Widget is Disposed exception). It is not clear from your
description which disposed widget you are accessing, but my guess is that is
may be in the dialog that is shown and then destroyed when the user enters
some information. Your error stack trace should be helpful in indicating
the disposed widget that is being accessed.
Grant
"kahon" <kahon@sohu.com> wrote in message
news:662ce262720d72e7df861ab0ec92950e$1@www.eclipse.org...
> hi,
> I write a class,which has a Shell represents my main UI.It is like below:
> ---------------------Shell--------------------------|
> |
> ---MenuBar-------- |
> ---Toolbar-------- |
> |
> |--------SashForm(main)-------------------------| |
> | | |
> Tree |SashFormright| |
> | | |
> |
> |------------------------------------------------
>
> then I want to change the sashForm(main)'s Tree by my input of one's
> menubar's
> input(a menuitem's click will brings front a Dialog which accept some
> user's input),and render the different Tree in the SashForm(main).I have
> write the dialog and receive user's input,like this: dialog.open()(returns
> String[] represent user's input),then I use the result to render different
> Tree,but it does raise a "widgt is disposed" Exception.
> All above suggest the shell should like a Access Control List's access,and
> I'm guesting the wrong is I don't understand the event listner
> machalism,then who can give me a right method to design the Framework? Or
> give me any suggestions.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02903 seconds