|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
net.nand.util.i18n.gui.PTEMain.NewDestSrcDialog
private class PTEMain.NewDestSrcDialog
Modal dialog to name a new destination locale file to create and edit, given a source.
To use the dialog, call setVisible(true)
and when that returns,
check if dest
!= null
.
Before returning, the dialog will:
PTEMain.OpenDestSrcDialog
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
javax.swing.JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private java.lang.String |
baseName
Base name from src , or null if couldn't be determined |
private javax.swing.JButton |
bCancel
|
private javax.swing.JButton |
bCreate
|
private java.lang.String |
calcName
Calculated name from baseName + tfLang + tfRegion , or null . |
java.io.File |
dest
Destination file chosen here by user, if any, or null if they cancelled; see src |
java.io.File |
src
Source file already chosen by user before this dialog; see dest |
private javax.swing.JTextField |
tfDestFilename
Dest language, region, filename. |
private javax.swing.JTextField |
tfLang
Dest language, region, filename. |
private javax.swing.JTextField |
tfRegion
Dest language, region, filename. |
private java.awt.event.WindowAdapter |
wa
|
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
---|
DEFAULT_MODALITY_TYPE |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PTEMain.NewDestSrcDialog(java.io.File src)
Create and pack a new dialog, not initially visible; see class javadoc. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae)
Handle button clicks: Create button validates dest and may dispose the dialog. |
void |
changedUpdate(javax.swing.event.DocumentEvent e)
Call doDocEvent(DocumentEvent) when text field contents change |
private void |
doDocEvent(javax.swing.event.DocumentEvent e)
Handle text changes in tfLang , tfRegion , tfDestFilename . |
void |
insertUpdate(javax.swing.event.DocumentEvent e)
Call doDocEvent(DocumentEvent) when text field contents change |
private void |
recalcDestName()
When the language and/or country/region field have changed, recalculate the destination filename if possible from baseName , unless the user has manually changed it already. |
void |
removeUpdate(javax.swing.event.DocumentEvent e)
Call doDocEvent(DocumentEvent) when text field contents change |
Methods inherited from class javax.swing.JDialog |
---|
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.io.File src
dest
public java.io.File dest
null
if they cancelled; see src
private final java.lang.String baseName
src
, or null
if couldn't be determined
private java.lang.String calcName
baseName
+ tfLang
+ tfRegion
, or null
.
Set in recalcDestName()
.
private final javax.swing.JButton bCreate
private final javax.swing.JButton bCancel
private final javax.swing.JTextField tfLang
doDocEvent(DocumentEvent)
is called.
private final javax.swing.JTextField tfRegion
doDocEvent(DocumentEvent)
is called.
private final javax.swing.JTextField tfDestFilename
doDocEvent(DocumentEvent)
is called.
private java.awt.event.WindowAdapter wa
Constructor Detail |
---|
public PTEMain.NewDestSrcDialog(java.io.File src)
src
- Source file, not null
java.lang.IllegalArgumentException
- if dest
is null
Method Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent ae)
dest
and may dispose the dialog. Cancel also disposes here.
See PTEMain.NewDestSrcDialog
class javadoc for validation actions performed.
actionPerformed
in interface java.awt.event.ActionListener
private void recalcDestName()
baseName
, unless the user has manually changed it already.
Updates calcName
and tfDestFilename
, enables/disables bCreate
.
To enable bCreate
, the language field must have 2 or more letters, and the
generated destination filename must be different than the source filename.
private void doDocEvent(javax.swing.event.DocumentEvent e)
tfLang
, tfRegion
, tfDestFilename
.
For tfDestFilename
, enable bCreate
if the name isn't the source filename
and clear calcName
if the user has manually changed it from the calculated name.
For other fields, call recalcDestName()
.
Note: DocumentEvents fire not only when the user types, but also when the program itself changes the contents of a JTextField.
public void insertUpdate(javax.swing.event.DocumentEvent e)
doDocEvent(DocumentEvent)
when text field contents change
insertUpdate
in interface javax.swing.event.DocumentListener
public void changedUpdate(javax.swing.event.DocumentEvent e)
doDocEvent(DocumentEvent)
when text field contents change
changedUpdate
in interface javax.swing.event.DocumentListener
public void removeUpdate(javax.swing.event.DocumentEvent e)
doDocEvent(DocumentEvent)
when text field contents change
removeUpdate
in interface javax.swing.event.DocumentListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |