Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.preference
Class StringButtonFieldEditor

java.lang.Object
  extended by 

org.eclipse.jface.preference.FieldEditor
      extended by 

org.eclipse.jface.preference.StringFieldEditor
          extended by 
org.eclipse.jface.preference.StringButtonFieldEditor
Direct Known Subclasses:
DirectoryFieldEditor, FileFieldEditor

public abstract class StringButtonFieldEditor
extends StringFieldEditor

An abstract field editor for a string type preference that presents a string input field with a change button to its right to edit the input field's content. When the user presses the change button, the abstract framework method changePressed() gets called to compute a new string.


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 StringButtonFieldEditor ()
          Creates a new string button field editor
protected StringButtonFieldEditor ( String name, String labelText, Composite parent)
          Creates a string button field editor.
 
Method Summary
protected  void adjustForNumColumns (int numColumns)
          Adjusts the horizontal span of this field editor's basic controls.
protected abstract   String changePressed ()
          Notifies that this field editor's change button has been pressed.
protected  void doFillIntoGrid ( Composite parent, int numColumns)
          Fills this field editor's basic controls into the given parent.
protected   Button getChangeControl ( Composite parent)
          Get the change control.
 int getNumberOfControls ()
          Returns the number of basic controls this field editor consists of.
protected   Shell getShell ()
          Returns this field editor's shell.
 void setChangeButtonText ( String text)
          Sets the text of the change button.
 void setEnabled (boolean enabled, Composite parent)
          Set whether or not the controls in the field editor are enabled.
 
Methods inherited from class org.eclipse.jface.preference. StringFieldEditor
checkState, 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

StringButtonFieldEditor

protected StringButtonFieldEditor()
Creates a new string button field editor


StringButtonFieldEditor

protected StringButtonFieldEditor(
String name,
                                  
String labelText,
                                  
Composite parent)
Creates a string button field editor.

Parameters:
name - the name of the preference this field editor works on
labelText - the label text of the field editor
parent - the parent of the field editor's control
Method Detail

adjustForNumColumns

protected void adjustForNumColumns(int numColumns)
Description copied from class: FieldEditor
Adjusts the horizontal span of this field editor's basic controls.

Subclasses must implement this method to adjust the horizontal span of controls so they appear correct in the given number of columns.

The number of columns will always be equal to or greater than the value returned by this editor's getNumberOfControls method.

Overrides:
adjustForNumColumns in class StringFieldEditor
Parameters:
numColumns - the number of columns

changePressed

protected abstract 
String changePressed()
Notifies that this field editor's change button has been pressed.

Subclasses must implement this method to provide a corresponding new string for the text field. If the returned value is null, the currently displayed value remains.

Returns:
the new string to display, or null to leave the old string showing

doFillIntoGrid

protected void doFillIntoGrid(
Composite parent,
                              int numColumns)
Description copied from class: StringFieldEditor
Fills this field editor's basic controls into the given parent.

The string field implementation of this FieldEditor framework method contributes the text field. Subclasses may override but must call super.doFillIntoGrid.

Overrides:
doFillIntoGrid in class StringFieldEditor
Parameters:
parent - the composite used as a parent for the basic controls; the parent's layout must be a GridLayout
numColumns - the number of columns

getChangeControl

protected 
Button getChangeControl(
Composite parent)
Get the change control. Create it in parent if required.

Parameters:
parent -
Returns:
Button

getNumberOfControls

public int getNumberOfControls()
Description copied from class: FieldEditor
Returns the number of basic controls this field editor consists of.

Overrides:
getNumberOfControls in class StringFieldEditor
Returns:
the number of controls

getShell

protected 
Shell getShell()
Returns this field editor's shell.

Returns:
the shell

setChangeButtonText

public void setChangeButtonText(
String text)
Sets the text of the change button.

Parameters:
text - the new text

setEnabled

public void setEnabled(boolean enabled,
                       
Composite parent)
Description copied from class: FieldEditor
Set whether or not the controls in the field editor are enabled.

Overrides:
setEnabled in class StringFieldEditor
Parameters:
enabled - The enabled state.
parent - The parent of the controls in the group. Used to create the controls if required.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire