站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.0

CloneableEditor (NetBeans Text API) - NetBeans API Javadoc 5.5.0

org.openide.text 6.9.22

org.openide.text
Class CloneableEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.openide.windows.TopComponent
                  extended by org.openide.windows.CloneableTopComponent
                      extended by org.openide.text.CloneableEditor
All Implemented Interfaces:
ImageObserver, MenuContainer, Externalizable, Serializable, Accessible, CloneableEditorSupport.Pane, HelpCtx.Provider, Lookup.Provider, org.openide.windows.TopComponent.Cloneable

public class CloneableEditor
extends org.openide.windows.CloneableTopComponent
implements CloneableEditorSupport.Pane

Cloneable top component to hold the editor kit.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openide.windows.CloneableTopComponent
org.openide.windows.CloneableTopComponent.Ref
 
Nested classes/interfaces inherited from class org.openide.windows.TopComponent
org.openide.windows.TopComponent.Cloneable, org.openide.windows.TopComponent.NodeName, org.openide.windows.TopComponent.Registry
 
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JEditorPane pane
          editor pane
 
Fields inherited from class org.openide.windows.CloneableTopComponent
EMPTY
 
Fields inherited from class org.openide.windows.TopComponent
CLOSE_EACH, CLOSE_LAST, PERSISTENCE_ALWAYS, PERSISTENCE_NEVER, PERSISTENCE_ONLY_OPENED
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
CloneableEditor()
          For externalization of subclasses only
CloneableEditor(CloneableEditorSupport support)
          Creates new editor component associated with support object.
 
Method Summary
 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  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  org.openide.windows.CloneableTopComponent createClonedObject()
           
 void ensureVisible()
          callback for the Pane implementation to adjust itself to the openAt() request.
 org.openide.windows.CloneableTopComponent getComponent()
          Get the TopComponent that contains the EditorPane
 JEditorPane getEditorPane()
          get the editor pane component represented by this wrapper.
 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()
           
 SystemAction[] getSystemActions()
           
 UndoRedo getUndoRedo()
          The undo/redo manager of the support.
 void open(org.openide.windows.Workspace workspace)
          Overrides superclass version.
protected  String preferredID()
           
 void readExternal(ObjectInput in)
           
protected  Object readResolve()
          Resolves deserialized object.
 boolean requestDefaultFocus()
           
 void requestFocus()
          Transfer the focus to the editor pane.
 boolean requestFocusInWindow()
          Transfer the focus to the editor pane.
 void updateName()
          Updates the name and tooltip of this CloneableEditor TopCompoenent according to the support retrieved from cloneableEditorSupport() method.
 void writeExternal(ObjectOutput out)
           
protected  Object writeReplace()
          Replaces serializing object.
 
Methods inherited from class org.openide.windows.CloneableTopComponent
canClose, clone, cloneComponent, cloneTopComponent, getReference, setReference
 
Methods inherited from class org.openide.windows.TopComponent
associateLookup, availableModes, cancelRequestAttention, close, close, closeNotify, componentDeactivated, componentHidden, getAccessibleContext, getActions, getActivatedNodes, getCloseOperation, getDisplayName, getHtmlDisplayName, getIcon, getLookup, getRegistry, isOpened, isOpened, open, openNotify, processKeyBinding, requestActive, requestAttention, requestVisible, setActivatedNodes, setCloseOperation, setDisplayName, setHtmlDisplayName, setIcon, setName, setToolTipText, toFront
 
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, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, 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
 
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, transferFocusBackward, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pane

protected JEditorPane pane
editor pane

Constructor Detail

CloneableEditor

public CloneableEditor()
For externalization of subclasses only


CloneableEditor

public CloneableEditor(CloneableEditorSupport support)
Creates new editor component associated with support object.

Parameters:
support - support that holds the document and operations above it
Method Detail

cloneableEditorSupport

protected CloneableEditorSupport cloneableEditorSupport()
Gives access to CloneableEditorSupport object under this CloneableEditor component.

Returns:
the CloneableEditorSupport object that holds the document or null, what means this component is not in valid state yet and can be discarded

getPersistenceType

public int getPersistenceType()
Overriden to explicitely set persistence type of CloneableEditor to PERSISTENCE_ONLY_OPENED

Overrides:
getPersistenceType in class org.openide.windows.TopComponent

getHelpCtx

public HelpCtx getHelpCtx()
Get context help for this editor pane. If the registered editor kit provides a help ID in bean info according to the protocol described for HelpCtx.findHelp(java.awt.Component), then that it used, else general help on the editor is provided.

Specified by:
getHelpCtx in interface HelpCtx.Provider
Overrides:
getHelpCtx in class org.openide.windows.TopComponent
Returns:
context help

canClose

public boolean canClose()
Indicates whether this component can be closed. Adds scheduling of "emptying" editor pane and removing all sub components.

Overrides:
canClose in class org.openide.windows.CloneableTopComponent

componentShowing

protected void componentShowing()
Overrides superclass method. In case it is called first time, initializes this CloneableEditor.

Overrides:
componentShowing in class org.openide.windows.TopComponent

createClonedObject

protected org.openide.windows.CloneableTopComponent createClonedObject()
Overrides:
createClonedObject in class org.openide.windows.CloneableTopComponent

componentOpened

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.

Overrides:
componentOpened in class org.openide.windows.TopComponent

componentClosed

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.

Overrides:
componentClosed in class org.openide.windows.CloneableTopComponent

open

public void open(org.openide.windows.Workspace workspace)
Overrides superclass version. Opens top component only if it is in valid state. (Editor top component may become invalid after deserialization).
Also tries to open all other top components which are docked in editor mode on given workspace, but not visible.

Overrides:
open in class org.openide.windows.TopComponent

closeLast

protected boolean closeLast()
When closing last view, also close the document.

Overrides:
closeLast in class org.openide.windows.CloneableTopComponent
Returns:
true if close succeeded

getUndoRedo

public UndoRedo getUndoRedo()
The undo/redo manager of the support.

Overrides:
getUndoRedo in class org.openide.windows.TopComponent
Returns:
the undo/redo manager shared by all editors for this support

getSystemActions

public SystemAction[] getSystemActions()
Overrides:
getSystemActions in class org.openide.windows.TopComponent

requestFocus

public void requestFocus()
Transfer the focus to the editor pane.

Overrides:
requestFocus in class org.openide.windows.TopComponent

requestFocusInWindow

public boolean requestFocusInWindow()
Transfer the focus to the editor pane.

Overrides:
requestFocusInWindow in class org.openide.windows.TopComponent

requestDefaultFocus

public boolean requestDefaultFocus()
Overrides:
requestDefaultFocus in class JComponent

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent
Returns:
Preferred size of editor top component

componentActivated

protected void componentActivated()
Overrides superclass method. Remembers last selected component of support belonging to this component.

Overrides:
componentActivated in class org.openide.windows.TopComponent
See Also:
TopComponent.componentDeactivated()

updateName

public void updateName()
Updates the name and tooltip of this CloneableEditor TopCompoenent according to the support retrieved from cloneableEditorSupport() method. The name and tooltip are in case of support presence updated thru its CloneableEditorSupport.messageName() and CloneableEditorSupport.messageToolTip() methods.

Specified by:
updateName in interface CloneableEditorSupport.Pane
See Also:
cloneableEditorSupport()

preferredID

protected String preferredID()
Overrides:
preferredID in class org.openide.windows.TopComponent

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class org.openide.windows.CloneableTopComponent
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class org.openide.windows.CloneableTopComponent
Throws:
IOException
ClassNotFoundException

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Replaces serializing object. Overrides superclass method. Adds checking for object validity. In case this object is invalid throws NotSerializableException.

Overrides:
writeReplace in class org.openide.windows.TopComponent
Throws:
ObjectStreamException - When problem during serialization occures.
NotSerializableException - When this CloneableEditor is invalid and doesn't want to be serialized.

readResolve

protected Object readResolve()
                      throws ObjectStreamException
Resolves deserialized object. Overrides superclass method. Adds checking for object validity. In case this object is invalid throws InvalidObjectException.

Throws:
ObjecStreamException - When problem during serialization occures.
InvalidObjectException - When deserialized CloneableEditor is invalid and shouldn't be used.
ObjectStreamException

getComponent

public org.openide.windows.CloneableTopComponent getComponent()
Description copied from interface: CloneableEditorSupport.Pane
Get the TopComponent that contains the EditorPane

Specified by:
getComponent in interface CloneableEditorSupport.Pane

getEditorPane

public JEditorPane getEditorPane()
Description copied from interface: CloneableEditorSupport.Pane
get the editor pane component represented by this wrapper.

Specified by:
getEditorPane in interface CloneableEditorSupport.Pane

ensureVisible

public void ensureVisible()
callback for the Pane implementation to adjust itself to the openAt() request.

Specified by:
ensureVisible in interface CloneableEditorSupport.Pane

org.openide.text 6.9.22

Built on May 28 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.