|
Re: getting the shell in SelectionAdapter while in a wizard [message #451029 is a reply to message #451027] |
Mon, 21 February 2005 22:04 |
Eclipse User |
|
|
|
Originally posted by: tranjim.hotmail.com
have you tried Display.getCurrent().getActiveShell()?
"Duncan Krebs" <duncan@krebsnet.com> wrote in message
news:cvdch6$23m$1@www.eclipse.org...
> Hi,
> I'm new to SWT and am stuck on this one. I have a button in a jface wizard
> that when clicked I want to display a directory selection dialog. However
> inside my widgetSeleceted method on the default SelectionAdapter I can't
> figure out how to get the shell that I need to pass to the the New Dialog
> constructor.
> I tried getting first the control from e.item and then the shell from the
> control but its giving me a null pointer exception. I suppose I could also
> implement my own SelectionAdapter but I'm thinking there has to be an
> easier way. Thanks. - dkrebs
>
>
|
|
|
Re: getting the shell in SelectionAdapter while in a wizard [message #451031 is a reply to message #451027] |
Tue, 22 February 2005 05:05 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Duncan Krebs wrote:
> Hi,
> I'm new to SWT and am stuck on this one. I have a button in a jface
> wizard that when clicked I want to display a directory selection dialog.
> However inside my widgetSeleceted method on the default SelectionAdapter
> I can't figure out how to get the shell that I need to pass to the the
> New Dialog constructor.
> I tried getting first the control from e.item and then the shell from
> the control but its giving me a null pointer exception. I suppose I
> could also implement my own SelectionAdapter but I'm thinking there has
> to be an easier way. Thanks. - dkrebs
>
>
usually when i create wizard i pass the workbenchwindow into it.
CL
|
|
|
|
Re: getting the shell in SelectionAdapter while in a wizard [message #451114 is a reply to message #451072] |
Wed, 23 February 2005 14:09 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
I think a wizard should handle its own business and not return any data
to be processed by some other methods. That is what I have done.
Otherwise you need, upon pushing finish or whatever, copy all your
values from your text box into local variables. Then add a method that
returns that local variable to your dialog/wizard class. I think that
is the best way.
CL
Duncan Krebs wrote:
> Jim:
> Thanks for the tip, I got that to work okay. Now I'm wondering how I can
> retrieve the value of a text box in the dialog when it returns to the
> main window. For example, with the tip you just showed me I now have a
> dialog with a browse button that when clicked it lets the user select a
> folder and the value is set in the text box next to the browse button.
> Then when they click okay I need to get that value of the text box in
> the code that opened the dialog window. Seems pretty simple, but I can't
> figure it out. Thanks for taking pitty.
>
> Jim Tran wrote:
>
>> have you tried Display.getCurrent().getActiveShell()?
>
>
>> "Duncan Krebs" <duncan@krebsnet.com> wrote in message
>> news:cvdch6$23m$1@www.eclipse.org...
>>
>>> Hi,
>>> I'm new to SWT and am stuck on this one. I have a button in a jface
>>> wizard that when clicked I want to display a directory selection
>>> dialog. However inside my widgetSeleceted method on the default
>>> SelectionAdapter I can't figure out how to get the shell that I need
>>> to pass to the the New Dialog constructor.
>>> I tried getting first the control from e.item and then the shell from
>>> the control but its giving me a null pointer exception. I suppose I
>>> could also implement my own SelectionAdapter but I'm thinking there
>>> has to be an easier way. Thanks. - dkrebs
>>>
>>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03717 seconds