Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Listen to PerformFinisch Wizard
Listen to PerformFinisch Wizard [message #1171927] Tue, 05 November 2013 15:34 Go to next message
arthurembo Simo is currently offline arthurembo SimoFriend
Messages: 16
Registered: May 2011
Location: Germany
Junior Member
I have the following problem. I get a foreign plugin (no access to source) to imports java projects in my workspace. I like to write an another plugin to do somethings after the performFinisch() method from the import-wizard of the first plugin is finisched. How can I detect this event from my plugin?

Best Regard
Re: Listen to PerformFinisch Wizard [message #1174701 is a reply to message #1171927] Thu, 07 November 2013 09:09 Go to previous message
arthurembo Simo is currently offline arthurembo SimoFriend
Messages: 16
Registered: May 2011
Location: Germany
Junior Member
Hi all,

I find a workaround to do my work but I get another problem:

I wrote an eclipse(Juno) plugin to automatically create a junit launch configuration, when a java project is created. I listen the changes in the workspace and when a new java project is created, I start a process to create the corresponding launch configuration:

public static void create(IProject project) {
    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType launchType = manager
    try {
        ILaunchConfigurationWorkingCopy workingCopy = launchType.newInstance(null, project.getName());
        List<IResource> resources = new ArrayList<IResource>();
        IResource[] resourcesArray = toArray(resources);
        workingCopy.setMappedResources(resources.toArray(resourcesArray) );
        workingCopy.setAttribute("org.eclipse.jdt.junit.CONTAINER", project.getName().replace("#", "\\#"));
        workingCopy.setAttribute("org.eclipse.jdt.junit.KEEPRUNNING_ATTR", false);
        workingCopy.setAttribute("org.eclipse.jdt.junit.TESTNAME", "");
        workingCopy.setAttribute("org.eclipse.jdt.junit.TEST_KIND", "org.eclipse.jdt.junit.loader.junit4");
        workingCopy.setAttribute("org.eclipse.jdt.launching.MAIN_TYPE", "");
        workingCopy.setAttribute("org.eclipse.jdt.launching.PROJECT_ATTR", "");
        workingCopy.setAttribute("org.eclipse.jdt.launching.VM_ARGUMENTS", "-Xms128m -Xmx512m -DSYS_DRIVE=${env_var:SYS_DRIVE} " +
                "-DAPPL_DRIVE=${env_var:APPL_DRIVE} -DDATA1_DRIVE=${env_var:DATA1_DRIVE} -DSYS_DIR=${env_var:SYS_DIR} " +
                "-DEXT1_DRIVE=F: -DTESTDATA_ROOT=${workspace_loc:trunk#IS+LVIS/testdata}");
    } catch (CoreException e) {
                "Unable to create a new launch configuration.", e);

By the method workingCopy.setMappedResources(), I give as parameter the corresponding IProject. I try the plugin, I create a project with the name 'testProject', my plugin receives the event and create the junit launch configuration file. I check the file, I open it in an editor and the attribute above are setted:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/testProject"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="testProject"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms128m -Xmx512m -DSYS_DRIVE=${env_var:SYS_DRIVE} -DAPPL_DRIVE=${env_var:APPL_DRIVE} -DDATA1_DRIVE=${env_var:DATA1_DRIVE} -DSYS_DIR=${env_var:SYS_DIR} -DEXT1_DRIVE=F: -DTESTDATA_ROOT=${workspace_loc:trunk#IS+LVIS/testdata}"/>

Now I opened the eclipse debug configuration dialog, I get a problem:

It look the dialog opening overwrote the launch configuration and I get no project selected in the dialog.

Another thing is that, when I make a right click on my project in the package explorer view to debug the project as Junit, it creates another launch configuration with the same name and the suffix (1). So "testProject(1)".

I need help thanks.

Best Regards.
Previous Topic:Including jars in a new project created with a custom wizard
Next Topic:Bogus API Errors?
Goto Forum:

Current Time: Wed Apr 25 11:07:50 GMT 2018

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

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