public class CloneableEditor extends CloneableTopComponent implements CloneableEditorSupport.Pane
CloneableTopComponent.Ref
TopComponent.Cloneable, TopComponent.Description, TopComponent.NodeName, TopComponent.OpenActionRegistration, TopComponent.Registration, TopComponent.Registry, TopComponent.SubComponent
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected JEditorPane |
pane
editor pane
|
EMPTY
CLOSE_EACH, CLOSE_LAST, PERSISTENCE_ALWAYS, PERSISTENCE_NEVER, PERSISTENCE_ONLY_OPENED, PROP_CLOSING_DISABLED, PROP_DND_COPY_DISABLED, PROP_DRAGGING_DISABLED, PROP_KEEP_PREFERRED_SIZE_WHEN_SLIDED_IN, PROP_MAXIMIZATION_DISABLED, PROP_SLIDING_DISABLED, PROP_UNDOCKING_DISABLED
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
CloneableEditor()
For externalization of subclasses only
|
CloneableEditor(CloneableEditorSupport support)
Creates new editor component associated with
support object.
|
CloneableEditor(CloneableEditorSupport support,
boolean associateLookup)
Creates new editor component associated with
support object (possibly also with its
lookup . |
Modifier and Type | Method and Description |
---|---|
boolean |
canClose()
Indicates whether this component can be closed.
|
protected CloneableEditorSupport |
cloneableEditorSupport()
Gives access to
CloneableEditorSupport object under
this CloneableEditor component. |
protected boolean |
closeLast()
When closing last view, also close the document.
|
protected boolean |
closeLast(boolean ask)
Utility method to close the document.
|
protected void |
componentActivated()
Overrides superclass method.
|
protected void |
componentClosed()
Descendants overriding this method must either call
this implementation or fire the
EditorCookie.Observable.PROP_OPENED_PANES
property change on their own. |
protected void |
componentOpened()
Descendants overriding this method must either call
this implementation or fire the
EditorCookie.Observable.PROP_OPENED_PANES
property change on their own. |
protected void |
componentShowing()
Overrides superclass method.
|
protected CloneableTopComponent |
createClonedObject() |
void |
ensureVisible()
callback for the Pane implementation to adjust itself to the openAt() request.
|
Action[] |
getActions() |
CloneableTopComponent |
getComponent()
Get the TopComponent that contains the EditorPane
|
JEditorPane |
getEditorPane()
Returns editor pane.
|
HelpCtx |
getHelpCtx()
Get context help for this editor pane.
|
int |
getPersistenceType()
Overriden to explicitely set persistence type of CloneableEditor
to PERSISTENCE_ONLY_OPENED
|
Dimension |
getPreferredSize() |
UndoRedo |
getUndoRedo()
The undo/redo manager of the support.
|
protected void |
initializeBySupport()
Asks the associated
CloneableEditorSupport to initialize
this editor via its CloneableEditorSupport.initializeCloneableEditor(org.openide.text.CloneableEditor)
method. |
void |
open() |
protected String |
preferredID() |
void |
readExternal(ObjectInput in) |
protected Object |
readResolve()
Resolves deserialized object.
|
boolean |
requestDefaultFocus()
Deprecated.
|
void |
requestFocus()
Deprecated.
|
boolean |
requestFocusInWindow()
Deprecated.
|
void |
updateName()
Updates the name and tooltip of this
CloneableEditor
TopCompoenent
according to the support retrieved from CloneableEditor.cloneableEditorSupport()
method. |
void |
writeExternal(ObjectOutput out) |
protected Object |
writeReplace()
Replaces serializing object.
|
canClose, clone, cloneComponent, cloneTopComponent, getReference, setReference
addNotify, associateLookup, availableModes, cancelRequestAttention, close, close, closeNotify, componentDeactivated, componentHidden, getAccessibleContext, getActivatedNodes, getCloseOperation, getDisplayName, getHtmlDisplayName, getIcon, getLookup, getRegistry, getShortName, getSubComponents, getSystemActions, getTabPosition, isOpened, isOpened, makeBusy, open, openAction, openAtTabPosition, openNotify, processKeyBinding, requestActive, requestAttention, requestVisible, setActivatedNodes, setAttentionHighlight, setCloseOperation, setDisplayName, setHtmlDisplayName, setIcon, setName, setToolTipText, toFront
addAncestorListener, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestFocus, 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, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
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, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected JEditorPane pane
public CloneableEditor()
public CloneableEditor(CloneableEditorSupport support)
support
- support that holds the document and operations above itpublic CloneableEditor(CloneableEditorSupport support, boolean associateLookup)
lookup
.support
- support that holds the document and operations above itassociateLookup
- true, if TopComponent.getLookup()
should return the lookup
associated with CloneableEditorSupport
.protected CloneableEditorSupport cloneableEditorSupport()
CloneableEditorSupport
object under
this CloneableEditor
component.CloneableEditorSupport
object
that holds the document or null
, what means
this component is not in valid state yet and can be discardedpublic int getPersistenceType()
getPersistenceType
in class TopComponent
public HelpCtx getHelpCtx()
HelpCtx.findHelp(java.awt.Component)
,
then that it used, else general help on the editor is provided.getHelpCtx
in interface HelpCtx.Provider
getHelpCtx
in class TopComponent
public boolean canClose()
canClose
in class CloneableTopComponent
protected void componentShowing()
CloneableEditor
.componentShowing
in class TopComponent
protected final void initializeBySupport()
CloneableEditorSupport
to initialize
this editor via its CloneableEditorSupport.initializeCloneableEditor(org.openide.text.CloneableEditor)
method. By default called from the support on various occasions including
shortly after creation and
after the CloneableEditor
has been deserialized.protected CloneableTopComponent createClonedObject()
createClonedObject
in class CloneableTopComponent
protected void componentOpened()
EditorCookie.Observable.PROP_OPENED_PANES
property change on their own.componentOpened
in class CloneableTopComponent
protected void componentClosed()
EditorCookie.Observable.PROP_OPENED_PANES
property change on their own.componentClosed
in class CloneableTopComponent
protected boolean closeLast()
closeLast(true)
.closeLast
in class CloneableTopComponent
true
if close succeededprotected final boolean closeLast(boolean ask)
ask
- verify and ask the user whether a document can be closed or not?public UndoRedo getUndoRedo()
getUndoRedo
in class TopComponent
public Action[] getActions()
getActions
in class TopComponent
@Deprecated public void requestFocus()
requestFocus
in class TopComponent
@Deprecated public boolean requestFocusInWindow()
requestFocusInWindow
in class TopComponent
@Deprecated public boolean requestDefaultFocus()
requestDefaultFocus
in class JComponent
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void open()
open
in class TopComponent
protected void componentActivated()
CloneableEditorSupport.getRecentPane
and
CloneableEditorSupport.getOpenedPanes
will be broken.componentActivated
in class TopComponent
TopComponent.componentDeactivated()
public void updateName()
CloneableEditor
TopCompoenent
according to the support retrieved from CloneableEditor.cloneableEditorSupport()
method. The name and tooltip are in case of support presence
updated thru its CloneableEditorSupport.messageName()
and
CloneableEditorSupport.messageToolTip()
methods.updateName
in interface CloneableEditorSupport.Pane
CloneableEditor.cloneableEditorSupport()
protected String preferredID()
preferredID
in class TopComponent
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class CloneableTopComponent
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class CloneableTopComponent
IOException
ClassNotFoundException
protected Object writeReplace() throws ObjectStreamException
NotSerializableException
.writeReplace
in class TopComponent
ObjectStreamException
- When problem during serialization occures.NotSerializableException
- When this CloneableEditor
is invalid and doesn't want to be serialized.protected Object readResolve() throws ObjectStreamException
InvalidObjectException
.ObjectStreamException
- When problem during serialization occures.InvalidObjectException
- When deserialized CloneableEditor
is invalid and shouldn't be used.public CloneableTopComponent getComponent()
CloneableEditorSupport.Pane
getComponent
in interface CloneableEditorSupport.Pane
public JEditorPane getEditorPane()
getEditorPane
in interface CloneableEditorSupport.Pane
public void ensureVisible()
ensureVisible
in interface CloneableEditorSupport.Pane