org.eclipse.cdt.internal.ui.dialogs.cpaths
Class SourceAttachmentDialog

java.lang.Object
  extended by org.eclipse.jface.window.Window
      extended by org.eclipse.jface.dialogs.Dialog
          extended by org.eclipse.cdt.internal.ui.dialogs.StatusDialog
              extended by org.eclipse.cdt.internal.ui.dialogs.cpaths.SourceAttachmentDialog
All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider

public class SourceAttachmentDialog
extends StatusDialog

A dialog to configure the source attachment of a library (library and zip archive). SourceAttachmentDialog


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
SourceAttachmentDialog(org.eclipse.swt.widgets.Shell parent, org.eclipse.cdt.core.model.ILibraryEntry entry, org.eclipse.cdt.core.model.ICProject project, boolean applyChanges)
          Creates an instance of the SourceAttachmentDialog.
 
Method Summary
static org.eclipse.cdt.core.model.IPathEntry getPathEntryToEdit(org.eclipse.cdt.core.model.ICProject jproject, org.eclipse.core.runtime.IPath containerPath, org.eclipse.core.runtime.IPath libPath)
          Helper method that tests if an classpath entry can be found in a container.
 org.eclipse.core.runtime.IPath getSourceAttachmentPath()
          Returns the configured source attachment path.
 org.eclipse.core.runtime.IPath getSourceAttachmentRootPath()
          Returns the configured source attachment path root.
 
Methods inherited from class org.eclipse.cdt.internal.ui.dialogs.StatusDialog
create, getStatus, setImage, setTitle
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, close, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, getBlockedHandler, getImage, setBlockedHandler, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
getDefaultImage, getDefaultImages, getDefaultOrientation, getReturnCode, getShell, getWindowManager, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setWindowManager
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceAttachmentDialog

public SourceAttachmentDialog(org.eclipse.swt.widgets.Shell parent,
                              org.eclipse.cdt.core.model.ILibraryEntry entry,
                              org.eclipse.cdt.core.model.ICProject project,
                              boolean applyChanges)
Creates an instance of the SourceAttachmentDialog. After open, the edited paths can be access with getSourceAttachmentPath and getSourceAttachmentRootPath.

Parameters:
parent - Parent shell for the dialog
entry - The entry to edit
project - Project to which the entry belongs. Can be null if applyChanges is false and the entry does not belong to a container.
applyChanges - If set to true, changes are applied on OK. If set to false, no changes are commited. When changes are applied, classpath entries which are not found on the classpath will be added as new libraries.
Method Detail

getSourceAttachmentPath

public org.eclipse.core.runtime.IPath getSourceAttachmentPath()
Returns the configured source attachment path.


getSourceAttachmentRootPath

public org.eclipse.core.runtime.IPath getSourceAttachmentRootPath()
Returns the configured source attachment path root. Sonce 2.1 source attachment roots are autodetected. The value returned is therefore always null.


getPathEntryToEdit

public static org.eclipse.cdt.core.model.IPathEntry getPathEntryToEdit(org.eclipse.cdt.core.model.ICProject jproject,
                                                                       org.eclipse.core.runtime.IPath containerPath,
                                                                       org.eclipse.core.runtime.IPath libPath)
                                                                throws org.eclipse.cdt.core.model.CModelException
Helper method that tests if an classpath entry can be found in a container. null is returned if the entry can not be found or if the container does not allows the configuration of source attachments

Parameters:
jproject - The container's parent project
containerPath - The path of the container
libPath - The path of the bibrary to be found
Returns:
IClasspathEntry A classpath entry from the container of null if the container can not be modified.
Throws:
org.eclipse.cdt.core.model.CModelException