From VisualWorks®, 7.6 of February 8, 2008 on March 3, 2008 at 9:42:55 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>WorkspaceImportsDialog</name> <environment>Tools</environment> <super>UI.SimpleDialog</super> <private>false</private> none namespaces importAllHolder <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.WorkspaceImportsDialog
The "Imported Namespaces" dialog brought up by the "Smalltalk>Namespaces..." menu item. Instance Variables: namespaces <MultiSelectionInList> Model of the "some" namespace list. importAllHolder <ValueHolder with: Boolean> Holds a Boolean indicating whether the user wants to import all namespaces or only those selected in the "some" namespace list.
</comment> <class> <name>WorkspacePage</name> <environment>Tools</environment> <super>UI.ApplicationModel</super> <private>false</private> none workspace label verboseLabel filename fileTimestamp textModel unacceptedText savedSelection savedFileTimestamp textModelOverride <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.WorkspacePage
This is the subapplication that takes care of text editing for various workspaces. Instance Variables: workspace <No Workspace | AbstractWorkspace subclass> The workspace that contains this page; supplies local variables and the receiver for doits. label <String> The label of this page. Returned as the page's #displayString and may be used to differentiate between several pages in a UI. When a page is associated with a file by saving, the label is changed to become the file name sans path information. verboseLabel <String | nil> The text that appears on the status bar when the page is selected. filename <Filename | nil> If a page is associated with a file, the name of that file. fileTimestamp <Timestamp | nil> The modification timestamp of a file at the time the file was read into the workspace. Before saving, it is compared to the timestamp of the file at that time to determine whether saving can overwrite changes made by other tools. textModel <PluggableAdaptor> redirecting value requests to the page, so that the page can either read or write the file it displays or use its textModelOverride (see below). unacceptedText <String | nil> When a page that has unsaved changes is uninstalled by the higher-level application, the unsaved text from the text editor controller is preserved here. If this variable is nil, the page is either active or had no unsaved changes when deactivated. savedSelection <Array | nil> When the unsaved text is preserved, the selection start and stop indices are saved here as an array of two elements. savedFileTimestamp <Timestamp | nil> When unsaved text is preserved, the original timestamp of the file where the text came from is preserved as well. When the interface is rebuilt later, the timestamp is restored to be the original one (by which time the original timestamp may have been overridden by the timestamp of the file at the time of rebuilding). textModelOverride <ValueHolder | nil> In some cases, such as when editing text in a value holder in the image, the page uses this as the holder for the text it shows. In such cases, 'accept' in the text view will save the text displayed into the holder. File>Save, however, will request a file name as save the text into a file. This holder is also used when opening a page on a non-existent file with some initial text, to store the initial text.
</comment> <class> <name>WorkspaceVariablePool</name> <environment>Tools</environment> <super>Kernel.NameSpace</super> <private>false</private> none workspace <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.WorkspaceVariablePool
A specialized NameSpace to be used as a pool of workspace local variables. A regular namespace would work just as well, but this subclass slips in a different inspector class, so we have more control over what the user gets as the inspector. Instance Variables: workspace <Workspace> The workspace this pool belongs to, to get import information.
</comment> <class> <name>AbstractWorkspace</name> <environment>Tools</environment> <super>UI.ApplicationModel</super> <private>false</private> none locals importAll specificImports importSummaryHolder pageExplanationHolder statusBarVisible encodingChannel menuBarHolder <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.AbstractWorkspace
This is the abstract superclass of various kinds of workspaces. Typically, a workspace manages some text and some local variables. This abstract superclass takes care of variable management and leaves text management as well as the actual GUI that takes care of switches between text(s) and variables up to the specific subclass. This class does, however, manage some GUI things--such as the window toolbar or value holders used by the status bar's page explanation and import summary boxes. It also assumes subclasses will implement the following methods: currentPage currentTextPage isAtTextPage Instance Variables: locals <WorkspaceVariablePool> The pool containing this workspace's local variables. importAll <Boolean> True if this workspace should compile the code it evaluates in context of all namespaces currently in the system. specificImports <Collection of: NameSpace> If 'importAll' if false, only namespaces included in this collection are imported when compiling the code in the workspace. menuBar <ValueHolder with: Menu> A holder with the workspace window menu bar. importSummaryHolder <ValueHolder with: String> The model of a status bar box showing the summary of currently imported namespaces. pageExplanationHolder <ValueHolder with: String> The model of a status bar box showing the explanation of the currenly displayed page. encodingChannel <ValueHolder with: Symbol> The encoding menu sets the value of this holder to be the currently selected encoding. Various component may register themselves as dependents to track preferred encoding changes. Class Variables ShowStatusBar <Boolean> If true (the default value) all workspaces open with the status bar visible. ShowToolBar <Boolean> If true (the default value) all workspaces open with the toolbar visible. UseMultiPageWorkspaces <Boolean> If true (the default value) open the new-style workspace.
</comment> <class> <name>Workspace</name> <environment>Tools</environment> <super>Tools.AbstractWorkspace</super> <private>false</private> none textPage inspectorPage currentPage <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.Workspace
This is a more traditional workspace, with a single text area to edit text, however it can switch the view to an inboard inspector on the pool of locals. Instance Variables: textPage <WorkspacePage> The page providing the text editing interface. inspectorPage <WorkspaceInspectorPage> The page providing the inspector interface. currentPage <WorkspacePage | WorkspaceInspectorPage> The currently displayed page, either the textPage or inspectorPage.
</comment> <class> <name>WorkspaceCompilerErrorHandler</name> <environment>Tools</environment> <super>Kernel.InteractiveCompilerErrorHandler</super> <private>false</private> none workspace <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.WorkspaceCompilerErrorHandler
A specialized error handler involved in workspace-local variables implementation. It is essentially an InteractiveErrorHandler. The only difference is the treatment of undefined variables. They are silently passed on to the workspace to be added to the pool of local variables, then compilation continues. Instance Variables: workspace <Workspace> The workspace that should receive all undeclared variables. Class Variables SilentlyDeclareVariables <Boolean> If true (the default) then assume that an undeclared variable is a workspace local variable
</comment> <class> <name>WorkspaceInspectorPage</name> <environment>Tools</environment> <super>Tools.Trippy.InspectorHolder</super> <private>false</private> none <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.WorkspaceInspectorPage
This is the inspector page displaying the workspace local variables. (Though technically it can contain any inspector on any object). It is just an subclass of the regular InspectorHolder extended to understand the workspace page protocol.
</comment> <class> <name>Workbook</name> <environment>Tools</environment> <super>Tools.AbstractWorkspace</super> <private>false</private> none pageHolder lastInstalledPage <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.Workbook
This is the new-style (as of 5i.4) workspace. It consists of a number of text pages selected using a tab control, as well as a separate page for workspace local variables. Instance Variables: pageHolder <SelectionInList> Pages currently contained by this workspace. Pages are instances of either WorkspacePage (text pages) or WorkspaceInspectorPage (variable page). A workbook contains one or more text pages followed by one variable page. lastInstalledPage <WorkspacePage | WorkspaceInspectorPage> The current page of the workspace. Preserved so the action triggered on a page change can refer to the previous page.
</comment> <class> <name>NoWorkspace</name> <environment>Tools</environment> <super>Core.Object</super> <private>false</private> none <imports></imports> <category>Tools-Workspace</category> <attributes> <package>Tools-Workspace</package> </attributes> </class> <comment> Tools.NoWorkspace
Instances of this class stand in for "real" parent workspaces of WorkspacePages used in a standalone mode (as undecorated windows similar to the classic Smalltalk-80 workspaces).
</comment> <name>PopularEncodings</name> <environment>Tools.WorkspacePage</environment> <private>false</private> <constant>false</constant> <category>encodings</category> <initializer>OrderedCollection new</initializer> <attributes> <package>Tools-Workspace</package> </attributes> <name>SilentlyDeclareVariables</name> <environment>Tools.WorkspaceCompilerErrorHandler</environment> <private>false</private> <constant>false</constant> <category>Settings</category> <initializer>true</initializer> <attributes> <package>Tools-Workspace</package> </attributes> <name>ShowToolBar</name> <environment>Tools.AbstractWorkspace</environment> <private>false</private> <constant>false</constant> <category>Settings</category> <initializer>true</initializer> <attributes> <package>Tools-Workspace</package> </attributes> <name>UseMultiPageWorkspaces</name> <environment>Tools.AbstractWorkspace</environment> <private>false</private> <constant>false</constant> <category>Settings</category> <initializer>true</initializer> <attributes> <package>Tools-Workspace</package> </attributes> <name>ShowStatusBar</name> <environment>Tools.AbstractWorkspace</environment> <private>false</private> <constant>false</constant> <category>Settings</category> <initializer>true</initializer> <attributes> <package>Tools-Workspace</package> </attributes> <methods> Tools.WorkspaceImportsDialog <category>private</category>
allNameSpaces ^Root withAllNameSpaces asSortedCollection: [:a :b | a fullName < b fullName]
importTypeChanged (builder componentAt: #namespaces) isEnabled: self importAllHolder value not
</methods> <methods> Tools.WorkspaceImportsDialog <category>accessing</category>
importAll ^self importAllHolder value
specificImports ^self namespaces selections
</methods> <methods> Tools.WorkspaceImportsDialog <category>aspects</category>
importAllHolder "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^importAllHolder isNil ifTrue: [importAllHolder := nil asValue] ifFalse: [importAllHolder]
namespaces "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^namespaces isNil ifTrue: [namespaces := MultiSelectionInList new] ifFalse: [namespaces]
</methods> <methods> Tools.WorkspaceImportsDialog <category>initialize-release</category>
initializeImportAll: aBoolean specific: namespaceCollection self namespaces list: self allNameSpaces. self importAllHolder value: aBoolean. self namespaces selections: namespaceCollection
postBuildWith: aBuilder self importAllHolder onChangeSend: #importTypeChanged to: self. self importTypeChanged
</methods> <methods> Tools.WorkspacePage <category>actions</category>
dragEntry: aDragContext ^(#(inspectorObject inspectorObjects) includes: aDragContext data key) ifTrue: [#dropEffectCopy] ifFalse: [#dropEffectNone]
dragOver: aDragContext ^(#(inspectorObject inspectorObjects) includes: aDragContext data key) ifTrue: [#dropEffectCopy] ifFalse: [#dropEffectNone]
drop: aDragContext #inspectorObject == aDragContext data key ifTrue: [self workspace addAllToLocals: aDragContext data clientData. ^#dropEffectCopy]. ^#dropEffectNone
fileItIn self textEditor fileItIn
maybeSaveIfCancel: aBlock "If the page has unsaved changes, suggest the user to save them using the usual Yes-No-Cancel dialog. Answer a Boolean indicating whether it is OK to close the window." | reply | self textEditor accepted ifFalse: [reply := Dialog choose: (#SaveChanges << #dialogs >> 'Save changes?') labels: (Array with: (#Yes << #dialogs >> 'Yes') with: (#No << #dialogs >> 'No') with: (#Cancel << #dialogs >> 'Cancel')) values: #(yes no cancel) default: #yes. #cancel == reply ifTrue: [^aBlock value]. #yes == reply ifTrue: [^self saveIntoFile]]. ^true
requestFileNameAndSave | newName | newName := Dialog requestNewFileName: #SaveWorkspaceToFileColon << #dialogs >> 'Save the workspace to file:' default: self suggestFileName. newName isEmpty ifTrue: [^false]. self filename: newName. ^self acceptText
saveIntoFile "Save the contents into a file. Prompt for a filename if needed. Answer true if saved successfully, false otherwise." ^filename isNil ifTrue: [self requestFileNameAndSave] ifFalse: [self acceptText]
</methods> <methods> Tools.WorkspacePage <category>privileged</category>
changeRequest "If a page's builder is nil, it has no editor yet. But it also means it hasn't been open yet and has no changes to lose." ^self builder isNil or: [self textEditor accepted or: [self maybeSaveIfCancel: [^false]]]
deactivate "Sent by the container application just before switching from this page to another one. Controller text is preserved to be reinstalled as unaccepted when the page is rebuilt later." | editor | editor := self textEditor. editor accepted ifFalse: [unacceptedText := editor text. savedFileTimestamp := fileTimestamp. savedSelection := Array with: editor selectionStartIndex with: editor selectionStopIndex]
encodingChanged (self hasUnsavedChanges and: [self okToRereadFile not]) ifTrue: [^self]. builder ifNotNil: [self textEditor cancel]
giveFocusToEditor (self builder componentAt: #text) takeKeyboardFocus
refresh "Refresh is sent as soon as the page becomes current again." unacceptedText notNil ifTrue: [self restoreUnacceptedText. unacceptedText := nil]. builder window isOpen ifTrue: [(builder componentAt: #text) takeKeyboardFocus]
testFileLoading self readText
</methods> <methods> Tools.WorkspacePage <category>accessing</category>
displayString ^self label asString
doItEnvironment ^self workspace doItEnvironment
doItHandler ^self workspace doItHandler
doItReceiver ^self workspace doItReceiver
label ^label
label: aString label := aString
verboseLabel ^verboseLabel notNil ifTrue: [verboseLabel] ifFalse: [filename isNil ifTrue: [(#TextOrSmalltalkCode << #labels >> 'Text or Smalltalk code') asString] ifFalse: [filename asString]]
verboseLabel: aStringOrNil verboseLabel := aStringOrNil. workspace updatePage
workspace ^workspace
workspace: aWorkspace workspace encodingChannel retractInterestsFor: self. workspace := aWorkspace. workspace encodingChannel onChangeSend: #encodingChanged to: self
</methods> <methods> Tools.WorkspacePage <category>private</category>
acceptText self textEditor accept. ^true
compareTextWithFile "Open a Differator on the text currently on the page (on the left) and the text from the file on the right." | text fileText | text := self textEditor text copy. fileText := [self filenameWithEncoding contentsOfEntireFile] on: OsError do: [:ex | ex return: String new]. (Differator newOn: text and: fileText) open
encoding ^workspace encodingChannel value
fileChangedOnDisk "Make sure that the timestamp of the file on the disk has not changed behind our back. If it has, it means the file has been saved into in the meantime (possibly even by us in an unsaved image session). Answer true if it is OK to save the file, false if saving may overwrite existing changes." ^fileTimestamp ~= self fileOnDiskTimestamp
filenameWithEncoding ^filename asFilename withEncoding: self encoding
fileOnDiskTimestamp filename isNil ifTrue: [^nil]. ^[filename modificationTimestamp] on: OsError do: [:ex | ex return: nil]
hasUnsavedChanges builder isNil ifTrue: [^false]. ^self textEditor accepted not
okToRereadFile ^Dialog confirm: (#okToRereadFile << #labels >> 'Reread the file using the new encoding?<n>(Unsaved changes will be lost).') expandMacros initialAnswer: false
rememberFileTimestamp fileTimestamp := self fileOnDiskTimestamp
restoreUnacceptedText self textEditor view editText: unacceptedText. self textEditor selectionStartIndex: savedSelection first stopIndex: savedSelection last. fileTimestamp := savedFileTimestamp. self textEditor notAccepted
suggestFileName | labelString | labelString := label asString. ^(labelString includes: $.) ifTrue: [labelString] ifFalse: [labelString, '.ws']
textEditor ^(builder componentAt: #text) widget controller
</methods> <methods> Tools.WorkspacePage <category>testing</category>
canBOSSObjects ^false
hasEmphasis | text | text := self textEditor text. ^(text emphasisAt: 1) notNil or: [text hasChangeOfEmphasis]
isAccepted "If a page's builder is nil, it has no editor yet. But it also means it hasn't been open yet and has no changes to lose." ^builder isNil or: [self textEditor accepted and: [unacceptedText isNil]]
</methods> <methods> Tools.WorkspacePage <category>initialize-release</category>
contents: aTextOrString textModelOverride := aTextOrString asValue
filename: aFilenameOrNil | candidate default | aFilenameOrNil ifNil: [^filename := nil]. candidate := aFilenameOrNil asLogicalFileSpecification componentStrings. default := Filename defaultDirectory asLogicalFileSpecification componentStrings. ((candidate first: default size) isSameSequenceAs: default) ifTrue: [candidate := candidate last: candidate size - default size]. filename := LogicalFilename fromComponents: candidate. self rememberFileTimestamp. aFilenameOrNil notNil ifTrue: [label := filename tail]
initialize workspace := NoWorkspace new. label := (#Workspace << #labels >> 'Workspace'). textModel := (PluggableAdaptor on: self) getSelector: #text putSelector: #text:
postBuildWith: aBuilder self textEditor initializeMenuForCodeWithFileItIn; doNotHandleLocally: #explain; autoAccept: false
postOpenWith: aBuilder (aBuilder componentAt: #text) takeKeyboardFocus
preBuildWith: aBuilder super preBuildWith: aBuilder. aBuilder labelAt: #label put: label
release workspace encodingChannel retractInterestsFor: self. super release
textHolder: aValueModel textModelOverride := aValueModel
</methods> <methods> Tools.WorkspacePage <category>actions-text</category>
copySelection self textEditor copySelection
cut self textEditor cut
debugIt self textEditor debugIt
doIt "This method processes menu shortcuts, and Ctrl+D is dispatched here for both shifted and unshifted keystrokes, which are handled differently by the editor. We match that here for consistency." InputState default shiftDown ifTrue: [self textEditor displayDate] ifFalse: [self textEditor doIt]
explain self textEditor explainFor: workspace
find self textEditor find
inspectIt self textEditor inspectIt
paste self textEditor paste
printIt self textEditor printIt
replace self textEditor replace
selectAll | controller | controller := self textEditor. controller selectFrom: 1 to: controller text size
undo self textEditor undo
</methods> <methods> Tools.WorkspacePage <category>private-file access</category>
okToSaveTextFrom: aContoller | choice | self fileChangedOnDisk ifFalse: [^true]. choice := Dialog choose: (#fileChangedByOtherProgram << #dialogs >> 'The file has been changed on the disk independently from this workspace. Saving may override other changes. Save anyway?') labels: (Array with: (#Yes << #dialogs >> 'Yes') with: (#No << #dialogs >> 'No') with: (#Compare << #dialogs >> 'Compare')) values: #(yes no compare) default: #no. choice = #compare ifTrue: [self compareTextWithFile]. ^choice = #yes
readText | text | text := [self filenameWithEncoding contentsOfEntireFile] on: OsError do: [:ex | ex isNested ifTrue: [ex pass] ifFalse: [ ^(#cannotReadTheFile << #dialogs >> '<cannot read the file>') asText emphasizeAllWith: #italic]]. self rememberFileTimestamp. ^text
text ^(textModelOverride notNil ifTrue: [textModelOverride value] ifFalse: [filename notNil ifTrue: [self readText] ifFalse: [String new]]) asText addHyperlinkEmphases
text: aText ^filename notNil ifTrue: [self writeText: aText] ifFalse: [self textHolder value: aText. true]
writeText: aText | stream | stream := self filenameWithEncoding writeStream. [stream nextPutAll: aText] ensure: [stream close]. self rememberFileTimestamp. textModelOverride := nil
</methods> <methods> Tools.WorkspacePage <category>aspects</category>
textHolder "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^textModelOverride isNil ifTrue: [textModelOverride := String new asValue] ifFalse: [textModelOverride]
textModel "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^textModel isNil ifTrue: [textModel := String new asValue] ifFalse: [textModel]
</methods> <methods> Tools.WorkspacePage class <category>accessing</category>
readFrom: aStream ^aStream contents
</methods> <methods> Tools.WorkspacePage class <category>instance creation</category>
filename: aFilenameOrString "Create a page containing text from the file of the given filename. The client should be prepared to catch possible OsErrors." ^(self new) filename: aFilenameOrString; testFileLoading; yourself
filename: aFilename contents: aTextOrString "Create a page with the given filename (a label is derived from that filename) and the contents, presumably coming from that file." ^(self new) filename: aFilename; contents: aTextOrString; yourself
labeled: aString "Create a new empty page unassociated with any file, with aString as the label." ^self new label: aString
labeled: aString on: aValueModel "Create a new page unassociated with any file, using aValueModel to hold the text being edited." ^self new label: aString; textHolder: aValueModel; yourself
labeled: aString with: aText "Create a new page unassociated with any file, with aString as the label and aText as the initial contents." ^self new label: aString; contents: aText; yourself
on: aValueModel "Create a new page unassociated with any file, using aValueModel to hold the text being edited." ^self new textHolder: aValueModel; yourself
on: aValueModel labeled: aString ^self labeled: aString on: aValueModel
with: aText "Create a new page unassociated with any file, with aString as the label and aText as the initial contents." ^self new contents: aText; yourself
with: aText labeled: aString ^self labeled: aString with: aText
</methods> <methods> Tools.WorkspacePage class <category>window opening</category>
open ^self new open
openOnHolder: aValueModel "Open a new workspace with a text holder as the content holder." "self openOnHolder: 'Hello world' asValue" ^(self on: aValueModel) open
openOnHolder: aValueModel labeled: aString "Open a new workspace with a text holder as the content holder." "self openOnHolder: 'Hello world' asValue labeled: 'Example' " ^(self labeled: aString on: aValueModel) open
openWith: aString "Open a new workspace with aString as the initial contents." "self openWith: 'Hello world'" ^(self with: aString) open
openWith: aString labeled: labelString "Open a new workspace with aString as the initial contents." "self openWith: 'Hello world' labeled: 'Example' " ^(self labeled: labelString with: aString) open
</methods> <methods> Tools.WorkspacePage class <category>system workpages</category>
cautiousAdaptorOn: aValueModel | confirmMessage | confirmMessage := #confirmChangeSystemWorkspaceContent << #dialogs >> 'About to change the workspace content saved in this image. Are you sure?'. ^(PluggableAdaptor on: aValueModel) getBlock: [:m | m value] putBlock: [:m :v | (Dialog confirm: confirmMessage) ifTrue: [m value: v]] updateBlock: [:m :a :p | true]
installationWorkspacePage ^WorkspacePage labeled: (#installationWorkspace << #labels >> 'Installation Workspace') on: (self cautiousAdaptorOn: ComposedTextView.InstallationWorkspace)
systemWorkspacePage ^WorkspacePage labeled: (#systemWorkspace << #labels >> 'System Workspace') on: (self cautiousAdaptorOn: ComposedTextView.SystemWorkspace)
</methods> <methods> Tools.WorkspacePage class <category>encodings menu</category>
addDefaultAndSourceEncodingsTo: aMenu for: aValueModel | encodingKey | encodingKey := (StreamEncoder lookupEncoderDirectory: #default) streamEncodingType asString. aMenu addItem: (self buildEncodingItem: ((#defaultEncoding << #menus >> 'Default (<1s>)') expandMacrosWith: encodingKey) key: #default for: aValueModel). encodingKey := (StreamEncoder lookupEncoderDirectory: #Source) streamEncodingType asString. aMenu addItem: (self buildEncodingItem: ((#sourceEncoding << #menus >> 'Source (<1s>)') expandMacrosWith: encodingKey) key: #Source for: aValueModel)
addLineTo: aMenu aMenu addLine
addOtherItemTo: aMenu for: aValueModel | item | item := MenuItem labeled: (#otherEllipsis << #menus >> 'Other...') asString. item value: [self chooseEncodingFor: aValueModel]. aMenu addItem: item
addPopularEncodingsTo: aMenu for: aValueModel | encodings | encodings := self sortedPopularEncodings. (encodings includes: aValueModel value) ifFalse: [encodings add: aValueModel value]. encodings do: [:key | (#(default Source) includes: key) ifFalse: [aMenu addItem: (self buildEncodingItem: key asString key: key for: aValueModel)]].
buildEncodingItem: labelString key: aSymbol for: aValueModel ^(MenuItem labeled: labelString) indication: [aValueModel value = aSymbol]; value: [aValueModel value: aSymbol]; yourself
buildEncodingMenuFor: aValueModel | menu | menu := Menu new. self addDefaultAndSourceEncodingsTo: menu for: aValueModel; addLineTo: menu; addPopularEncodingsTo: menu for: aValueModel; addLineTo: menu; addOtherItemTo: menu for: aValueModel. ^menu
chooseEncodingFor: aValueModel | encodings choice | encodings := StreamEncoder availableEncodings asSet. encodings remove: #Source ifAbsent: []; remove: #default ifAbsent: []. encodings := encodings asSortedStrings. choice := Dialog choose: (#selectEncoding << #dialogs >> 'Select Encoding') fromList: encodings values: encodings lines: 20 cancel: [nil]. choice notNil ifTrue: [aValueModel value: choice. self rememberPopularEncoding: choice]
forgetPopularEncodings "self forgetPopularEncodings" PopularEncodings := OrderedCollection new
maximumEncodingsToRemember ^8
rememberPopularEncoding: aSymbol (#(default Source) includes: aSymbol) ifFalse: [PopularEncodings remove: aSymbol ifAbsent: []. PopularEncodings addFirst: aSymbol. [PopularEncodings size > self maximumEncodingsToRemember] whileTrue: [PopularEncodings removeLast]]
sortedPopularEncodings ^PopularEncodings asSortedStrings
</methods> <methods> Tools.WorkspacePage class <category>examples</category>
example1 "A standalone workspace page can be used as a replacement of SimpleWorkspace. Thanks to Terry Raymond for the idea." "self example1" (WorkspacePage new textHolder: (#initialText << #examples >> 'initial text') asString asValue; label: (#PrimitiveWorkspaceExample << #examples >> 'Primitive workspace example'); yourself) open
</methods> <methods> Tools.WorkspaceVariablePool <category>initialize-release</category>
initialize: aWorkspace workspace := aWorkspace
</methods> <methods> Tools.WorkspaceVariablePool <category>accessing</category>
updateImports self importsObjects: (workspace imports collect: [:each | GeneralNameSpaceImport pathString: each fullName])
workspace ^workspace
</methods> <methods> Tools.WorkspaceVariablePool <category>collection accessing</category>
removeKey: key ifAbsent: aBlock | bind | bind := bindings lookup: key. ^bind == nil ifTrue: [aBlock value] ifFalse: [self simpleRemoveKey: key]
</methods> <methods> Tools.AbstractWorkspace <category>accessing</category>
addLocal: aKey locals at: aKey put: nil
addLocal: aKey value: anObject locals at: aKey put: anObject
currentPage "Subclasses should implement this to answer the current page installed; whatever is their notion of what pages are there and how they are managed." self subclassResponsibility
currentTextPage "Subclasses should implement this to answer the current text page installed or fail if the current page is not one that contains text; whatever is their notion of what pages are there and how they are managed." self subclassResponsibility
doItEnvironment "Every time the environment is requested, re-update imports if 'all' are imported because namespaces might have been added to the system in the meantime." importAll ifTrue: [locals updateImports]. ^locals
doItHandler ^WorkspaceCompilerErrorHandler new workspace: self
doItReceiver ^locals at: #self ifAbsent: [nil]
encoding: aSymbol encodingChannel value: aSymbol
encodingChannel ^encodingChannel
imports ^importAll ifTrue: [Root allNameSpaces copyWithout: Undeclared] ifFalse: [specificImports]
importSummaryHolder "This is a ValueHolder with a String containing the summary of what namespaces are imported. Subclasses may use it as they wish in their UIs." importSummaryHolder isNil ifTrue: [importSummaryHolder := String new asValue]. ^importSummaryHolder
isAtTextPage "Subclasses should implement this so the answer is true if the current page is one that contains text and false otherwise." self subclassResponsibility
menuBarHolder menuBarHolder isNil ifTrue: [menuBarHolder := self buildMenuBar asValue]. ^menuBarHolder
pageExplanationHolder "This is a ValueHolder with a String containing an explanation of what the current page displays. For example, explanation of a text page with a text from a file is the full path name of the file. Subclasses may use it as they wish in their UIs." ^pageExplanationHolder isNil ifTrue: [pageExplanationHolder := String new asValue] ifFalse: [pageExplanationHolder]
statusBarVisible ^statusBarVisible
</methods> <methods> Tools.AbstractWorkspace <category>actions-delegated</category>
copySelection ^self currentPage copySelection
cut ^self currentPage cut
explain ^self currentPage explain
fileSave | result | result := self currentTextPage saveIntoFile. self updatePage. ^result
fileSaveAs | result | result := self currentTextPage requestFileNameAndSave. self updatePage. ^result
find ^self currentPage find
paste ^self currentPage paste
replace ^self currentPage replace
selectAll ^self currentPage selectAll
smalltalkDebugIt ^self currentPage debugIt
smalltalkDoIt ^self currentPage doIt
smalltalkFileItIn ^self currentPage fileItIn
smalltalkInspectIt ^self currentPage inspectIt
smalltalkPrintIt ^self currentPage printIt
undo ^self currentPage undo
</methods> <methods> Tools.AbstractWorkspace <category>actions</category>
bossIn self currentPage canBOSSObjects ifTrue: [self currentPage bossIn]
bossOut self currentPage canBOSSObjects ifTrue: [self currentPage bossOut]
editImports | dialog | dialog := WorkspaceImportsDialog new. dialog initializeImportAll: importAll specific: specificImports. dialog open ifTrue: [importAll := dialog importAll. specificImports := dialog specificImports. self updateImports]
helpAbout AboutVisualWorksDialog open
helpWorkspace SmalltalkWorkbench openHelpBook: 'VisualWorks Tools' topic: 'Workspace'
statusBarVisible: aBoolean statusBarVisible := aBoolean. builder window refresh
toggleStatusBar self statusBarVisible: statusBarVisible not
toggleToolbar | menuItem | menuItem := self menuBar atNameKey: #toolbar. self builder window toolbarVisible: menuItem isOn not. menuItem indication: menuItem isOn not
</methods> <methods> Tools.AbstractWorkspace <category>privileged</category>
addAllToLocals: partCollection partCollection size = 1 ifTrue: [self addOneToLocals: partCollection first] ifFalse: [self addManyToLocals: partCollection]
addAllToLocalsQuietly: keyValueCollection | validated | validated := Dictionary new. keyValueCollection do: [:keyValue | | name | name := self makeVariableName: keyValue key uniqueIn: validated. validated at: name put: keyValue value]. validated keysAndValuesDo: [:key :value | self addLocal: key value: value]
addManyToLocals: partCollection | validated | validated := Dictionary new. partCollection do: [:each | | name | name := self makeVariableName: each asVariableName uniqueIn: validated. validated at: name put: each]. (self confirmAdditionOf: validated) ifFalse: [^self]. validated keysAndValuesDo: [:name :part | self addLocal: name value: part value]
addOneToLocals: aPart | name | name := Dialog request: (#AssignDroppedObjectToWorkspaceLocalNamedColon << #dialogs >> 'Assign the dropped object to a workspace local named:') initialAnswer: (self makeVariableName: aPart asVariableName). name isEmpty ifTrue: [^self]. self addLocal: name value: aPart value
clientAreaBottomOffset ^statusBarVisible ifTrue: [-24] ifFalse: [0]
explainSpecial: aString for: anExplainer "Answer with a string explaining the code view selection if it is displaying one of the special edit functions." (locals includesKey: aString asSymbol) ifTrue: [^Array with: (#explainer1SisAWorkspaceLocal << #dialogs >> '''<1s>'' is a workspace local variable. Switch to the Variables tab to inspect its value.' expandMacrosWith: aString) -> nil]. ^nil
</methods> <methods> Tools.AbstractWorkspace <category>private</category>
buildEncodingSubmenu ^WorkspacePage buildEncodingMenuFor: encodingChannel
buildMenuBar | menu | menu := self class menuBar. (menu atNameKey: #toggleStatusBar) indicationSelector: #statusBarVisible. (menu atNameKey: #editEncoding) submenu: [self buildEncodingSubmenu]. menu augmentFrom: self class to: AbstractWorkspace menuName: #menuBar for: self. ^menu
canBOSSObjects ^self currentPage canBOSSObjects
capitalized: aString ^aString copy at: 1 put: aString first asUppercase; yourself
confirmAdditionOf: namePartDictionary | message nameCount | message := WriteStream on: (String new: 100). nameCount := 1. message nextPutAll: (#AssignDroppedObjectToWorkspaceLocalsColon << #dialogs >> 'Assign the dropped objects to these workspace locals?') asString; cr. namePartDictionary keys asSortedCollection do: [:each | message nextPutAll: '"', each, '"'] separatedBy: [nameCount \\ 6 = 0 ifTrue: [message nextPutAll: ','; cr] ifFalse: [message nextPutAll: ', ']. nameCount := nameCount + 1]. ^Dialog confirm: message contents
hibernate "Prepare to become temporarily inactive and potentially have the widgets rebuilt. Usually happens during UI rebuilds." self subclassResponsibility
importSummary ^importAll ifTrue: [(#All << #labels >> 'All') asString] ifFalse: [specificImports size printString]
makeVariableName: aString "Given an arbitrary string, produce a string that can be a valid variable name. Do not allow pseudo-variable names except 'self'." | noBlanks | noBlanks := aString trimBlanks. (SystemUtils validateName: noBlanks) isNil ifTrue: [^((#object1s << #dialogs >> 'object<1s>') expandMacrosWith: (noBlanks select: [:some | some isLetter | some isDigit]))]. (#('true' 'false' 'super' 'nil' 'thisContext') includes: noBlanks) ifTrue: [^(#x1sObject << #dialogs >> '<1s>Object' expandMacrosWith: noBlanks)]. ^noBlanks
makeVariableName: aString uniqueIn: aDictionary "Accept a string that can be anything and answer another string that can safely be used as a legal Smalltalk variable name. The answer can be the same as the argument if it was OK to begin with. Make sure there is no name clash with keys of aDictionary. Append 2, 3, and so on to the original name until the clash if resolved. The dictionary keys may be strings or symbols." | namesTaken baseName name suffix | namesTaken := (aDictionary keys collect: [:each | each asString]) asSet. baseName := self makeVariableName: aString. name := baseName. suffix := 2. [namesTaken includes: name] whileTrue: [name := baseName, suffix printString. suffix := suffix + 1]. ^name
menuBar ^self menuBarHolder value
refreshMenuBar ^self menuBarHolder value: self buildMenuBar
reInstallInterface "Install the receiver's user interface again. Keep the same window. This happens when restarting or changing look and feel." | window spec | self hibernate. window := builder window. window component release. "Event dispatcher has to be reset so that it doesn't hold on to old objects, such as keyboardProcessor, etc" window controller reInstallEventDispatcher. builder := UIBuilder new. builder setWindow: window. builder source: self. spec := self class interfaceSpecFor: #windowSpec. self preBuildWith: builder. builder add: spec. self postBuildWith: builder. builder doFinalHookup. builder window refresh. "Refresh needed to force proper layouts to the text widget, which is otherwise not always able to properly restore its selection during postOpen." self postOpenWith: builder. ^builder
updateImports locals updateImports. self importSummaryHolder value: self importSummary
updatePage "Page-related things such as labels may have changed for the current page." self pageExplanationHolder value: self currentPage verboseLabel
</methods> <methods> Tools.AbstractWorkspace <category>events</category>
windowEvent: anEvent from: aWindow super windowEvent: anEvent from: aWindow. anEvent key = #newGraphicsDevice ifTrue: [self reInstallInterface]
</methods> <methods> Tools.AbstractWorkspace <category>initialize-release</category>
initialize statusBarVisible := self class showStatusBar. locals := WorkspaceVariablePool new initialize: self. importAll := true. specificImports := Array with: Smalltalk with: Core with: Kernel. encodingChannel := #Source asValue. self updateImports
postBuildWith: aBuilder builder window application: self; sendWindowEvents: #(#newGraphicsDevice).
postOpenWith: aBuilder "Any new workspace comes up with the toolbar showing. Toggle it if the user prefers it initially hidden." self class showToolBar ifFalse: [self toggleToolbar]
</methods> <methods> Tools.AbstractWorkspace class <category>window opening</category>
openFile: aFilenameOrString "Open a new workspace or a workbook with a single page on the file." "Workspace openFile: 'visual.cha'" "Workbook openFile: 'visual.cha'" ^(self withFile: aFilenameOrString) open
openFile: aFilenameOrString ifAbsent: aBlock "Open a new workspace or a workbook with a single page on the file. If the file does not exist, create a workbook anyway with a page associated with that non-existent file, and with the result of evaluating aBlock (expected to be a String or a Text) as the initial contents." "Workspace openFile: 'bogus.zzz' ifAbsent: ['-new file-']" "Workbook openFile: 'bogus.zzz' ifAbsent: ['-new file-']" ^(self withFile: aFilenameOrString ifAbsent: aBlock) open
openOnHolder: aValueModel "Open a new workspace or a workbook with a single page that has aString as the label and aValueModel as the content holder. Answer the builder." "Workspace openOnHolder: 'Hello world' asValue" "Workbook openOnHolder: 'Hello world' asValue" ^(self on: aValueModel) open
openOnHolder: aValueModel labeled: aString "Open a new workspace or a workbook with a single page that has aString as the label and aValueModel as the content holder. Answer the builder." "Workspace openOnHolder: 'Hello world' asValue labeled: 'Greeting'" "Workbook openOnHolder: 'Hello world' asValue labeled: 'Greeting'" ^(self on: aValueModel labeled: aString) open
openWith: aText "Open a new workspace or a workbook with a single page that has aString as the label and aText as the contents." "Workspace openWith: 'Hello world' " "Workbook openWith: 'Hello world' " ^(self with: aText) open
openWith: aText labeled: aString "Open a new workspace or a workbook with a single page that has aString as the label and aText as the contents." "Workspace openWith: 'Hello world' labeled: 'Greeting' " "Workbook openWith: 'Hello world' labeled: 'Greeting' " ^(self with: aText labeled: aString) open
</methods> <methods> Tools.AbstractWorkspace class <category>instance creation</category>
on: aValueModel "Create a new instance using aValueModel as the contents holder." self subclassResponsibility
on: aValueModel labeled: aString "Create a new workbook with a single text page that has aString as the label and aValueModel as the contents holder." self subclassResponsibility
with: aText "Create a new workbook with aText as the contents." self subclassResponsibility
with: aText labeled: aString "Create a new workbook with a single text page that has aString as the label and aText as the contents." self subclassResponsibility
withFile: aFilenameOrString "Create a new workbook with text from the specified file, or empty if the file is missing." ^self withFile: aFilenameOrString ifAbsent: [String new]
withFile: aFilenameOrString ifAbsent: aBlock "Create a new workbook with text from the specified file. If the file does not exist, create a workbook anyway with a page associated with that non-existent file, and with the result of evaluating aBlock (expected to be a String or a Text) as the initial contents." self subclassResponsibility
</methods> <methods> Tools.AbstractWorkspace class <category>accessing</category>
showStatusBar ^ShowStatusBar
showStatusBar: aBoolean ShowStatusBar := aBoolean
showToolBar ^ShowToolBar
showToolBar: aBoolean ShowToolBar := aBoolean
useMultiPageWorkspaces ^UseMultiPageWorkspaces
useMultiPageWorkspaces: aBoolean UseMultiPageWorkspaces := aBoolean
</methods> <methods> Tools.AbstractWorkspace class <category>notifications</category>
instanceMethodsChanged Screen default allScheduledControllersDo: [:each | (each model isKindOf: self) ifTrue: [each model refreshMenuBar]]
</methods> <methods> Tools.Workspace <category>actions</category>
fileNew self showTextPage. self currentPage maybeSaveIfCancel: [^self]. textPage := WorkspacePage new. self installPage: textPage
fileOpen | nameString | self showTextPage. self currentPage maybeSaveIfCancel: [^self]. nameString := Dialog requestFileName: (#OpenFileNamedColon << #dialogs >> 'Open file named: ') default: '*.ws'. nameString isEmpty ifTrue: [^self]. textPage := WorkspacePage filename: nameString asFilename. self installPage: textPage
mutateToWorkbook "Replace this workspace window with a workbook with a single text page. The workbook should occupy the same position on the screen as the original window." | book bounds | book := Workbook new. textPage deactivate. book replaceAllTextPagesWith: textPage. locals keysAndValuesDo: [:key :value | book addLocal: key value: value]. bounds := self builder window displayBox. "Opening the new window and THEN closing the old eliminates screen flicker." book allButOpenInterface: #windowSpec; finallyOpenIn: bounds withType: #normal. self builder window controller closeAndUnschedule. "bypass changeRequest"
showInspectorPage self isAtTextPage ifTrue: [self currentPage deactivate. self installPage: inspectorPage]
showTextPage self isAtInspectorPage ifTrue: [self currentPage deactivate. self installPage: textPage]
toggleView self isAtTextPage ifTrue: [self showInspectorPage] ifFalse: [self showTextPage]
</methods> <methods> Tools.Workspace <category>private</category>
buildMenuBar | menu | menu := super buildMenuBar. (menu atNameKey: #pageText) indicationSelector: #isAtTextPage. (menu atNameKey: #pageVariables) indicationSelector: #isAtInspectorPage. ^menu
hibernate self currentPage deactivate
installPage: aWorkspacePage currentPage := aWorkspacePage. aWorkspacePage builder: nil. self pageSubcanvas client: aWorkspacePage spec: #windowSpec builder: builder newSubBuilder. self updatePage. aWorkspacePage refresh
pageSubcanvas ^(self builder componentAt: #page) widget
</methods> <methods> Tools.Workspace <category>initialize-release</category>
initialize super initialize. self textPage: (WorkspacePage new workspace: self). inspectorPage := WorkspaceInspectorPage withInspectorOn: locals
postBuildWith: aBuilder super postBuildWith: aBuilder. (builder componentAt: #page) component layout bottomOffset: [self clientAreaBottomOffset]. (builder componentAt: #pageExplanation) component layout topOffset: [self clientAreaBottomOffset]. (builder componentAt: #importSummary) component layout topOffset: [self clientAreaBottomOffset]
postOpenWith: aBuilder super postOpenWith: aBuilder. self installPage: textPage
preBuildWith: aBuilder super preBuildWith: aBuilder. aBuilder labelAt: #label put: self currentPage label
setContents: aString self setContents: aString from: nil
setContents: aString from: aFilenameOrNil self currentPage contents: aString; filename: aFilenameOrNil
textPage: aWorkspacePage "This message should not be sent after the UI is built." textPage notNil ifTrue: [textPage release]. textPage := aWorkspacePage. textPage workspace: self. currentPage := textPage
</methods> <methods> Tools.Workspace <category>testing</category>
canUndo ^self isAtTextPage or: [self currentPage canUndo]
</methods> <methods> Tools.Workspace <category>accessing</category>
changeRequest ^self currentPage changeRequest
currentPage ^currentPage
currentTextPage currentPage == textPage ifFalse: [self error: (#errNotAtTextPage << #dialogs >> 'not at text page')]. ^self currentPage
isAtInspectorPage ^self isAtTextPage not
isAtTextPage ^currentPage == textPage
</methods> <methods> Tools.Workspace class <category>instance creation</category>
on: aValueModel "Create a new workspace with aString as the initial contents." | instance | instance := self new. instance currentPage textHolder: aValueModel. ^instance
on: aValueModel labeled: aString "Create a new workspace with aValueModel as the content holder and aString as its label." | instance | instance := self new. instance currentPage label: aString; textHolder: aValueModel. ^instance
with: aString "Create a new workspace with aString as the initial contents." ^self new setContents: aString; yourself
with: aString labeled: labelString "Create a new workspace with aString as the initial contents." | instance | instance := self new. instance currentPage label: labelString; contents: aString. ^instance
withFile: aFilenameOrString ifAbsent: aBlock "Create a new workspace with the contents of the file as the initial contents. If the file is missing, execute the block. If the block returns, create a workspace on a new file with the name specified by the filename and the value returned by the block as the initial content." | page | page := [WorkspacePage filename: aFilenameOrString] on: OsError do: [:ex | ex return: (WorkspacePage filename: aFilenameOrString contents: aBlock value)]. ^self new textPage: page; yourself
</methods> <methods> Tools.WorkspaceCompilerErrorHandler <category>initialize-release</category>
workspace: aWorkspace workspace := aWorkspace
</methods> <methods> Tools.WorkspaceCompilerErrorHandler <category>private-undeclared variables</category>
declareGlobal: assoc from: codeStream "Change the association's key from (possibly) a String to a Symbol, then add that association to Smalltalk (as opposed to the superclass adding it to the current environment)." | name | name := SystemUtils validateStaticVariableName: assoc key confirm: [:msg :vname | Dialog confirm: msg for: editor view] warn: [:msg | Dialog warn: msg for: editor view]. name == nil ifTrue: [^self abort]. name asString = assoc key asString ifFalse: [self replaceEditSelectionWith: name]. assoc key: name. Smalltalk defineSharedVariable: assoc key private: false constant: false category: #'Workspace Globals' initializer: nil. (Smalltalk bindingFor: assoc key) value: assoc value. ^true "retry"
declareWorkspaceVar: assoc from: codeStream "Change the association's key from (possibly) a String to a Symbol, then add that association to the pool of workspace variables." assoc key: assoc key asSymbol. workspace doItEnvironment simpleAddBinding: assoc. (workspace doItEnvironment bindingFor: assoc key) value: assoc value. ^true "retry"
undeclaredVariableTypes ^super undeclaredVariableTypes addFirst: #Workspace << #dialogs >> 'Workspace' -> #declareWorkspaceVar:from:; yourself
</methods> <methods> Tools.WorkspaceCompilerErrorHandler <category>interaction</category>
undeclaredStore: association in: assignNode from: codeStream self class silentlyDeclareVariables ifTrue: [^self declareWorkspaceVar: association from: codeStream]. ^super undeclaredStore: association in: assignNode from: codeStream
</methods> <methods> Tools.WorkspaceCompilerErrorHandler class <category>accessing</category>
silentlyDeclareVariables ^SilentlyDeclareVariables
silentlyDeclareVariables: aBoolean SilentlyDeclareVariables := aBoolean
</methods> <methods> Tools.WorkspaceInspectorPage <category>private</category>
exportSelections | parts | parts := inspector selections. ^parts collect: [:each | each key -> each value]
workspace ^self builder window application
</methods> <methods> Tools.WorkspaceInspectorPage <category>testing</category>
canBOSSObjects ^#{BinaryObjectStorage} isDefined
canUndo ^inspector canUndo
isAccepted ^true
</methods> <methods> Tools.WorkspaceInspectorPage <category>actions</category>
bossIn "This message can only be sent when BOSS is loaded so it is OK to assume it is. Still, we avoid a hard reference to it, in case it isn't loaded." | nameString boss stream objects | nameString := Dialog requestFileNameWithMessage: (#BOSSInFromC << #dialogs >> 'BOSS In From:') default: '*.bos' version: #mustBeOld ifFail: [''] for: nil. nameString isEmpty ifTrue: [^self]. stream := nameString asFilename readStream. [boss := #{BinaryObjectStorage} value onOldNoScan: stream. objects := boss next] ensure: [stream close]. ((objects isKindOf: SequenceableCollection) not or: [objects contains: [:some | (some isKindOf: Association) not]]) ifTrue: [self error: (#FileDoesNotContainVariables << #dialogs >> 'The object does not look like a saved variable collection')] ifFalse: [self workspace addAllToLocalsQuietly: objects]. inspector refresh; selectAll
bossOut "This message can only be sent when BOSS is loaded so it is OK to assume it is. Still, we avoid a hard reference to it, in case it isn't loaded." | nameString boss stream objects | inspector hasSelection ifFalse: [inspector selectAll]. nameString := Dialog requestFileNameWithMessage: (#BOSSOutToC << #dialogs >> 'BOSS Out To:') default: 'objects.bos' version: #new ifFail: [''] for: nil. nameString isEmpty ifTrue: [^self]. objects := self exportSelections. stream := nameString asFilename writeStream. [boss := #{BinaryObjectStorage} value onNew: stream. boss nextPut: objects] ensure: [stream close]
copySelection ^inspector copySelection
cut "There is no real cut in the inspector." ^inspector copySelection; removeSelected
debugIt self textEditor debugIt
doIt self textEditor doIt
fileItIn self textEditor fileItIn
find self textEditor find
inspectIt self textEditor inspectIt
paste ^inspector paste
printIt self textEditor printIt
refresh inspector refresh; selectAll
replace self textEditor replace
selectAll ^inspector selectAll
textEditor ^(inspector builder componentAt: #text) widget controller
undo ^inspector undo
</methods> <methods> Tools.WorkspaceInspectorPage <category>accessing</category>
changeRequest "An inspector is unlikely to contain anything worthwhile, so closing is always OK." ^true
displayString ^self label
label ^(#Variables << #labels >> 'Variables') asString
verboseLabel ^(#WorkspaceLocalVariables << #labels >> 'Workspace local variables') asString
</methods> <methods> Tools.WorkspaceInspectorPage <category>privileged</category>
deactivate "About to switch from this page to another one. Unselect everything so everything gets re-selected when we come back. Flush the history so that we don't quietly hang onto large things. This is important in workspaces, since they are more permanent than inspectors." inspector flushUndoHistory; select: nil
</methods> <methods> Tools.Workbook <category>actions</category>
fileNew self addAndSelectPage: (WorkspacePage labeled: self pickUniquePageLabel)
fileOpen | nameString | nameString := Dialog requestFileName: (#OpenFileNamedColon << #dialogs >> 'Open file named: ') default: '*.ws'. nameString isEmpty ifTrue: [^self]. self addAndSelectPage: (WorkspacePage filename: nameString asFilename)
pageClose self canClosePage ifFalse: [self error: (#errCannotCloseThisPage << #dialogs >> 'cannot close this page')]. self currentTextPage changeRequest ifFalse: [^self]. self removePage: self currentTextPage
pageRename | newLabel current | self canRenamePage ifFalse: [self error: (#errCannotRenameThisPage << #dialogs >> 'cannot rename this page')]. current := self currentPage. newLabel := Dialog request: (#RenameThisPageAsColon << #dialogs >> 'Rename this page as:') initialAnswer: current label. newLabel isEmpty ifTrue: [^self]. current label: newLabel. self pages changed: #at: with: self pageHolder selectionIndex
pageTearOff "Remove the current text page from the workbook and open it as a separate workspace (not a workbook). If this was the last text page, close the current workbook. The new window should have reasonable size and position--that is same size as the original workbook and either same or cascaded position, depending on whether the workbook stays or goes. With the MPUI introduction, if the original window is closed, it should be done *after* opening the new one." | thisPage workspace bounds wasLastPage | bounds := self builder window displayBox. thisPage := self currentTextPage. thisPage deactivate. workspace := Workspace new textPage: thisPage. locals keysAndValuesDo: [:key :value | workspace addLocal: key value: value]. wasLastPage := self textPageCount <= 1. wasLastPage ifFalse: [self removePage: thisPage. bounds := Screen default makeRectangleVisible: (bounds copy moveBy: 20@20)]. workspace allButOpenInterface: #windowSpec; finallyOpenIn: bounds withType: #normal. wasLastPage ifTrue: [self builder window controller closeAndUnschedule]
</methods> <methods> Tools.Workbook <category>private-pages</category>
currentPage ^lastInstalledPage
currentTextPage self isAtTextPage ifFalse: [self error: (#errNotAtTextPage << #dialogs >> 'not at text page')]. ^self currentPage
installPage: aWorkspacePage lastInstalledPage := aWorkspacePage. aWorkspacePage builder: nil. self tabControl client: aWorkspacePage spec: #windowSpec builder: builder newSubBuilder. self updatePage. aWorkspacePage refresh
isAtTextPage "Text pages are all pages except the last." ^self pageHolder selectionIndex < self pageHolder list size
textPageCount "One of the pages is the Variables page; all others are text." ^self pages size - 1
</methods> <methods> Tools.Workbook <category>private</category>
hibernate self pageHolder selectionIndex: 0
pickUniquePageLabel | labels suffix label | labels := self pages collect: [:each | each displayString]. suffix := 1. [label := ((#Page1s << #dialogs >> 'Page <1s>') expandMacrosWith: suffix printString). labels includes: label] whileTrue: [suffix := suffix + 1]. ^label
reInstallInterface "It is suspicious that the selection is not preserved while rebuilding, but for now let's just work around it." | pageIndex | pageIndex := self pageHolder selectionIndex. super reInstallInterface. self pageHolder selectionIndex: pageIndex
suggestSaving: pageCollection | messageStream wordsOnThisLine | messageStream := (String new: 100) writeStream. wordsOnThisLine := 1. messageStream nextPutAll: (#SomePagesNeedSaved << #dialogs >> 'The following pages have unsaved changes:') asString; cr. pageCollection do: [:each | wordsOnThisLine > 5 ifTrue: [messageStream cr. wordsOnThisLine := 0]. wordsOnThisLine := wordsOnThisLine + 1. messageStream nextPut: $"; nextPutAll: each displayString; nextPut: $"] separatedBy: [messageStream nextPutAll: ', ']. messageStream nextPutAll: '.'; cr; nextPutAll: (#SaveChangesBeforeClosing << #dialogs >> 'Save changes before closing the window?') asString. ^Dialog choose: messageStream contents labels: (Array with: (#Yes << #dialogs >> 'Yes') with: (#No << #dialogs >> 'No') with: (#Cancel << #dialogs >> 'Cancel')) values: #(yes no cancel) default: #yes
tabControl ^(builder componentAt: #pages) widget
updatePage "Page-related things such as labels may have changed for the current page." super updatePage. self pages changed: #at: with: self pageHolder selectionIndex
</methods> <methods> Tools.Workbook <category>initialize-release</category>
initialize super initialize. self pageHolder list: (List with: ((WorkspacePage labeled: (#Page1 << #dialogs >> 'Page 1')) workspace: self) with: (WorkspaceInspectorPage withInspectorOn: locals))
postBuildWith: aBuilder super postBuildWith: aBuilder. (builder componentAt: #pages) component layout bottomOffset: [self clientAreaBottomOffset]. (builder componentAt: #pageExplanation) component layout topOffset: [self clientAreaBottomOffset]. (builder componentAt: #importSummary) component layout topOffset: [self clientAreaBottomOffset]. self pageHolder selectionIndexHolder onChangeSend: #pageChanged to: self
postOpenWith: aBuilder super postOpenWith: aBuilder. self pageHolder selection: self pageHolder list first
</methods> <methods> Tools.Workbook <category>aspects</category>
pageHolder "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^pageHolder isNil ifTrue: [pageHolder := SelectionInList new] ifFalse: [pageHolder]
</methods> <methods> Tools.Workbook <category>accessing</category>
addAndSelectPage: aWorkspacePage self addPage: aWorkspacePage. self pageHolder selection: aWorkspacePage
addPage: aWorkspacePage "The Variables page always remains the last, so any new page always ends up being one before the last." | inspectorPage | inspectorPage := self pages last. aWorkspacePage workspace: self. self pages add: aWorkspacePage before: inspectorPage
changeRequest | unsaved choice | unsaved := self pages reject: [:some | some isAccepted]. unsaved isEmpty ifTrue: [^true]. choice := self suggestSaving: unsaved. choice = #no ifTrue: [^true]. choice = #cancel ifTrue: [^false]. "The choice is #yes, i.e. save all" unsaved do: [:each | each saveIntoFile ifFalse: [^false]]. ^true
pageChanged | selection | selection := self pageHolder selection. lastInstalledPage notNil ifTrue: [lastInstalledPage deactivate. lastInstalledPage := nil]. selection isNil ifTrue: [^self]. self installPage: selection
pages ^self pageHolder list
removePage: aWorkspacePage self pages remove: aWorkspacePage
replaceAllTextPagesWith: aPage | inspectorPage removed | inspectorPage := self pages last. aPage workspace: self. removed := self pages removeAllSuchThat: [:page | page ~~ inspectorPage]. removed do: [:each | each release]. self pages addFirst: aPage
selectPageLabeled: userMessageOrString self pageHolder selection: (self pages detect: [:aPage | aPage label asString = userMessageOrString asString] ifNone: [^self])
selectPageNumber: index self pageHolder selectionIndex: index
</methods> <methods> Tools.Workbook <category>private-testing</category>
canClosePage ^self isAtTextPage and: [self textPageCount > 1]
canRenamePage ^self isAtTextPage
canUndo ^self isAtTextPage or: [self currentPage canUndo]
</methods> <methods> Tools.Workbook class <category>examples</category>
example1 "Here is how to open a workbook with pages containing text." "self example1" | book | book := Workbook new. book replaceAllTextPagesWith: "also get rid of the default 'Page 1'" (WorkspacePage labeled: 'example1' with: (self class compiledMethodAt: #example1) getSource); addAndSelectPage: "now add more pages" (WorkspacePage labeled: 'example2' with: (self class compiledMethodAt: #example2) getSource). book open
example2 "Here is how to open a workbook with pages containing text from files." "self example2" | book | book := Workbook new. book replaceAllTextPagesWith: (WorkspacePage filename: 'visual.cha' asFilename). book open
</methods> <methods> Tools.Workbook class <category>instance creation</category>
on: aValueModel "Create a new workbook with a single text page that has aString as the label and aValueModel as the contents holder." | book | book := self new. book replaceAllTextPagesWith: (WorkspacePage on: aValueModel). ^book
on: aValueModel labeled: aString "Create a new workbook with a single text page that has aString as the label and aValueModel as the contents holder." | book | book := self new. book replaceAllTextPagesWith: (WorkspacePage labeled: aString on: aValueModel). ^book
with: aText "Create a new workbook with a single text page that has aString as the label and aText as the contents." | book | book := self new. book replaceAllTextPagesWith: (WorkspacePage with: aText). ^book
with: aText labeled: aString "Create a new workbook with a single text page that has aString as the label and aText as the contents." | book | book := self new. book replaceAllTextPagesWith: (WorkspacePage labeled: aString with: aText). ^book
withFile: aFilenameOrString ifAbsent: aBlock "Create a new workbook with text from the specified file. If the file does not exist, create a workbook anyway with a page associated with that non-existent file, and with the result of evaluating aBlock (expected to be a String or a Text) as the initial contents." | book page | book := self new. page := [WorkspacePage filename: aFilenameOrString] on: OsError do: [:ex | ex return: (WorkspacePage filename: aFilenameOrString contents: aBlock value)]. book replaceAllTextPagesWith: page. ^book
</methods> <methods> Tools.Workbook class <category>system workbooks</category>
openSystemWorkbook ^self systemWorkbook open
systemWorkbook ^Workbook new replaceAllTextPagesWith: WorkspacePage installationWorkspacePage; addPage: WorkspacePage systemWorkspacePage; yourself
</methods> <methods> Tools.NoWorkspace <category>workspace fakery</category>
addAllToLocals: ignored
doItHandler ^InteractiveCompilerErrorHandler new
doItReceiver ^nil
encodingChannel ^#Source asValue
updatePage "Nothing to do."
</methods> <methods> Tools.WorkspaceImportsDialog class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #ImportedNamespaces #defaultString: 'Imported Namespaces' #catalogID: #labels) #bounds: #(#{Graphics.Rectangle} 238 268 442 539 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.RadioButtonSpec} #layout: #(#{Core.Point} 10 10 ) #model: #importAllHolder #label: #(#{Kernel.UserMessage} #key: #All #defaultString: 'All' #catalogID: #labels) #select: true ) #(#{UI.RadioButtonSpec} #layout: #(#{Core.Point} 10 30 ) #model: #importAllHolder #label: #(#{Kernel.UserMessage} #key: #SomeColon #defaultString: 'Some:' #catalogID: #labels) #select: false ) #(#{UI.SequenceViewSpec} #layout: #(#{Graphics.LayoutFrame} 10 0 60 0 -10 1 -50 1 ) #name: #namespaces #model: #namespaces #multipleSelections: true #selectionType: #checkMark ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} 10 0 -35 1 -10 0.5 -10 1 ) #model: #accept #label: #(#{Kernel.UserMessage} #key: #OK #defaultString: 'OK' #catalogID: #labels) #isDefault: true ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.LayoutFrame} 10 0.5 -35 1 -10 1 -10 1 ) #model: #cancel #label: #(#{Kernel.UserMessage} #key: #Cancel #defaultString: 'Cancel' #catalogID: #labels) #defaultable: true ) ) ) )
</methods> <methods> Tools.WorkspacePage class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #label #bounds: #(#{Graphics.Rectangle} 512 384 960 649 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TextEditorSpec} #properties: #(#{UI.PropertyListDictionary} #dropSelector #drop: #dragEnterSelector #dragEntry: #dragOverSelector #dragOver: ) #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 0 1 ) #name: #text #model: #textModel #callbacksSpec: #(#{UI.UIEventCallbackSubSpec} #requestValueChangeSelector: #okToSaveTextFrom: ) #tabRequiresControl: true ) ) ) )
</methods> <methods> Tools.Workspace class <category>interface specs</category>
windowSpec "Tools.UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #properties: #(#{UI.PropertyListDictionary} #labelFromApplication true ) #label: #label #min: #(#{Core.Point} 250 100 ) #max: #(#{Core.Point} 0 0 ) #bounds: #(#{Graphics.Rectangle} 474 368 1024 768 ) #flags: 4 #menu: #menuBarHolder #toolBar: #toolBar ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.SubCanvasSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 -24 1 ) #name: #page #flags: 0 ) #(#{UI.InputFieldSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 -24 1 -41 1 0 1 ) #name: #pageExplanation #model: #pageExplanationHolder #tabable: false #isReadOnly: true ) #(#{UI.InputFieldSpec} #layout: #(#{Graphics.LayoutFrame} -40 1 -24 1 0 1 0 1 ) #name: #importSummary #model: #importSummaryHolder #tabable: false #isReadOnly: true ) ) ) )
</methods> <methods> Tools.Workspace class <category>resources</category>
menuBar "Tools.MenuEditor new openOnClass: self andSelector: #menuBar" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_File #defaultString: '&File' #catalogID: #menus ) #nameKey: #fileMenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_New #defaultString: '&New' #catalogID: #menus ) #nameKey: #fileNew #value: #fileNew #shortcutKeyCharacter: $N #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileNew ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_OpenDot #defaultString: '&Open...' #catalogID: #menus ) #nameKey: #fileOpen #value: #fileOpen #shortcutKeyCharacter: $O #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileOpen ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Save #defaultString: '&Save' #catalogID: #menus ) #nameKey: #fileSave #value: #fileSave #enablementSelector: #isAtTextPage #shortcutKeyCharacter: $S #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileSave ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Save_AsDot #defaultString: 'Save &As...' #catalogID: #menus ) #nameKey: #fileSaveAs #value: #fileSaveAs #enablementSelector: #isAtTextPage ) ) #(1 3 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Edit #defaultString: '&Edit' #catalogID: #menus ) #nameKey: #editMenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Undo #defaultString: '&Undo' #catalogID: #menus ) #nameKey: #editUndo #value: #undo #enablementSelector: #canUndo #shortcutKeyCharacter: $Z #shortcutModifiers: 2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Cu_t #defaultString: 'Cu&t' #catalogID: #menus ) #nameKey: #editCut #value: #cut #enablementSelector: #isAtTextPage #shortcutKeyCharacter: $X #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #cut ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Copy #defaultString: '&Copy' #catalogID: #menus ) #nameKey: #editCopy #value: #copySelection #shortcutKeyCharacter: $C #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #copy ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Paste #defaultString: '&Paste' #catalogID: #menus ) #nameKey: #editPaste #value: #paste #shortcutKeyCharacter: $V #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #paste ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_FindDots #defaultString: '&Find...' #catalogID: #menus ) #nameKey: #editFind #value: #find #shortcutKeyCharacter: $L #shortcutModifiers: 2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_ReplaceDots #defaultString: '&Replace...' #catalogID: #menus ) #nameKey: #editReplace #value: #replace #shortcutKeyCharacter: $R #shortcutModifiers: 2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Select_All #defaultString: 'Select &All' #catalogID: #menus ) #nameKey: #editSelectAll #value: #selectAll ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Encoding #defaultString: '&Encoding' #catalogID: #menus ) #nameKey: #editEncoding ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Boss_InDot #defaultString: 'Boss &In...' #catalogID: #menus ) #value: #bossIn #enablementSelector: #canBOSSObjects ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Boss_OutDot #defaultString: 'Boss &Out...' #catalogID: #menus ) #value: #bossOut #enablementSelector: #canBOSSObjects ) ) #(1 3 2 1 1 2 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Smalltalk #defaultString: '&Smalltalk' #catalogID: #menus ) #nameKey: #smalltalkSubmenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_DoIt #defaultString: '&Do it' #catalogID: #menus ) #value: #smalltalkDoIt #shortcutKeyCharacter: $D #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #doIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_PrintIt #defaultString: '&Print it' #catalogID: #menus ) #value: #smalltalkPrintIt #shortcutKeyCharacter: $P #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #printIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_InspectIt #defaultString: '&Inspect it' #catalogID: #menus ) #value: #smalltalkInspectIt #shortcutKeyCharacter: $Q #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #inspectIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #De_bugIt #defaultString: 'De&bug it' #catalogID: #menus ) #value: #smalltalkDebugIt #shortcutKeyCharacter: $B #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #debugIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_NamespacesDot #defaultString: '&Namespaces...' #catalogID: #menus ) #value: #editImports #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #namespaces ) ) ) #(4 1 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_View #defaultString: '&View' #catalogID: #menus ) #nameKey: #viewSubmenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Text #defaultString: '&Text' #catalogID: #menus ) #nameKey: #pageText #value: #showTextPage ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Variables #defaultString: '&Variables' #catalogID: #menus ) #nameKey: #pageVariables #value: #showInspectorPage ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_BecomeMultiPage #defaultString: '&Become Multi-Page' #catalogID: #menus ) #value: #mutateToWorkbook ) ) #(2 1 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Options #defaultString: '&Options' #catalogID: #menus ) #nameKey: #optionsMenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Toolbar #defaultString: '&Toolbar' #catalogID: #menus ) #nameKey: #toolbar #value: #toggleToolbar #indication: true ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_StatusBar #defaultString: '&Status Bar' #catalogID: #menus ) #nameKey: #toggleStatusBar #value: #toggleStatusBar ) ) #(2 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Help #defaultString: '&Help' #catalogID: #menus ) #nameKey: #help #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Workspace #defaultString: '&Workspace' #catalogID: #menus ) #value: #helpWorkspace #shortcutKeyCharacter: #F1 #shortcutModifiers: 0 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #help ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_AboutVisualWorksDot #defaultString: '&About VisualWorks...' #catalogID: #menus ) #value: #helpAbout ) ) #(1 1 ) nil ) ) ) #(6 ) nil ) decodeAsLiteralArray
toolBar "MenuEditor new openOnClass: self andSelector: #toolBar" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #New #defaultString: 'New' #catalogID: #menus) #value: #fileNew #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileNew ) #helpText: #(#{Kernel.UserMessage} #key: #New #defaultString: 'New' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Open #defaultString: 'Open' #catalogID: #menus) #value: #fileOpen #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileOpen ) #helpText: #(#{Kernel.UserMessage} #key: #Open #defaultString: 'Open' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Save #defaultString: 'Save' #catalogID: #menus) #value: #fileSave #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileSave ) #helpText: #(#{Kernel.UserMessage} #key: #Save #defaultString: 'Save' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Cut #defaultString: 'Cut' #catalogID: #menus) #value: #cut #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #cut ) #helpText: #(#{Kernel.UserMessage} #key: #Cut #defaultString: 'Cut' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Copy #defaultString: 'Copy' #catalogID: #menus) #value: #copySelection #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #copy ) #helpText: #(#{Kernel.UserMessage} #key: #Copy #defaultString: 'Copy' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Paste #defaultString: 'Paste' #catalogID: #menus) #value: #paste #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #paste ) #helpText: #(#{Kernel.UserMessage} #key: #Paste #defaultString: 'Paste' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #DoIt #defaultString: 'Do it' #catalogID: #menus) #value: #smalltalkDoIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #doIt ) #helpText: #(#{Kernel.UserMessage} #key: #DoIt #defaultString: 'Do it' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #PrintIt #defaultString: 'Print it' #catalogID: #menus) #value: #smalltalkPrintIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #printIt ) #helpText: #(#{Kernel.UserMessage} #key: #PrintIt #defaultString: 'Print it' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #InspectIt #defaultString: 'Inspect it' #catalogID: #menus) #value: #smalltalkInspectIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #inspectIt ) #helpText: #(#{Kernel.UserMessage} #key: #InspectIt #defaultString: 'Inspect it' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #DebugIt #defaultString: 'Debug it' #catalogID: #menus) #value: #smalltalkDebugIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #debugIt ) #helpText: #(#{Kernel.UserMessage} #key: #DebugIt #defaultString: 'Debug it' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #toggleView #defaultString: 'toggleView' #catalogID: #menus) #value: #toggleView #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #inspectLocals ) #helpText: #(#{Kernel.UserMessage} #key: #ToggleTextvariablesView #defaultString: 'Toggle text/variables view' #catalogID: #menus) ) ) #(3 3 4 1 ) nil ) decodeAsLiteralArray
</methods> <methods> Tools.Workbook <category>actions</category>
menuItemFlushInspectorHistory <itemInMenu: #(#menuBar #editMenu) position: 10.1> ^(MenuItem labeled: #_Forget >> '&Forget' << #menus) hidden: [self isAtTextPage]; enabled: [self currentPage canUndo]; value: [self currentPage inspector flushUndoHistory]; yourself
</methods> <methods> Tools.Workbook class <category>interface specs</category>
windowSpec "Tools.UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: #(#{Kernel.UserMessage} #key: #Workspace #defaultString: 'Workspace' #catalogID: #labels ) #min: #(#{Core.Point} 250 100 ) #max: #(#{Core.Point} 0 0 ) #bounds: #(#{Graphics.Rectangle} 474 368 1024 768 ) #flags: 4 #menu: #menuBarHolder #toolBar: #toolBar ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TabControlSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 -25 1 ) #name: #pages #model: #pageHolder #tabable: true #labels: #() ) #(#{UI.InputFieldSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 -24 1 -41 1 0 1 ) #name: #pageExplanation #model: #pageExplanationHolder #tabable: false #helpText: #(#{Kernel.UserMessage} #key: #ExplainCurrentPage #defaultString: 'Explanation of the current page' #catalogID: #labels) #isReadOnly: true ) #(#{UI.InputFieldSpec} #layout: #(#{Graphics.LayoutFrame} -40 1 -24 1 0 1 0 1 ) #name: #importSummary #model: #importSummaryHolder #tabable: false #helpText: #(#{Kernel.UserMessage} #key: #NamespacesImportedHere #defaultString: 'Namespaces imported by this workspace' #catalogID: #labels) #isReadOnly: true ) ) ) )
</methods> <methods> Tools.Workbook class <category>resources</category>
menuBar "Tools.MenuEditor new openOnClass: self andSelector: #menuBar" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Page #defaultString: '&Page' #catalogID: #menus ) #nameKey: #pageMenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_New #defaultString: '&New' #catalogID: #menus ) #nameKey: #fileNew #value: #fileNew #shortcutKeyCharacter: $N #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileNew ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_OpenDot #defaultString: '&Open...' #catalogID: #menus ) #nameKey: #fileOpen #value: #fileOpen #shortcutKeyCharacter: $O #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileOpen ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Save #defaultString: '&Save' #catalogID: #menus ) #nameKey: #fileSave #value: #fileSave #enablementSelector: #isAtTextPage #shortcutKeyCharacter: $S #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileSave ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Save_AsDot #defaultString: 'Save &As...' #catalogID: #menus ) #nameKey: #fileSaveAs #value: #fileSaveAs #enablementSelector: #isAtTextPage ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_RenameDot #defaultString: '&Rename...' #catalogID: #menus ) #nameKey: #pageRename #value: #pageRename #enablementSelector: #canRenamePage ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_TearOff #defaultString: '&Tear Off' #catalogID: #menus ) #nameKey: #pageTearOff #value: #pageTearOff #enablementSelector: #isAtTextPage ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Re_move #defaultString: 'Re&move' #catalogID: #menus ) #nameKey: #pageClose #value: #pageClose #enablementSelector: #canClosePage ) ) #(1 3 3 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Edit #defaultString: '&Edit' #catalogID: #menus ) #nameKey: #editMenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Undo #defaultString: '&Undo' #catalogID: #menus ) #nameKey: #editUndo #value: #undo #enablementSelector: #canUndo #shortcutKeyCharacter: $Z #shortcutModifiers: 2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Cu_t #defaultString: 'Cu&t' #catalogID: #menus ) #nameKey: #editCut #value: #cut #enablementSelector: #isAtTextPage #shortcutKeyCharacter: $X #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #cut ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Copy #defaultString: '&Copy' #catalogID: #menus ) #nameKey: #editCopy #value: #copySelection #shortcutKeyCharacter: $C #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #copy ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Paste #defaultString: '&Paste' #catalogID: #menus ) #nameKey: #editPaste #value: #paste #shortcutKeyCharacter: $V #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #paste ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_FindDots #defaultString: '&Find...' #catalogID: #menus ) #nameKey: #editFind #value: #find #shortcutKeyCharacter: $L #shortcutModifiers: 2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_ReplaceDots #defaultString: '&Replace...' #catalogID: #menus ) #nameKey: #editReplace #value: #replace #shortcutKeyCharacter: $R #shortcutModifiers: 2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Select_All #defaultString: 'Select &All' #catalogID: #menus ) #nameKey: #editSelectAll #value: #selectAll #shortcutKeyCharacter: $A #shortcutModifiers: 2 ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Encoding #defaultString: '&Encoding' #catalogID: #menus ) #nameKey: #editEncoding ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Boss_InDot #defaultString: 'Boss &In...' #catalogID: #menus ) #value: #bossIn #enablementSelector: #canBOSSObjects ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Boss_OutDot #defaultString: 'Boss &Out...' #catalogID: #menus ) #value: #bossOut #enablementSelector: #canBOSSObjects ) ) #(1 3 2 1 1 2 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Smalltalk #defaultString: '&Smalltalk' #catalogID: #menus ) #nameKey: #smalltalkSubmenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_DoIt #defaultString: '&Do it' #catalogID: #menus ) #value: #smalltalkDoIt #shortcutKeyCharacter: $D #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #doIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_PrintIt #defaultString: '&Print it' #catalogID: #menus ) #value: #smalltalkPrintIt #shortcutKeyCharacter: $P #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #printIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_InspectIt #defaultString: '&Inspect it' #catalogID: #menus ) #value: #smalltalkInspectIt #shortcutKeyCharacter: $Q #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #inspectIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #De_bugIt #defaultString: 'De&bug it' #catalogID: #menus ) #value: #smalltalkDebugIt #shortcutKeyCharacter: $B #shortcutModifiers: 2 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #debugIt ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_FileItIn #defaultString: '&File it In' #catalogID: #menus ) #value: #smalltalkFileItIn ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_NamespacesDot #defaultString: '&Namespaces...' #catalogID: #menus ) #value: #editImports #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #namespaces ) ) ) #(4 1 1 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Options #defaultString: '&Options' #catalogID: #menus ) #nameKey: #optionsMenu #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Toolbar #defaultString: '&Toolbar' #catalogID: #menus ) #nameKey: #toolbar #value: #toggleToolbar #indication: true ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_StatusBar #defaultString: '&Status Bar' #catalogID: #menus ) #nameKey: #toggleStatusBar #value: #toggleStatusBar ) ) #(2 ) nil ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Help #defaultString: '&Help' #catalogID: #menus ) #nameKey: #help #submenu: #(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_Workspace #defaultString: '&Workspace' #catalogID: #menus ) #value: #helpWorkspace #shortcutKeyCharacter: #F1 #shortcutModifiers: 0 #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #help ) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #_AboutVisualWorksDot #defaultString: '&About VisualWorks...' #catalogID: #menus ) #value: #helpAbout ) ) #(1 1 ) nil ) ) ) #(5 ) nil ) decodeAsLiteralArray
toolBar "MenuEditor new openOnClass: self andSelector: #toolBar" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #New #defaultString: 'New' #catalogID: #menus) #value: #fileNew #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileNew ) #helpText: #(#{Kernel.UserMessage} #key: #New #defaultString: 'New' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Open #defaultString: 'Open' #catalogID: #menus) #value: #fileOpen #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileOpen ) #helpText: #(#{Kernel.UserMessage} #key: #Open #defaultString: 'Open' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Save #defaultString: 'Save' #catalogID: #menus) #nameKey: #fileSave #value: #fileSave #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #fileSave ) #helpText: #(#{Kernel.UserMessage} #key: #Save #defaultString: 'Save' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Cut #defaultString: 'Cut' #catalogID: #menus) #nameKey: #cut #value: #cut #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #cut ) #helpText: #(#{Kernel.UserMessage} #key: #Cut #defaultString: 'Cut' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Copy #defaultString: 'Copy' #catalogID: #menus) #nameKey: #copy #value: #copySelection #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #copy ) #helpText: #(#{Kernel.UserMessage} #key: #Copy #defaultString: 'Copy' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #Paste #defaultString: 'Paste' #catalogID: #menus) #nameKey: #paste #value: #paste #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #paste ) #helpText: #(#{Kernel.UserMessage} #key: #Paste #defaultString: 'Paste' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #DoIt #defaultString: 'Do it' #catalogID: #menus) #value: #smalltalkDoIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #doIt ) #helpText: #(#{Kernel.UserMessage} #key: #DoIt #defaultString: 'Do it' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #PrintIt #defaultString: 'Print it' #catalogID: #menus) #value: #smalltalkPrintIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #printIt ) #helpText: #(#{Kernel.UserMessage} #key: #PrintIt #defaultString: 'Print it' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #InspectIt #defaultString: 'Inspect it' #catalogID: #menus) #value: #smalltalkInspectIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #inspectIt ) #helpText: #(#{Kernel.UserMessage} #key: #InspectIt #defaultString: 'Inspect it' #catalogID: #menus) ) #(#{UI.MenuItem} #rawLabel: #(#{Kernel.UserMessage} #key: #DebugIt #defaultString: 'Debug it' #catalogID: #menus) #value: #smalltalkDebugIt #labelImage: #(#{UI.ResourceRetriever} #{ToolbarIconLibrary} #debugIt ) #helpText: #(#{Kernel.UserMessage} #key: #DebugIt #defaultString: 'Debug it' #catalogID: #menus) ) ) #(3 3 4 ) nil ) decodeAsLiteralArray
</methods> <methods> Tools.VisualLauncher <category>actions</category>
fileOpen <menuItem: #(#OpenFileItemLabel #menus '&Open File...') icon: nil nameKey: #fileOpen menu: #(#menuBar file) position: 9.02> | name ws | name := (Dialog requestFileName: (#OpenFile << #dialogs >> 'Open File') default: '*.ws') trimBlanks. name isEmpty ifFalse: [ws := Workspace withFile: name. ws encodingChannel value: #default. ws open]
helpInstallationWorkspace <menuItem: #(#installWorkspace #menus 'Installation Workspace') nameKey: nil menu: #(#menuBar #help) position: 5.02> Workbook systemWorkbook open; selectPageLabeled: (#installationWorkspace << #labels >> 'Installation Workspace')
helpSystemWorkspace <menuItem: #(#systemWorkspaceMenu #menus 'System Workspace') nameKey: nil menu: #(#menuBar #help) position: 5.03> Workbook systemWorkbook open; selectPageLabeled: (#systemWorkspace << #labels >> 'System Workspace')
toolsNewWorkspace "Open a new workspace." <menuItem: #(#Workspace #labels 'Workspace') icon: #workspaceIcon nameKey: nil menu: #(#launcherToolBar) position: 30.5 helpText: #(#OpenANewWorkspace #labels 'Open a new workspace')> <menuItem: #(#_Workspace #menus '&Workspace') icon: #workspaceIcon nameKey: nil shortcutKeyCharacter: #F6 shortcutModifiers: 0 menu: #(#menuBar tools) position: 9.00> self openApplicationForClassNamed: (AbstractWorkspace useMultiPageWorkspaces ifTrue: [#Workbook] ifFalse: [#Workspace])
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>ApplicationModel</name> <environment>UI</environment> <super>UI.Model</super> <private>false</private> none builder uiSession eventHandlers savedWindowInformation <imports></imports> <category>UIBuilder-Framework</category> <attributes> <package>UIBuilder-Framework</package> </attributes> </class> <class> <name>InteractiveCompilerErrorHandler</name> <environment>Kernel</environment> <super>Kernel.CompilerErrorHandler</super> <private>false</private> none editor lengthChange selectRange alreadyHandled <imports></imports> <category>System-Compiler-Support</category> <attributes> <package>System-Compiler-Support</package> </attributes> </class> <class> <name>VisualLauncher</name> <environment>Tools</environment> <super>UI.ApplicationModel</super> <private>false</private> none menuBar toolBar textCollector toolDock <imports></imports> <category>Tools-Misc</category> <attributes> <package>Tools-Misc</package> </attributes> </class> <class> <name>NameSpace</name> <environment>Kernel</environment> <super>Kernel.GeneralNameSpace</super> <private>false</private> none parent name <imports></imports> <category>System-Name Spaces</category> <attributes> <package>System-Name Spaces</package> </attributes> </class> <class> <name>InspectorHolder</name> <environment>Tools.Trippy</environment> <super>UI.ApplicationModel</super> <private>false</private> none inspector <imports></imports> <category>Tools-Trippy</category> <attributes> <package>Tools-Trippy</package> </attributes> </class> <class> <name>SimpleDialog</name> <environment>UI</environment> <super>UI.ApplicationModel</super> <private>false</private> none close accept cancel preBuildBlock postBuildBlock postOpenBlock escapeIsCancel parentView <imports></imports> <category>Interface-Dialogs</category> <attributes> <package>Interface-Dialogs</package> </attributes> </class>