/** * Creates a file field editor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param enforceAbsolute <code>true</code> if the file path * must be absolute, and <code>false</code> otherwise * @param validationStrategy either {@link StringButtonFieldEditor#VALIDATE_ON_KEY_STROKE} * to perform on the fly checking, or {@link StringButtonFieldEditor#VALIDATE_ON_FOCUS_LOST} * (the default) to perform validation only after the text has been typed in * @param parent the parent of the field editor's control. * @since 3.4 * @see StringButtonFieldEditor#VALIDATE_ON_KEY_STROKE * @see StringButtonFieldEditor#VALIDATE_ON_FOCUS_LOST */ public FileFieldEditor(String name, String labelText, boolean enforceAbsolute, int validationStrategy, Composite parent) { init(name, labelText); this.enforceAbsolute = enforceAbsolute; setErrorMessage(JFaceResources .getString("FileFieldEditor.errorMessage"));//$NON-NLS-1$ setChangeButtonText(JFaceResources.getString("openBrowse"));//$NON-NLS-1$ setValidateStrategy(validationStrategy); createControl(parent); }
/** * Creates a file field editor. * * @param name the name of the preference this field editor works on * @param labelText the label text of the field editor * @param enforceAbsolute <code>true</code> if the file path * must be absolute, and <code>false</code> otherwise * @param validationStrategy either {@link StringButtonFieldEditor#VALIDATE_ON_KEY_STROKE} * to perform on the fly checking, or {@link StringButtonFieldEditor#VALIDATE_ON_FOCUS_LOST} * (the default) to perform validation only after the text has been typed in * @param parent the parent of the field editor's control. * @since 3.4 * @see StringButtonFieldEditor#VALIDATE_ON_KEY_STROKE * @see StringButtonFieldEditor#VALIDATE_ON_FOCUS_LOST */ public FileFieldEditor(String name, String labelText, boolean enforceAbsolute, int validationStrategy, Composite parent) { init(name, labelText); this.enforceAbsolute = enforceAbsolute; setErrorMessage(JFaceResources .getString("FileFieldEditor.errorMessage"));//$NON-NLS-1$ setChangeButtonText(JFaceResources.getString("openBrowse"));//$NON-NLS-1$ setValidateStrategy(validationStrategy); createControl(parent); }