Home » Eclipse Projects » Rich Client Platform (RCP) » How to install a plug-in?
|
Re: How to install a plug-in? [message #535926 is a reply to message #535652] |
Wed, 26 May 2010 11:10 |
|
Hi,
José a écrit :
> 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?
You should create an update-site project (File > New > Plugin development > Update site). Then you can export your plugin as an update site and use it to install your plugin in other Eclipse platforms.
--
Mickael Istria - BonitaSoft S.A.
http://www.bonitasoft.com/products/downloads.php
|
|
| |
Re: How to install a plug-in? [message #538308 is a reply to message #535652] |
Mon, 07 June 2010 10:00 |
José Messages: 31 Registered: March 2010 |
Member |
|
|
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 11:09 |
José Messages: 31 Registered: March 2010 |
Member |
|
|
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 #539416 is a reply to message #535652] |
Thu, 10 June 2010 16:19 |
José Messages: 31 Registered: March 2010 |
Member |
|
|
I have opened the *.jar file of the plugin folder with winrar and yes, the folder that I need is inside...so them, I don't know why it's not working, here's the code when I try to use the folder
String stringSourcePath = Platform.getBundle("com.argos.framework").getLocation();
stringSourcePath = stringSourcePath.substring(16); // To quit the reference:file:/
copyFilesToWorkSpace(new File(stringSourcePath + "/baseproject"), new File(stringDestinationPath + "/" + ArgosModel.getProjectName()));
and the plugin.xml has this content:
<plugin>
<extension
id="com.argos.framework"
name="Argos"
point="org.eclipse.ui.newWizards">
.
.
.
</plugin>
anyone knows?
[Updated on: Thu, 10 June 2010 16:21] Report message to a moderator
|
|
| |
Re: How to install a plug-in? [message #539914 is a reply to message #535652] |
Mon, 14 June 2010 09:30 |
José Messages: 31 Registered: March 2010 |
Member |
|
|
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 09:15 |
José Messages: 31 Registered: March 2010 |
Member |
|
|
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 09:17] Report message to a moderator
|
|
| |
Re: How to install a plug-in? [message #540327 is a reply to message #535652] |
Tue, 15 June 2010 16:07 |
José Messages: 31 Registered: March 2010 |
Member |
|
|
I have done the next code that it's supposed to be in a recursive method
Bundle bundleArgos = Platform.getBundle("com.argos.framework");
Enumeration<String> List = bundleArgos.getEntryPaths("/");
while (List.hasMoreElements()){
/*HERE, ASK IF IT IS A FOLDER OR NOT
IF IT IS A FOLDER, create it at destination and call this method with the folders.
ELSE copy the file into the actual folder of destination*/
}
The problem is that I do the next thing:
URL urlArgos1 = bundleArgos.getEntry(List.getClass().toString());
How can I know if it's a file or folder?. I haven't seen that in the bundle you do "get folder or get file" in order to see if it returns null or not (to know if it's a folder or not).
Thank you so much, I think I'm near
DP: I don't know if enumeration<string> is right, but I have seen that it supposed to have a type, and I haven't found which is it by googling... is it right?
[Updated on: Tue, 15 June 2010 16:10] Report message to a moderator
|
|
| |
Re: How to install a plug-in? [message #540350 is a reply to message #535652] |
Tue, 15 June 2010 18:55 |
José Messages: 31 Registered: March 2010 |
Member |
|
|
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 18:58] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Sep 20 12:47:49 GMT 2024
Powered by FUDForum. Page generated in 0.09568 seconds
|