Package com.lightdev.app.shtm
Class SHTMLPanelImpl
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.lightdev.app.shtm.SHTMLPanel
com.lightdev.app.shtm.SHTMLPanelImpl
- All Implemented Interfaces:
SHTMLPrefsChangeListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,CaretListener
Main component of application SimplyHTML.
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected SHTMLDocument
currently active SHTMLDocumentstatic final String
com.lightdev.app.shtm.DynamicResource
single instance of a dynamic resource for use by allstatic final String
static final String
static final String
static final String
static final String
static final String
action names these have to correspond with the keys in the resource bundle to allow for dynamic menu creation and controlstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
final String
help menu IDstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected ActionListener
static final String
static final String
static final String
static final String
static final String
static final String
static com.lightdev.app.shtm.PluginManager
the plug-in manager of SimplyHTMLfinal String
plugin menu IDstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
adjust the divider sizes of SimplyHTML's SplitPanel according to visibilityvoid
caret listener implementation to track format changesvoid
static void
configureActionProperties
(Action action, String cmd) get action properties from the associated resource bundlecreateActionMenuItem
(String actionName) Returns a new menu item for a named action of SimplyHTML.protected void
createToolbarItem
(JToolBar toolBar, String itemKey) protected void
customize the frame to our needsint
com.lightdev.app.shtm.DocumentPane
Convenience method for obtaining the document textgetMaxAttributes
(int caretPosition) static SHTMLPanelImpl
static UIResources
protected void
instantiate Actions and put them into the commands Hashtable for later use along with their action commands.protected void
boolean
boolean
boolean
indicates whether or not the document needs to be saved.void
openHyperlink
(String linkURL) protected boolean
processKeyBinding
(KeyStroke ks, KeyEvent e, int condition, boolean pressed) void
refresh the display for a given plug-inprotected void
register FrmMain as an object which has interest in events from a given document panestatic void
void
setContentPanePreferredSize
(Dimension prefSize) void
setCurrentDocumentContent
(String sText) Convenience method for setting the document textprotected void
setEditorPane
(SHTMLEditorPane editorPane) static void
void
setOpenHyperlinkHandler
(ActionListener openHyperlinkHandler) Sets the handler for the Open Hyperlink action.static void
setUiResources
(UIResources uiResources) void
Switches between the rich text view and the source view, given tabbed panes are not used.protected void
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 toovoid
update all actionsMethods inherited from class com.lightdev.app.shtm.SHTMLPanel
createSHTMLPanel, getResources, setResources, shtmlPrefChanged
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
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
Methods inherited from class java.awt.Container
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
Methods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
APP_TEMP_DIR
- See Also:
-
IMAGE_DIR
- See Also:
-
ACTION_SELECTED_KEY
- See Also:
-
ACTION_SELECTED
- See Also:
-
ACTION_UNSELECTED
- See Also:
-
FILE_LAST_OPEN
- See Also:
-
FILE_LAST_SAVE
- See Also:
-
dynRes
public com.lightdev.app.shtm.DynamicResource dynRessingle instance of a dynamic resource for use by all -
pluginManager
public static com.lightdev.app.shtm.PluginManager pluginManagerthe plug-in manager of SimplyHTML -
openHyperlinkHandler
-
doc
currently active SHTMLDocument -
pluginMenuId
plugin menu ID- See Also:
-
helpMenuId
help menu ID- See Also:
-
exitAction
action names these have to correspond with the keys in the resource bundle to allow for dynamic menu creation and control- See Also:
-
undoAction
- See Also:
-
redoAction
- See Also:
-
cutAction
- See Also:
-
copyAction
- See Also:
-
pasteAction
- See Also:
-
pasteOtherAction
- See Also:
-
selectAllAction
- See Also:
-
clearFormatAction
- See Also:
-
fontAction
- See Also:
-
fontFamilyAction
- See Also:
-
fontSizeAction
- See Also:
-
increaseFontSizeAction
- See Also:
-
decreaseFontSizeAction
- See Also:
-
fontBoldAction
- See Also:
-
fontStrikethroughAction
- See Also:
-
fontItalicAction
- See Also:
-
fontUnderlineAction
- See Also:
-
fontColorAction
- See Also:
-
removeFontColorAction
- See Also:
-
selectedFontColorAction
- See Also:
-
redFontColorAction
- See Also:
-
blueFontColorAction
- See Also:
-
blackFontColorAction
- See Also:
-
greenFontColorAction
- See Also:
-
helpTopicsAction
- See Also:
-
aboutAction
- See Also:
-
gcAction
- See Also:
-
elemTreeAction
- See Also:
-
testAction
- See Also:
-
insertTableAction
- See Also:
-
formatTableAction
- See Also:
-
toggleTableHeaderCellAction
- See Also:
-
insertTableColAction
- See Also:
-
insertTableRowAction
- See Also:
-
insertTableRowHeaderAction
- See Also:
-
appendTableRowAction
- See Also:
-
appendTableColAction
- See Also:
-
deleteTableRowAction
- See Also:
-
deleteTableColAction
- See Also:
-
nextTableCellAction
- See Also:
-
prevTableCellAction
- See Also:
-
moveTableRowUpAction
- See Also:
-
moveTableColumnLeftAction
- See Also:
-
moveTableColumnRightAction
- See Also:
-
moveTableRowDownAction
- See Also:
-
toggleBulletsAction
- See Also:
-
toggleNumbersAction
- See Also:
-
formatListAction
- See Also:
-
editPrefsAction
- See Also:
-
insertImageAction
- See Also:
-
formatImageAction
- See Also:
-
formatParaAction
- See Also:
-
editNamedStyleAction
- See Also:
-
paraAlignLeftAction
- See Also:
-
paraAlignCenterAction
- See Also:
-
paraAlignRightAction
- See Also:
-
insertLinkAction
- See Also:
-
editLinkAction
- See Also:
-
openLinkAction
- See Also:
-
setTagAction
- See Also:
-
editAnchorsAction
- See Also:
-
saveAllAction
- See Also:
-
documentTitleAction
- See Also:
-
setDefaultStyleRefAction
- See Also:
-
findReplaceAction
- See Also:
-
setStyleAction
- See Also:
-
formatAsCodeAction
- See Also:
-
printAction
- See Also:
-
-
Method Details
-
getUiResources
-
setUiResources
-
setInternalUiResources
public static void setInternalUiResources() -
getOwnerSHTMLPanel
-
processKeyBinding
- Overrides:
processKeyBinding
in classJComponent
-
createActionMenuItem
Description copied from class:SHTMLPanel
Returns a new menu item for a named action of SimplyHTML. (Can be used for building custom popup menu, or for invoking the action externally in another way.)- Specified by:
createActionMenuItem
in classSHTMLPanel
-
getAction
- Specified by:
getAction
in classSHTMLPanel
-
getDocumentText
Convenience method for obtaining the document text- Specified by:
getDocumentText
in classSHTMLPanel
- Returns:
- returns the document text as string.
-
needsSaving
public boolean needsSaving()indicates whether or not the document needs to be saved.- Specified by:
needsSaving
in classSHTMLPanel
- Returns:
- true, if changes need to be saved
-
setCurrentDocumentContent
Convenience method for setting the document text- Specified by:
setCurrentDocumentContent
in classSHTMLPanel
-
setContentPanePreferredSize
- Specified by:
setContentPanePreferredSize
in classSHTMLPanel
-
getDocument
- Specified by:
getDocument
in classSHTMLPanel
- Returns:
- returns the currently used ExtendedHTMLDocument Object
-
adjustDividers
public void adjustDividers()adjust the divider sizes of SimplyHTML's SplitPanel according to visibility -
clearDockPanels
public void clearDockPanels() -
refreshPluginDisplay
refresh the display for a given plug-in- Parameters:
pi
- the plug-in to refresh
-
initDocumentPane
protected void initDocumentPane() -
initActions
protected void initActions()instantiate Actions and put them into the commands Hashtable for later use along with their action commands. This is hard coded as Actions need to be instantiated hard coded anyway, so we do the storage incommands
right away. -
setActionBuilder
-
addAction
- Specified by:
addAction
in classSHTMLPanel
-
updateActions
public void updateActions()update all actions -
customizeFrame
protected void customizeFrame()customize the frame to our needs -
createToolbarItem
-
registerDocument
protected void registerDocument()register FrmMain as an object which has interest in events from a given document pane -
unregisterDocument
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 -
isWYSIWYGEditorActive
public boolean isWYSIWYGEditorActive() -
isHtmlEditorActive
public boolean isHtmlEditorActive() -
configureActionProperties
get action properties from the associated resource bundle- Parameters:
action
- the action to apply properties tocmd
- the name of the action to get properties for
-
caretUpdate
caret listener implementation to track format changes- Specified by:
caretUpdate
in interfaceCaretListener
-
getMaxAttributes
-
getDocumentPane
public com.lightdev.app.shtm.DocumentPane getDocumentPane()- Returns:
- Returns the documentPane.
-
setEditorPane
-
getSHTMLEditorPane
- Returns:
- Returns the editorPane.
-
getEditorPane
- Specified by:
getEditorPane
in classSHTMLPanel
-
getSourceEditorPane
- Specified by:
getSourceEditorPane
in classSHTMLPanel
-
getMostRecentFocusOwner
- Specified by:
getMostRecentFocusOwner
in classSHTMLPanel
-
getCaretPosition
public int getCaretPosition()- Specified by:
getCaretPosition
in classSHTMLPanel
-
getMenuBar
- Specified by:
getMenuBar
in classSHTMLPanel
-
switchViews
public void switchViews()Description copied from class:SHTMLPanel
Switches between the rich text view and the source view, given tabbed panes are not used. Has no corresponding action; calling this method is up to the caller application of SimplyHTML.- Specified by:
switchViews
in classSHTMLPanel
-
setOpenHyperlinkHandler
Description copied from class:SHTMLPanel
Sets the handler for the Open Hyperlink action. SimplyHTML itself has no ability to open hyperlinks, so it forwards the action to the caller application.- Specified by:
setOpenHyperlinkHandler
in classSHTMLPanel
-
openHyperlink
-