'From Squeak3.4 of 1 March 2003 [latest update: #5170] on 18 March 2003 at 7:45:55 pm'! "Change Set: FlapService Date: 17 March 2003 Author: Brent Vukmer This changeset creates an alternative to the 'quads'structure used by the Flaps class to create flap buttons and by the PartsBin class to create thumbnails. A FlapService object can be created from a 'quad' Array, can become a 'quad' Array, and can convert to a PartsBin thumbnail or an IconicButton."! Object subclass: #FlapService instanceVariableNames: 'serviceProvider instantiationCommand label description ' classVariableNames: '' poolDictionaries: '' category: 'Morphic-Flaps'! !FlapService commentStamp: 'bkv 3/17/2003 21:05' prior: 0! This class replaces the 'quad' structure used in the Flaps class to represent services provided by various classes to a FlapTab. See notes on the instVars below for details on this class's structure. Possible useful expressions for doIt or printIt: "Lookup all FlapServices in the system." FlapService allFlapServices. "Lookup all classes in the system that provide FlapServices." FlapService allFlapServiceProviders. "An example of creating a FlapService and turning it into a button." ( FlapService withQuadArray: { Workspace name asSymbol. #prototypicalToolWindow. 'Workspace'. 'A Workspace is a simple window for editing text. You can later save the contents to a file if you desire.' } ) openAsFlapButton. Structure: serviceProvider Class -- This is a Class that offers this 'flap service'. instantiationCommand Symbol -- A selector that is an instantiation command for the serviceProvider. label String -- A UI-display label. description String -- A UI-display description of the given flap service ( often displayed in balloon help). ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/13/2003 11:30'! description ^description ! ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/13/2003 11:30'! description: aDescription description _ aDescription. ! ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/13/2003 11:27'! instantiationCommand ^instantiationCommand! ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/13/2003 11:29'! instantiationCommand: aSelector instantiationCommand _ aSelector.! ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/13/2003 11:29'! label ^label ! ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/13/2003 11:29'! label: aLabel label _ aLabel ! ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/13/2003 11:22'! serviceProvider ^serviceProvider! ! !FlapService methodsFor: 'accessing' stamp: 'bkv 3/17/2003 20:59'! serviceProvider: aServiceProvider serviceProvider _ aServiceProvider.! ! !FlapService methodsFor: 'legacy' stamp: 'bkv 3/17/2003 22:06'! asQuadArray "This is a legacy method to supply 'quad' structures to Flaps code that expect them." ^{ (self serviceProvider name asSymbol). (self instantiationCommand). (self label). (self description). }! ! !FlapService methodsFor: 'printing' stamp: 'bkv 3/13/2003 20:53'! printOn: aStream aStream nextPutAll: self class asString, ' ', self serviceProvider asString. aStream nextPutAll: '