public class EditorPane extends org.fife.ui.rsyntaxtextarea.RSyntaxTextArea implements DocumentListener
RSyntaxTextArea.org.fife.ui.rtextarea.RTextArea.RTextAreaMutableCaretEventorg.fife.ui.rtextarea.RTextAreaBase.RTAMouseListenerJTextArea.AccessibleJTextAreaJTextComponent.AccessibleJTextComponent, JTextComponent.DropLocation, JTextComponent.KeyBindingJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_TAB_SIZE |
static String |
FOLDERS_PREFS |
static String |
FONT_SIZE_PREFS |
static String |
LINE_WRAP_PREFS |
static String |
TAB_SIZE_PREFS |
static String |
TABS_EMULATED_PREFS |
ANIMATE_BRACKET_MATCHING_PROPERTY, ANTIALIAS_PROPERTY, AUTO_INDENT_PROPERTY, BRACKET_MATCHING_PROPERTY, CLEAR_WHITESPACE_LINES_PROPERTY, CLOSE_CURLY_BRACES_PROPERTY, CLOSE_MARKUP_TAGS_PROPERTY, CODE_FOLDING_PROPERTY, EOL_VISIBLE_PROPERTY, FOCUSABLE_TIPS_PROPERTY, FRACTIONAL_FONTMETRICS_PROPERTY, HIGHLIGHT_SECONDARY_LANGUAGES_PROPERTY, HYPERLINKS_ENABLED_PROPERTY, MARK_OCCURRENCES_PROPERTY, MARKED_OCCURRENCES_CHANGED_PROPERTY, PAINT_MATCHED_BRACKET_PAIR_PROPERTY, PARSER_NOTICES_PROPERTY, SYNTAX_SCHEME_PROPERTY, SYNTAX_STYLE_PROPERTY, TAB_LINE_COLOR_PROPERTY, TAB_LINES_PROPERTY, USE_SELECTED_TEXT_COLOR_PROPERTY, VISIBLE_WHITESPACE_PROPERTYCOPY_ACTION, CUT_ACTION, DELETE_ACTION, INSERT_MODE, MARK_ALL_COLOR_PROPERTY, MARK_ALL_OCCURRENCES_CHANGED_PROPERTY, MARK_ALL_ON_OCCURRENCE_SEARCHES_PROPERTY, OVERWRITE_MODE, PASTE_ACTION, REDO_ACTION, SELECT_ALL_ACTION, UNDO_ACTIONBACKGROUND_IMAGE_PROPERTY, CURRENT_LINE_HIGHLIGHT_COLOR_PROPERTY, CURRENT_LINE_HIGHLIGHT_FADE_PROPERTY, HIGHLIGHT_CURRENT_LINE_PROPERTY, ROUNDED_SELECTION_PROPERTYDEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEYlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTSYNTAX_STYLE_ACTIONSCRIPT, SYNTAX_STYLE_ASSEMBLER_6502, SYNTAX_STYLE_ASSEMBLER_X86, SYNTAX_STYLE_BBCODE, SYNTAX_STYLE_C, SYNTAX_STYLE_CLOJURE, SYNTAX_STYLE_CPLUSPLUS, SYNTAX_STYLE_CSHARP, SYNTAX_STYLE_CSS, SYNTAX_STYLE_CSV, SYNTAX_STYLE_D, SYNTAX_STYLE_DART, SYNTAX_STYLE_DELPHI, SYNTAX_STYLE_DOCKERFILE, SYNTAX_STYLE_DTD, SYNTAX_STYLE_FORTRAN, SYNTAX_STYLE_GO, SYNTAX_STYLE_GROOVY, SYNTAX_STYLE_HOSTS, SYNTAX_STYLE_HTACCESS, SYNTAX_STYLE_HTML, SYNTAX_STYLE_INI, SYNTAX_STYLE_JAVA, SYNTAX_STYLE_JAVASCRIPT, SYNTAX_STYLE_JSON, SYNTAX_STYLE_JSON_WITH_COMMENTS, SYNTAX_STYLE_JSP, SYNTAX_STYLE_LATEX, SYNTAX_STYLE_LESS, SYNTAX_STYLE_LISP, SYNTAX_STYLE_LUA, SYNTAX_STYLE_MAKEFILE, SYNTAX_STYLE_MXML, SYNTAX_STYLE_NONE, SYNTAX_STYLE_NSIS, SYNTAX_STYLE_PERL, SYNTAX_STYLE_PHP, SYNTAX_STYLE_PROPERTIES_FILE, SYNTAX_STYLE_PYTHON, SYNTAX_STYLE_RUBY, SYNTAX_STYLE_SAS, SYNTAX_STYLE_SCALA, SYNTAX_STYLE_SQL, SYNTAX_STYLE_TCL, SYNTAX_STYLE_TYPESCRIPT, SYNTAX_STYLE_UNIX_SHELL, SYNTAX_STYLE_VISUAL_BASIC, SYNTAX_STYLE_WINDOWS_BATCH, SYNTAX_STYLE_XML, SYNTAX_STYLE_YAMLNO_SUCH_PAGE, PAGE_EXISTSABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
EditorPane()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
changedUpdate(DocumentEvent e) |
void |
convertSpacesToTabs() |
void |
convertTabsToSpaces() |
void |
embedWithScrollbars(Container container)
Add this
EditorPane with scrollbars to a container. |
boolean |
fileChanged() |
void |
getBookmarks(TextEditorTab tab,
Collection<Bookmark> result)
Add this editors bookmarks to the specified collection.
|
ScriptLanguage |
getCurrentLanguage()
Get
ScriptLanguage used for this EditorPane. |
File |
getFile()
Get file currently open in this
EditorPane. |
protected String |
getFileName() |
float |
getFontSize() |
File |
getGitDirectory()
Get the directory of the git repository for the currently open file.
|
protected org.fife.ui.rsyntaxtextarea.RSyntaxDocument |
getRSyntaxDocument() |
void |
increaseFontSize(float factor)
Increase font size of this editor by a given factor.
|
void |
insertUpdate(DocumentEvent e) |
boolean |
isNew() |
String |
loadFolders() |
void |
loadPreferences()
Loads the preferences for the Tab and apply them.
|
protected void |
modified()
Set the title according to whether the file was modified or not.
|
void |
open(File file)
Load editor contents from given file.
|
void |
redoLastAction() |
void |
removeUpdate(DocumentEvent e) |
void |
resetTabSize()
Reset tab size to current preferences.
|
void |
savePreferences(String top_folders)
Retrieves and saves the preferences to the persistent store
|
void |
setAutoCompletionEnabled(boolean value) |
void |
setFileName(File file)
TODO
|
void |
setFileName(String baseName)
Set the name to use for new files.
|
void |
setFontSize(float size)
Set the font size for this editor.
|
void |
setGitDirectory(File dir)
Set this
EditorPanes git directory. |
protected void |
setLanguage(ScriptLanguage language)
Set the language of this
EditorPane. |
protected void |
setLanguage(ScriptLanguage language,
boolean addHeader)
Set the language of this
EditorPane, optionally adding a header. |
protected void |
setLanguageByFileName(String name)
Get the language by filename extension.
|
void |
setTabSize(int width) |
void |
toggleBookmark()
Add/remove bookmark for line containing the cursor/caret.
|
void |
toggleBookmark(int line)
Add/remove bookmark for a specific line.
|
void |
undoLastAction() |
boolean |
wasChangedOutside() |
org.fife.ui.rtextarea.RTextScrollPane |
wrappedInScrollbars() |
void |
write(File file)
Write the contents of this
EditorPane to given file. |
int |
zapGremlins()
Adapted from ij.plugin.frame.Editor.
|
addActiveLineRangeListener, addHyperlinkListener, addNotify, addParser, appendFoldingMenu, clearParsers, configurePopupMenu, copyAsStyledText, copyAsStyledText, createDefaultModel, createMouseListener, createPopupMenu, createRTextAreaUI, doBracketMatching, fireCaretUpdate, foldToggled, forceReparsing, forceReparsing, getAnimateBracketMatching, getAntiAliasingEnabled, getBackgroundForToken, getCloseCurlyBraces, getCloseMarkupTags, getCodeTemplateManager, getDefaultBracketMatchBGColor, getDefaultBracketMatchBorderColor, getDefaultSelectionColor, getDefaultSyntaxScheme, getEOLMarkersVisible, getFoldManager, getFontForTokenType, getFontMetricsForTokenType, getForegroundForToken, getForegroundForTokenType, getFractionalFontMetricsEnabled, getHighlightSecondaryLanguages, getHyperlinkForeground, getHyperlinksEnabled, getLastVisibleOffset, getLineHeight, getLinkGenerator, getMarkAllHighlightRanges, getMarkedOccurrences, getMarkOccurrences, getMarkOccurrencesColor, getMarkOccurrencesDelay, getMatchedBracketBGColor, getMatchedBracketBorderColor, getMaxAscent, getPaintMarkOccurrencesBorder, getPaintMatchedBracketPair, getPaintTabLines, getParser, getParserCount, getParserDelay, getParserNotices, getRightHandSideCorrection, getSecondaryLanguageBackground, getSecondaryLanguageCount, getShouldIndentNextLine, getShowMatchedBracketPopup, getSyntaxEditingStyle, getSyntaxScheme, getTabLineColor, getTemplatesEnabled, getTokenListFor, getTokenListForLine, getToolTipText, getToolTipTextImpl, getUnderlineForToken, getUseFocusableTips, getUseSelectedTextColor, init, isAutoIndentEnabled, isBracketMatchingEnabled, isClearWhitespaceLinesEnabled, isCodeFoldingEnabled, isWhitespaceVisible, modelToToken, paintComponent, removeActiveLineRangeListener, removeHyperlinkListener, removeNotify, removeParser, restoreDefaultSyntaxScheme, saveTemplates, setActiveLineRange, setAnimateBracketMatching, setAntiAliasingEnabled, setAutoIndentEnabled, setBracketMatchingEnabled, setClearWhitespaceLinesEnabled, setCloseCurlyBraces, setCloseMarkupTags, setCodeFoldingEnabled, setDocument, setEOLMarkersVisible, setFont, setFractionalFontMetricsEnabled, setHighlighter, setHighlightSecondaryLanguages, setHyperlinkForeground, setHyperlinksEnabled, setLinkGenerator, setLinkScanningMask, setMarkOccurrences, setMarkOccurrencesColor, setMarkOccurrencesDelay, setMatchedBracketBGColor, setMatchedBracketBorderColor, setPaintMarkOccurrencesBorder, setPaintMatchedBracketPair, setPaintTabLines, setParserDelay, setRightHandSideCorrection, setSecondaryLanguageBackground, setShowMatchedBracketPopup, setSyntaxEditingStyle, setSyntaxScheme, setTabLineColor, setTemplateDirectory, setTemplatesEnabled, setUseFocusableTips, setUseSelectedTextColor, setWhitespaceVisible, viewToTokenaddLineHighlight, beginAtomicEdit, beginRecordingMacro, canRedo, canUndo, createPopupMenuItem, createUndoManager, discardAllEdits, endAtomicEdit, endRecordingMacro, getAction, getCurrentMacro, getDefaultMarkAllHighlightColor, getDefaultModifier, getIconGroup, getMarkAllHighlightColor, getMarkAllOnOccurrenceSearches, getPopupMenu, getSelectedOccurrenceText, getTextMode, getToolTipSupplier, handleReplaceSelection, isRecordingMacro, loadMacro, paste, playbackLastMacro, print, read, removeAllLineHighlights, removeLineHighlight, replaceRange, replaceSelection, setActionProperties, setActionProperties, setCaret, setCaretStyle, setIconGroup, setMarkAllHighlightColor, setMarkAllOnOccurrenceSearches, setPopupMenu, setRoundedSelectionEdges, setSelectedOccurrenceText, setTextMode, setToolTipSupplier, setUIforceCurrentLineHighlightRepaint, getBackground, getBackgroundImage, getBackgroundObject, getCaretLineNumber, getCaretOffsetFromLineStart, getCurrentCaretY, getCurrentLineHighlightColor, getDefaultCaretColor, getDefaultCurrentLineHighlightColor, getDefaultFont, getDefaultForeground, getDefaultMarginLineColor, getDefaultMarginLinePosition, getDefaultTabSize, getFadeCurrentLineHighlight, getHighlightCurrentLine, getLineEndOffsetOfCurrentLine, getLineStartOffsetOfCurrentLine, getMarginLineColor, getMarginLinePixelLocation, getMarginLinePosition, getRoundedSelectionEdges, getTabsEmulated, isMarginLineEnabled, isOSX, possiblyUpdateCurrentLineHighlightLocation, processComponentEvent, setBackground, setBackgroundImage, setBackgroundObject, setCurrentLineHighlightColor, setFadeCurrentLineHighlight, setHighlightCurrentLine, setLineWrap, setMargin, setMarginLineColor, setMarginLineEnabled, setMarginLinePosition, setRTextAreaUI, setTabsEmulated, updateMarginLineX, yForLine, yForLineContainingappend, getAccessibleContext, getColumns, getColumnWidth, getLineCount, getLineEndOffset, getLineOfOffset, getLineStartOffset, getLineWrap, getPreferredScrollableViewportSize, getPreferredSize, getRowHeight, getRows, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getTabSize, getUIClassID, getWrapStyleWord, insert, paramString, setColumns, setRows, setWrapStyleWordaddCaretListener, addInputMethodListener, addKeymap, copy, cut, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, print, print, print, processInputMethodEvent, removeCaretListener, removeKeymap, restoreComposedText, saveComposedText, select, selectAll, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setKeymap, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setText, updateUI, viewToModel, writeaddAncestorListener, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, 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, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final String FONT_SIZE_PREFS
public static final String LINE_WRAP_PREFS
public static final String TAB_SIZE_PREFS
public static final String TABS_EMULATED_PREFS
public static final String FOLDERS_PREFS
public static final int DEFAULT_TAB_SIZE
public void setTabSize(int width)
setTabSize in class org.fife.ui.rtextarea.RTextAreaBasepublic void embedWithScrollbars(Container container)
EditorPane with scrollbars to a container.container - the container to add this editor pane to.public org.fife.ui.rtextarea.RTextScrollPane wrappedInScrollbars()
RTextScrollPane.public void undoLastAction()
undoLastAction in class org.fife.ui.rsyntaxtextarea.RSyntaxTextAreapublic void redoLastAction()
redoLastAction in class org.fife.ui.rsyntaxtextarea.RSyntaxTextAreapublic boolean fileChanged()
true if the file in this EditorPane was
changes since it was last saved.public void insertUpdate(DocumentEvent e)
insertUpdate in interface DocumentListenerpublic void removeUpdate(DocumentEvent e)
removeUpdate in interface DocumentListenerpublic void changedUpdate(DocumentEvent e)
changedUpdate in interface DocumentListenerprotected void modified()
public boolean isNew()
true if the file in this EditorPane is an
unsaved new file which has not been edited yet.public boolean wasChangedOutside()
EditorPane was changed ouside of
this EditorPane since it was openend.public void write(File file) throws IOException
EditorPane to given file.file - File to write the contents of this editor to.IOException - Thrown when a parent directory could not be created.public void open(File file) throws IOException
file - file to load.IOException - Thrown if the canonical file path couldn't be obtained for the file.public void setFileName(String baseName)
baseName - the fallback base name.public void setFileName(File file)
file - The file to edit in this EditorPane.public File getGitDirectory()
null is there is no
such thing.public void setGitDirectory(File dir)
EditorPanes git directory.dir - directory to set the git directory to.protected String getFileName()
protected void setLanguageByFileName(String name)
name - the filename.setLanguage(ScriptLanguage),
setLanguage(ScriptLanguage, boolean)protected void setLanguage(ScriptLanguage language)
EditorPane.language - ScriptLanguage to set the editors language to.setLanguageByFileName(String),
setLanguage(ScriptLanguage, boolean)protected void setLanguage(ScriptLanguage language, boolean addHeader)
EditorPane, optionally adding a header.
TODO: What is this header?language - ScriptLanguage to set the editors language to.addHeader - set to true to add a header.setLanguageByFileName(String),
setLanguage(ScriptLanguage)public void setAutoCompletionEnabled(boolean value)
public File getFile()
EditorPane.public ScriptLanguage getCurrentLanguage()
ScriptLanguage used for this EditorPane.ScriptLanguage.public float getFontSize()
public void setFontSize(float size)
size - the new font size.public void increaseFontSize(float factor)
factor - Factor to increase font size.protected org.fife.ui.rsyntaxtextarea.RSyntaxDocument getRSyntaxDocument()
RSyntaxDocument.public void toggleBookmark()
public void toggleBookmark(int line)
line - line to toggle the bookmark on.public void getBookmarks(TextEditorTab tab, Collection<Bookmark> result)
tab - Tab index to set for added bookmarks.result - Collection to add the bookmarks to.public int zapGremlins()
public void convertTabsToSpaces()
convertTabsToSpaces in class org.fife.ui.rtextarea.RTextAreaBasepublic void convertSpacesToTabs()
convertSpacesToTabs in class org.fife.ui.rtextarea.RTextAreaBasepublic void loadPreferences()
public String loadFolders()
public void savePreferences(String top_folders)
public void resetTabSize()
Copyright © 2015–2022 SciJava. All rights reserved.