Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Plugin files ...
Plugin files ... [message #205105] Mon, 12 December 2005 14:49 Go to next message
Eclipse UserFriend
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 #205128 is a reply to message #205105] Mon, 12 December 2005 18:21 Go to previous messageGo to next message
Andreas Herz is currently offline Andreas HerzFriend
Messages: 196
Registered: July 2009
Senior Member
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);
}
Re: Plugin files ... [message #205158 is a reply to message #205128] Tue, 13 December 2005 09:04 Go to previous message
Eclipse UserFriend
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);
> }
>
Previous Topic:Drag and Drop walkthrough
Next Topic:gef help included in feature?
Goto Forum:
  


Current Time: Fri Apr 26 08:45:31 GMT 2024

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

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

Back to the top