SystemOrganization addCategory: #'ShoutWorkspace-Workspace'! Workspace subclass: #SHWorkspace instanceVariableNames: 'stylingActive' classVariableNames: '' poolDictionaries: '' category: 'ShoutWorkspace-Workspace'! SHWorkspace class instanceVariableNames: 'stylingActive'! !SHWorkspace commentStamp: '' prior: 0! I am a workspace with Shout syntax highlighting! SHWorkspace class instanceVariableNames: 'stylingActive'! !SHWorkspace class methodsFor: 'class initialization' stamp: 'tween 6/26/2004 11:43'! initialize (TheWorldMenu respondsTo: #registerOpenCommand:) ifTrue: [TheWorldMenu registerOpenCommand: {'Shout Workspace'. {self. #open}}]! ! !SHWorkspace class methodsFor: 'instance creation' stamp: 'tween 6/26/2004 11:52'! open self new openLabel: 'Shout Workspace'! ! !SHWorkspace class methodsFor: 'accessing' stamp: 'tween 9/23/2008 20:31'! stylingActive ^stylingActive ifNil:[true]! ! !SHWorkspace class methodsFor: 'accessing' stamp: 'tween 9/23/2008 20:31'! stylingActive: aBoolean stylingActive := aBoolean! ! !SHWorkspace methodsFor: 'override' stamp: 'tween 9/23/2008 20:09'! addModelItemsToWindowMenu: aMenu super addModelItemsToWindowMenu: aMenu. aMenu addLine. aMenu addUpdating: #isStylingActive target: self action: #toggleStylingActive.! ! !SHWorkspace methodsFor: 'override' stamp: 'tween 10/11/2007 15:22'! embeddedInMorphicWindowLabeled: labelString | window pane | window := (SystemWindow labelled: labelString) model: self. pane := MorphicTextEditor default on: self text: #contents accept: #acceptContents: readSelection: nil menu: #codePaneMenu:shifted: . pane font: Preferences standardCodeFont. window addMorph: pane frame: (0@0 corner: 1@1). ^ window! ! !SHWorkspace methodsFor: 'binding' stamp: 'tween 6/26/2004 11:34'! hasBindingOf: aString ^(bindings notNil and: [bindings includesKey: aString]) ! ! !SHWorkspace methodsFor: 'binding' stamp: 'tween 6/26/2004 11:34'! hasBindingThatBeginsWith: aString bindings ifNil:[^false]. bindings keysDo:[:each | (each beginsWith: aString) ifTrue:[^true]]. ^false ! ! !SHWorkspace methodsFor: 'styling' stamp: 'tween 9/23/2008 20:08'! isStylingActive ^self stylingActive ifTrue: [' syntax highlighting' translated] ifFalse: [' syntax highlighting' translated] ! ! !SHWorkspace methodsFor: 'styling' stamp: 'tween 9/23/2008 20:10'! shoutAboutToStyle: aPluggableShoutMorphOrView "set up the compilation class in aPluggableShoutMorphOrView. Answer true if styling should go ahead, false otherwise" aPluggableShoutMorphOrView classOrMetaClass: nil; workspace: self. ^self stylingActive! ! !SHWorkspace methodsFor: 'styling' stamp: 'tween 9/23/2008 20:23'! stylingActive ^stylingActive ifNil:[stylingActive := self class stylingActive].! ! !SHWorkspace methodsFor: 'styling' stamp: 'tween 9/24/2008 12:05'! toggleStylingActive stylingActive := self stylingActive not. dependents last setText: dependents last textMorph contents asString asText. "style or unstyle the current contents" self class stylingActive: stylingActive. "remember as the default for new Workspaces" ^self isStylingActive ! ! SHWorkspace initialize!