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.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected SHTMLDocumentcurrently active SHTMLDocumentstatic final Stringcom.lightdev.app.shtm.DynamicResourcesingle instance of a dynamic resource for use by allstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringaction names these have to correspond with the keys in the resource bundle to allow for dynamic menu creation and controlstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringfinal Stringhelp menu IDstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected ActionListenerstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic com.lightdev.app.shtm.PluginManagerthe plug-in manager of SimplyHTMLfinal Stringplugin menu IDstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidadjust the divider sizes of SimplyHTML's SplitPanel according to visibilityvoidcaret listener implementation to track format changesvoidstatic voidconfigureActionProperties(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 voidcreateToolbarItem(JToolBar toolBar, String itemKey) protected voidcustomize the frame to our needsintcom.lightdev.app.shtm.DocumentPaneConvenience method for obtaining the document textgetMaxAttributes(int caretPosition) static SHTMLPanelImplstatic UIResourcesprotected voidinstantiate Actions and put them into the commands Hashtable for later use along with their action commands.protected voidbooleanbooleanbooleanindicates whether or not the document needs to be saved.voidopenHyperlink(String linkURL) protected booleanprocessKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) voidrefresh the display for a given plug-inprotected voidregister FrmMain as an object which has interest in events from a given document panestatic voidvoidsetContentPanePreferredSize(Dimension prefSize) voidsetCurrentDocumentContent(String sText) Convenience method for setting the document textprotected voidsetEditorPane(SHTMLEditorPane editorPane) static voidvoidsetOpenHyperlinkHandler(ActionListener openHyperlinkHandler) Sets the handler for the Open Hyperlink action.static voidsetUiResources(UIResources uiResources) voidSwitches between the rich text view and the source view, given tabbed panes are not used.protected voidremove FrmMain as a registered object from a given document pane and its components remove all plug-ins owned by this FrmMain from SimplyHTML objects toovoidupdate all actionsMethods inherited from class com.lightdev.app.shtm.SHTMLPanel
createSHTMLPanel, getResources, setResources, shtmlPrefChangedMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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:
processKeyBindingin classJComponent
-
createActionMenuItem
Description copied from class:SHTMLPanelReturns 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:
createActionMenuItemin classSHTMLPanel
-
getAction
- Specified by:
getActionin classSHTMLPanel
-
getDocumentText
Convenience method for obtaining the document text- Specified by:
getDocumentTextin classSHTMLPanel- Returns:
- returns the document text as string.
-
needsSaving
public boolean needsSaving()indicates whether or not the document needs to be saved.- Specified by:
needsSavingin classSHTMLPanel- Returns:
- true, if changes need to be saved
-
setCurrentDocumentContent
Convenience method for setting the document text- Specified by:
setCurrentDocumentContentin classSHTMLPanel
-
setContentPanePreferredSize
- Specified by:
setContentPanePreferredSizein classSHTMLPanel
-
getDocument
- Specified by:
getDocumentin 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 incommandsright away. -
setActionBuilder
-
addAction
- Specified by:
addActionin 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:
caretUpdatein interfaceCaretListener
-
getMaxAttributes
-
getDocumentPane
public com.lightdev.app.shtm.DocumentPane getDocumentPane()- Returns:
- Returns the documentPane.
-
setEditorPane
-
getSHTMLEditorPane
- Returns:
- Returns the editorPane.
-
getEditorPane
- Specified by:
getEditorPanein classSHTMLPanel
-
getSourceEditorPane
- Specified by:
getSourceEditorPanein classSHTMLPanel
-
getMostRecentFocusOwner
- Specified by:
getMostRecentFocusOwnerin classSHTMLPanel
-
getCaretPosition
public int getCaretPosition()- Specified by:
getCaretPositionin classSHTMLPanel
-
getMenuBar
- Specified by:
getMenuBarin classSHTMLPanel
-
switchViews
public void switchViews()Description copied from class:SHTMLPanelSwitches 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:
switchViewsin classSHTMLPanel
-
setOpenHyperlinkHandler
Description copied from class:SHTMLPanelSets 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:
setOpenHyperlinkHandlerin classSHTMLPanel
-
openHyperlink
-