public abstract class TextDialog extends JDialog
react()
method and
check the value of answer
for the local url which has been clicked.
All transformation operate on the text form of the data.
Therefore every link must begin verbatim with "appendText(String)
and thus be already well-formed
HTML.
JDialog.AccessibleJDialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected String |
answer |
static Dimension |
defaultSize |
static String |
DIGITS |
protected JEditorPane |
epane |
protected boolean |
firstPara
Whether the next call to appendText is the first in this step.
|
protected boolean |
hasShortcuts |
protected Icon |
icon |
protected KeyListener |
keylistener |
static String |
lf
For use by subclasses.
|
protected HyperlinkListener |
linklistener
The answer of the user is executed by clicking one of the offered links.
|
String |
nonSelectedLink
The graphic attribute to signal to the user the non-selection of a link by the user.
|
protected @Opt List<String> |
shortcutlist |
protected int |
stepNum |
accessibleContext, rootPane, rootPaneCheckingEnabled
DEFAULT_MODALITY_TYPE
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
TextDialog(JFrame context,
String windowtitle,
boolean isModal) |
TextDialog(JFrame context,
String windowtitle,
boolean isModal,
boolean hasShortcuts) |
TextDialog(JFrame context,
String windowtitle,
boolean isModal,
boolean hasShortcuts,
PlafIcon.type t) |
TextDialog(@Opt JFrame context,
@Opt String windowtitle,
boolean isModal,
boolean hasShortcuts,
PlafIcon.type t,
@Opt Dimension size)
Only constructor, all others are just default argument wrappers.
|
TextDialog(JFrame context,
String windowtitle,
boolean isModal,
PlafIcon.type t) |
Modifier and Type | Method and Description |
---|---|
protected void |
appendText(String text)
Wraps the text into one "[p]" element, for later graying out.
|
protected void |
appendTextLine(String text)
Appends only short (additional) text without any interactive formatting.
|
protected void |
finished() |
protected void |
react()
Callback function, must be overridden by the user.
|
void |
runDialog() |
protected void |
transformLinks()
Replaces link appearances and marks older dialog fragments by graying out.
|
static String |
wrapError(String t)
For use by subclasses.
|
static String |
wrapTT(String t)
For use by subclasses.
|
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
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
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, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final String lf
public static final Dimension defaultSize
public String nonSelectedLink
protected int stepNum
protected boolean firstPara
protected String answer
protected final JEditorPane epane
protected final Icon icon
protected final boolean hasShortcuts
protected HyperlinkListener linklistener
answer
is set and
the call-back react()
is called. There the caller performs the next
step of the dialog by adding further HTML text (again with links for reaction)
by calling appendText(String)
.
All these steps are numbered visibly.
We use the url value of the HTML source text, i.e. not parsed or verified,
which is retrieved by HyperlinkEvent.getDescription()
.public static final String DIGITS
protected KeyListener keylistener
public TextDialog(JFrame context, String windowtitle, boolean isModal, boolean hasShortcuts)
public TextDialog(JFrame context, String windowtitle, boolean isModal, PlafIcon.type t)
public TextDialog(JFrame context, String windowtitle, boolean isModal, boolean hasShortcuts, PlafIcon.type t)
public TextDialog(@Opt @Opt JFrame context, @Opt @Opt String windowtitle, boolean isModal, boolean hasShortcuts, PlafIcon.type t, @Opt @Opt Dimension size)
public JDialog(Window owner, String title) Creates a modeless dialog with the specified title and owner Window. ... Parameters: ... title - the String to display in the dialog's title bar or null if the dialog has no titleis THE ONLY PLACE where there is anything said about "title==null". We ASSUME that title is OPT String.
protected void transformLinks()
[a href='xxx']yyy[/a] --> [b]yyy[/b] iff xxx==answer --> [i]yyy[/i] otherwise (variant : [strike]yyy[/strike]; is not xhtml strict but better to read!)
[html] [html] [body] [body] [p style="color:gray"] [p style="color:gray"] VERY old text VERY old text [/p] [/p] [hr/] [hr/] [p] [p style="color:gray"] LAST text LAST text [/p] [/p] [hr/] ((NEW text <----- later )) [/body] [/body] [/html] [/html]The easier idea of own big "div" cannot be used because of bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6618068
setText("[div style='xxx']") ---> getText() == "[div]" setText("[p style='xxx']") ---> getText() == "[p]"
protected void appendText(String text)
protected void appendTextLine(String text)
public void runDialog()
protected void react()
answer
,
which is (the raw source text of) the url selected by the user.protected void finished()
see also the complete user documentation .