TextEditor pop-up menu changes

The new pop up menu in text edit panes. New menu items include "debug it", "map keystrokes..." and "paste special", "browse", and "font" submenus.Paste Special menu:

The new "paste special" menu provides a new capability, plus an easy interface to an existing VisualWorks function.

The menu item paste special and its submenu items can be removed from the menu using code in the supplied DevTools workspace.

method call...

Paste Method Template Dialog Box imageThis causes a chooser window dialog to pop 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. This functions is also available from a keystroke if the pasteMethodTemplateKey: method has been mapped to a keystroke.

Using the supplied dialog image as an example, if the user presses the Accept key, the following text will be pasted into the existing text:

self downcastLocalEvent: aKey with: aParameter at: aPoint from: anInitiator

As in Class Hierarchy browsers, clicking on the instance button will change the list of instance methods to a list of class methods.

If the selected method is a class method and the template is being pasted into an instance method, self class will be put at the beginning of the template text rather than just self.

Clicking on the browse button will abort the dialog and will open a Class Hierarchy browser on the selected class, and the existing text will remain unchanged.

If a method is selected when the browse button is pressed, that method will be automatically selected in the new browser.

The automatic selection of the method can be turned on or off using code in the supplied DevTools workspace.

Clicking on the Cancel button at any time will abort the dialog and the existing text will remain unchanged.

See EtAbstractMethodsBrowser>>pasteMethodTemplate and its callers for additional details.

Paste Previous Dialog imageprevious...

This provides a menu interface to an existing, but not well-publicized, feature in VisualWorks.

If the previous... menu item is chosen, or the Shift key is held while the 'paste' menu item is chosen, 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 existing text.

This functions is also available from a keystroke if the pastePrevious: method has been mapped to a keystroke.

Clicking on the Cancel button at any time will abort the dialog and the existing text will remain unchanged.

See ParagraphEditor>>pastePrevious and its callers for additional details.


do it
print it
inspect

A new feature has been added to these menu items.

If do it, print it, or inspect is selected, the executed text is pushed onto the top of the paste history buffer. The contents of the clipboard remain unchanged.

This function can be particularly useful if there is a need to execute the same piece of code on multiple inspected objects.

The paste history buffer can be accessed using the paste previous menu item.

The copying of executed text to the paste history buffer by the do it, print it, or inspect menu items can be turned on or off using code in the supplied DevTools workspace.

See ParagraphEditor>>evaluateSelection and its callers for additional details.

debug it...

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 user had chosen ‘do it…’ from the pop-up text pane menu. A "halt" debugger window is pops up, and the programmer can employ it in the normal manner. The selection in the original window will not be modified in any way. This function is also available from a keystroke if the debugItKey: method has been mapped to a keystroke.

The menu item debug it... can be removed from the menu using code in the supplied DevTools workspace.

See ParagraphEditor>>selectionAsDebugStream, ParagraphEditor>>debugSelection and their callers for additional details.


Image of the new "browse" submenu. Items included are "class" and "hierarchy".Browse menu:

The new browse menu provides an easy interface to the existing VisualWorks/Envy browsing functions.

The menu item browse and its submenu items can be removed from the menu using code in the supplied DevTools workspace.

class

This menu item parses and evaluates the current text selection. A Class browser is opened on the class of the result. This function is also available from a keystroke if the browseClassKey: method has been mapped to a keystroke.

See ParagraphEditor>>browseClassKey: and its callers for additional details.

hierarchy

This menu item parses and evaluates the current text selection. A Class Hierarchy browser is opened on the class of the result. This function is also available from a keystroke if the browseClassHierarchyKey: method has been mapped to a keystroke.

See ParagraphEditor>>browseClassHierarchyKey: and its callers for additional details.


Image of the new "font" submenu. Items include ”bold", "italic", "serif", "underline", "larger“, "smaller" and "normal".Font menu:

The new "font" menu provides an easy interface to an existing VisualWorks font change function.

The menu item font and its submenu items can be removed from the menu using code in the supplied DevTools workspace.

bold
italic
serif
underline
larger
smaller
normal

If any text is selected, then the font and/or font style is changed. If no text is selected, then the font and/or font style is only changed for any text that is typed after the current cursor location. This function is also available from a keystroke if the VisualWorks provided changeEmphasisKey: method has been mapped to one or more keystrokes.

See the following methods of ParagrahEditor and their callers for additional details:

>>fontBold and >>isSelectionBolded
>>fontItalic and >>isSelectionItalicized
>>fontLarger and >>isSelectionLargerFont
>>fontNormal and >>isSelectionNormal
>>fontSerif and >>isSelectionSerif
>>fontSmaller and >>isSelectionLargerFont
>>fontUnderline and >>isSelectionUnderlined



map keystrokes...

This menu item opens a DispatchTable editor for the Editor controller of the current window pane and all others like it. This function is also available from a keystroke if the mapKeystrokesKey: method has been mapped to a keystroke.

The menu item map keystrokes... can be removed from the menu using code in the supplied DevTools workspace.

See implementors of >>mapKeystrokes and their callers for additional details.


[ < Methods Browser changes ] [ TextEditor Keystroke Remapping > ]

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

[ Home ]

This work is licensed under a Creative Commons License.

Creative Commons License