Class mxCellEditor
java.lang.Object
com.mxgraph.swing.view.mxCellEditor
- All Implemented Interfaces:
mxICellEditor
To control this editor, use mxGraph.invokesStopCellEditing, mxGraph.
enterStopsCellEditing and mxGraph.escapeEnabled.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractActionstatic intstatic intstatic doubleprotected Objectprotected JEditorPaneHolds the editor for HTML editing.protected booleanSpecifies if the text content of the HTML body should be extracted before and after editing for HTML markup.protected mxGraphComponentprotected doubleDefines the minimum scale to be used for the editor.protected intprotected intprotected booleanSpecifies if linefeeds should be replaced with BREAKS before editing, and BREAKS should be replaced with linefeeds after editing.protected JScrollPaneprotected booleanSpecifies if shift ENTER should submit text if enterStopsCellEditing is true.protected JTextAreaHolds the editor for plain text editing.protected AbstractActionprotected EventObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidInstalls the keyListener in the textArea and editorPane for handling the enter keystroke and updating the modified state.Returns the current editing value.Returns the cell that is currently being edited.Returns the current editor or null if no editing is in progress.getEditorBounds(mxCellState state, double scale) Returns the bounds to be used for the editor.protected StringgetInitialValue(mxCellState state, EventObject trigger) Gets the initial editing value for the given cell.doubleintintbooleanReturns replaceHtmlLinefeedsprotected booleanisHideLabel(mxCellState state) booleanReturns replaceHtmlLinefeedsbooleanReturns shiftEnterSubmitsTextvoidsetExtractHtmlBody(boolean value) Sets extractHtmlBodyvoidsetMinimumEditorScale(double minimumEditorScale) voidsetMinimumHeight(int minimumHeight) voidsetMinimumWidth(int minimumWidth) voidsetReplaceHtmlLinefeeds(boolean value) Sets replaceHtmlLinefeedsvoidsetShiftEnterSubmitsText(boolean value) Sets shiftEnterSubmitsTextvoidstartEditing(Object cell, EventObject evt) Starts editing the given cell.voidstopEditing(boolean cancel) Stops the current editing.protected booleanuseLabelBounds(mxCellState state) Returns true if the label bounds of the state should be used for the editor.
-
Field Details
-
DEFAULT_MIN_WIDTH
public static int DEFAULT_MIN_WIDTH -
DEFAULT_MIN_HEIGHT
public static int DEFAULT_MIN_HEIGHT -
DEFAULT_MINIMUM_EDITOR_SCALE
public static double DEFAULT_MINIMUM_EDITOR_SCALE -
graphComponent
-
minimumEditorScale
protected double minimumEditorScaleDefines the minimum scale to be used for the editor. Set this to 0 if the font size in the editor -
minimumWidth
protected int minimumWidth -
minimumHeight
protected int minimumHeight -
editingCell
-
trigger
-
scrollPane
-
textArea
Holds the editor for plain text editing. -
editorPane
Holds the editor for HTML editing. -
extractHtmlBody
protected boolean extractHtmlBodySpecifies if the text content of the HTML body should be extracted before and after editing for HTML markup. Default is true. -
replaceLinefeeds
protected boolean replaceLinefeedsSpecifies if linefeeds should be replaced with BREAKS before editing, and BREAKS should be replaced with linefeeds after editing. This value is ignored if extractHtmlBody is false. Default is true. -
shiftEnterSubmitsText
protected boolean shiftEnterSubmitsTextSpecifies if shift ENTER should submit text if enterStopsCellEditing is true. Default is false. -
cancelEditingAction
-
textSubmitAction
-
-
Constructor Details
-
mxCellEditor
-
-
Method Details
-
isExtractHtmlBody
public boolean isExtractHtmlBody()Returns replaceHtmlLinefeeds -
setExtractHtmlBody
public void setExtractHtmlBody(boolean value) Sets extractHtmlBody -
isReplaceHtmlLinefeeds
public boolean isReplaceHtmlLinefeeds()Returns replaceHtmlLinefeeds -
setReplaceHtmlLinefeeds
public void setReplaceHtmlLinefeeds(boolean value) Sets replaceHtmlLinefeeds -
isShiftEnterSubmitsText
public boolean isShiftEnterSubmitsText()Returns shiftEnterSubmitsText -
setShiftEnterSubmitsText
public void setShiftEnterSubmitsText(boolean value) Sets shiftEnterSubmitsText -
configureActionMaps
protected void configureActionMaps()Installs the keyListener in the textArea and editorPane for handling the enter keystroke and updating the modified state. -
getEditor
Returns the current editor or null if no editing is in progress. -
useLabelBounds
Returns true if the label bounds of the state should be used for the editor. -
getEditorBounds
Returns the bounds to be used for the editor. -
startEditing
Description copied from interface:mxICellEditorStarts editing the given cell.- Specified by:
startEditingin interfacemxICellEditor
-
isHideLabel
-
stopEditing
public void stopEditing(boolean cancel) Description copied from interface:mxICellEditorStops the current editing.- Specified by:
stopEditingin interfacemxICellEditor
-
getInitialValue
Gets the initial editing value for the given cell. -
getCurrentValue
Returns the current editing value. -
getEditingCell
Description copied from interface:mxICellEditorReturns the cell that is currently being edited.- Specified by:
getEditingCellin interfacemxICellEditor
-
getMinimumEditorScale
public double getMinimumEditorScale()- Returns:
- the minimumEditorScale
-
setMinimumEditorScale
public void setMinimumEditorScale(double minimumEditorScale) - Parameters:
minimumEditorScale- the minimumEditorScale to set
-
getMinimumWidth
public int getMinimumWidth()- Returns:
- the minimumWidth
-
setMinimumWidth
public void setMinimumWidth(int minimumWidth) - Parameters:
minimumWidth- the minimumWidth to set
-
getMinimumHeight
public int getMinimumHeight()- Returns:
- the minimumHeight
-
setMinimumHeight
public void setMinimumHeight(int minimumHeight) - Parameters:
minimumHeight- the minimumHeight to set
-