public class ParserSelector extends JPanel
registerParser
. The user can select one
of the registered parsers, and a new instance of the selected parser can be created with
createParser
.JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ParserSelector(boolean showReadingAnnotationSelector)
Creates a new parser selector which shows the currently registered parsers.
|
ParserSelector(boolean showReadingAnnotationSelector,
char readingStart,
char readingEnd)
Creates a new parser selector which shows the currently registered parsers.
|
Modifier and Type | Method and Description |
---|---|
static Parser |
createParser(Class<? extends Parser> parserClass,
Dictionary[] dictionaries,
Set<String> exclusions,
boolean firstOccurrenceOnly)
Creates a new instance of the parser class.
|
Parser |
createParser(Dictionary[] dictionaries,
Set<String> exclusions)
Creates a new instance of the currently selected parser.
|
ReadingAnnotationFilter |
createReadingAnnotationFilter()
Creates a new reading annotation filter with the currently selected reading brackets.
|
static ReadingAnnotationFilter |
createReadingAnnotationFilter(char readingStart,
char readingEnd)
Creates a reading annotation filter with the given reading brackets.
|
char |
getReadingEnd() |
char |
getReadingStart() |
Class<? extends Parser> |
getSelectedParser()
Returns the class of the currently selected parser.
|
boolean |
isDetectParagraphs()
Determines if the user selected the detect paragraphs checkbox.
|
boolean |
isFirstOccurrenceOnly() |
boolean |
isNoReadingBrackets()
Tests if no reading brackets are selected.
|
static void |
registerParser(Class<? extends Parser> parserClass,
String displayName)
Registers a parser class with the parser selector.
|
void |
setDetectParagraphs(boolean detect) |
void |
setEnabled(Class<? extends Parser> parserClass,
boolean enabled)
Enables/disables a registered parser in this selector.
|
void |
setEnabled(String displayName,
boolean enabled)
Enables/disables a registered parser in this selector.
|
void |
setFirstOccurrenceOnly(boolean firstOccurrenceOnly) |
void |
setNoReadingBrackets()
Disable the use of a reading bracket filter by setting the selected reading brackets to
"none".
|
void |
setReadingBrackets(char readingStart,
char readingEnd) |
void |
setSelected(Class<? extends Parser> parserClass)
Makes the parser the currently selected parser.
|
void |
setSelected(String displayName)
Makes the parser the currently selected parser.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
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, 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, 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
public ParserSelector(boolean showReadingAnnotationSelector)
showReadingAnnotationSelector
- If this is true
, a widget will be shown
which lets the user choose the brackets which delimit reading annotations.public ParserSelector(boolean showReadingAnnotationSelector, char readingStart, char readingEnd)
showReadingAnnotationSelector
- If this is true
, a widget will be shown
which lets the user choose the brackets which delimit reading annotations.readingStart
- Start character of a reading annotation.readingEnd
- End character of a reading annotation.public static void registerParser(Class<? extends Parser> parserClass, String displayName)
ParserSelector
created before a new parser is registered will not be updated.parserClass
- Class implementing the Parser
interface.displayName
- Name of the parser shown to the user.ClassCastException
- if the parser class does not implement the
Parser
interface.NoSuchMethodException
- if the parser class has no constructor of the form
(Dictionary[] dictionaries,Set exclusions)
.public static Parser createParser(Class<? extends Parser> parserClass, Dictionary[] dictionaries, Set<String> exclusions, boolean firstOccurrenceOnly)
public static ReadingAnnotationFilter createReadingAnnotationFilter(char readingStart, char readingEnd)
null
is returned.public Class<? extends Parser> getSelectedParser()
public Parser createParser(Dictionary[] dictionaries, Set<String> exclusions)
public ReadingAnnotationFilter createReadingAnnotationFilter()
null
is returned.public void setEnabled(Class<? extends Parser> parserClass, boolean enabled)
public void setEnabled(String displayName, boolean enabled)
public void setSelected(Class<? extends Parser> parserClass)
public void setSelected(String displayName)
public char getReadingStart()
public char getReadingEnd()
public void setReadingBrackets(char readingStart, char readingEnd)
public void setNoReadingBrackets()
public boolean isNoReadingBrackets()
public void setFirstOccurrenceOnly(boolean firstOccurrenceOnly)
public boolean isFirstOccurrenceOnly()
public void setDetectParagraphs(boolean detect)
public boolean isDetectParagraphs()
true
, the
detect paragraphs option of the JGlossifyReader
should be used when importing a text
document. While this option has no relation to the text parser backend, from a UI perspective
it makes sense to place the control here because the user does not make a difference between
text import and parsing.Copyright © 2001-2013 the JGloss developers. All Rights Reserved.