ScriptManager and Shout (was: Techo and Shout)
Jason Rogers
jacaetevha at gmail.com
Thu Nov 17 14:39:12 UTC 2005
On 11/17/05, astares at gmx.de <astares at gmx.de> wrote:
> 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
Thanks. I will have a look at it.
--
Jason Rogers
"I am crucified with Christ: nevertheless I live; yet not I,
but Christ liveth in me: and the life which I now live in
the flesh I live by the faith of the Son of God, who loved
me, and gave himself for me."
Galatians 2:20
More information about the Squeak-dev
mailing list
|