This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Weblication
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
The other night, I mentioned this idea to Michaell Lucas-Smith. The guy's a genious or super quick or something. In no time at all, he had whipped up his Discuss Methods.
Tonite, I pulled a blatent rip off/repackage of the implementation. I wanted a twist, I wanted to be able to highlight ANY text anywhere and generate styled html from it. So I stole the chunk of code that turns Text into styled html (but I'm repeatedly giving credit here), and applied a single override in ParagraphEditor so that when you hold ctrl-alt-shift during a copy operation, it "weblicates" the copied selection.
This was not actually the original way I wanted to do it. My first cut added a "weblicate" menu option right below the "copy" menu option in the basic editGroupMenu template. Then I just implemented a variant of the copySelection method for this menu item. The problem with this approach is that apparently many applications set some other object than the controller as the menu message receiver. So they'd all have to implement the variant copySelection method.
Ironically, most of those application implementations of copySelection, simply call the same method in the controller, the place I had put my variant in the first place. Imagine how much trampoline code could be removed if ControllerWithMenu checked first with its menu message receiver and sent the message if found there, but if not, defaulted back to itself?