[openide-dev] Displaying of files created after generating them through a wizard

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[openide-dev] Displaying of files created after generating them through a wizard

Justin Quak

Hi,

I am currently working on a wizard to generate a certain file type for Grid Services. I have successfully created the wizard and the files that are suppose to be created through the wizard is successfuly.

I would like to ask if there are any examples on how I can open a file in the IDE after the file has been created so that the user can edit or modify the contents.

Any help would be much appreciated.

Thanks.


Best Regards,
Justin Quak


Find your perfect match at MSN Personals with Match.com
Reply | Threaded
Open this post in threaded view
|

RE: [openide-dev] Displaying of files created after generating them through a wizard

emlope
I tried doing this a while ago by borrowing some netbeans src:
org.netbeans.modules.openfile.OpenFileImpl
It worked for me, I was able to pass in a Fileobject to OpenFileImpl's open method. I had a CallableSystemAction to start the wizard, after the wizard completed, I knew the name of the file I had just generated, so I opened the file from there.
Elizabeth


From: Justin Quak [mailto:[hidden email]]
Sent: Thursday, September 08, 2005 10:06 AM
To: [hidden email]
Subject: [openide-dev] Displaying of files created after generating them through a wizard

Hi,

I am currently working on a wizard to generate a certain file type for Grid Services. I have successfully created the wizard and the files that are suppose to be created through the wizard is successfuly.

I would like to ask if there are any examples on how I can open a file in the IDE after the file has been created so that the user can edit or modify the contents.

Any help would be much appreciated.

Thanks.


Best Regards,
Justin Quak


Find your perfect match at MSN Personals with Match.com
Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Displaying of files created after generating them through a wizard

Tom Ball
In reply to this post by Justin Quak
Look at contrib/povray/povray/, which demonstrates basic editing
commands.  You can probably ignore the SetMainFileAction code, which
looks to be povray-specific.

Tom

Justin Quak wrote:

> Hi,
>
> I am currently working on a wizard to generate a certain file type for
> Grid Services. I have successfully created the wizard and the files that
> are suppose to be created through the wizard is successfuly.
>
> I would like to ask if there are any examples on how I can open a file
> in the IDE after the file has been created so that the user can edit or
> modify the contents.
>
> Any help would be much appreciated.
>
> Thanks.
>
>
> Best Regards,
> Justin Quak
>
> Find your perfect match at MSN Personals with Match.com
> <http://g.msn.com/8HMAENSG/2752??PS=47575>

Reply | Threaded
Open this post in threaded view
|

[openide-dev] Re: Displaying of files created after generating them through a wizard

Jesse Glick
In reply to this post by Justin Quak
Justin Quak wrote:
> I am currently working on a wizard to generate a certain file type
> for Grid Services. I have successfully created the wizard and the
> files that are suppose to be created through the wizard is
> successfuly.
>
> I would like to ask if there are any examples on how I can open a
> file in the IDE after the file has been created so that the user can
> edit or modify the contents.

((OpenCookie)DataObject.find(theFileObject).getCookie(OpenCookie.class)).open();

-J.

--
         You may land now, O Alien Intelligences!
      The ground has been sanctified with Baco Bits!
[hidden email]  x22801  netbeans.org  ant.apache.org

Reply | Threaded
Open this post in threaded view
|

[openide-dev] Re: Displaying of files created after generating them through a wizard

Tim Boudreau
In reply to this post by Justin Quak
Justin Quak wrote:
> Hi,
>
> I am currently working on a wizard to generate a certain file type for
> Grid Services. I have successfully created the wizard and the files that
> are suppose to be created through the wizard is successfuly.
>
> I would like to ask if there are any examples on how I can open a file
> in the IDE after the file has been created so that the user can edit or
> modify the contents.

(if starting with file)
FileObject fob = FileUtil.toFileObject (theFile);

DataObject dob = DataObject.find (fob);
if (dob != null) {
    OpenCookie ck = (OpenCookie) dob.getCookie(OpenCookie.class);
    if (ck != null) {
       ck.open();
    }
}

-Tim

>
> Any help would be much appreciated.
>
> Thanks.
>
>
> Best Regards,
> Justin Quak
>
> ------------------------------------------------------------------------
> Find your perfect match at MSN Personals with Match.com
> <http://g.msn.com/8HMAENSG/2752??PS=47575>

Reply | Threaded
Open this post in threaded view
|

Re: [openide-dev] Re: Displaying of files created after generating them through a wizard

mkleint-3
what kind of wizard are you using? is that one of the new file kind?
if you implement WizardDescriptor.InstantiatingIterator then all you
have to do is include the created files' FileObjects into the Set
returned by the instantiate() method. the framework will open it for you
automagically. Maybe it works with other wizards as well, not sure I
just worked lately with the Instantiating one..

hope that helps.

Milos


Tim Boudreau wrote:

> Justin Quak wrote:
>
>> Hi,
>>
>> I am currently working on a wizard to generate a certain file type
>> for Grid Services. I have successfully created the wizard and the
>> files that are suppose to be created through the wizard is successfuly.
>>
>> I would like to ask if there are any examples on how I can open a
>> file in the IDE after the file has been created so that the user can
>> edit or modify the contents.
>
>
> (if starting with file)
> FileObject fob = FileUtil.toFileObject (theFile);
>
> DataObject dob = DataObject.find (fob);
> if (dob != null) {
>    OpenCookie ck = (OpenCookie) dob.getCookie(OpenCookie.class);
>    if (ck != null) {
>       ck.open();
>    }
> }
>
> -Tim
>
>>
>> Any help would be much appreciated.
>>
>> Thanks.
>>
>>
>> Best Regards,
>> Justin Quak
>>
>> ------------------------------------------------------------------------
>> Find your perfect match at MSN Personals with Match.com
>> <http://g.msn.com/8HMAENSG/2752??PS=47575>
>
>