Package org.eclipse.jdt.ui.wizards
Class BuildPathDialogAccess
java.lang.Object
org.eclipse.jdt.ui.wizards.BuildPathDialogAccess
Class that gives access to dialogs used by the Java build path page to configure classpath entries
and properties of classpath entries.
Static methods are provided to show dialogs for:
- configuration of source attachments
- configuration of Javadoc locations
- configuration and selection of classpath variable entries
- configuration and selection of classpath container entries
- configuration and selection of JAR and external JAR entries
- selection of class and source folders
This class is not intended to be instantiated or subclassed by clients.
- Since:
- 3.0
- Restriction:
- This class is not intended to be instantiated by clients.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.eclipse.core.runtime.IPath[]
chooseClassFolderEntries
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialSelection, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to select new class folders.static IClasspathEntry[]
chooseContainerEntries
(org.eclipse.swt.widgets.Shell shell, IJavaProject project, IClasspathEntry[] currentClasspath) Shows the UI to choose new classpath container classpath entries.static org.eclipse.core.runtime.IPath[]
chooseExternalClassFolderEntries
(org.eclipse.swt.widgets.Shell shell) Shows the UI to select new external class folder entries.static org.eclipse.core.runtime.IPath[]
chooseExternalJAREntries
(org.eclipse.swt.widgets.Shell shell) Shows the UI to select new external JAR or ZIP archive entries.static org.eclipse.core.runtime.IPath[]
chooseJAREntries
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialSelection, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to select new JAR or ZIP archive entries located in the workspace.static org.eclipse.core.runtime.IPath[]
chooseSourceFolderEntries
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialSelection, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to select new source folders.static org.eclipse.core.runtime.IPath[]
chooseVariableEntries
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath[] existingPaths) Shows the UI for selecting new variable classpath entries.static IClasspathEntry
configureContainerEntry
(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry, IJavaProject project, IClasspathEntry[] currentClasspath) Shows the UI to configure a classpath container classpath entry.static org.eclipse.core.runtime.IPath
configureExternalAnnotationsAttachment
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry) Shows the UI for configuring an external annotations attachment.static org.eclipse.core.runtime.IPath
configureExternalClassFolderEntries
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry) Shows the UI to configure an external class folder.static org.eclipse.core.runtime.IPath
configureExternalJAREntry
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry) Shows the UI to configure an external JAR or ZIP archive.static org.eclipse.core.runtime.IPath
configureJAREntry
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to configure a JAR or ZIP archive located in the workspace.static URL[]
configureJavadocLocation
(org.eclipse.swt.widgets.Shell shell, String libraryName, URL initialURL) Shows the UI for configuring a javadoc location.static IClasspathEntry
configureJavadocLocation
(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry) Shows the UI for configuring a javadoc location attribute of the classpath entry.static IClasspathEntry
configureSourceAttachment
(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry) Shows the UI for configuring source attachments, with editing of source attachment encoding disabled.static IClasspathEntry
configureSourceAttachment
(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry, boolean canEditEncoding) Shows the UI for configuring source attachments.static org.eclipse.core.runtime.IPath
configureVariableEntry
(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntryPath, org.eclipse.core.runtime.IPath[] existingPaths) Shows the UI for configuring a variable classpath entry.
-
Method Details
-
configureSourceAttachment
public static IClasspathEntry configureSourceAttachment(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry) Shows the UI for configuring source attachments, with editing of source attachment encoding disabled.null
is returned if the user cancels the dialog. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialoginitialEntry
- The entry to edit. The kind of the classpath entry must be eitherIClasspathEntry.CPE_LIBRARY
orIClasspathEntry.CPE_VARIABLE
.- Returns:
- Returns the resulting classpath entry containing a potentially modified source
attachment path, source attachment root and source attachment encoding,
or
null
if the dialog has been canceled. The resulting entry can be used to replace the original entry on the classpath. Note that the dialog does not make any changes on the passed entry nor on the classpath that contains it.
-
configureSourceAttachment
public static IClasspathEntry configureSourceAttachment(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry, boolean canEditEncoding) Shows the UI for configuring source attachments. The source attachment encoding can be edited depending on the parametercanEditEncoding
.null
is returned if the user cancels the dialog. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialoginitialEntry
- The entry to edit. The kind of the classpath entry must be eitherIClasspathEntry.CPE_LIBRARY
orIClasspathEntry.CPE_VARIABLE
.canEditEncoding
- whether the source attachment encoding can be edited- Returns:
- Returns the resulting classpath entry containing a potentially modified source
attachment path, source attachment root and source attachment encoding,
or
null
if the dialog has been canceled. The resulting entry can be used to replace the original entry on the classpath. Note that the dialog does not make any changes on the passed entry nor on the classpath that contains it. - Since:
- 3.8
-
configureExternalAnnotationsAttachment
public static org.eclipse.core.runtime.IPath configureExternalAnnotationsAttachment(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry) Shows the UI for configuring an external annotations attachment.null
is returned when the user cancels the dialog. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialoginitialEntry
- The entry to edit.- Returns:
- Returns the selected path, possibly different from the initialEntry,
or
null
if the dialog has been cancelled. - Since:
- 3.11
-
configureJavadocLocation
public static URL[] configureJavadocLocation(org.eclipse.swt.widgets.Shell shell, String libraryName, URL initialURL) Shows the UI for configuring a javadoc location.null
is returned if the user cancels the dialog. If OK is pressed, an array of length 1 containing the configured URL is returned. Note that the configured URL can benull
when the user wishes to have no URL location specified. The dialog does not apply any changes. UseJavaUI
to access and configure Javadoc locations.- Parameters:
shell
- The parent shell for the dialog.libraryName
- Name of of the library to which configured javadoc location belongs.initialURL
- The initial URL ornull
.- Returns:
- Returns an array of size 1 that contains the resulting javadoc location or
null
if the dialog has been canceled. Note that the configured URL can benull
when the user wishes to have no URL location specified.
-
configureJavadocLocation
public static IClasspathEntry configureJavadocLocation(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry) Shows the UI for configuring a javadoc location attribute of the classpath entry.null
is returned if the user cancels the dialog. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialEntry
- The entry to edit. The kind of the classpath entry must be eitherIClasspathEntry.CPE_LIBRARY
orIClasspathEntry.CPE_VARIABLE
.- Returns:
- Returns the resulting classpath entry containing a potentially modified javadoc location attribute,
or
null
if the dialog has been canceled. The resulting entry can be used to replace the original entry on the classpath. Note that the dialog does not make any changes on the passed entry nor on the classpath that contains it. - Since:
- 3.1
-
configureVariableEntry
public static org.eclipse.core.runtime.IPath configureVariableEntry(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntryPath, org.eclipse.core.runtime.IPath[] existingPaths) Shows the UI for configuring a variable classpath entry. SeeIClasspathEntry.CPE_VARIABLE
for details about variable classpath entries. The dialog returns the configured classpath entry path ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialEntryPath
- The initial variable classpath variable path ornull
to use an empty path.existingPaths
- An array of paths that are already on the classpath and therefore should not be selected again.- Returns:
- Returns the configures classpath entry path or
null
if the dialog has been canceled.
-
chooseVariableEntries
public static org.eclipse.core.runtime.IPath[] chooseVariableEntries(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath[] existingPaths) Shows the UI for selecting new variable classpath entries. SeeIClasspathEntry.CPE_VARIABLE
for details about variable classpath entries. The dialog returns an array of the selected variable entries ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.existingPaths
- An array of paths that are already on the classpath and therefore should not be selected again.- Returns:
- Returns an non empty array of the selected variable entries or
null
if the dialog has been canceled.
-
configureContainerEntry
public static IClasspathEntry configureContainerEntry(org.eclipse.swt.widgets.Shell shell, IClasspathEntry initialEntry, IJavaProject project, IClasspathEntry[] currentClasspath) Shows the UI to configure a classpath container classpath entry. SeeIClasspathEntry.CPE_CONTAINER
for details about container classpath entries. The dialog returns the configured classpath entry ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialEntry
- The initial classpath container entry.project
- The project the entry belongs to. The project does not have to exist and can also benull
.currentClasspath
- The class path entries currently selected to be set as the projects classpath. This can also include the entry to be edited. The dialog uses these entries as information only (e.g. to avoid duplicate entries); The user still can make changes after the the classpath container dialog has been closed. SeeIClasspathContainerPageExtension
for more information.- Returns:
- Returns the configured classpath container entry or
null
if the dialog has been canceled by the user.
-
chooseContainerEntries
public static IClasspathEntry[] chooseContainerEntries(org.eclipse.swt.widgets.Shell shell, IJavaProject project, IClasspathEntry[] currentClasspath) Shows the UI to choose new classpath container classpath entries. SeeIClasspathEntry.CPE_CONTAINER
for details about container classpath entries. The dialog returns the selected classpath entries ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.project
- The project the entry belongs to. The project does not have to exist and can also benull
.currentClasspath
- The class path entries currently selected to be set as the projects classpath. This can also include the entry to be edited. The dialog uses these entries as information only; The user still can make changes after the the classpath container dialog has been closed. SeeIClasspathContainerPageExtension
for more information.- Returns:
- Returns the selected classpath container entries or
null
if the dialog has been canceled by the user.
-
configureJAREntry
public static org.eclipse.core.runtime.IPath configureJAREntry(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to configure a JAR or ZIP archive located in the workspace. The dialog returns the configured classpath entry path ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialEntry
- The path of the initial archive entryusedEntries
- An array of paths that are already on the classpath and therefore should not be selected again.- Returns:
- Returns the configured JAR path or
null
if the dialog has been canceled by the user.
-
chooseJAREntries
public static org.eclipse.core.runtime.IPath[] chooseJAREntries(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialSelection, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to select new JAR or ZIP archive entries located in the workspace. The dialog returns the selected entries ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialSelection
- The path of the element (container or archive) to initially select ornull
to not select an entry.usedEntries
- An array of paths that are already on the classpath and therefore should not be selected again.- Returns:
- Returns the new JAR paths or
null
if the dialog has been canceled by the user.
-
configureExternalJAREntry
public static org.eclipse.core.runtime.IPath configureExternalJAREntry(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry) Shows the UI to configure an external JAR or ZIP archive. The dialog returns the configured ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialEntry
- The path of the initial archive entry.- Returns:
- Returns the configured external JAR path or
null
if the dialog has been canceled by the user.
-
chooseExternalJAREntries
public static org.eclipse.core.runtime.IPath[] chooseExternalJAREntries(org.eclipse.swt.widgets.Shell shell) Shows the UI to select new external JAR or ZIP archive entries. The dialog returns the selected entry paths ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.- Returns:
- Returns the new external JAR paths or
null
if the dialog has been canceled by the user.
-
chooseExternalClassFolderEntries
public static org.eclipse.core.runtime.IPath[] chooseExternalClassFolderEntries(org.eclipse.swt.widgets.Shell shell) Shows the UI to select new external class folder entries. The dialog returns the selected entry paths ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.- Returns:
- Returns the new external class folder path or
null
if the dialog has been canceled by the user. - Since:
- 3.4
-
configureExternalClassFolderEntries
public static org.eclipse.core.runtime.IPath configureExternalClassFolderEntries(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialEntry) Shows the UI to configure an external class folder. The dialog returns the configured ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialEntry
- The path of the initial archive entry.- Returns:
- Returns the configured external class folder path or
null
if the dialog has been canceled by the user. - Since:
- 3.4
-
chooseClassFolderEntries
public static org.eclipse.core.runtime.IPath[] chooseClassFolderEntries(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialSelection, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to select new class folders. The dialog returns the selected class folder entry paths ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialSelection
- The path of the element to initially select ornull
.usedEntries
- An array of paths that are already on the classpath and therefore should not be selected again.- Returns:
- Returns the configured class folder paths or
null
if the dialog has been canceled by the user.
-
chooseSourceFolderEntries
public static org.eclipse.core.runtime.IPath[] chooseSourceFolderEntries(org.eclipse.swt.widgets.Shell shell, org.eclipse.core.runtime.IPath initialSelection, org.eclipse.core.runtime.IPath[] usedEntries) Shows the UI to select new source folders. The dialog returns the selected classpath entry paths ornull
if the dialog has been canceled. The dialog does not apply any changes.- Parameters:
shell
- The parent shell for the dialog.initialSelection
- The path of the element to initially select ornull
usedEntries
- An array of paths that are already on the classpath and therefore should not be selected again.- Returns:
- Returns the configured class folder entry paths or
null
if the dialog has been canceled by the user.
-