Tools Notepad/en: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) |
||
Zeile 16: | Zeile 16: | ||
== Snippet Management == |
== Snippet Management == |
||
All text editors inside expecco share a common snippet database. Snippets are little text fragments which can be quickly pasted into any text editor by pressing some abbreviation followed by ALT-SPACE. |
All text editors inside expecco share a common snippet database. Snippets are little text fragments which can be quickly pasted into any text editor by pressing some abbreviation followed by <kbd>ALT</kbd>-<kbd>SPACE</kbd>. |
||
For example, a programmer who often needs the string "self" to be typed in, might want to attach the word "self " to the snipplet-abreviation "s" and get the full string via "s"-ALT-SPACE. |
For example, a programmer who often needs the string "self" to be typed in, might want to attach the word "self " to the snipplet-abreviation "s" and get the full string via "s"-<kbd>ALT</kbd>-<kbd>SPACE</kbd>. |
||
A number of predefined snippets (mostly for programmers) can be found and managed in the snippet manager. |
A number of predefined snippets (mostly for programmers) can be found and managed in the snippet manager. |
||
You may want to customize them according to your domain's requirements. |
You may want to customize them according to your domain's requirements. |
Version vom 28. Februar 2017, 16:14 Uhr
Inhaltsverzeichnis
Introduction[Bearbeiten]
Workspaces (notepads) are simple text-editor windows. These can be used to prepare or inspect test-data, texts and similar. They also provide a calculator and scripting-language capability: you can type in an expression (expressed as Smalltalk or JavaScript code fragment) and evaluate it. Finally, they can be used as "PostIt-Note", to remember fragments of text or code. Workspaces are very useful to compute test-vectors, hex- or binary numbers or to generate string data, which can be copy-pasted into a freeze-value, an attachment or (using the File Browser) into a file.
The following screenshot displays a script/code fragment being evaluated:
Multiple Tabs[Bearbeiten]
Workspaces support multiple tabs. Click on the "Add Page" button or menu function, to get another tab.
Timer Functions[Bearbeiten]
There is also a Stopwatch and an AlarmTimer found in the Tab-Page menu. Use them for simple measuring tasks, or to get a timed feedback (for example, to get reminded of something to do or check during a long running test-task). The Alarm-Timer can be configured to ring after a time-period or at a final alarm time (good as a tea-timer !).
Snippet Management[Bearbeiten]
All text editors inside expecco share a common snippet database. Snippets are little text fragments which can be quickly pasted into any text editor by pressing some abbreviation followed by ALT-SPACE. For example, a programmer who often needs the string "self" to be typed in, might want to attach the word "self " to the snipplet-abreviation "s" and get the full string via "s"-ALT-SPACE. A number of predefined snippets (mostly for programmers) can be found and managed in the snippet manager. You may want to customize them according to your domain's requirements.
Collecting Text from Various Places[Bearbeiten]
A very common task is to collect text-fragments via copy-paste from various places (such as different input fields of a tested GUI application) and place them as a single line collection into a freeze-value, attachment or other string-field. The "Autofetch Selection" feature found in the "Edit" menu does exactly that for you: it monitors the clipboard, and appends every copied string (from any other application) into the workspace's text area.
Sorting[Bearbeiten]
Under the editor's right-button-menu, you will find various items under "More" -> "Tools" -> "Sort". These operate on the currently selected line-range. For example, to sort a number of lines, select them, and apply the "Sort Lines" function.
Generating Unique IDs[Bearbeiten]
The right-button-menu also provides a function to generate globally unique IDs (GUIDs or UUIDs). Try "More" -> "More" -> "Insert new UUID"
Code Evaluation[Bearbeiten]
Workspaces include code interpreters for JavaScript and Smalltalk Code. To evaluate a piece of code, select it, and apply the "doIt" menu function. Use "printIt" to paste the result. Finally "inspectIt" will open an inspector window on the result.
For example, to compute the square-root of the number 2, type:
2.sqrt()
apply "printIt", to get the result pasted at the current text-cursor position (already selected, so you can Cut or Copy it immediately for further use).
The syntax of the interpreter can be changed via the main-menu (under the "Workspace"-item), or via the right-click-menu in the lower-right syntax indicator field. Notice that the syntax-indicator field's visibility can be controlled via the "View"-menu's "Show Info" item. You may have to turn it on first.
The above example works when "JavaScript" is set as syntax. With Smalltalk syntax, you would have to enter:
2 sqrt
More Features[Bearbeiten]
The Notepad as described here is a somewhat stripped-down version of the full Smalltalk-Workspace application. You can find even more features (text-filters, variables etc.) in this application, which can be opened via
Smalltalk.WorkspaceApplication.open()
or by changing the default notepad in the "Settings" - "External Tools" dialog to "Smalltalk".
Back to Online Documentation.