eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'WorkspaceApplication':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: WorkspaceApplication


Inheritance:

   Object
   |
   +--Model
      |
      +--ApplicationModel
         |
         +--ToolApplicationModel
            |
            +--MultiViewToolApplication
               |
               +--WorkspaceApplication

Package:
stx:libtool
Category:
Interface-Smalltalk
Version:
rev: 1.419 date: 2024/04/09 13:24:15
user: stefan
file: WorkspaceApplication.st directory: libtool
module: stx stc-classLibrary: libtool

Description:


A simple wrapper around a WorkSpace-View, adding a pullDown menu.

copyright

COPYRIGHT (c) 2001 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

defaults
o  default
a place where the default workspaceApplication could be hooked in;
see SystemBrowser default and FileBrowser default on the intention...

o  defaultEditToolbarVisible

o  defaultInfoVisible

o  defaultMyWorkspaceDotWspFile

o  defaultToolbarVisible

o  filterTemplate

o  generatorTemplate

o  textProcessorTemplate

o  webServiceLinkName

help specs
o  helpSpec

image specs-execution
o  runScriptIcon
This resource specification was automatically generated
by the ImageEditor of ST/X.

Usage example(s):

     self runScriptIcon inspect
     ImageEditor openOnClass:self andSelector:#runScriptIcon
     Icon flushCachedIcons

o  runScriptWithDebugIcon
This resource specification was automatically generated
by the ImageEditor of ST/X.

Usage example(s):

     self runScriptWithDebugIcon inspect
     ImageEditor openOnClass:self andSelector:#runScriptWithDebugIcon
     Icon flushCachedIcons

interface specs
o  manageSnippetsDialogSpec
This resource specification was automatically generated
by the UIPainter of ST/X.

Usage example(s):

     UIPainter new openOnClass:WorkspaceApplication andSelector:#manageSnippetsDialogSpec
     WorkspaceApplication new openInterface:#manageSnippetsDialogSpec

o  toolBarSpec
This resource specification was automatically generated
by the UIPainter of ST/X.

Usage example(s):

     UIPainter new openOnClass:WorkspaceApplication andSelector:#toolBarSpec
     WorkspaceApplication new openInterface:#toolBarSpec

o  windowSpec
This resource specification was automatically generated
by the UIPainter of ST/X.

Usage example(s):

     UIPainter new openOnClass:WorkspaceApplication andSelector:#windowSpec
     WorkspaceApplication new openInterface:#windowSpec
     WorkspaceApplication open

o  windowSpecForInfoBar
This resource specification was automatically generated
by the UIPainter of ST/X.

Usage example(s):

     UIPainter new openOnClass:WorkspaceApplication andSelector:#windowSpecForInfoBar
     WorkspaceApplication new openInterface:#windowSpecForInfoBar

menu specs
o  bufferAddMenuSlice
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#bufferAddMenuSlice
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication bufferAddMenuSlice)) startUp

o  bufferMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#bufferMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication bufferMenu)) startUp

o  editMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#editMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication editMenu)) startUp

o  editModeInfoLabelMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#editModeInfoLabelMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication editModeInfoLabelMenu)) startUp

o  editToolBarMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#editToolBarMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication editToolBarMenu)) startUp

o  executionMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#executionMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication executionMenu)) startUp

o  fileMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#fileMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication fileMenu)) startUp

o  helpMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#helpMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication helpMenu)) startUp

o  languageInfoLabelMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#languageInfoLabelMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication languageInfoLabelMenu)) startUp

o  mainMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#mainMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication mainMenu)) startUp

o  manageSnippetDialogMenuSpec
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#manageSnippetDialogMenuSpec
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication manageSnippetDialogMenuSpec)) startUp

o  smalltalkMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#smalltalkMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication smalltalkMenu)) startUp

o  toolBarMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#toolBarMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication toolBarMenu)) startUp

o  viewMenuExtraSlice
This resource specification was automatically generated
by the MenuEditor of ST/X.

o  workspaceMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:WorkspaceApplication andSelector:#workspaceMenu
     (Menu new fromLiteralArrayEncoding:(WorkspaceApplication workspaceMenu)) startUp

private
o  createWorkspaceView

special startup
o  openEvaluationWorkspace
a workspace specially for beginners, learning Smalltalk

Usage example(s):

     self openEvaluationWorkspace

o  openForSinglePageDoing: aBlock
the original Workspace

o  openMyWorkspace
a workspace where I hold my personal expressions and snippets for doIts

Usage example(s):

openMyWorkspace_new leads to an error in root /, which we don't understand...

Usage example(s):

self openMyWorkspace_old.

Usage example(s):

      WorkspaceApplication openMyWorkspace

o  openMyWorkspace_new
open showing tabs for ALL bookmarked workspace files

o  openMyWorkspace_old
open showing the single file: MyWorkspace.wsp

o  openOnFile: aFilename
launch a new workspace on the contents of some file

Usage example(s):

     WorkspaceApplication openOnFile:'Makefile'

o  openScriptingWorkspace
a workspace specially for script development

o  openSpecialWorkspaceWith: aBlock named: name
common helper

o  openSystemWorkspace
the system workspace shows multiple tabs with hello, intro, help, etc...

Usage example(s):

     |ws b|
     ws := self openSystemWorkspace.
     ws addMyWorkspace.
     ws selectedWorkspaceIndexHolder value:(ws workspaces size).
     ws selectedWorkspace contents:'Tools::NewSystemBrowser open'; selectAll.
     ws selectedWorkspace 
        add:(b := Button label:'DoIt' action:[ws doIt. b destroy])

o  openWith: initialText
launch a new workspace with some initial contents.
The workspace will be opened in smalltalk syntax mode

Usage example(s):

     WorkspaceApplication openWith:'Transcript showCR:''hello world'''

o  openWith: initialText selected: selectedBoolean
launch a new workspace with some initial contents.
The workspace will be opened in smalltalk syntax mode

Usage example(s):

     WorkspaceApplication openWith:'Transcript showCR:''hello world'''

o  openWith: initialText selected: selectedBoolean title: titleString
launch a new workspace with some initial contents.
The workspace will be opened in smalltalk syntax mode

Usage example(s):

     WorkspaceApplication 
        openWith:'Transcript showCR:''hello world''' 
        selected:false
        title:'hello'

o  openWithGlobalsInspector
open a workspaceApp with a single initial pane, showing global variables.
Same as Smalltalk inspect, but looks nicer...

Usage example(s):

     self openWithGlobalsInspector

o  openWithText: initialText
like openWith, but will set the language to 'text', so it is not incorrectly syntax highlighted

Usage example(s):

     WorkspaceApplication openWithText:'foo 1 2 3 4'

o  openWithWorkspaceVariableInspector
open a workspaceApp with a single initial pane, showing workspace variables.
Same as Workspace workspaceVariables inspect, but looks nicer...

Usage example(s):

     self openWithWorkspaceVariableInspector

startup
o  open
the very first open opens a MyWorkspace

Usage example(s):

     MyWorkspaceOpened := nil.
     WorkspaceApplication open.

o  openRegularWorkspace
always open a normal MyWorkspace

o  openSnippetsManageDialogFor: anInstance
open the snippet management dialog

Usage example(s):

     self openSnippetsManageDialogFor:nil


Instance protocol:

aspects
o  autoDefineVariables
a value holder

o  autoFetchSelectionHolder
autoFetchSelection will automatically copy the current selection
and paste it at the cursor.
This makes it easy to collect multiple text fragments
(i.e. without having to go through the popup menus every time)

o  autoFetchSelectionMenuItemVisible
autoFetchSelection will automatically copy the current selection
and paste it at the cursor.
This makes it easy to collect multiple text fragments
(i.e. without having to go through the popup menus every time)

o  bookmarks

o  browseItMenuButtonVisible

o  canChangeLanguageHolder
return/create the 'canChangeLanguageHolder' value holder (automatically generated)

o  canChangeLanguageHolder: aValueHolder
set the 'canChangeLanguageHolder' value holder (automatically generated)

o  cursorColHolder

o  cursorColLabelHolder

o  cursorLineAndColumnLabelHolder

o  cursorLineHolder

o  cursorLineLabelHolder

o  deadKeysEnabledHolder
the current buffer's line-end cursor mode

o  deadKeysEnabledInAllEditorsHolder
all editor's dead key mode mode

o  doItMenuButtonVisible

o  editModeST80CursorHolder
the current buffer's line-end cursor mode

o  hasCryptLoaded

o  hasCryptedCodeLoaded

o  hasHistory

o  hasInfoLabel

o  inspectItMenuButtonVisible

o  languageInfoLabelHolder
'Syntax: ',

o  modeLabelHolder

o  namespaceHolder

o  namespaceInfoLabelHolder

o  printIntegersAsHolder

o  printItMenuButtonVisible

o  profileItMenuButtonVisible

o  setWindowLabel: label
Modified (format): / 15-03-2021 / 15:02:37 / cg

o  setWindowLabel: label language: language

o  smalltalkMenuEnabledHolder

o  syntax: aProgrammingLanguageOrNil
the argument must sth. like SmalltalkLanguage

o  syntaxHolder

o  toolBarView

aspects-queries
o  anyWorkspaceVariableIsDefined

o  canAddBookmark
true

o  canUndoEdit

o  isSQLWorkspaceAvailable

o  isSQLWorkspaceSelected

o  isScriptingWorkspaceSelected

o  isWebBrowserAvailable

o  selectedWorkspaceIsTextView

autofetch selection
o  autoFetchSelection
if on, the clipboard is watched, and when changed automatically pasted

o  autoFetchSelection: aBoolean
if on, the clipboard is watched,
and whenever it changes, it will be automatically pasted

o  autoFetchSelectionLines

o  itemFromClipboard
fetch the clipBoard text and paste it selected.

o  selectionClear: foo
Transcript showCR:foo.

o  startClipboardWatcher

o  stopClipboardWatcher

o  waitForClipBoardToChange
endless loop, watching out for clipBoard changes.
Then pastes the text at the cursor position.
Should be forked off

defaults
o  defaultEvaluatorSyntax

o  defaultFileNameForLoad

o  defaultFileNameForSave
eval-ws

o  defaultFileNameForSaveAll

o  defaultNameSpaceForDoIts

o  defaultPatternLoad

o  executeMenuVisible

o  thisIsASmalltalkWorkspace
can be redefined in a subclass to disable smalltalk-specific menu items
(expecco uses workspaces as scratchpads)

o  thisIsASmalltalkWorkspaceAndAutoFetchMenuItemVisible
Modified (format): / 18-11-2022 / 11:14:23 / cg

o  thisWorkspaceCanEvaluate
can be redefined in a subclass to disable smalltalk-specific menu items
(expecco uses workspaces as scratchpads)

o  workspaceMenuVisible

drag & drop
o  droppedFile: aFilename in: aComponent
this is a notification from my textView component

help specs
o  helpSpec
dynamically adjust the menuSave item's helpText

o  updateHelpSpec: aSpec
dynamically adjust the menuSave item's helpText (ask for name or use previous name)

initialization & release
o  closeRequest
asks for permission before closing

o  initialSyntax: aLanguage

o  initialize
autoDefineDefault := #doIt.

o  postBuildEditModeInfoLabel: aLabel

o  postBuildWith: aBuilder
force geometry update

o  postOpenWith: aBuilder
(comment from inherited method)
starts the active help for this tool (if turned on in the settings)
and updates the info label and the font's (from the settings)

o  processEvent: anEvent
filter double click in line-label.
Return true, if I have eaten the event

menu-actions
o  addWorkspaceVariable

o  askForEncryptionKeyFor: algorithm

o  askForFilterBlock: message template: template rememberIn: nameOfClassVar

o  askForFilterBlock: message template: template rememberIn: nameOfClassVar openFilteredInto: openFilteredHolder
ask for a filter block, to reject lines.
openFiltered is invoked wth a boolean to specify if the rejected lines should be shown
or else removed from the text

o  autoDefineVariablesChanged

o  basicInspectIt
forwarded from main menu to my current workspace

o  browseImplementors

o  browseImplementorsOfIt

o  browseIt
forwarded from main menu to my current workspace

o  browseReferencesToIt

o  browseSenders

o  checkForUnencryptedSave
return false, if user does NOT want to save it unencrypted

o  clearHistory

o  compareTextAgainst

o  debugIt
forwarded from main menu to my current workspace

o  encryptionAlgorithm

o  findClassAndBrowse

o  inspectIt
forwarded from main menu to my current workspace

o  inspectIt: isBasicInspector
forwarded from main menu to my current workspace

o  inspectWorkspaceVariables
opens an inspector on GLOBAL workspace variables

o  loadFile: aFileName encoding: encodingSymbolOrNil label: label
This small hack allows programmers to have their own
MyWorkspace.wsp in their ~/.smalltalk directory

o  manageSnippets
open the snippet management dialog

Usage example(s):

self openDialogInterface:#manageSnippetsDialogSpec withBindings:bindings

o  menuLoadEncryptedFrom
ask for a key and a filename, then decrypt and show the contents.
Useful for pasword files

o  menuSQLConnect
for the SQL workspace, to connect via the main menu

o  menuSave
menu operation: save the selected tab's contents to a file

o  menuSaveAs
redefined to check if the original came from an encrypted file,
before a dialog asking for a filename and saving unencrypted

o  menuSaveAsScript
ask for a name then save as an stx script file

o  menuSaveAsScriptAs: filenameOrNil
if filenameOrNil is nil, ask for a name first;
then save as an stx script file.
Returns the filename or nil, if not saved (i.e. when user cancels the dialog)

o  menuSaveEncryptedAs
place the size info at some random position within the random bytes

o  newEvaluationWorkspace
open a new window with an evaluation workspace

o  newScriptingWorkspace
open a new window with a scripting workspace

o  newSystemWorkspace
open a new window with a system workspace

o  openDocumentation
opens the documentation file

o  openEditingDocumentation
opens the documentation file

o  pasteAndExecute: aString

o  pasteSnippet
choose a snippet in a dialog and paste it

o  profileIt
forwarded from main menu to my current workspace

o  redoLastDoIt

o  removeAllWorkspaceVariables
removes all global workspace variables

o  removeGlobalVariable

o  removeSharedPool

o  removeWorkspaceVariable

o  renameWorkspace: wsIndex to: newName

o  saveAsScriptAs: filename
save as an stx script file (writes both a scriptand a bat for windows)

o  saveBatchForScript: scriptFilename
saves a .bat to call the script

o  setCompilerForSyntax

o  setCompilerForSyntaxIn: aWorkspace
compilerClass := (language evaluatorClass "self compilerClassForSyntaxName:syntax").

o  setNameSpaceForDoIts

o  spyOnIt
forwarded from main menu to my current workspace

o  switchToBookmarkEntry: bookmark

o  terminateBackgroundProcesses

o  timeIt
forwarded from main menu to my current workspace

menu-actions-adding
o  addBookmark

o  addClassVariableInspector

o  addEvaluationWorkspace

o  addGlobalVariable

o  addGlobalVariableInspector

o  addInspectorOn: aValue basic: isBasicInspector suppressPseudoSlots: suppressPseudoSlots
Inspector2 does not work yet!

o  addInspectorOn: aValue inspectorClass: inspectorClass suppressPseudoSlots: suppressPseudoSlots
v allowFollow:true.

o  addMyWorkspace

o  addNamespaceInspector

o  addNamespaceInspectorFor: aNameSpaceOrSharedPool

o  addSQLWorkspace

o  addScriptingWorkspace

o  addSelectionToSnippets
add a snippet for the selected string

o  addSharedPool

o  addSharedPoolInspector

o  addStopWatch
avoid making stx:libwidg3 a prerequisite.

o  addTeaTimer
you think that is a useless gimmick ?
I use it in the office and as a wakeup clock timer

o  addTerminal
mhm - xterm embedding seems to no longer work; the default from user prefs is therefore false

o  addWebBrowser

o  addWorkspaceVariableInspector
adds an inspector on GLOBAL workspace variables

o  addWorkspaceWithSameContents

o  menuAddBookmarkTo: folder
not a text view - nothing to bookmark

menu-actions-editing
o  changesBrowserOnText

o  editBookmarks

o  editModeInsert

o  editModeInsertAndSelect

o  editModeOverwrite

o  fileInSelectedText
filein the selected workspace's selected contents as if read from a file

o  fileInText
filein the selected workspace's contents as if read from a file

o  filterText
a filterblock is asked for, which is applied to the
selected line range.
Each line for which the filter evaluats to false is removed

o  generateText
a generatorblock is asked for, which is evaluated to generate
lines onto an output stream.
The generated text is inserted (or replaces the current selection)

o  googleSpellingSuggestion

o  googleTranslate: fromToModeString
translate the selected text and paste it after the selection.

o  indent

o  pasteLastDoIt

o  processText
a block is asked for, which is applied to each line of the selected line range.
Each line is replaced by the corresponding output of the processing block

o  undent

o  undoEdit

menu-dynamic
o  bookmarkMenu

o  editModeInfoLabelMenu

o  languageListMenuSlice
dynamically generate a slice containing the available
programming languages

o  makeRecentDoItsMenuFor: aSelector

o  namespaceInfoLabelMenu

o  namespaceInfoLabelMenuHolder

o  pasteRecentDoItMenu

o  recentDoItsMenuFor: aSelector

o  redoRecentDoItMenu

private
o  askIfAnyModified: question yesButton: yesButtonText
reset modified flag so question is asked only once

o  compilerClassForSyntaxName: syntax

o  compilerClassOf: aWorkspace
catch, because it could be a non-edit view there (VT100, TeaTimer etc.)

o  createEvaluationWorkspace
this workspace is neat in having separate panes
for input, output and a list of recent expresson results.
It is also perfect for beginners (but not only).

o  createScriptingWorkspace
this workspace is perfect for script development (stx --script file.st).
It adds an input view, an output view and highlights stdErr in a separate color.
Lets the script run in a separate, fresh and clean ST/X

o  createWorkspace
create a view to be put into a tab

o  createWorkspaceView
create normal workspace tab

o  createWorkspaceViewForText
creates a language unaware workspace

o  do: theCode in: workspace withExecTimeInfoIn: timeLabel showResultIn: resultViewOrNil
timeLabel helpText:'Code executed by a slow AST interpreter; time includes parse time'.

o  isModifiedWorkspace: aView

o  lastDoItsString

o  selectedLintRules
bad obfuscated design; this is called from the LintService to ask for a lintRule set;
I'd rather set this explicitly (I call you) instead of you call me

o  syntaxFromEvaluatorClass: aClass
knowing the evaluator class, determine the syntax highlighter class

o  workspaceSelectionChanged
attach line, col and mode holders to the current workspace window

special startup
o  openSystemWorkspace
create the tabs for the initial welcome system workspace

Usage example(s):

     |ws b|
     ws := self openSystemWorkspace.
     ws addMyWorkspace.
     ws selectedWorkspaceIndexHolder value:(ws workspaces size).
     ws selectedWorkspace contents:'Tools::NewSystemBrowser open'; selectAll.
     ws selectedWorkspace 
        add:(b := Button label:'DoIt' action:[ws doIt. b destroy])

user actions
o  infoVisibilityChanged
(comment from inherited method)
#CodeView.

o  namespaceChangedByUser
remember as default for next new workspace

o  runScriptIn: ws debug: debug
Run button of a scripting workspace was pressed.
Save the script, execute it with stx --script

o  syntaxChangedByUser
remember as default for next new workspace

o  toolBarVisibilityChanged
(comment from inherited method)
force it to recompute its dimension



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:26:23 GMT