Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.io.util
Class ExtendedFileFieldEditor

java.lang.Object
  extended by org.eclipse.jface.preference.FieldEditor
      extended by org.eclipse.jface.preference.StringFieldEditor
          extended by org.eclipse.jface.preference.StringButtonFieldEditor
              extended by org.eclipse.jface.preference.FileFieldEditor
                  extended by eu.esdihumboldt.hale.ui.io.util.ExtendedFileFieldEditor
Direct Known Subclasses:
OpenFileFieldEditor, SaveFileFieldEditor

public class ExtendedFileFieldEditor
extends org.eclipse.jface.preference.FileFieldEditor

File field editor that allows setting the file dialog style and filter names or IContentTypes


Field Summary
 
Fields inherited from class org.eclipse.jface.preference.StringFieldEditor
oldValue, UNLIMITED, VALIDATE_ON_FOCUS_LOST, VALIDATE_ON_KEY_STROKE
 
Fields inherited from class org.eclipse.jface.preference.FieldEditor
HORIZONTAL_GAP, IS_VALID, VALUE
 
Constructor Summary
protected ExtendedFileFieldEditor(int style)
          Create a file field editor
  ExtendedFileFieldEditor(String name, String labelText, boolean enforceAbsolute, org.eclipse.swt.widgets.Composite parent, int style)
          Create a file field editor
  ExtendedFileFieldEditor(String name, String labelText, boolean enforceAbsolute, int validationStrategy, org.eclipse.swt.widgets.Composite parent, int style)
          Create a file field editor
  ExtendedFileFieldEditor(String name, String labelText, org.eclipse.swt.widgets.Composite parent, int style)
          Create a file field editor
 
Method Summary
protected  String changePressed()
           
protected  File getFile(File startingDirectory)
          Helper to open the file chooser dialog.
 void setContentTypes(Set<org.eclipse.core.runtime.content.IContentType> types)
          Set the content types, this is an alternative to using setFileExtensions(String[]) and setFilterNames(String[])
 void setFileExtensions(String[] extensions)
          Sets this file field editor's file extension filter.
 void setFilterNames(String[] names)
          Sets this file field editor's file extension filter names.
 
Methods inherited from class org.eclipse.jface.preference.FileFieldEditor
checkState, setFilterPath
 
Methods inherited from class org.eclipse.jface.preference.StringButtonFieldEditor
adjustForNumColumns, doFillIntoGrid, getChangeControl, getNumberOfControls, getShell, setChangeButtonText, setEnabled
 
Methods inherited from class org.eclipse.jface.preference.StringFieldEditor
doCheckState, doLoad, doLoadDefault, doStore, getErrorMessage, getStringValue, getTextControl, getTextControl, isEmptyStringAllowed, isValid, refreshValidState, setEmptyStringAllowed, setErrorMessage, setFocus, setStringValue, setTextLimit, setValidateStrategy, showErrorMessage, valueChanged
 
Methods inherited from class org.eclipse.jface.preference.FieldEditor
applyFont, checkParent, clearErrorMessage, clearMessage, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, createControl, dispose, fillIntoGrid, fireStateChanged, fireValueChanged, getFieldEditorFontName, getLabelControl, getLabelControl, getLabelText, getPage, getPreferenceName, getPreferencePage, getPreferenceStore, init, load, loadDefault, presentsDefaultValue, setButtonLayoutData, setLabelText, setPage, setPreferenceName, setPreferencePage, setPreferenceStore, setPresentsDefaultValue, setPropertyChangeListener, showErrorMessage, showMessage, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedFileFieldEditor

protected ExtendedFileFieldEditor(int style)
Create a file field editor

Parameters:
style - the file dialog style

ExtendedFileFieldEditor

public ExtendedFileFieldEditor(String name,
                               String labelText,
                               boolean enforceAbsolute,
                               org.eclipse.swt.widgets.Composite parent,
                               int style)
Create a file field editor

Parameters:
name - the preference name
labelText - the label text
enforceAbsolute - true if the file path must be absolute, and false otherwise
parent - the parent composite
style - the file dialog style
See Also:
FileFieldEditor.FileFieldEditor(String, String, boolean, Composite)

ExtendedFileFieldEditor

public ExtendedFileFieldEditor(String name,
                               String labelText,
                               boolean enforceAbsolute,
                               int validationStrategy,
                               org.eclipse.swt.widgets.Composite parent,
                               int style)
Create a file field editor

Parameters:
name - the preference name
labelText - the label text
enforceAbsolute - true if the file path must be absolute, and false otherwise
validationStrategy - the validation strategy
parent - the parent composite
style - the file dialog style
See Also:
FileFieldEditor.FileFieldEditor(String, String, boolean, int, Composite)

ExtendedFileFieldEditor

public ExtendedFileFieldEditor(String name,
                               String labelText,
                               org.eclipse.swt.widgets.Composite parent,
                               int style)
Create a file field editor

Parameters:
name - the preference name
labelText - the label text
parent - the parent composite
style - the file dialog style
See Also:
FileFieldEditor.FileFieldEditor(String, String, Composite)
Method Detail

changePressed

protected String changePressed()
Overrides:
changePressed in class org.eclipse.jface.preference.FileFieldEditor
See Also:
FileFieldEditor.changePressed()

getFile

protected File getFile(File startingDirectory)
Helper to open the file chooser dialog.

Parameters:
startingDirectory - the directory to open the dialog on.
Returns:
File The File the user selected or null if they do not.

setFileExtensions

public void setFileExtensions(String[] extensions)
Sets this file field editor's file extension filter.

Overrides:
setFileExtensions in class org.eclipse.jface.preference.FileFieldEditor
Parameters:
extensions - a list of file extension, or null to set the filter to the system's default value

setFilterNames

public void setFilterNames(String[] names)
Sets this file field editor's file extension filter names.

Parameters:
names - a list of filter names, must correspond with the extensions set using setFileExtensions(String[])

setContentTypes

public void setContentTypes(Set<org.eclipse.core.runtime.content.IContentType> types)
Set the content types, this is an alternative to using setFileExtensions(String[]) and setFilterNames(String[])

Parameters:
types - the content types

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d