Plugin files ... [message #205105] |
Mon, 12 December 2005 14:49 |
Eclipse User |
|
|
|
Originally posted by: greg.gigon.tugulu.com
Hello,
I have added some files to my plugin. Those files are templates. I'd like my plugin when it creates
new project to copy those template files to a project folder.
Template files are within plugin folder. How to access those files from Plugin level and copy them
acress. I was trying static methods on PluginClass but all I got is just getImageDescriptor().
Cheers, Greg
|
|
|
|
Re: Plugin files ... [message #205158 is a reply to message #205128] |
Tue, 13 December 2005 09:04 |
Eclipse User |
|
|
|
Originally posted by: greg.gigon.tugulu.com
Thank you, thank you, thank you.
I ask same question on org.eclipse.platform, NO RESPOND, and your snipped is exactly what I need.
Thank You one more time :)
Greg
FreeGroup wrote:
> Ok,
>
> GEF stands for "graphical editing framework".
>
> So - this newsgroup is not the right place for your question.
>
> Anyway - here some code snipped from my project
> --------------------------------------
>
> private static void copyAnyTemplateToAnyplace() throws Exception
> {
> IProject project = JacobDesigner.getPlugin().getSelectedProject();
>
> InputStream in = JacobDesigner.getPlugin().find(new
> Path("templates/Any.template")).openStream();
> String template = IOUtils.toString(in);
> in.close();
> IFile newFile = project.getFile("newFile.txt");
> newFile.create(new StringBufferInputStream(template), false,
> processMonitor);
> }
>
|
|
|
Powered by
FUDForum. Page generated in 0.53631 seconds