[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
[news.eclipse.platform] Using JarWriter2
From
:
muthukumaran_m@xxxxxxxxxxx
(Muthukumaran)
Date
: Mon, 16 Apr 2007 22:21:09 +0000 (UTC)
Newsgroups
:
eclipse.platform
Organization
: Eclipse
User-agent
: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Hi,
I am new to Eclipse Plugin, i was trying to develop a plugin to add the selected java file to a jar file, following is the code
public void run(IAction action) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
MessageDialog.openInformation(
shell,
"TWE_Plugin Plug-in",
"Twe Action was executed : " + getClass());
IFile[] fileToexport = {file};
JarPackageData description= new JarPackageData();
IPath location= new Path("C:/temp/myjar.jar");
description.setJarLocation(location);
description.setSaveManifest(true);
//description.setManifestMainClass(mainType);
description.setElements(fileToexport);
try
{
TweJarFileWriter jar = new TweJarFileWriter(description, shell);
jar.createJar(file);
}
catch(Exception exp)
{ System.out.println("Exp : " + exp);
exp.printStackTrace();
}
}
public class TweJarFileWriter extends JarWriter2
{
public TweJarFileWriter(JarPackageData jarPackage, Shell parent) throws CoreException
{
super(jarPackage, parent);
}
public void createJar(IFile file) {
try
{
this.addFile(file, file.getFullPath(), new File(file.getFullPath().toOSString()));
}
catch(Exception exp)
{
System.out.println("Exp : " + exp);
exp.printStackTrace();
}
} }
When i run the pluing nothing is happening, kinldy tell me what is the issue in this code.
Thanks, Muthu
Follow-Ups
:
[news.eclipse.platform] Re: Using JarWriter2
From:
Walter Harley
Prev by Date:
[news.eclipse.platform] Re: TT_DESKTOP_ENOENT error in hp
Next by Date:
[news.eclipse.platform] Re: Using JarWriter2
Previous by thread:
[news.eclipse.platform] TT_DESKTOP_ENOENT error in hp
Next by thread:
[news.eclipse.platform] Re: Using JarWriter2
Index(es):
Date
Thread