Providing a library from the Eclipse plugin to the workspace

JUnit does the same, and I just can't figure out how ...

Eclipse junit quick fix

I assume that because of this entry in Properties> Java Build Path> Libraries> Add Library Wizard:

Eclipse junit add library

How can I do the same and include my library in this wizard from my plugin, i.e. make it available to the user in the workspace?

+3
source share
2 answers

OK, there are three different extension points that you need to look at. The easiest way is to look at the JUnit plugin itself (there are four of them)

org.eclipse.jdt.junit: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.git
org.eclipse.jdt.junit.core: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.core.git
org.eclipse.jdt.junit.runtime: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.runtime.git
org.eclipse.jdt.junit4.runtime: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit4.runtime.git

So, you can research JUnit plugins, but these are the extension points that you will need:

, org.eclipse.jdt.ui.classpathContainerPage. JUnit plugin.xml:

<extension point="org.eclipse.jdt.ui.classpathContainerPage">
  <classpathContainerPage
        name="%JUnitContainerName"
        class="org.eclipse.jdt.internal.junit.buildpath.JUnitContainerWizardPage"
        id="org.eclipse.jdt.junit.JUNIT_CONTAINER">
  </classpathContainerPage>
</extension>

, JUnitContainerWizardPage. IClasspathContainerPage IClasspathContainerPageExtension.

quickfix classpathfix . org.eclipse.jdt.ui.quickFixProcessors org.eclipse.jdt.ui.classpathFixProcessors. JUnit plugin.xml :

<extension point="org.eclipse.jdt.ui.quickFixProcessors">
  <quickFixProcessor
        name="%junitQuickFixProcessor"
        class="org.eclipse.jdt.internal.junit.ui.JUnitQuickFixProcessor"
        id="org.eclipse.jdt.junit.JUnitQuickFixProcessor">
  </quickFixProcessor>
</extension>

<extension point="org.eclipse.jdt.ui.classpathFixProcessors">
  <classpathFixProcessor
        name="%junitClasspathFixProcessor"
        class="org.eclipse.jdt.internal.junit.ui.JUnitClasspathFixProcessor"
        id="org.eclipse.jdt.junit.JUnitClasspathFixProcessor">
        <overrides id="org.eclipse.jdt.ui.text.correction.DefaultClasspathFixProcessor">
        </overrides>
  </classpathFixProcessor>
</extension>
+3

, :

, , org.eclipse.jdt.junit.core.

   <extension
      point="org.eclipse.jdt.core.classpathContainerInitializer">
      <classpathContainerInitializer
            class="org.eclipse.jdt.internal.junit.buildpath.JUnitContainerInitializer"
            id="org.eclipse.jdt.junit.JUNIT_CONTAINER">
      </classpathContainerInitializer>
   </extension>
0

All Articles