Added keystroke utility methods

These are the editor utility methods added by the DevTools. Since they are utility methods, they cannot be assigned to keystrokes using the TextEditor Keystroke remapping. However, they can be used to support any additional ParagraphEditor methods that might added by other developers.

browseClass

This utility method parses and evaluates the current text selection. A Class browser is opened on the class of the evaluation result. This method is called by the class menu item in the browse submenu, on the enhanced Text editor pop-up menu.

browseClassHierarchy

This utility method parses and evaluates the current text selection. A Class Hierarchy browser is opened on the class of the evaluation result. This method is called by the hierarchy menu item included in the browse submenu, on the enhanced Text editor pop-up menu.

browseTextMenu

Image of the new "browse" submenu. Items included are "class" and "hierarchy".This utility method returns a pop-up menu with choices to browse class or hierarchy. The menu items call browseClass and browseClassHierarchy, respectively.

debugIt

If any text is currently selected, this utility method will call debugSelection. This utility method is called by the debug it... menu item on the enhanced Text editor pop-up menu.

debugSelection

If any text is currently selected, the selection is copied to a buffer and a line with "self halt." is put in the buffer before the text. The text in the buffer is then treated as if the debug it... menu item were chosen from the enhanced Text editor pop-up menu. A "halt" debugger window is popped up, and the user can use it in the normal manner. The selection in the original window is not modified in any way.

fontBold

If any text is currently selected, the bold attribute of the selection's font style is toggled. If nothing is currently selected, then the bold attribute of the font style is toggled for any text that is typed after the current cursor location. This method is called by the bold menu item included in the font submenu, on the enhanced Text editor pop-up menu.

fontItalic

If any text is currently selected, the italic attribute of the selection's font style is toggled. If nothing is currently selected, then the italic attribute of the font style is toggled for any text that is typed after the current cursor location. This method is called by the italic menu item included in the font submenu, on the enhanced Text editor pop-up menu.

fontLarger

If any text is currently selected, the selection's font style is changed to display the text in the larger font size. If nothing is currently selected, then the font style for any text that is typed after the current cursor location will be of a larger font. This method is called by the larger menu item included in the font submenu, on the enhanced Text editor pop-up menu.

fontNormal

If any text is currently selected, the selection's font style is changed to display the text in a normal font size with no special attributes turned on. If nothing is currently selected, then any text that is typed after the current cursor location will display in a normal font size with no special attributes turned on. This method is called by the normal menu item included in the font submenu, on the enhanced Text editor pop-up menu.

fontSerif

If any text is currently selected, the serif attribute of the selection's font style is toggled. If nothing is currently selected, then the serif attribute of the font style is toggled for any text that is typed after the current cursor location. This method is called by the serif menu item included in the font submenu, on the enhanced Text editor pop-up menu.

fontSmaller

If any text is currently selected, the selection's font style is changed to display the text in the smaller font size. If nothing is currently selected, then the font style  for any text that is typed after the current cursor location will be of a smaller font. This method is called by the smaller menu item included in the font submenu, on the enhanced Text editor pop-up menu.

fontUnderline

If any text is currently selected, the bold attribute of the selection's underline style is toggled. If nothing is currently selected, then the underline attribute of the font style is toggled for any text that is typed after the current cursor location. This method is called by the underline menu item included in the font submenu, on the enhanced Text editor pop-up menu.

format

If the model understands a format:from: message, then that message is sent to the model. In most Paragraph editors, this executes the same method that is executed if the format menu item is chosen from the Text editor pop-up menu.

initializeMenuForCopyOnly

Class versions comments browser popup text menu imageIf a model does not provide a pop-up text menu, this method will initialize one in the controller that only has the find... and copy menu items. An example of its use can be found in the Class version comments browser of the Application Manager.

initializeMenuForEnhancedText

Text pop up menu for application version comments dialog box. If a model does not provide a pop-up text menu, this method will initialize one in the controller that is the standard text menu with a paste previous... menu item added. An example of its use can be found in the version with comments dialog box for Applications and Classes in the Application Manager.

initializeMenuForWorkspace

Application versions comments browser popup text menu imageIf a model does not provide a pop-up text menu, this method will initialize one in the controller that is an enhanced coding text menu with a paste previous..., debug it..., map keystrokes... menu items and the browse submenu added. An example of its use can be found in the Application version comments browser of the Application Manager.

insertBreakpoint

If the model understands a addBreakpoint:from: message, then that message is sent to the model. In most Paragraph editors, this executes the same method that is executed if the insert breakpoint menu item is chosen from the enhanced Text editor pop-up menu. As a warning, this utility method is tied to the PDP Debugger (Professional Debug Package) and is an experimental use of it. Calling this method sometimes causes the text in the code view editing pane to be displayed incorrectly. This method should be used with caution.

isSelectionAtLastCharacter

This utility method returns true if the selection is currently at the last character of the text. This method is currently used by cursorToStartOfNextLineKey:.

isSelectionBolded

This utility method returns true if the bold attribute of the current selection's font style is on. This method is currently used by fontBold and the enhanced Text editor pop-up menu to decide if the bold menu item should be disabled.

isSelectionEmpty

This utility method returns true if no text is currently selected. This method is currently used by many parts of the new editing code that will only work if any text is currently selected.

isSelectionItalicized

This utility method returns true if the italic attribute of the current selection's font style is on. This method is currently used by fontItalic and the enhanced Text editor pop-up menu to decide if the italic menu item should be disabled.

isSelectionLargerFont

This utility method returns true if the font style of the current selection is set to display the text in the larger font size. This method is currently used by the enhanced Text editor pop-up menu to decide if the larger menu item should be disabled and the smaller menu item enabled.

isSelectionNormal

This utility method returns true if none of the current selection's font attributes are on. This method is currently used by the enhanced Text editor pop-up menu to decide if the normal menu item should be disabled.

isSelectionSerif

This utility method returns true if the serif attribute of the current selection's font style is on. This method is currently used by fontSerif and the enhanced Text editor pop-up menu to decide if the serif menu item should be disabled.

isSelectionUnderlined

This utility method returns true if the underline attribute of the current selection's font style is on. This method is currently used by fontUnderline and the enhanced Text editor pop-up menu to decide if the underline menu item should be disabled.

lastCharacterBlock

This utility method returns the selection block for the last character of the controller's text.

mapKeystrokes

This utility method opens a DispatchTable editor for the Editor controller of the current window pane and will allow the keystrokes to be remapped for all Editor controllers like the current one. This method is called by the map keystrokes... menu item on the enhanced Text editor pop-up menu.

nextTokenStart: stringIndex

This utility method will return the string index for the beginning of the next word or special character. Word delimiters include special characters and separator characters.

pasteMethodTemplate

This utility method send code editing models a pasteMethodTemplate message. A chooser window dialog pops up with the hierarchy of the current class listed on the left side. On the right side is a list of the instance or class methods for the selected class. If the user selects a class and method name combination and then presses the accept button, a method call template will be pasted into the text. In most Paragraph editors, this executes the same method that is executed if the paste special | method call... item is chosen from the enhanced Text editor pop-up menu.

pastePrevious

This utility method provides a way to call an existing, but not well-publicized, feature in VisualWorks. When this method is called, a dialog pops up displaying the list of items in the paste history buffer. If one of the items is chosen, and the OK button is pressed, the item is pasted into the text. This function is also available if the user holds the Shift key when the paste menu item is chosen from the Text editor pop-up menu, or if the paste special | previous... menu item is chosen from the enhanced Text editor pop-up menu.

previousTokenStart: stringIndex

This utility method will return the string index for the beginning of the previous word or special character. Word delimiters include special characters and separator characters.

selectAll

This utility method selects all the characters in the controller's text.

selectButDontScrollFrom: start to: stop

This utility method changes the current selection so that it extends from the start index to the stop index, but does not scroll the view up or down. This method is currently used by selectToNextPageKey: and selectToPreviousPageKey:.

selectionAsDebugStream

This utility method copies the current selection to a buffer and a line with "self halt." is put in the buffer before the text. This method is currently used by debugSelection.

testKey: aCharEvent

This utility method was previously used to help debug the dispatching of characters entered from the keyboard. It is not currently being used.


[ < Added keystroke methods ] [ DevTools Workspace > ]

[ Main ] [ Table of Contents ] [ Contact info ] [ Index ]

[ Home ]

This work is licensed under a Creative Commons License.

Creative Commons License