Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-ui-dev] New Java Project Wizard extensions

We have made a plugin with our own New Project Wizard, which extends the
New
Java Project wizard. To achieve our goals, we needed to clone the following
classes:
      - NewJavaProjectWizardPage
      - WizardNewProjectCreationPage
      - BuildPathsBlock
      - CPListLabelProvider (cloned because it is used in BuildPathsBlock)

Our goals were as follows:

- We need to be able to create a project that uses src and bin folders even
  when the user does not have that preference set in the Java Preference
  Page.

To work around this problem, we changed methods getDefaultClassPath and
getDefaultBuildPath in our clone of BuildPathsBlock so that they always use
src and bin folders.


- We need to be able to put other libraries ont the classpath than JRE_LIB.

To work around this problem, we added the following method to our clone of
class NewJavaProjectWizardPage (calling a new method in our clone of
BuildPathsBlock):
      /**
         * Sets the library classpath to be used for the new Java project.
         * <p>
         * The caller of this method is  responsible for creating the
         * library classpath entries
         * for the <code>IJavaProject</code> that corresponds to created
the
         * project.
         * </p>
         *
         * @param entries the library classpath entries
         */
        public void setLibraryClassPath(IClasspathEntry[] entries) {
                fBuildPathsBlock.setLibraryClassPath(entries);
        }


- We need to get the name of the project from another source than
user-input
on the WizardNewProjectCreationPage.

To achieve this, we added the following methods to our clone of
WizardNewProjectCreationPage:
      public void setProjectFieldValue(String value) { ... }
      public void setProjectFieldEnabled(boolean enabled) {... }



Back to the top