ScriptManager and Shout (was: Techo and Shout)

astares at gmx.de astares at gmx.de
Thu Nov 17 08:50:11 UTC 2005


Hi Jason,

Integration for Techo was very easy: since Techo was already a 
subclass of Workspace I changed the superclass to SHWorkspace and
replaced the TextEditor in #buildWindow with a MorphicTextEditor.
SHWorkspace/Workspace already has support for bindings so 
nothing had to be done here.

Note that shout requires three callbacks #shoutAboutToStyle:,
#hasBindingThatBeginsWith: and #hasBindingOf: wich were already 
implemented in SHWorkspace.

I've implemented Shout support into ScriptManager, have a look
at:

http://www.squeaksource.com/DeveloperWorkspace/ScriptManager-tbn.2.mcz

or load it using the SqueakMap Package loader from within your image
(package "ScriptManager Shout")

NOTE: the provided version supports Shout but does not yet have eCompletion 
support. Depending on your time you may want to add it. Have a look into 
category *ecomplection in class Workspace to start.

Here are the steps in detail:

1. Replace method #editorMorph with:
====================================

editorMorph

	^MorphicTextEditor default 
		on: self 
		text: #contents 
		accept: #contents:notifying:
		readSelection: #contentsSelection 
		menu: #codePaneMenu:shifted:.

2. Implement a method #shoutAboutToStyle in ScriptManager
=========================================================
shoutAboutToStyle: aPluggableShoutMorphOrView
	"set up the compilation class in aPluggableShoutMorphOrView.
	Answer true if styling should go ahead, false otherwise"
	
	aPluggableShoutMorphOrView 
		classOrMetaClass: nil;
		workspace: self.
	^true

3. Implement other callbacks 
============================
implemented #hasBindingOf: and #hasBindingThatBeginsWith: to return false

4. Register in World menu:
==========================
initialize
	Scripts := Dictionary new.
	TheWorldMenu registerOpenCommand: {'Script Manager'. {self. #openBrowser}}.

5. Implement unload to remove the world menu entry
==================================================
unload
	"Called when the class is being removed"

	TheWorldMenu unregisterOpenCommandWithReceiver: self.
   
Bye
Torsten




   

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner



More information about the Squeak-dev mailing list