dsto.dfc.swt.controls
Class FileTextField

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by dsto.dfc.swt.controls.FileTextField
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable, org.eclipse.swt.widgets.Listener

public class FileTextField
extends org.eclipse.swt.widgets.Composite
implements org.eclipse.swt.widgets.Listener

A text control that is designed for entering a file or directory. Consists of a standard text field plus a "..." button to the right to popup a file or directory dialog.

Author:
phillipm

Field Summary
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
FileTextField(org.eclipse.swt.widgets.Composite parent, int style)
          Create a new instance.
 
Method Summary
 String getDefaultExtension()
           
 String getDialogDescription()
           
 String[] getDialogExtensions()
           
 int getDialogMode()
           
 String getDialogTitle()
           
 org.eclipse.swt.widgets.Button getPopupButton()
           
 String getText()
           
 org.eclipse.swt.widgets.Text getTextField()
           
 void handleEvent(org.eclipse.swt.widgets.Event e)
           
 boolean isSelectDirectory()
           
 void setDefaultExtension(String extension)
           
 void setDialogDescription(String string)
          Set the description shown on the dialog.
 void setDialogDirectory(String directory)
           
 void setDialogExtensions(String[] extensions)
           
 void setDialogMode(int mode)
          One of SWT.SAVE or SWT.OPEN.
 void setDialogTitle(String string)
           
 void setSelectDirectory(boolean b)
           
 void setSuggestedWidth(int columns)
           
 void setText(String text)
           
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getBorderWidth, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileTextField

public FileTextField(org.eclipse.swt.widgets.Composite parent,
                     int style)
Create a new instance.

Parameters:
parent - The parent component.
style - The text field's style.
Method Detail

setSuggestedWidth

public void setSuggestedWidth(int columns)

getTextField

public org.eclipse.swt.widgets.Text getTextField()

getPopupButton

public org.eclipse.swt.widgets.Button getPopupButton()

setText

public void setText(String text)

getText

public String getText()

setDialogDirectory

public void setDialogDirectory(String directory)

getDialogExtensions

public String[] getDialogExtensions()

setDialogExtensions

public void setDialogExtensions(String[] extensions)

setDefaultExtension

public void setDefaultExtension(String extension)

getDefaultExtension

public String getDefaultExtension()

getDialogMode

public int getDialogMode()

setDialogMode

public void setDialogMode(int mode)
One of SWT.SAVE or SWT.OPEN. Has no effect for directory dialogs.


setDialogTitle

public void setDialogTitle(String string)

getDialogTitle

public String getDialogTitle()

isSelectDirectory

public boolean isSelectDirectory()

setSelectDirectory

public void setSelectDirectory(boolean b)

getDialogDescription

public String getDialogDescription()

setDialogDescription

public void setDialogDescription(String string)
Set the description shown on the dialog. Only implemented for directory dialogs.


handleEvent

public void handleEvent(org.eclipse.swt.widgets.Event e)
Specified by:
handleEvent in interface org.eclipse.swt.widgets.Listener


Copyright © 2008 Commonwealth of Australia