|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
javax.swing.JButton
com.altair.hwm.beans.utils.HWMButton
com.altair.hwm.beans.utils.HWMFileBrowser
public class HWMFileBrowser
Title: HWMFileBrowser
Description: A file chooser class -- This bean is essentially a button, that acts as a file browser button. The user can specify the file filters as properties of the bean
NOTE: Whenever using HWMFileBrowser on a modal HWMDialog follow 1. Donot use the mechanism of using addHWMCmdEventListener() and handling OnCmdSuccess() and OnCmdFailed() methods 2.Rather treat the HWMFileBrowser as a button, addActionListener and in actionPerformed() do fileBrowser.Browse(HWMDialog) Company: Altair Engineering, Inc.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
---|---|
static int |
FILE_NOT_SELECTED
This is returned if the user cancels the file selection |
static int |
FILE_SELECTED
This is returned if the user has selected a file |
static int |
METH_BROWSE
|
static java.lang.String |
PROP_APPROVE_TXT
|
static java.lang.String |
PROP_CURRENT_WORKING_DIR
|
static java.lang.String |
PROP_DLG_TITLE
|
static java.lang.String |
PROP_FILE_FILTER
|
static java.lang.String |
PROP_FILENAME
|
static java.lang.String |
PROP_VALUE
|
static java.lang.String |
VERSION
|
Fields inherited from class com.altair.hwm.beans.utils.HWMButton |
---|
BTNTYPE_APPLY, BTNTYPE_APPLY_AND_NEXT, BTNTYPE_CANCEL, BTNTYPE_GENERIC, BTNTYPE_NEXT, BTNTYPE_PREV |
Fields inherited from class javax.swing.AbstractButton |
---|
BORDER_PAINTED_CHANGED_PROPERTY, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
HWMFileBrowser()
Constructor |
Method Summary | |
---|---|
int |
Browse()
Displays browser and returns the selected file. |
int |
Browse(java.awt.Component compParent)
Displays browser and returns the selected file. |
java.lang.String |
GetApproveBtnText()
Gets the approve button text. |
java.lang.String |
GetDialogTitle()
Gets the dialog title. |
javax.swing.JFileChooser |
GetFileChooser()
Get the file chooser which this class wraps |
java.util.Hashtable |
GetFileFilter()
Retrieves info regarding all the file filters. |
java.lang.String |
GetSelectedFilename()
Get the name of the file chosen by the file browser |
java.lang.String |
GetWorkingDir()
Get the current working dir |
boolean |
IsFileValid(java.io.File file,
java.io.File fileDir)
Returns true if file selected is valid else false |
void |
OnAction()
Callback function when the button is pressed. |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
This method gets called when a bound property is changed. |
void |
readExternal(java.io.ObjectInput inp)
De-Serialization -- read all the properties from file. |
void |
ReadProperties()
Get the required properties from the datamodel and initialize self |
void |
SaveProperties()
Save the required properties in the datamodel (so that they persist) |
void |
SetApproveBtnText(java.lang.String strApproveBtnTxt)
Sets the approve button text. |
void |
SetBeanName(java.lang.String strBeanName)
Set the name of the bean |
void |
SetDialogTitle(java.lang.String strTitle)
Sets the dialog title. |
void |
SetFileFilter(java.util.Hashtable hashtblFilter)
Adds file filter(s) with the given extension and description. |
void |
SetFrameWork(IHWMFrameWork hwmFrameWork)
This method is called by the HWM Application to set the interface with which a bean can communicate directly with the HWM application. |
void |
SetSelectedFile(java.lang.String szFilename)
Set the name of the file chosen by the file browser |
void |
SetWorkingDir(java.lang.String szWorkingDir)
Set the current working dir |
java.lang.String |
TCLCreateAdditionalEventProcs()
This method rerurns the TCL statement string for any additional procedures that is requred for the bean. |
void |
writeExternal(java.io.ObjectOutput objOutput)
Serialization -- write all the properties to file. |
Methods inherited from class javax.swing.JButton |
---|
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, removeNotify, setDefaultCapable, updateUI |
Methods inherited from class javax.swing.AbstractButton |
---|
addActionListener, addChangeListener, addItemListener, doClick, doClick, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setUI, setVerticalAlignment, setVerticalTextPosition |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VERSION
public static final java.lang.String PROP_VALUE
public static final java.lang.String PROP_FILENAME
public static final java.lang.String PROP_FILE_FILTER
public static final java.lang.String PROP_CURRENT_WORKING_DIR
public static final java.lang.String PROP_DLG_TITLE
public static final java.lang.String PROP_APPROVE_TXT
public static final int METH_BROWSE
public static final int FILE_NOT_SELECTED
public static final int FILE_SELECTED
Constructor Detail |
---|
public HWMFileBrowser()
Method Detail |
---|
public void SetFrameWork(IHWMFrameWork hwmFrameWork)
SetFrameWork
in interface IHWMControl
SetFrameWork
in class HWMButton
hwmFrameWork
- The interface with which a bean can communicate with
the HWM application.public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class HWMButton
evt
- - A PropertyChangeEvent object describing the event source
and the property that has changed.public void SaveProperties()
SaveProperties
in class HWMButton
public void ReadProperties()
ReadProperties
in class HWMButton
public void SetBeanName(java.lang.String strBeanName)
SetBeanName
in interface IHWMControl
SetBeanName
in class HWMButton
strBeanName
- The name of this bean as the framework knows it to be.
Will be useful, if the bean chooses to scope its data in the datamodel -
especially if multiple instances of the same bean appear in the processpublic void writeExternal(java.io.ObjectOutput objOutput) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class HWMButton
java.io.IOException
public void readExternal(java.io.ObjectInput inp) throws java.lang.ClassNotFoundException, java.io.IOException
readExternal
in interface java.io.Externalizable
readExternal
in class HWMButton
java.lang.ClassNotFoundException
java.io.IOException
public void SetFileFilter(java.util.Hashtable hashtblFilter)
hashtblFilter
- The hash table containing all the extensions
and the descriptions for each file filterpublic java.util.Hashtable GetFileFilter()
public void SetWorkingDir(java.lang.String szWorkingDir)
szWorkingDir
- The current working directory to usepublic java.lang.String GetWorkingDir()
public void SetSelectedFile(java.lang.String szFilename)
szFilename
- The name of the filepublic java.lang.String GetSelectedFilename()
public void SetDialogTitle(java.lang.String strTitle)
strTitle
- The title for the dialogpublic java.lang.String GetDialogTitle()
public void SetApproveBtnText(java.lang.String strApproveBtnTxt)
strApproveBtnTxt
- The text for the approve buttonpublic java.lang.String GetApproveBtnText()
public javax.swing.JFileChooser GetFileChooser()
public int Browse()
public boolean IsFileValid(java.io.File file, java.io.File fileDir)
file
- The selected filefileDir
- The current directory in the file browser
public int Browse(java.awt.Component compParent)
compParent
- The dialog will be centered in this component.
public void OnAction()
OnAction
in class HWMButton
actionEvt
- The action event objectpublic java.lang.String TCLCreateAdditionalEventProcs()
TCLCreateAdditionalEventProcs
in interface ITCLCodeCreator
TCLCreateAdditionalEventProcs
in class HWMButton
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |