Skip to main content


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
Hi,
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
Boris
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
            .getLaunchConfigurationType(JUNIT_LAUNCH_IDENTIFIER);
    try {
        ILaunchConfigurationWorkingCopy workingCopy = launchType.newInstance(null, project.getName());
        List<IResource> resources = new ArrayList<IResource>();
        resources.add(project);
        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}");
        workingCopy.doSave();
    } catch (CoreException e) {
        log.log(Level.WARNING,
                "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>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<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}"/>
</launchConfiguration>


Now I opened the eclipse debug configuration dialog, I get a problem:
http://i43.tinypic.com/28bafqq.jpg

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: required Bundle org.eclipse.help.appserver could not be found
Goto Forum:
  


Current Time: Thu Apr 25 16:24:32 GMT 2024

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

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

Back to the top