# Class SHTMLPanel

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.lightdev.app.shtm.SHTMLPanel

All Implemented Interfaces:
  `SHTMLPrefsChangeListener, ImageObserver, MenuContainer, Serializable, Accessible`

Direct Known Subclasses:
  `SHTMLPanelImpl`

public abstract class SHTMLPanel extends JPanel implements SHTMLPrefsChangeListener
Class for using SimplyHTML as as component

See Also:
  - Serialized Form

## Nested Class Summary

### Nested classes/interfaces inherited from class JPanel

`JPanel.AccessibleJPanel`

### Nested classes/interfaces inherited from class JComponent

`JComponent.AccessibleJComponent`

### Nested classes/interfaces inherited from class Container

`Container.AccessibleAWTContainer`

### Nested classes/interfaces inherited from class Component

`Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Color`
`DARK_BLUE`
`static final Color`
`DARK_GREEN`
`static final Color`
`DARK_RED`
`static final Color`
`LIGHT_BLUE`
`static final Color`
`LIGHT_GREEN`
`static final Color`
`LIGHT_RED`

### Fields inherited from class JComponent

`listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW`

### Fields inherited from class Component

`accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT`

### Fields inherited from interface ImageObserver

`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`addAction(String text, Action action)`
`abstract JMenuItem`
`createActionMenuItem(String actionName)`
Returns a new menu item for a named action of SimplyHTML.
`static SHTMLPanel`
`createSHTMLPanel()`
`abstract Action`
`getAction(String actionName)`
`abstract int`
`getCaretPosition()`
`abstract HTMLDocument`
`getDocument()`
`abstract String`
`getDocumentText()`
`abstract JEditorPane`
`getEditorPane()`
`abstract JMenuBar`
`getMenuBar()`
`abstract JEditorPane`
`getMostRecentFocusOwner()`
`static UIResources`
`getResources()`
`abstract JEditorPane`
`getSourceEditorPane()`
`abstract boolean`
`needsSaving()`
`static void`
`setActionBuilder(ActionBuilder ab)`
`abstract void`
`setContentPanePreferredSize(Dimension dimension)`
`abstract void`
`setCurrentDocumentContent(String sText)`
`abstract void`
`setOpenHyperlinkHandler(ActionListener openHyperlinkHandler)`
Sets the handler for the Open Hyperlink action.
`static void`
`setResources(UIResources resources)`
`void`
`shtmlPrefChanged(String propertyName, String newValue, String oldValue)`
`abstract void`
`switchViews()`
Switches between the rich text view and the source view, given tabbed panes are not used.

### Methods inherited from class JPanel

`getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI`

### Methods inherited from class 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, 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`

### Methods inherited from class 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 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`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### LIGHT_BLUE

public static final Color LIGHT_BLUE

### DARK_BLUE

public static final Color DARK_BLUE

### LIGHT_GREEN

public static final Color LIGHT_GREEN

### DARK_GREEN

public static final Color DARK_GREEN

### LIGHT_RED

public static final Color LIGHT_RED

### DARK_RED

public static final Color DARK_RED

## Method Details

### shtmlPrefChanged

public void shtmlPrefChanged(String propertyName, String newValue, String oldValue)

Specified by:
  `shtmlPrefChanged` in interface `SHTMLPrefsChangeListener`

### createSHTMLPanel

public static SHTMLPanel createSHTMLPanel()

### getDocumentText

public abstract String getDocumentText()

### needsSaving

public abstract boolean needsSaving()

### setContentPanePreferredSize

public abstract void setContentPanePreferredSize(Dimension dimension)

### setCurrentDocumentContent

public abstract void setCurrentDocumentContent(String sText)

### setResources

public static void setResources(UIResources resources)

### setActionBuilder

public static void setActionBuilder(ActionBuilder ab)

### getDocument

public abstract HTMLDocument getDocument()

### getEditorPane

public abstract JEditorPane getEditorPane()

### getSourceEditorPane

public abstract JEditorPane getSourceEditorPane()

### getResources

public static UIResources getResources()

### getCaretPosition

public abstract int getCaretPosition()

### getMenuBar

public abstract JMenuBar getMenuBar()

### getMostRecentFocusOwner

public abstract JEditorPane getMostRecentFocusOwner()

### getAction

public abstract Action getAction(String actionName)

### addAction

public abstract void addAction(String text, Action action)

### createActionMenuItem

public abstract JMenuItem createActionMenuItem(String actionName)
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.)

### switchViews

public abstract void switchViews()
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.

### setOpenHyperlinkHandler

public abstract void setOpenHyperlinkHandler(ActionListener openHyperlinkHandler)
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.