This is MiscInspectorWrapper.h in view mode; [Download] [Up]
/* MiscInspectorWrapper.h * * This is a class that allows a simple collection of single inspectors that * work one the same type of data. To the manager they all appear as one * mulitpurpose inspector. * * Usage: You need to implement a proper doesHandleSelection method. The * rest cn be done inside IB. * This class will be useful if you want to have one NIB that contains * all the different single-inspectors (subviewControllers) but you * only want the NIB to be loaded when it's needed. * Also this enables you to programatically create many copies of * a single inspector and have it respond to different triggers. * At runtime the wrapper has to find out how many copys are needed * (remember: there must be a ono-on-one trigger-inspector(controller) * relation because of the swapView objects) * and he can creat them. That's how NotApplicable etc are * implemented (also they are not really wrapper subclasses) * * Notes: Maybe it's somewhat confusing be I'll try to clarify it a little bit. * ...or maybe I'll confuse you even more. * All the single inspectors will initially think that the wrapper is * the real inspector manager. But this is buggy and stupid. * A wrapper can not provide the information about selections etc. like * a real manager should. But we need to fool the single inspectors for * the first time to let it register (addInspector) itself right here * at the wrapper. * After the wrapper has added an inspector it can set the single * inspectors manager to the real app inspector manager. So all * selection info can be found etc . pp. * * Inside the wrapper I decided to naem single inspectors just * controllers because the are somehow handicaped inspectors. * They are lacking (or can/should lack) a usaable doesHandleSelection * implementation because this is perfectly handled by the wrapper. * * Written by: Thomas Engel * Created: 08.02.1994 (Copyright 1994 Thomas Engel) * Last modified: 24.02.1994 */ // This object is included in the MiscKit by permission from the author // and its use is governed by the MiscKit license, found in the file // "LICENSE.rtf" in the MiscKit distribution. Please refer to that file // for a list of all applicable permissions and restrictions. #import <appkit/appkit.h> @interface MiscInspectorWrapper:Object { id manager; id controllers; } // Locally we speak of controllers but to work properly we have to use the // same method as the inspectorManager does. // The haredst part it to implement a new doesHandle method that checks the // selection and loads the NIB if it finds work is one the way. - (BOOL)doesHandleSelection; - setManager:anObject; - addInspector:anInspector; - addWrappedControllers; // The following methods are almost stupid . They only ask the manager for // the same info. They are included for more WM-Inspector appearance and to // Have the wrapper behave more like a MiscInspector. - window; - okButton; - revertButton; - selection; - (unsigned)selectionCount; @end /* * History: 24.02.94 Added the selection etc methods. * * 08.02.94 First code entered. * * * Bugs: - No read/write. */
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.