declare namespace javax {
namespace swing {
namespace tree {
/**
* A TreeCellEditor
. You need to supply an
* instance of DefaultTreeCellRenderer
* so that the icons can be obtained. You can optionally supply
* a TreeCellEditor
that will be layed out according
* to the icon in the DefaultTreeCellRenderer
.
* If you do not supply a TreeCellEditor
,
* a TextField
will be used. Editing is started
* on a triple mouse click, or after a click, pause, click and
* a delay of 1200 milliseconds.
*
* Warning:
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
* has been added to the java.beans
package.
* Please see {@link java.beans.XMLEncoder}.
* @see javax.swing.JTree
* @author Scott Violet
*/
// @ts-ignore
class DefaultTreeCellEditor extends java.lang.Object implements java.awt.event.ActionListener, javax.swing.tree.TreeCellEditor, javax.swing.event.TreeSelectionListener {
/**
* Constructs a DefaultTreeCellEditor
* object for a JTree using the specified renderer and
* a default editor. (Use this constructor for normal editing.)
* @param tree a JTree
object
* @param renderer a DefaultTreeCellRenderer
object
*/
// @ts-ignore
constructor(tree: javax.swing.JTree, renderer: javax.swing.tree.DefaultTreeCellRenderer)
/**
* Constructs a DefaultTreeCellEditor
* object for a JTree
using the
* specified renderer and the specified editor. (Use this constructor
* for specialized editing.)
* @param tree a JTree
object
* @param renderer a DefaultTreeCellRenderer
object
* @param editor a TreeCellEditor
object
*/
// @ts-ignore
constructor(tree: javax.swing.JTree, renderer: javax.swing.tree.DefaultTreeCellRenderer, editor: javax.swing.tree.TreeCellEditor)
/**
* Editor handling the editing.
*/
// @ts-ignore
realEditor: javax.swing.tree.TreeCellEditor
/**
* Renderer, used to get border and offsets from.
*/
// @ts-ignore
renderer: javax.swing.tree.DefaultTreeCellRenderer
/**
* Editing container, will contain the editorComponent
.
*/
// @ts-ignore
editingContainer: java.awt.Container
/**
* Component used in editing, obtained from the
* editingContainer
.
*/
// @ts-ignore
editingComponent: java.awt.Component
/**
* As of Java 2 platform v1.4 this field should no longer be used. If
* you wish to provide similar behavior you should directly override
* isCellEditable
.
*/
// @ts-ignore
canEdit: boolean
/**
* Used in editing. Indicates x position to place
* editingComponent
.
*/
// @ts-ignore
offset: number /*int*/
/**
* JTree
instance listening too.
*/
// @ts-ignore
tree: javax.swing.JTree
/**
* Last path that was selected.
*/
// @ts-ignore
lastPath: javax.swing.tree.TreePath
/**
* Used before starting the editing session.
*/
// @ts-ignore
timer: javax.swing.Timer
/**
* Row that was last passed into
* getTreeCellEditorComponent
.
*/
// @ts-ignore
lastRow: number /*int*/
/**
* True if the border selection color should be drawn.
*/
// @ts-ignore
borderSelectionColor: java.awt.Color
/**
* Icon to use when editing.
*/
// @ts-ignore
editingIcon: javax.swing.Icon
/**
* Font to paint with, null
indicates
* font of renderer is to be used.
*/
// @ts-ignore
font: java.awt.Font
/**
* Sets the color to use for the border.
* @param newColor the new border color
*/
// @ts-ignore
public setBorderSelectionColor(newColor: java.awt.Color): void
/**
* Returns the color the border is drawn.
* @return the border selection color
*/
// @ts-ignore
public getBorderSelectionColor(): java.awt.Color
/**
* Sets the font to edit with. null
indicates
* the renderers font should be used. This will NOT
* override any font you have set in the editor
* the receiver was instantiated with. If null
* for an editor was passed in a default editor will be
* created that will pick up this font.
* @param font the editing Font
* @see #getFont
*/
// @ts-ignore
public setFont(font: java.awt.Font): void
/**
* Gets the font used for editing.
* @return the editing Font
* @see #setFont
*/
// @ts-ignore
public getFont(): java.awt.Font
/**
* Configures the editor. Passed onto the realEditor
.
*/
// @ts-ignore
public getTreeCellEditorComponent(tree: javax.swing.JTree, value: java.lang.Object | any, isSelected: boolean, expanded: boolean, leaf: boolean, row: number /*int*/): java.awt.Component
/**
* Returns the value currently being edited.
* @return the value currently being edited
*/
// @ts-ignore
public getCellEditorValue(): any
/**
* If the realEditor
returns true to this
* message, prepareForEditing
* is messaged and true is returned.
*/
// @ts-ignore
public isCellEditable(event: java.util.EventObject): boolean
/**
* Messages the realEditor
for the return value.
*/
// @ts-ignore
public shouldSelectCell(event: java.util.EventObject): boolean
/**
* If the realEditor
will allow editing to stop,
* the realEditor
is removed and true is returned,
* otherwise false is returned.
*/
// @ts-ignore
public stopCellEditing(): boolean
/**
* Messages cancelCellEditing
to the
* realEditor
and removes it from this instance.
*/
// @ts-ignore
public cancelCellEditing(): void
/**
* Adds the CellEditorListener
.
* @param l the listener to be added
*/
// @ts-ignore
public addCellEditorListener(l: javax.swing.event.CellEditorListener): void
/**
* Removes the previously added CellEditorListener
.
* @param l the listener to be removed
*/
// @ts-ignore
public removeCellEditorListener(l: javax.swing.event.CellEditorListener): void
/**
* Returns an array of all the CellEditorListener
s added
* to this DefaultTreeCellEditor with addCellEditorListener().
* @return all of the CellEditorListener
s added or an empty
* array if no listeners have been added
* @since 1.4
*/
// @ts-ignore
public getCellEditorListeners(): javax.swing.event.CellEditorListener[]
/**
* Resets lastPath
.
*/
// @ts-ignore
public valueChanged(e: javax.swing.event.TreeSelectionEvent): void
/**
* Messaged when the timer fires, this will start the editing
* session.
*/
// @ts-ignore
public actionPerformed(e: java.awt.event.ActionEvent): void
/**
* Sets the tree currently editing for. This is needed to add
* a selection listener.
* @param newTree the new tree to be edited
*/
// @ts-ignore
setTree(newTree: javax.swing.JTree): void
/**
* Returns true if event
is a MouseEvent
* and the click count is 1.
* @param event the event being studied
*/
// @ts-ignore
shouldStartEditingTimer(event: java.util.EventObject): boolean
/**
* Starts the editing timer.
*/
// @ts-ignore
startEditingTimer(): void
/**
* Returns true if event
is null
,
* or it is a MouseEvent
with a click count > 2
* and inHitRegion
returns true.
* @param event the event being studied
*/
// @ts-ignore
canEditImmediately(event: java.util.EventObject): boolean
/**
* Returns true if the passed in location is a valid mouse location
* to start editing from. This is implemented to return false if
* x
is <= the width of the icon and icon gap displayed
* by the renderer. In other words this returns true if the user
* clicks over the text part displayed by the renderer, and false
* otherwise.
* @param x the x-coordinate of the point
* @param y the y-coordinate of the point
* @return true if the passed in location is a valid mouse location
*/
// @ts-ignore
inHitRegion(x: number /*int*/, y: number /*int*/): boolean
// @ts-ignore
determineOffset(tree: javax.swing.JTree, value: java.lang.Object | any, isSelected: boolean, expanded: boolean, leaf: boolean, row: number /*int*/): void
/**
* Invoked just before editing is to start. Will add the
* editingComponent
to the
* editingContainer
.
*/
// @ts-ignore
prepareForEditing(): void
/**
* Creates the container to manage placement of
* editingComponent
.
*/
// @ts-ignore
createContainer(): java.awt.Container
/**
* This is invoked if a TreeCellEditor
* is not supplied in the constructor.
* It returns a TextField
editor.
* @return a new TextField
editor
*/
// @ts-ignore
createTreeCellEditor(): javax.swing.tree.TreeCellEditor
}
}
}
}