public class SHTMLPanelImpl extends SHTMLPanel implements javax.swing.event.CaretListener
This class constructs the main panel and all of its GUI elements such as menus, etc.
It defines a set of inner classes creating actions which can be connected to menus, buttons or instantiated individually.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
aboutAction |
static java.lang.String |
ACTION_SELECTED |
static java.lang.String |
ACTION_SELECTED_KEY |
static java.lang.String |
ACTION_UNSELECTED |
static java.lang.String |
APP_TEMP_DIR |
static java.lang.String |
appendTableColAction |
static java.lang.String |
appendTableRowAction |
static java.lang.String |
clearFormatAction |
static java.lang.String |
copyAction |
static java.lang.String |
cutAction |
static java.lang.String |
deleteTableColAction |
static java.lang.String |
deleteTableRowAction |
protected SHTMLDocument |
doc
currently active SHTMLDocument
|
static java.lang.String |
documentTitleAction |
com.lightdev.app.shtm.DynamicResource |
dynRes
single instance of a dynamic resource for use by all
|
static java.lang.String |
editAnchorsAction |
static java.lang.String |
editLinkAction |
static java.lang.String |
editNamedStyleAction |
static java.lang.String |
editPrefsAction |
static java.lang.String |
elemTreeAction |
static java.lang.String |
exitAction
action names
these have to correspond with the keys in the
resource bundle to allow for dynamic
menu creation and control
|
static java.lang.String |
FILE_LAST_OPEN |
static java.lang.String |
FILE_LAST_SAVE |
static java.lang.String |
findReplaceAction |
static java.lang.String |
fontAction |
static java.lang.String |
fontBoldAction |
static java.lang.String |
fontColorAction |
static java.lang.String |
fontFamilyAction |
static java.lang.String |
fontItalicAction |
static java.lang.String |
fontSizeAction |
static java.lang.String |
fontStrikethroughAction |
static java.lang.String |
fontUnderlineAction |
static java.lang.String |
formatAsCodeAction |
static java.lang.String |
formatImageAction |
static java.lang.String |
formatListAction |
static java.lang.String |
formatParaAction |
static java.lang.String |
formatTableAction |
static java.lang.String |
gcAction |
java.lang.String |
helpMenuId
help menu ID
|
static java.lang.String |
helpTopicsAction |
static java.lang.String |
IMAGE_DIR |
static java.lang.String |
insertImageAction |
static java.lang.String |
insertLinkAction |
static java.lang.String |
insertTableAction |
static java.lang.String |
insertTableColAction |
static java.lang.String |
insertTableRowAction |
static java.lang.String |
insertTableRowHeaderAction |
static java.lang.String |
moveTableColumnLeftAction |
static java.lang.String |
moveTableColumnRightAction |
static java.lang.String |
moveTableRowDownAction |
static java.lang.String |
moveTableRowUpAction |
static java.lang.String |
nextTableCellAction |
protected java.awt.event.ActionListener |
openHyperlinkHandler |
static java.lang.String |
openLinkAction |
static java.lang.String |
paraAlignCenterAction |
static java.lang.String |
paraAlignLeftAction |
static java.lang.String |
paraAlignRightAction |
static java.lang.String |
pasteAction |
static java.lang.String |
pasteOtherAction |
static com.lightdev.app.shtm.PluginManager |
pluginManager
the plug-in manager of SimplyHTML
|
java.lang.String |
pluginMenuId
plugin menu ID
|
static java.lang.String |
prevTableCellAction |
static java.lang.String |
printAction |
static java.lang.String |
redoAction |
static java.lang.String |
saveAllAction |
static java.lang.String |
selectAllAction |
static java.lang.String |
setDefaultStyleRefAction |
static java.lang.String |
setStyleAction |
static java.lang.String |
setTagAction |
static java.lang.String |
testAction |
static java.lang.String |
toggleBulletsAction |
static java.lang.String |
toggleNumbersAction |
static java.lang.String |
toggleTableHeaderCellAction |
static java.lang.String |
undoAction |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier and Type | Method and Description |
---|---|
void |
addAction(java.lang.String text,
javax.swing.Action action) |
void |
adjustDividers()
adjust the divider sizes of SimplyHTML's SplitPanel
according to visibility
|
void |
caretUpdate(javax.swing.event.CaretEvent e)
caret listener implementation to track format changes
|
void |
clearDockPanels() |
protected void |
createToolbarItem(javax.swing.JToolBar toolBar,
java.lang.String itemKey) |
protected void |
customizeFrame()
customize the frame to our needs
|
javax.swing.Action |
getAction(java.lang.String actionName) |
static void |
getActionProperties(javax.swing.Action action,
java.lang.String cmd)
get action properties from the associated resource bundle
|
int |
getCaretPosition() |
javax.swing.text.html.HTMLDocument |
getDocument() |
com.lightdev.app.shtm.DocumentPane |
getDocumentPane() |
java.lang.String |
getDocumentText()
Convenience method for obtaining the document text
|
javax.swing.JEditorPane |
getEditorPane() |
javax.swing.text.AttributeSet |
getMaxAttributes(int caretPosition) |
javax.swing.JMenuBar |
getMenuBar() |
javax.swing.JEditorPane |
getMostRecentFocusOwner() |
static SHTMLPanelImpl |
getOwnerSHTMLPanel(java.awt.Component c) |
static TextResources |
getResources() |
SHTMLEditorPane |
getSHTMLEditorPane() |
javax.swing.JEditorPane |
getSourceEditorPane() |
protected void |
initActions()
instantiate Actions and put them into the commands
Hashtable for later use along with their action commands.
|
protected void |
initDocumentPane() |
boolean |
isHtmlEditorActive() |
boolean |
needsSaving()
indicates whether or not the document needs to be saved.
|
javax.swing.JMenuItem |
newActionMenuItem(java.lang.String actionName)
Returns a new menu item for a named action of SimplyHTML.
|
void |
openHyperlink(java.lang.String linkURL) |
protected boolean |
processKeyBinding(javax.swing.KeyStroke ks,
java.awt.event.KeyEvent e,
int condition,
boolean pressed) |
void |
refreshPluginDisplay(SHTMLPlugin pi)
refresh the display for a given plug-in
|
protected void |
registerDocument()
register FrmMain as an object which has interest
in events from a given document pane
|
static void |
setActionBuilder(ActionBuilder ab) |
void |
setContentPanePreferredSize(java.awt.Dimension prefSize) |
void |
setCurrentDocumentContent(java.lang.String sText)
Convenience method for setting the document text
|
protected void |
setEditorPane(SHTMLEditorPane editorPane) |
void |
setOpenHyperlinkHandler(java.awt.event.ActionListener openHyperlinkHandler)
Sets the handler for the Open Hyperlink action.
|
static void |
setTextResources(TextResources textResources) |
void |
switchViews()
Switches between the rich text view and the source view, given
tabbed panes are not used.
|
protected void |
unregisterDocument()
remove FrmMain as a registered object from a given
document pane and its components
remove all plug-ins owned by this FrmMain from
SimplyHTML objects too
|
void |
updateActions()
update all actions
|
createSHTMLPanel, setResources, shtmlPrefChanged
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, 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, 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 static final java.lang.String APP_TEMP_DIR
public static final java.lang.String IMAGE_DIR
public static final java.lang.String ACTION_SELECTED_KEY
public static final java.lang.String ACTION_SELECTED
public static final java.lang.String ACTION_UNSELECTED
public static final java.lang.String FILE_LAST_OPEN
public static final java.lang.String FILE_LAST_SAVE
public com.lightdev.app.shtm.DynamicResource dynRes
public static com.lightdev.app.shtm.PluginManager pluginManager
protected java.awt.event.ActionListener openHyperlinkHandler
protected SHTMLDocument doc
public final java.lang.String pluginMenuId
public final java.lang.String helpMenuId
public static final java.lang.String exitAction
public static final java.lang.String undoAction
public static final java.lang.String redoAction
public static final java.lang.String cutAction
public static final java.lang.String copyAction
public static final java.lang.String pasteAction
public static final java.lang.String pasteOtherAction
public static final java.lang.String selectAllAction
public static final java.lang.String clearFormatAction
public static final java.lang.String fontAction
public static final java.lang.String fontFamilyAction
public static final java.lang.String fontSizeAction
public static final java.lang.String fontBoldAction
public static final java.lang.String fontStrikethroughAction
public static final java.lang.String fontItalicAction
public static final java.lang.String fontUnderlineAction
public static final java.lang.String fontColorAction
public static final java.lang.String helpTopicsAction
public static final java.lang.String aboutAction
public static final java.lang.String gcAction
public static final java.lang.String elemTreeAction
public static final java.lang.String testAction
public static final java.lang.String insertTableAction
public static final java.lang.String formatTableAction
public static final java.lang.String toggleTableHeaderCellAction
public static final java.lang.String insertTableColAction
public static final java.lang.String insertTableRowAction
public static final java.lang.String insertTableRowHeaderAction
public static final java.lang.String appendTableRowAction
public static final java.lang.String appendTableColAction
public static final java.lang.String deleteTableRowAction
public static final java.lang.String deleteTableColAction
public static final java.lang.String nextTableCellAction
public static final java.lang.String prevTableCellAction
public static final java.lang.String moveTableRowUpAction
public static final java.lang.String moveTableColumnLeftAction
public static final java.lang.String moveTableColumnRightAction
public static final java.lang.String moveTableRowDownAction
public static final java.lang.String toggleBulletsAction
public static final java.lang.String toggleNumbersAction
public static final java.lang.String formatListAction
public static final java.lang.String editPrefsAction
public static final java.lang.String insertImageAction
public static final java.lang.String formatImageAction
public static final java.lang.String formatParaAction
public static final java.lang.String editNamedStyleAction
public static final java.lang.String paraAlignLeftAction
public static final java.lang.String paraAlignCenterAction
public static final java.lang.String paraAlignRightAction
public static final java.lang.String insertLinkAction
public static final java.lang.String editLinkAction
public static final java.lang.String openLinkAction
public static final java.lang.String setTagAction
public static final java.lang.String editAnchorsAction
public static final java.lang.String saveAllAction
public static final java.lang.String documentTitleAction
public static final java.lang.String setDefaultStyleRefAction
public static final java.lang.String findReplaceAction
public static final java.lang.String setStyleAction
public static final java.lang.String formatAsCodeAction
public static final java.lang.String printAction
public static TextResources getResources()
public static void setTextResources(TextResources textResources)
public static SHTMLPanelImpl getOwnerSHTMLPanel(java.awt.Component c)
protected boolean processKeyBinding(javax.swing.KeyStroke ks, java.awt.event.KeyEvent e, int condition, boolean pressed)
processKeyBinding
in class javax.swing.JComponent
public javax.swing.JMenuItem newActionMenuItem(java.lang.String actionName)
SHTMLPanel
newActionMenuItem
in class SHTMLPanel
public javax.swing.Action getAction(java.lang.String actionName)
getAction
in class SHTMLPanel
public java.lang.String getDocumentText()
getDocumentText
in class SHTMLPanel
public boolean needsSaving()
needsSaving
in class SHTMLPanel
public void setCurrentDocumentContent(java.lang.String sText)
setCurrentDocumentContent
in class SHTMLPanel
public void setContentPanePreferredSize(java.awt.Dimension prefSize)
setContentPanePreferredSize
in class SHTMLPanel
public javax.swing.text.html.HTMLDocument getDocument()
getDocument
in class SHTMLPanel
public void adjustDividers()
public void clearDockPanels()
public void refreshPluginDisplay(SHTMLPlugin pi)
pi
- the plug-in to refreshprotected void initDocumentPane()
protected void initActions()
commands
right away.public static void setActionBuilder(ActionBuilder ab)
public void addAction(java.lang.String text, javax.swing.Action action)
addAction
in class SHTMLPanel
public void updateActions()
protected void customizeFrame()
protected void createToolbarItem(javax.swing.JToolBar toolBar, java.lang.String itemKey)
protected void registerDocument()
protected void unregisterDocument()
public boolean isHtmlEditorActive()
public static void getActionProperties(javax.swing.Action action, java.lang.String cmd)
action
- the action to apply properties tocmd
- the name of the action to get properties forpublic void caretUpdate(javax.swing.event.CaretEvent e)
caretUpdate
in interface javax.swing.event.CaretListener
public javax.swing.text.AttributeSet getMaxAttributes(int caretPosition)
public com.lightdev.app.shtm.DocumentPane getDocumentPane()
protected void setEditorPane(SHTMLEditorPane editorPane)
public SHTMLEditorPane getSHTMLEditorPane()
public javax.swing.JEditorPane getEditorPane()
getEditorPane
in class SHTMLPanel
public javax.swing.JEditorPane getSourceEditorPane()
getSourceEditorPane
in class SHTMLPanel
public javax.swing.JEditorPane getMostRecentFocusOwner()
getMostRecentFocusOwner
in class SHTMLPanel
public int getCaretPosition()
getCaretPosition
in class SHTMLPanel
public javax.swing.JMenuBar getMenuBar()
getMenuBar
in class SHTMLPanel
public void switchViews()
SHTMLPanel
switchViews
in class SHTMLPanel
public void setOpenHyperlinkHandler(java.awt.event.ActionListener openHyperlinkHandler)
SHTMLPanel
setOpenHyperlinkHandler
in class SHTMLPanel
public void openHyperlink(java.lang.String linkURL)