Home » Eclipse Projects » Rich Client Platform (RCP) » How to install a plug-in?
How to install a plug-in? [message #535652] |
Tue, 25 May 2010 03:35  |
Eclipse User |
|
|
|
I have done a plug-in for eclipse and now, after make some tries in the execution, I want to install it on a new eclipse to see how it works.
But seeing the project folders, I don't know how to install it in Eclipse, I see there is a folder called bin, whose contents com/articles/.... where there are the .class of the files of my plug-in and nothing more....
What must I do?
Thanks!
|
|
| | |
Re: How to install a plug-in? [message #538308 is a reply to message #535652] |
Mon, 07 June 2010 06:00   |
Eclipse User |
|
|
|
Hi again!
I have found this tutorial.
http://www.eclipse.org/articles/article.php?file=Article-Upd ate/index.html
I have done all the steps and it almost work, there is something that I need and I can't do it.
My plug-in need a folder that I have included on the workspace, to work with it. When I use the plug-in at executing it does well, like I want (executing from the workspace, like a attempt).
But, when I execute it like a installed feature of Eclipse. It does badly because it doesn't have the folder needed for doing a good execution. Trying to fix this I have added to the build.properties this firstly:
source.. = src/,\
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
baseproject/
.
"baseproject" is the folder I need. With this attempt I didn't fix it...and with this one either
source.. = src/,\
baseproject/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.
What can I do?
|
|
|
Re: How to install a plug-in? [message #538320 is a reply to message #535652] |
Mon, 07 June 2010 07:09   |
Eclipse User |
|
|
|
Hi again!
I have found this tutorial.
http://www.eclipse.org/articles/article.php?file=Article-Upd ate/index.html
I have done all the steps and it almost work, there is something that I need and I can't do it.
My plug-in need a folder that I have included on the workspace, to work with it. When I use the plug-in at executing it does well, like I want (executing from the workspace, like a attempt).
But, when I execute it like a installed feature of Eclipse. It does badly because it doesn't have the folder needed for doing a good execution. Trying to fix this I have added to the build.properties this firstly:
source.. = src/,\
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
baseproject/
.
"baseproject" is the folder I need. With this attempt I didn't fix it...and with this one either
source.. = src/,\
baseproject/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.
What can I do?
|
|
| | | |
Re: How to install a plug-in? [message #539914 is a reply to message #535652] |
Mon, 14 June 2010 05:30   |
Eclipse User |
|
|
|
Thank you so much, I'm trying in that way, but I'm get lost in the second part, with the inputstreams...
I want to copy the folder with its own subfolders and files into a new folder in the workspace. How I create the new folder using ResoucesPlugin?, after that how can I do to copy "baseproject" content to that new folder?.
Bundle bundleArgos = Platform.getBundle("com.argos.framework");
URL urlArgos = bundleArgos.getEntry("baseproject");
ResourcesPlugin.getWorkspace().getRoot().?
A part of that, I don't understand why my way works fine when I try it at executting like a project of Eclipse, and now, when I install it into a Eclipse, it doens't work, it should be the same...
|
|
| |
Re: How to install a plug-in? [message #540173 is a reply to message #535652] |
Tue, 15 June 2010 05:15   |
Eclipse User |
|
|
|
Thanks for the help guide, very useful!
I have done that for copy one file...and it works perfectly
Bundle bundleArgos = Platform.getBundle("com.argos.framework");
URL urlArgos = bundleArgos.getEntry("/baseproject/AndroidManifest.xml");
InputStream source;
try {
source = urlArgos.openStream();
IProject ArgosProject = root.getProject(ArgosModel.getProjectName());
IFolder folder = ArgosProject.getFolder("tupac");
if (!folder.exists())
try {
folder.create(IResource.NONE, true, null);
} catch (CoreException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
IFile file = folder.getFile("hello.txt");
try {
file.create(source, IResource.NONE, null);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
But now, how can I do a automatic way of copy all the files and subfolders?, I haven't seen in the IFOLDER or IFILE something that allows this without indicating the exactly name of the file, I must have they recorded in the code in order to do that? :S
Thank you so much
[Updated on: Tue, 15 June 2010 05:17] by Moderator
|
|
| | | |
Re: How to install a plug-in? [message #540350 is a reply to message #535652] |
Tue, 15 June 2010 14:55  |
Eclipse User |
|
|
|
thank you so much!!!, I've done it... and it works ^^ lol....
I let this here, to help to others, this is the less I can do being so helped like I've been... thanks!
private void copyBundleToWorkSpace(Bundle bundleArgos, String path, IProject project) {
// TODO Auto-generated method stub
Enumeration<?> List = bundleArgos.getEntryPaths(path);
while (List.hasMoreElements()){
Object object = List.nextElement();
Enumeration<?> tmpList = bundleArgos.getEntryPaths(object.toString());
if(tmpList!=null){
//Create and recall
IFolder folder = project.getFolder(object.toString().substring(12));
if (!folder.exists())
try {
folder.create(IResource.NONE, true, null);
} catch (CoreException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
copyBundleToWorkSpace(bundleArgos, object.toString(), project);
}
else{
IFile file = project.getFile(object.toString().substring(12));
URL urlArgos = bundleArgos.getEntry(object.toString());
try {
InputStream source = urlArgos.openStream();
try {
file.create(source, IResource.NONE, null);
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
It only has a problem....that it doens't create empty folders, because it "detects" that like a file, and then it "fails"....but the rest works perfectly
NOTE: substr (substring) is used because i take the folder baseproject and I want it to the root directory of the project, so I take the "baseproject/" with the substr
[Updated on: Tue, 15 June 2010 14:58] by Moderator
|
|
|
Goto Forum:
Current Time: Tue Jul 22 18:08:20 EDT 2025
Powered by FUDForum. Page generated in 0.05856 seconds
|