org.eclipse.cdt.internal.ui.wizards.dialogfields
Class LinkToFileGroup

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField
      extended by org.eclipse.cdt.internal.ui.wizards.dialogfields.StringDialogField
          extended by org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField
              extended by org.eclipse.cdt.internal.ui.wizards.dialogfields.LinkToFileGroup

public class LinkToFileGroup
extends StringButtonDialogField

This class is part of the NewClassWizard It handels the Link to file part


Constructor Summary
LinkToFileGroup(IStringButtonAdapter adapter, org.eclipse.swt.widgets.Listener listener)
           
 
Method Summary
 org.eclipse.swt.widgets.Control[] doFillIntoGrid(org.eclipse.swt.widgets.Composite parent, int nColumns)
          Creates all controls of the dialog field and fills it to a composite.
 org.eclipse.swt.widgets.Button getBrowseButtonControl(org.eclipse.swt.widgets.Composite parent)
           
 org.eclipse.swt.widgets.Button getLinkCheckButtonControl(org.eclipse.swt.widgets.Composite parent)
           
 java.lang.String getLinkTarget()
          Returns the link target location entered by the user.
 int getNumberOfControls()
          Returns the number of columns of the dialog field.
 java.lang.String getResolvedPath()
           
 java.lang.String getText()
          Gets the text.
 org.eclipse.swt.widgets.Text getTextControl(org.eclipse.swt.widgets.Composite parent)
          Creates or returns the created text control.
static org.eclipse.swt.layout.GridData gridDataForText(int span)
           
 boolean linkCreated()
           
 void setLinkTarget(java.lang.String target)
          Sets the value of the link target field
 void setText(java.lang.String text)
          Sets the text.
 org.eclipse.core.runtime.IStatus validateLinkLocation(org.eclipse.core.resources.IResource linkHandle)
          Validates this page's controls.
 
Methods inherited from class org.eclipse.cdt.internal.ui.wizards.dialogfields.StringButtonDialogField
changeControlPressed, enableButton, getChangeControl, setButtonLabel
 
Methods inherited from class org.eclipse.cdt.internal.ui.wizards.dialogfields.StringDialogField
setFocus, setTextWithoutUpdate
 
Methods inherited from class org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField
createEmptySpace, createEmptySpace, dialogFieldChanged, getLabelControl, isEnabled, postSetFocusOnDialogField, setDialogFieldListener, setEnabled, setLabelText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinkToFileGroup

public LinkToFileGroup(IStringButtonAdapter adapter,
                       org.eclipse.swt.widgets.Listener listener)
Method Detail

doFillIntoGrid

public org.eclipse.swt.widgets.Control[] doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
                                                        int nColumns)
Description copied from class: DialogField
Creates all controls of the dialog field and fills it to a composite. The composite is assumed to have MGridLayout as layout. The dialog field will adjust its controls' spans to the number of columns given. To be reimplemented by dialog field implementors.

Overrides:
doFillIntoGrid in class StringButtonDialogField

getNumberOfControls

public int getNumberOfControls()
Description copied from class: DialogField
Returns the number of columns of the dialog field. To be reimplemented by dialog field implementors.

Overrides:
getNumberOfControls in class StringButtonDialogField

getLinkCheckButtonControl

public org.eclipse.swt.widgets.Button getLinkCheckButtonControl(org.eclipse.swt.widgets.Composite parent)

getText

public java.lang.String getText()
Description copied from class: StringDialogField
Gets the text. Can not be null

Overrides:
getText in class StringDialogField

setText

public void setText(java.lang.String text)
Description copied from class: StringDialogField
Sets the text. Triggers a dialog-changed event.

Overrides:
setText in class StringDialogField

getTextControl

public org.eclipse.swt.widgets.Text getTextControl(org.eclipse.swt.widgets.Composite parent)
Description copied from class: StringDialogField
Creates or returns the created text control.

Overrides:
getTextControl in class StringDialogField
Parameters:
parent - The parent composite or null when the widget has already been created.

gridDataForText

public static org.eclipse.swt.layout.GridData gridDataForText(int span)

getBrowseButtonControl

public org.eclipse.swt.widgets.Button getBrowseButtonControl(org.eclipse.swt.widgets.Composite parent)

getLinkTarget

public java.lang.String getLinkTarget()
Returns the link target location entered by the user.

Returns:
the link target location entered by the user. null if the user chose not to create a link.

getResolvedPath

public java.lang.String getResolvedPath()

setLinkTarget

public void setLinkTarget(java.lang.String target)
Sets the value of the link target field

Parameters:
target - the value of the link target field

validateLinkLocation

public org.eclipse.core.runtime.IStatus validateLinkLocation(org.eclipse.core.resources.IResource linkHandle)
Validates this page's controls.

Returns:
IStatus indicating the validation result. IStatus.OK if the specified link target is valid given the linkHandle.

linkCreated

public boolean linkCreated()