|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inet.editor.BaseEditor
public class BaseEditor
A simple editor component with some base features.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
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 |
Constructor Summary | |
---|---|
BaseEditor(boolean hasScrollpane)
Complete construction of an editor, which is editable and has a toolbar. |
|
BaseEditor(boolean hasScrollpane,
boolean editable,
boolean hasToolbar,
boolean isHtml)
Complete construction of an editor. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ev)
Handelt die Events der Toolbar. |
void |
addActionListener(java.awt.event.ActionListener listener)
Adds an action listener to this editor |
void |
allowImagePaste(boolean allowImagePaste)
Enables or disables the image-paste function of the editor. |
void |
caretUpdate(javax.swing.event.CaretEvent ev)
Aktualisiert die Toolbar nachdem der Textcursor (Caret) im pane bewegt wurde. |
int |
getCurrentLoadID()
Returns the load-ID of the currently displayed document. |
java.awt.Font |
getDefaultFont()
Returns the default font, if any. |
java.util.Dictionary<java.lang.Object,java.lang.Object> |
getDocumentProperties()
Returns the persistant document properties table. |
javax.swing.JTextPane |
getEditor()
Liefert das innere Textsteuerelement. |
com.inet.html.utils.EmbeddedImage[] |
getEmbeddedImages()
Returns a list with the reference to all images used in this document or null, if the document isn't an InetHtmlDocument . |
java.awt.Dimension |
getMinimumSize()
|
java.awt.Dimension |
getPreferredSize()
|
java.lang.String |
getText()
Liefert den aktuellen Text des Document in HTML oder Plaintext |
javax.swing.JToolBar |
getToolbar()
Accessor Methode für UI |
javax.swing.undo.UndoManager |
getUndoManager()
FIXME TEST ONLY |
void |
insertFrom(BaseEditor editor)
Fügt Text vom übergebenen Editor ein. |
void |
insertHtml(java.lang.String htmlText)
Inserts a HTML content into the current document. |
boolean |
isChanged()
If the text was changed since the last setText() |
boolean |
isEditable()
Ist der Editor aktuell im Bearbeitungsmode. |
boolean |
isHtml()
Liefert getText() einen HTML formatierten oder eine Plain Text |
boolean |
isLoading()
If the text of setText is completly loaded. |
boolean |
isShowLinkURL()
A flag which descides whether a link-tooltip always displayes the target URL. |
void |
requestFocus()
Damit man den Focus ins Textfeld setzen kann |
void |
setBase(java.net.URL base)
Set a default value for getBase() |
void |
setConfiguration(InetHtmlConfiguration htmlConfiguration)
Set the default configuration for HTML documents, opened by this editor. |
void |
setCustomHyperlinkHandler(HyperlinkHandler handler)
Sets the custom handler for the HyperlinkListener of this editor. |
void |
setCustomPasteHandler(PasteFileHandler handler)
Sets the custom PasteFileHandler of the current TransferHandler. |
void |
setDefaultFont(java.awt.Font defaultFont)
Sets the default font for this editor. |
void |
setDefaultFontPX(java.awt.Font defaultFont)
Sets the default font for this editor. |
void |
setDocumentProperties(java.util.Dictionary<java.lang.Object,java.lang.Object> properties)
Sets a persistant document property table. |
void |
setDocumentProperty(java.lang.Object key,
java.lang.Object value)
Adds or sets a persistant document property. |
void |
setEditable(boolean editable)
Setzte den aktuellen Bearbeitungsmode. |
void |
setEnabled(boolean enabled)
|
void |
setFontScale(float scale)
Sets the scale factor |
void |
setPage(java.net.URL page)
Loads the page references by the page URL and thes the base URL. |
void |
setShowLinkURL(boolean showLinkURL)
A switch to descide whether a link-tooltip always displayes the target URL. |
void |
setText(java.lang.String str,
boolean isHtml)
Setzt den Text und das Format des Textes. |
void |
setTextAntiAlias(boolean enabled)
Enables or disables the text anti-alias render hint |
void |
setTextSelectionEnabled(boolean enabled)
Enables or disables the selectability of the content of the editor. |
void |
setTextShowMode()
Show only the text and hide the toolbar |
int |
setTextWithLoadID(java.lang.String str,
boolean isHtml)
Sets the text to display. |
void |
setUnChanged()
Reset the status of changed. |
void |
showDocument(java.net.URL url,
java.lang.String string)
Opens the specified location. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BaseEditor(boolean hasScrollpane)
hasScrollpane
- true, if the editor is supposed to have a scroll panepublic BaseEditor(boolean hasScrollpane, boolean editable, boolean hasToolbar, boolean isHtml)
hasScrollpane
- true, if the editor is supposed to have a scroll paneeditable
- if true, the editor is editable by defaulthasToolbar
- if true, the editor will have a toolbarisHtml
- set to true, if the content will be HTML by defaultMethod Detail |
---|
public void requestFocus()
requestFocus
in class javax.swing.JComponent
public void showDocument(java.net.URL url, java.lang.String string)
url
- The page to loadstring
- The target for the page, e.g. _blankpublic void setBase(java.net.URL base)
base
- the new base value.public void setText(java.lang.String str, boolean isHtml)
str
- der text, darf nicht null seinisHtml
- ob in HTML formatiertpublic int setTextWithLoadID(java.lang.String str, boolean isHtml)
getCurrentLoadID
will have the same value. Note, that this may never happen, if this method is called
several times in a row.
str
- The content to displayisHtml
- has to be true, if the content is in HTML format
public int getCurrentLoadID()
public java.lang.String getText()
public boolean isHtml()
public boolean isChanged()
setUnChanged()
public boolean isLoading()
public void setUnChanged()
public boolean isEditable()
public void setTextShowMode()
public void setEditable(boolean editable)
editable
- wahr = editierbarpublic void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
public javax.swing.JTextPane getEditor()
public javax.swing.JToolBar getToolbar()
public void caretUpdate(javax.swing.event.CaretEvent ev)
caretUpdate
in interface javax.swing.event.CaretListener
ev
- das zu behandelnde Eventpublic void actionPerformed(java.awt.event.ActionEvent ev)
actionPerformed
in interface java.awt.event.ActionListener
ev
- das zu behandelnde Eventpublic void insertHtml(java.lang.String htmlText)
htmlText
- the HTML content to insertpublic void insertFrom(BaseEditor editor)
editor
- the editor to get the content frompublic void addActionListener(java.awt.event.ActionListener listener)
listener
- the listener to add, must not be nullpublic com.inet.html.utils.EmbeddedImage[] getEmbeddedImages()
InetHtmlDocument
.
null
public void allowImagePaste(boolean allowImagePaste)
allowImagePaste
- true, to enablepublic javax.swing.undo.UndoManager getUndoManager()
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public void setConfiguration(InetHtmlConfiguration htmlConfiguration)
htmlConfiguration
- the configuration to setpublic void setDefaultFont(java.awt.Font defaultFont)
defaultFont
- the default font and font-sizepublic void setDefaultFontPX(java.awt.Font defaultFont)
defaultFont
- the default font and font-sizepublic void setFontScale(float scale)
scale
- a value between 0.1 and 10public java.awt.Font getDefaultFont()
null
if none is set.public void setPage(java.net.URL page)
page
URL and thes the base URL. If the page could not be loaded, an
error page is displayed.
page
- The URL to load.public java.util.Dictionary<java.lang.Object,java.lang.Object> getDocumentProperties()
public void setDocumentProperties(java.util.Dictionary<java.lang.Object,java.lang.Object> properties)
properties
- the properties table to usepublic void setDocumentProperty(java.lang.Object key, java.lang.Object value)
key
- the key of the property, must not be nullvalue
- the value to setpublic void setShowLinkURL(boolean showLinkURL)
showLinkURL
- true, to force the link to be displayedpublic boolean isShowLinkURL()
public void setCustomHyperlinkHandler(HyperlinkHandler handler)
HyperlinkListener
of this editor. The handler will be
the fist code to be executed when this listener receives an event. It may interrupt the default
behavior of this listener.
handler
- the instance custom handler, may be null to resetpublic void setCustomPasteHandler(PasteFileHandler handler)
handler
- the custom handler to usepublic void setTextAntiAlias(boolean enabled)
enabled
- true to enable text anti-aliaspublic void setTextSelectionEnabled(boolean enabled)
enabled
- true to enable, false to disable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |