|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.borland.primetime.editor.EditorManager
The EditorManager class manages all of the editors currently active in the system. It is also used to create new ones. The EditorManager is also responsible for maintaining information that is global to all of the editors (e.g. tabsize, fontsize, margins, colors). There is always only a single EditorManager in the system. It instantiates itself when it is first needed.
Field Summary | |
static java.lang.String |
alignClosingCurlyBraceAttribute
Name of the attribute that specifies whether or not to align the indentation level of the closing curly brace with the opening curly brace. |
static java.lang.String |
backgroundColorAttribute
Name of the attribute that specifies the default background color of the managed editors. |
static java.lang.String |
blinkCaretAttribute
The attribute that specifies if the caret should be blinking. |
static java.lang.String |
blockIndentAttribute
Name of the attribute that specifies the block indent size for managed editors. |
static java.lang.String |
caretAttribute
Name of the attribute that specifies the caret for the managed editors. |
static java.lang.String |
createBackupFileAttribute
The attribute that specifies if backup files should be created. |
static java.lang.Object |
EDITOR_TOPIC
This is the editor topic, used for PropertyPageFactories. |
static java.lang.String |
fontAttribute
Name of the attribute that specifies the font for managed editors. |
static java.lang.String |
fontSizeAttribute
Name of the attribute that specifies the font size for managed editors. |
static java.lang.String |
foregroundColorAttribute
Name of the attribute that specifies the default foreground color of the managed editors. |
static java.lang.String |
indentAfterBraceAttribute
Name of the attribute that specifies whether or not to add an extra level of indentation for every extra open brace found on the previous non-blank line. |
static java.lang.String |
insertLeadingTabsAttribute
Name of the attribute that specifies that all leading blanks in the file should be changed to leading TAB characters in the most optimal way at the time the file is saved. |
static java.lang.String |
insertModeAttribute
Name of the attribute that specifies whether or not the managed editors are in insert mode. |
static java.lang.String |
internationalInputMethods
The attribute that specifies if International Input Methods should be enabled. |
static java.lang.String |
keymapAttribute
Name of the attribute that specifies the keymap for the managed editors. |
static java.lang.String |
removeLeadingTabsAttribute
Name of the attribute that specifies that all real TAB characters should be removed from the file when the file is saved. |
static java.lang.String |
rightMarginAttribute
Name of the attribute that specifies the right margin line of the managed editors. |
static java.lang.String |
searchWordAtCursorAttribute
Name of the attribute that specifies that a search in the editor should initialize the search box with the word under the cursor. |
static java.lang.String |
showSearchDialogAttribute
Name of the attribute that specifies that a dialog box should pop up when a search in the current file fails to come up with any (more) results. |
static java.lang.String |
smartEndAttribute
Name of the attribute that specifies whether or not to use SmartEnd for the EndLineAction. |
static java.lang.String |
smartHomeAttribute
Name of the attribute that specifies whether or not to use SmartHome for the BeginLineAction. |
static java.lang.String |
smartIndentAttribute
Name of the attribute that specifies whether or not to use Smart Indent when the user types the |
static java.lang.String |
smartTabsAttribute
Name of the attribute that specifies whether or not to use SmartTabs. |
static java.lang.String |
stripTrailingSpaceAttribute
The attribute that specifies if trailing spaces should be deleted when the file is saved. |
static java.lang.String |
styleContextAttribute
Name of the attribute that specifies the StyleContext for the managed editors. |
static java.lang.String |
tabSizeAttribute
Name of the attribute that specifies the tab size for managed editors. |
static java.lang.String |
useSyntaxHighlightAttribute
Name of the attribute that specifies whether or not to use color syntax highlighting when painting the file. |
static java.lang.String |
useTabCharAttribute
Name of the attribute that specifies whether or not to use the |
static java.lang.String |
visibleMarginAttribute
Name of the attribute that specifies whether or not the right margin line of the managed editors is visible. |
Method Summary | |
static void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
static void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener for a specific property. |
static EditorPane |
configureEditor(EditorPane editor,
TextEditorKit kit)
Configure the incoming editor pane using the current settings and add this editor pane as a listener. |
static EditorPane |
createEditor(TextEditorKit kit)
Create a new EditorPane. |
static javax.swing.text.Keymap |
createKeymap(javax.swing.text.Keymap map,
javax.swing.text.JTextComponent.KeyBinding[] bindings,
javax.swing.Action[] actions)
Bind the supplied bindings and actions into the supplied keymap. |
static javax.swing.text.Keymap |
createKeymap(java.lang.String keymapName,
javax.swing.text.JTextComponent.KeyBinding[] bindings,
javax.swing.Action[] actions)
Create a new keymap with the supplied name and the supplied bindings and actions. |
static javax.swing.text.Keymap |
createSubKeymap(java.lang.String keymapName,
javax.swing.text.Keymap masterKeymap,
javax.swing.text.JTextComponent.KeyBinding[] bindings,
javax.swing.Action[] actions)
Create a new sub-keymap with the supplied name and the supplied master keymap and the supplied bindings and actions. |
static void |
customizeKeymap(java.lang.Object keymap)
Allow the user to customize a keymap. |
static java.util.HashMap |
getActionMap()
Get all the actions that are applicable to the current keymap. |
static int |
getBlockIndent()
Get the indent size the editor currently is using. |
static javax.swing.text.Caret |
getCaret()
Returns a newly minted instance of the currently installed caret. |
static java.util.ArrayList |
getContextActions(ActionGroup group)
Query all the EditorContextActionProviders by calling their getContextAction method, and adding the actions returned by the getContextAction methods in an array to be added to the incoming action group. |
static EditorPane |
getEditor(Node node)
Examines a Node and determines if its viewer has an EditorPane associated with it, and if so, returns that EditorPane. |
static TextEditorKit |
getEditorKit()
Get the editor kit that the editor is currently using. |
static TextEditorKit |
getEditorKit(java.lang.Class keyClass)
Retrieve an editor kit. |
static EditorOption |
getEditorOption(java.lang.String key)
Get a previously registered editor option based on its key name. |
static EditorOption[] |
getEditorOptions()
Get all the options that were previously registered through the registerEditorOption function. |
static java.awt.Font |
getFont()
Get the font the editor is currently using. |
static javax.swing.text.Keymap |
getKeymap()
Return the currently installed keymap. |
static javax.swing.text.Keymap |
getKeymap(java.lang.String keymapName)
Retrieve a keymap by name. |
static javax.swing.Action |
getKeymapCustomizer()
Get the currently installed keymap customizer. |
static java.lang.String |
getKeymapName()
Get the name of the currently installed keymap. |
static java.lang.Object |
getProperty(java.lang.Object key)
Look up a property value using the specified key. |
static int |
getRightMargin()
Get the column at which the right margin is displayed. |
static MasterStyleContext |
getStyleContext()
Get the style context that the editor is currently using for syntax highlighting. |
static int |
getTabSize()
Get the tab size the editor is currently using. |
static void |
initOpenTool(byte majorVersion,
byte minorVersion)
Initialize all the options and all the OpenTools definitions. |
static boolean |
isAlignClosingCurlyBrace()
Ask the editor if it is aligning closing curly braces. |
static boolean |
isBlinkCaret()
Ask the editor if the caret is blinking. |
static boolean |
isBooleanOptionValue(java.lang.String key)
Get the value of a previously registered editor option based on its key name. |
static boolean |
isCreateBackupFile()
Ask the editor if it is creating backup files. |
static boolean |
isIndentAfterBrace()
Ask the editor if it is indenting after an opening curly brace. |
static boolean |
isInsertLeadingTabs()
Ask the editor if leading spaces are replaced with tabs. |
static boolean |
isInsertMode()
Ask the editor if it is inserting or overstriking. |
static boolean |
isInternationalInputMethods()
Ask the editor if international input methods is on. |
static boolean |
isRemoveLeadingTabs()
Ask the editor if leading tabs are replaced with spaces. |
static boolean |
isSearchWordAtCursor()
Ask the editor if the search box should be initialized with the word under the caret. |
static boolean |
isShowSearchDialog()
Ask the editor if a dialog appears if a search fails. |
static boolean |
isSmartEnd()
Ask the editor if the end key is smart. |
static boolean |
isSmartHome()
Ask the editor if the home key is smart. |
static boolean |
isSmartIndent()
Ask the editor if it is using smart indent. |
static boolean |
isSmartTabs()
Ask the editor if the tabbing is done smartly. |
static boolean |
isStripTrailingSpace()
Ask the editor if trailing spaces are stripped. |
static boolean |
isUseSyntaxHighlight()
Ask the editor if syntax highlighting is on. |
static boolean |
isUseTabChar()
Ask the editor if it is using hard coded tab characters. |
static boolean |
isVisibleMargin()
Ask the editor if it is displaying the right margin. |
static void |
putProperty(java.lang.Object key,
java.lang.Object value)
Store a property value using the specified key. |
static void |
registerContextActionProvider(EditorContextActionProvider provider)
Register an EditorContextActionProvider and insert it in the sorted list of providers based on decreasing priority. |
static void |
registerEditorKit(TextEditorKit kit)
Register an editor kit. |
static void |
registerEditorOption(EditorOption opt)
Register an editor option in this central place. |
static void |
registerKeymap(javax.swing.text.Keymap keymap)
Register a keymap. |
static void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. |
static void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. |
static void |
setAlignClosingCurlyBrace(boolean b)
Tell the editor if it should align closing curly braces. |
static void |
setBackgroundColor(java.awt.Color c)
Set the new background color the editor should be using. |
static void |
setBlinkCaret(boolean b)
Tell the editor if the caret should be blinking. |
static void |
setBlockIndent(int newSize)
Set the indent size that the editor will use. |
static void |
setCaret(java.lang.Class caret)
The EditorManager manages the caret that all editors will use. |
static void |
setCreateBackupFile(boolean b)
Tell the editor if it should create backup files. |
static void |
setFont(java.awt.Font f)
Set the font that the editor will use. |
static void |
setForegroundColor(java.awt.Color c)
Set the new foreground color the editor should be using. |
static void |
setIndentAfterBrace(boolean b)
Tell the editor if it should indent after an opening curly brace. |
static void |
setInsertLeadingTabs(boolean b)
Tell the editor if it should replace leading spaces with tabs on saving. |
static void |
setInsertMode(boolean mode)
Tell the editor if it should use insert or overstrike mode. |
static void |
setInternationalInputMethods(boolean b)
Tell the editor if it should use International Input Methods. |
static void |
setKeymap(javax.swing.text.Keymap keymap)
Set the keymap that the editor should be using. |
static void |
setKeymapCustomizer(javax.swing.Action action)
Set the keymap customizer action which, when its actionPerformed function is called, should allow the user to customize the currently installed keymap. |
static void |
setKeymapName(java.lang.String keymapName)
Set the keymap that the editor should be using. |
static void |
setOptionValue(BooleanEditorOption opt,
boolean value)
Set a binary editor option value. |
static void |
setRemoveLeadingTabs(boolean b)
Tell the editor if it should replace leading tabs with spaces on saving. |
static void |
setRightMargin(int column)
Set the column at which the right margin should be displayed. |
static void |
setSearchWordAtCursor(boolean b)
Tell the editor if it should initialize the search box with the word under the caret when a search is performed. |
static void |
setShowSearchDialog(boolean b)
Tell the editor if it should pop up a dialog when a search fails. |
static void |
setSmartEnd(boolean b)
Tell the editor if it should make the end key smart. |
static void |
setSmartHome(boolean b)
Tell the editor if it should make the home key smarter. |
static void |
setSmartIndent(boolean b)
Tell the editor if it should use smart indent. |
static void |
setSmartTabs(boolean b)
Tell the editor if it should make tabbing smart. |
static void |
setStripTrailingSpace(boolean b)
Tell the editor if it should strip trailing spaces when saving. |
static void |
setStyleContext(MasterStyleContext styleContext)
Set the new style context that the editor should be using for syntax highlighting. |
static void |
setTabSize(int newSize)
Set the tab size that the editor will use. |
static void |
setUseSyntaxHighlight(boolean b)
Tell the editor if it should use syntax highlighting. |
static void |
setUseTabChar(boolean b)
Tell the editor if it should use hard coded tab characters when possible. |
static void |
setVisibleMargin(boolean visible)
Tell the editor if it should display the right margin. |
static void |
showStatusMessage(EditorPane editor,
java.lang.String message,
boolean appendOnly,
boolean temporary)
Show a message in the status bar of the IDE. |
static void |
showStatusMessage(EditorPane editor,
java.lang.String message,
boolean appendOnly,
boolean temporary,
boolean paintImmediately)
Show a message in the status bar of the IDE. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String blinkCaretAttribute
public static final java.lang.String createBackupFileAttribute
public static final java.lang.String stripTrailingSpaceAttribute
public static final java.lang.String internationalInputMethods
public static final java.lang.Object EDITOR_TOPIC
public static final java.lang.String blockIndentAttribute
public static final java.lang.String tabSizeAttribute
public static final java.lang.String useTabCharAttribute
public static final java.lang.String smartIndentAttribute
public static final java.lang.String indentAfterBraceAttribute
public static final java.lang.String alignClosingCurlyBraceAttribute
public static final java.lang.String smartHomeAttribute
public static final java.lang.String smartEndAttribute
public static final java.lang.String smartTabsAttribute
EditorActions#InsertTabAction
public static final java.lang.String useSyntaxHighlightAttribute
public static final java.lang.String fontAttribute
public static final java.lang.String fontSizeAttribute
public static final java.lang.String insertModeAttribute
public static final java.lang.String foregroundColorAttribute
public static final java.lang.String backgroundColorAttribute
public static final java.lang.String visibleMarginAttribute
public static final java.lang.String rightMarginAttribute
public static final java.lang.String keymapAttribute
public static final java.lang.String styleContextAttribute
public static final java.lang.String caretAttribute
public static final java.lang.String removeLeadingTabsAttribute
public static final java.lang.String insertLeadingTabsAttribute
public static final java.lang.String showSearchDialogAttribute
public static final java.lang.String searchWordAtCursorAttribute
Method Detail |
public static void initOpenTool(byte majorVersion, byte minorVersion)
public static void registerEditorOption(EditorOption opt)
opt
- The option that should be registered.public static EditorOption[] getEditorOptions()
public static void setOptionValue(BooleanEditorOption opt, boolean value)
opt
- the option that should be modified.value
- the new value of the option.public static EditorOption getEditorOption(java.lang.String key)
key
- The name of the desired option.public static boolean isBooleanOptionValue(java.lang.String key)
key
- The name of the option whose value is wantedpublic static void registerEditorKit(TextEditorKit kit)
kit
- The TextEditorKit to register.getEditorKit(java.lang.Class)
public static TextEditorKit getEditorKit(java.lang.Class keyClass)
keyClass
- The class of the TextEditorKit being retrieved.registerEditorKit(com.borland.primetime.editor.TextEditorKit)
public static void registerKeymap(javax.swing.text.Keymap keymap)
kit
- The TextEditorKit to register.getEditorKit(java.lang.Class)
public static javax.swing.text.Keymap getKeymap(java.lang.String keymapName)
keymapName
- The name of the Keymap being retrieved.registerKeymap(javax.swing.text.Keymap)
public static void setBlockIndent(int newSize)
newSize
- the new indent size.public static int getBlockIndent()
public static void setTabSize(int newSize)
newSize
- The new tab size for the editor.public static int getTabSize()
public static void setUseTabChar(boolean b)
b
- the new useTabChar value.public static boolean isUseTabChar()
public static void setSmartIndent(boolean b)
b
- The new value of smartIndentpublic static boolean isSmartIndent()
public static void setIndentAfterBrace(boolean b)
b
- The new value of IndentAfterBrace.public static boolean isIndentAfterBrace()
public static void setAlignClosingCurlyBrace(boolean b)
b
- The new value of AlignClosingCurlyBracepublic static boolean isAlignClosingCurlyBrace()
public static void setSmartHome(boolean b)
b
- the new value of SmartHome.public static boolean isSmartHome()
public static void setSmartEnd(boolean b)
b
- the new value of SmartEnd.public static boolean isSmartEnd()
public static void setSmartTabs(boolean b)
b
- the new value of SmartTabs.public static boolean isSmartTabs()
public static void setBlinkCaret(boolean b)
b
- the new value of BlinkCaret.public static boolean isBlinkCaret()
public static void setCreateBackupFile(boolean b)
b
- the new value of CreateBackupFile.public static boolean isCreateBackupFile()
public static void setStripTrailingSpace(boolean b)
b
- the new value of StripTrailingSpace.public static boolean isStripTrailingSpace()
public static void setRemoveLeadingTabs(boolean b)
b
- the new value of RemoveLeadingTabs.public static boolean isRemoveLeadingTabs()
public static void setInsertLeadingTabs(boolean b)
b
- the new value of InsertLeadingTabs.public static boolean isInsertLeadingTabs()
public static void setInternationalInputMethods(boolean b)
b
- the new value of InternationalInputMethods.public static boolean isInternationalInputMethods()
public static void setUseSyntaxHighlight(boolean b)
b
- the new value of UseSyntaxHighlight.public static boolean isUseSyntaxHighlight()
public static void setShowSearchDialog(boolean b)
b
- the new value of ShowSearchDialog.public static boolean isShowSearchDialog()
public static void setSearchWordAtCursor(boolean b)
b
- the new value of SearchWordAtCursor.public static boolean isSearchWordAtCursor()
public static void setFont(java.awt.Font f)
f
- the new font the editor should use.public static java.awt.Font getFont()
public static void setInsertMode(boolean mode)
mode
- the new insert mode.public static boolean isInsertMode()
public static void setForegroundColor(java.awt.Color c)
c
- the new foreground color.public static void setBackgroundColor(java.awt.Color c)
c
- the new background color.public static void setVisibleMargin(boolean visible)
visible
- true if the margin should be displayed, false otherwise.public static boolean isVisibleMargin()
public static void setRightMargin(int column)
column
- the new column for the right margin.public static int getRightMargin()
public static void setKeymapName(java.lang.String keymapName)
keymapName
- the name of the new keymap.public static java.lang.String getKeymapName()
public static void setKeymap(javax.swing.text.Keymap keymap)
keymap
- the new keymap that should be installed.public static javax.swing.text.Keymap getKeymap()
public static void setKeymapCustomizer(javax.swing.Action action)
action
- The action that, when triggered, will
allow the user to modify the currently
installed keymap.public static javax.swing.Action getKeymapCustomizer()
public static void customizeKeymap(java.lang.Object keymap)
keymap
- The name of the keymap to customize
is keymap.toString(). If keymap is
null, the warning message dialog will
be displayed.public static void setStyleContext(MasterStyleContext styleContext)
styleContext
- the new style context.public static MasterStyleContext getStyleContext()
public static TextEditorKit getEditorKit()
public static javax.swing.text.Caret getCaret()
setCaret(java.lang.Class)
public static void setCaret(java.lang.Class caret)
caret
- The new caret class.
If caret == null the default caret class will be installed,
which is the EditorCaret class.public static EditorPane createEditor(TextEditorKit kit)
kit
- The TextEditorKit to use.public static EditorPane configureEditor(EditorPane editor, TextEditorKit kit)
editor
- the editor that should be configured.kit
- the kit that should be installed in the editor.public static EditorPane getEditor(Node node)
Node[] nodes = Browser.getActiveBrowser().getOpenNodes(); for (int i=0; i < nodes.length; i++) { if (nodes[i] instanceof JavaFileNode) { EditorPane editor = EditorManager.getEditor(nodes[i]); // Do work with the editor } }
If you want to access the Editor that currently has the focus, use the following code instead:
EditorPane editor = EditorAction.getFocusedEditor(); // Do work with the editor
node
- The node that might have an EditorPanepublic static javax.swing.text.Keymap createKeymap(java.lang.String keymapName, javax.swing.text.JTextComponent.KeyBinding[] bindings, javax.swing.Action[] actions)
keymapName
- the name of the new keymap.bindings
- the bindings that should be linked to the actions.actions
- the actions that should be linked to the bindings.public static javax.swing.text.Keymap createKeymap(javax.swing.text.Keymap map, javax.swing.text.JTextComponent.KeyBinding[] bindings, javax.swing.Action[] actions)
map
- the keymap that should receive the bindings and actions.bindings
- the bindings that should be linked to the actions.actions
- the actions that should be linked to the bindings.public static javax.swing.text.Keymap createSubKeymap(java.lang.String keymapName, javax.swing.text.Keymap masterKeymap, javax.swing.text.JTextComponent.KeyBinding[] bindings, javax.swing.Action[] actions)
keymapName
- the name of the new keymap.masterKeymap
- the name of the new keymap.bindings
- the bindings that should be linked to the actions.actions
- the actions that should be linked to the bindings.public static void showStatusMessage(EditorPane editor, java.lang.String message, boolean appendOnly, boolean temporary)
editor
- the editor issuing the message.message
- the actual message.appendOnly
- if true, append to the message that is there alreadytemporary
- if true, the message disappears after several seconds.public static void showStatusMessage(EditorPane editor, java.lang.String message, boolean appendOnly, boolean temporary, boolean paintImmediately)
editor
- the editor issuing the message.message
- the actual message.appendOnly
- if true, append to the message that is there alreadytemporary
- if true, the message disappears after several seconds.paintImmediately
- if true, force a paint right away.public static final java.lang.Object getProperty(java.lang.Object key)
key
- the non-null property keypublic static final void putProperty(java.lang.Object key, java.lang.Object value)
key
- the non-null keyvalue
- the valuepublic static void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be addedpublic static void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removedpublic static void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The name of the property to listen on.listener
- The PropertyChangeListener to be addedpublic static void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removedpublic static void registerContextActionProvider(EditorContextActionProvider provider)
provider
- The provider that wants to be registered.public static java.util.ArrayList getContextActions(ActionGroup group)
group
- The action group that will receive the actions.public static java.util.HashMap getActionMap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |