Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » File creation
File creation [message #449313] Fri, 21 January 2005 09:48 Go to next message
Eclipse UserFriend
Originally posted by: seb01016.fh-hagenberg.at

Hello!

I am a little bit confused how to create a new file in Eclipse. I know
that there is the NewFileCreation wizard which can be used to create own
files and I already used it to create a special file. These files can be
edited with a special editor. This editor adds an action to the
EditorContribution bar. If this action is invoked, new java files should
bed created from the information specified in the editor. My problem is
you to find out the current Path of the project, how to use the IFile
interface to create files....

To sumerize my problem up:

1) I have got the name of the file that should be created as a simple
string, for example "MyJavaFile.java" and eventually a package name as
string too.

2) I want to check if the current project has the package, if the user has
specified one, if it does not exist, I want to create the package too.

3) The new file sould be created in the current project in the specified
package (if none is specifed it sould be placed in the default package)

4) eventually refresh the navigator view (if necessary to show the new
file)

thx in advance

Hannes
Re: File creation [message #449497 is a reply to message #449313] Tue, 25 January 2005 14:29 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
You may get more response if you ask this in the eclipse.platform newsgroup,
since this question is not related to swt.

Grant

"Schoenboeck" <seb01016@fh-hagenberg.at> wrote in message
news:csqj68$col$1@www.eclipse.org...
> Hello!
>
> I am a little bit confused how to create a new file in Eclipse. I know
> that there is the NewFileCreation wizard which can be used to create own
> files and I already used it to create a special file. These files can be
> edited with a special editor. This editor adds an action to the
> EditorContribution bar. If this action is invoked, new java files should
> bed created from the information specified in the editor. My problem is
> you to find out the current Path of the project, how to use the IFile
> interface to create files....
>
> To sumerize my problem up:
>
> 1) I have got the name of the file that should be created as a simple
> string, for example "MyJavaFile.java" and eventually a package name as
> string too.
>
> 2) I want to check if the current project has the package, if the user has
> specified one, if it does not exist, I want to create the package too.
>
> 3) The new file sould be created in the current project in the specified
> package (if none is specifed it sould be placed in the default package)
>
> 4) eventually refresh the navigator view (if necessary to show the new
> file)
>
> thx in advance
>
> Hannes
>
Previous Topic:button event delay
Next Topic:Grid spacing too large on Motif
Goto Forum:
  


Current Time: Sat Nov 16 02:38:30 GMT 2019

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

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

Back to the top