public abstract class AbstractMultilineDialog extends JComponent
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowImport
True if the dialog allow to import a text file.
|
static int |
APPROVE_OPTION |
static int |
CANCEL_OPTION |
protected AbstractAction |
cancelaction
The Cancel action.
|
protected Dimension |
dim
The dialog dimension.
|
protected File |
dir
The default directory if the dialog allow to import a text file.
|
protected AbstractAction |
importAction
The import action.
|
protected JTextComponent |
textComp
The text component.
|
protected ExtensionFileFilter |
txtfilter
The file filter if the dialog allow to import a text file.
|
protected AbstractAction |
yesaction
The Yes action.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
AbstractMultilineDialog(JTextComponent textComp)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
JDialog |
createDialog(String title,
Component parent)
Create the dialog.
|
protected JPanel |
createYesNoPanel()
Create the Yes / No bottom Panel.
|
protected void |
doCancel()
Called when the user clicks on the Cancel button.
|
protected void |
doYes()
Called when the user clicks on the Yes button.
|
Dimension |
getDialogDimension()
Return the dimension of the dialog.
|
String |
getDialogTitle()
Return the dialog title.
|
File |
getImportDefaultDirectory()
Return the default directory if the editor has an import text file option.
|
ExtensionFileFilter |
getImportFileFilter()
Return the file filter if the editor has an import text file option.
|
boolean |
isAllowingImport()
Return true if the editor has an import text file option.
|
boolean |
isEditable()
Return true if the text is editable.
|
void |
setAllowImport(boolean allowImport)
Set if the editor has an import text file option.
|
void |
setDialogDimension(Dimension dim)
Set the dimension of the dialog.
|
void |
setDialogTitle(String dialogTitle)
Set the dialog title.
|
void |
setEditable(boolean isEditable)
Set if the text is editable.
|
void |
setImportDefaultDirectory(File dir)
Set the default directory if the editor has an import text file option.
|
void |
setImportFileFilter(ExtensionFileFilter filter)
Set the file filter if the editor has an import text file option.
|
void |
setText(String text)
Set the associated text.
|
protected abstract void |
setUp()
Set up the panel contents.
|
int |
showDialog(Component parent)
Show the dialog.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, imageUpdate, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected JTextComponent textComp
protected Dimension dim
protected AbstractAction yesaction
protected AbstractAction cancelaction
protected AbstractAction importAction
protected boolean allowImport
protected File dir
protected ExtensionFileFilter txtfilter
public static final int APPROVE_OPTION
public static final int CANCEL_OPTION
public AbstractMultilineDialog(JTextComponent textComp)
textComp
- the text componentpublic void setEditable(boolean isEditable)
isEditable
- true if the text is editablepublic boolean isEditable()
public void setDialogTitle(String dialogTitle)
dialogTitle
- the dialog titlepublic String getDialogTitle()
public void setAllowImport(boolean allowImport)
allowImport
- true if the editor has an import text file optionpublic boolean isAllowingImport()
public void setImportDefaultDirectory(File dir)
dir
- the default directory if the editor has an import text file optionpublic File getImportDefaultDirectory()
public void setImportFileFilter(ExtensionFileFilter filter)
filter
- the file filter if the editor has an import text file optionpublic ExtensionFileFilter getImportFileFilter()
public void setDialogDimension(Dimension dim)
dim
- the dimensionpublic Dimension getDialogDimension()
public int showDialog(Component parent) throws HeadlessException
parent
- the parent componentHeadlessException
public JDialog createDialog(String title, Component parent) throws HeadlessException
title
- the dialog titleparent
- the parent componentHeadlessException
protected abstract void setUp()
public void setText(String text)
text
- the textprotected JPanel createYesNoPanel()
protected void doYes()
protected void doCancel()