Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Create Folder in Project with Wizard
Create Folder in Project with Wizard [message #18118] |
Sun, 18 November 2007 05:01  |
Eclipse User |
|
|
|
Originally posted by: special1.gmx.de
Hello,
I'm trying to implement a Script Language with dltk in Eclipse.
It is a Text-Mining language and the aim is, that you can create so called
rule Files in a source folder in your project and add some text files in a
folder called input and look at the results after running in a folder
called output in in the same project, too.
My problem is, that I'm at this time not able to create and use some
folders on startup in my eclipse project automatically.
I'm using the ProjectWizard with ProjectWizardFirstPage and
ProjectWizardSecondPage.
public class ProjectWizard extends NewElementWizard implements INewWizard,
IExecutableExtension
{
..
}
I want that, if you create a new project from my plugin, you automatically
create three folders in the project.
Can anyone please help me ?
Thanks
Sebastian Biedermann
|
|
|
Re: Create Folder in Project with Wizard [message #18191 is a reply to message #18118] |
Tue, 20 November 2007 03:27   |
Eclipse User |
|
|
|
Hi Sebastian,
You could create any project structure in overloaded method
ProjectWizardSecondPage.performFinish().
For example then you create pages from ProjectWizard class.
....
fSecondPage = new ProjectWizardSecondPage(fFirstPage) {
public void performFinish(IProgressMonitor monitor) throws
CoreException, InterruptedException {
if (fCurrProject == null) {
updateProject(new SubProgressMonitor(monitor, 1));
}
// then do what you want with fCurrProject
// At the end we need to perform other configuration steps.
super.performFinish(monitor);
}
};
addPage(fSecondPage);
......
Best regards,
Andrei.
> Hello,
>
> I'm trying to implement a Script Language with dltk in Eclipse.
> It is a Text-Mining language and the aim is, that you can create so
> called rule Files in a source folder in your project and add some text
> files in a folder called input and look at the results after running in
> a folder called output in in the same project, too.
>
> My problem is, that I'm at this time not able to create and use some
> folders on startup in my eclipse project automatically.
>
> I'm using the ProjectWizard with ProjectWizardFirstPage and
> ProjectWizardSecondPage.
>
> public class ProjectWizard extends NewElementWizard implements
> INewWizard, IExecutableExtension
> {
>
> .
>
> }
>
> I want that, if you create a new project from my plugin, you
> automatically create three folders in the project.
>
> Can anyone please help me ?
>
> Thanks
> Sebastian Biedermann
>
|
|
|
Re: Create Folder in Project with Wizard [message #18259 is a reply to message #18191] |
Wed, 21 November 2007 07:14   |
Eclipse User |
|
|
|
Originally posted by: special1.gmx.de
Hi
thanks for help, i now created some folders in my project with IFolder
interface in the finish method
just like this
fCurrProject = fFirstPage.getProjectHandle();
input = fCurrProject.getFolder("input");
input.create(false, true, monitor);
there are now some normal folders on startup,
can you tell me how i can create a source folder, too ?
Thanks a lot
Sebastian
"Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
news:fhu5l9$otl$1@build.eclipse.org...
> Hi Sebastian,
>
>
> You could create any project structure in overloaded method
> ProjectWizardSecondPage.performFinish().
>
> For example then you create pages from ProjectWizard class.
> ...
>
> fSecondPage = new ProjectWizardSecondPage(fFirstPage) {
> public void performFinish(IProgressMonitor monitor) throws
> CoreException, InterruptedException {
> if (fCurrProject == null) {
> updateProject(new SubProgressMonitor(monitor, 1));
> }
> // then do what you want with fCurrProject
>
> // At the end we need to perform other configuration steps.
> super.performFinish(monitor);
> }
> };
> addPage(fSecondPage);
> .....
>
> Best regards,
> Andrei.
>
>> Hello,
>>
>> I'm trying to implement a Script Language with dltk in Eclipse.
>> It is a Text-Mining language and the aim is, that you can create so
>> called rule Files in a source folder in your project and add some text
>> files in a folder called input and look at the results after running in
>> a folder called output in in the same project, too.
>>
>> My problem is, that I'm at this time not able to create and use some
>> folders on startup in my eclipse project automatically.
>>
>> I'm using the ProjectWizard with ProjectWizardFirstPage and
>> ProjectWizardSecondPage.
>>
>> public class ProjectWizard extends NewElementWizard implements
>> INewWizard, IExecutableExtension
>> {
>>
>> .
>>
>> }
>>
>> I want that, if you create a new project from my plugin, you
>> automatically create three folders in the project.
>>
>> Can anyone please help me ?
>>
>> Thanks
>> Sebastian Biedermann
>>
|
|
|
Re: Create Folder in Project with Wizard [message #18292 is a reply to message #18259] |
Wed, 28 November 2007 02:15  |
Eclipse User |
|
|
|
Hi Sebastian,
>
> Hi
>
> thanks for help, i now created some folders in my project with IFolder
> interface in the finish method
> just like this
>
>
> fCurrProject = fFirstPage.getProjectHandle();
> input = fCurrProject.getFolder("input");
> input.create(false, true, monitor);
>
>
> there are now some normal folders on startup,
> can you tell me how i can create a source folder, too ?
You could do it after super.performFinish(monitor) will be executed, it
configures all required DLTK things.
Example:
>>>>>
IScriptProject scriptProject = this.getScriptProject();
IBuildpathEntry[] rawBuildpath = scriptProject.getRawBuildpath();
IBuildpathEntry[] newBuildpath = new IBuildpathEntry[rawBuildpath.length
+ 1];
System.arraycopy(rawBuildpath, 0, newBuildpath, 0, rawBuildpath.length);
newBuildpath[rawBuildpath.length] = DLTKCore.newSourceEntry("myfolder");
scriptProject.setRawBuildpath(newBuildpath, new NullProgressMonitor());
>>>>
You also could create external source entries, library entries, project
dependency entries, container entries. (DKTKCore methods:
newExtLibraryEntry, newLibraryEntry, newLibraryEntry, newContainerEntry).
Best regards,
Andrei.
>
> Thanks a lot
> Sebastian
>
> "Andrei Sobolev" <haiodo@xored.com> schrieb im Newsbeitrag
> news:fhu5l9$otl$1@build.eclipse.org...
>> Hi Sebastian,
>>
>>
>> You could create any project structure in overloaded method
>> ProjectWizardSecondPage.performFinish().
>>
>> For example then you create pages from ProjectWizard class.
>> ...
>>
>> fSecondPage = new ProjectWizardSecondPage(fFirstPage) {
>> public void performFinish(IProgressMonitor monitor) throws
>> CoreException, InterruptedException {
>> if (fCurrProject == null) {
>> updateProject(new SubProgressMonitor(monitor, 1));
>> }
>> // then do what you want with fCurrProject
>>
>> // At the end we need to perform other configuration steps.
>> super.performFinish(monitor);
>> }
>> };
>> addPage(fSecondPage);
>> .....
>>
>> Best regards,
>> Andrei.
>>
>>> Hello,
>>>
>>> I'm trying to implement a Script Language with dltk in Eclipse.
>>> It is a Text-Mining language and the aim is, that you can create so
>>> called rule Files in a source folder in your project and add some text
>>> files in a folder called input and look at the results after running in
>>> a folder called output in in the same project, too.
>>>
>>> My problem is, that I'm at this time not able to create and use some
>>> folders on startup in my eclipse project automatically.
>>>
>>> I'm using the ProjectWizard with ProjectWizardFirstPage and
>>> ProjectWizardSecondPage.
>>>
>>> public class ProjectWizard extends NewElementWizard implements
>>> INewWizard, IExecutableExtension
>>> {
>>>
>>> .
>>>
>>> }
>>>
>>> I want that, if you create a new project from my plugin, you
>>> automatically create three folders in the project.
>>>
>>> Can anyone please help me ?
>>>
>>> Thanks
>>> Sebastian Biedermann
>>>
>
|
|
|
Goto Forum:
Current Time: Mon May 12 18:58:08 EDT 2025
Powered by FUDForum. Page generated in 0.03144 seconds
|