ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Documentation/MiscFindPanel/MiscFindPanelClass.rtf

This is MiscFindPanelClass.rtf in view mode; [Download] [Up]

Copyright ©1993 Christopher J. Kane.  All Rights Reserved.  Version 1.1.




MiscFindPanelClass



Category Of:	Application

Declared In:	MiscFindPanelClass.h




Category Description


The MiscFindPanelClass category of Application simplifies the interfacing of the MiscFindPanel class bundle to an application.  If the MiscFindPanel class is integrated into a project as a self-contained dynamically loaded class bundle and this category is added to the main project, the loading of the MiscFindPanel class and the construction of the MiscFindPanel itself will be delayed until the user (or code in the application) first demands it.  This can reduce the launch time of an application, at the expense of a small extra delay the first time the user asks for the facilities of the find panel.

Because the MiscFindPanel class, when it exists in a dynamically loading bundle, is not linked into the main executable of an application, the class cannot be referred to directly in the usual Objective-C way to send it class messages, nor is there anything to which connections can easily be made in a .nib file.  This category of Application solves these problems by providing action methods that will forward the messages to the find panel, and methods with which the MiscFindPanel class and instance can be obtained.  It also does the dynamic loading of the class code when it is first needed.

If NXApp or NXApp's delegate implements one or more of the delegate methods, it will be notified when the MiscFindPanel class has been loaded, or when the find panel will be created or has been created.  This functionality is only part of this category; it is not implemented by the MiscFindPanel class.  If both NXApp (for example, a subclass) and NXApp's delegate implement a method, the message will be sent to the delegate.




Instance Methods


enterSelection:
	- enterSelection:sender

Sends the find panel its enterSelection: action message, and returns the value returned by that method.



findNext:
	- findNext:sender

Sends the find panel its findForward: action message, and returns the value returned by that method.



findPanel
	- (FindPanel *)findPanel

Returns the find panel instance, loading the class and creating it if necessary.  If the panel could not be created, nil is returned.



MiscFindPanelClass
	- (Class)MiscFindPanelClass

Returns the MiscFindPanel class, loading it first if necessary.  If the class could not be loaded, Nil is returned.  This method does not cause the find panel instance to be created.



findPrevious:
	- findPrevious:sender

Sends the find panel its findBackward: action message, and returns the value returned by that method.



isMiscFindPanelClassLoaded
	- (BOOL)isMiscFindPanelClassLoaded

Returns YES if the MiscFindPanel class has been loaded (or was attempted to be loaded), NO otherwise.  This method does not cause the MiscFindPanel class to be loaded.



isFindPanelLoaded
	- (BOOL)isFindPanelLoaded

Returns YES if the find panel instance has been created (or was attempted to be created), NO otherwise.  This method does not cause the find panel instance to be created.



jumpToSelection:
	- jumpToSelection:sender

Sends the find panel its jumpToSelection: action message, and returns the value returned by that method.



orderFrontFindPanel:
	- orderFrontFindPanel:sender

Sends the find panel the makeKeyAndOrderFront: message, and returns the value returned by that method.




Delegate Methods


MiscFindPanelClassWasLoaded:
	- (Class)MiscFindPanelClassWasLoaded:(Class)theClass

Notifies NXApp's delegate, if it responds to this message, that the MiscFindPanel class was dynamically loaded (or was at least attempted to be loaded).  The class is passed as the parameter.  If theClass is Nil, then the class could not be loaded.  An implementation of this method is a good place to use the setReplacementEnabled: and setFindPbEnabled: MiscFindPanel class methods.  Note that the find panel itself has not yet been created when this method is called; if you wish to manipulate a control in the find panel directly, do that from within an implementation of the findPanelDidLoad: delegate method.

The delegate is given the chance to substitute another class for the class just loaded by returning a different class; theClass should be returned if the delegate does not want to substitute another class.  This functionality is of dubious value, except in cases where the MiscFindPanel class could not be loaded (theClass is Nil).  Then the delegate may choose to try to load the class itself, use a different class (which must be semantically equivalent to the MiscFindPanel class), display an alert panel to the user, or some other appropriate action.  Substituting another class for a succesfully loaded MiscFindPanel class is not recommended.    This method is called from within this category's MiscFindPanelClass method.



findPanelDidLoad:
	- (FindPanel *)findPanelDidLoad:(FindPanel *)thePanel

Notifies NXApp's delegate, if it responds to this message, that the find panel instance was created (or was at least attempted to be created).  The panel is passed as the parameter.  If thePanel is nil, then the panel could not be created.  This is a good place in which to configure specific controls within the find panel.  The delegate may substitute another panel for the loaded find panel by returning a value other than thePanel.  If the MiscFindPanel class could not load the find panel, the user is always shown an alert panel (by the sharedInstance class method) explaining that.  However, if you have substituted another class for the MiscFindPanel class (see the delegate method MiscFindPanelClassWasLoaded:, above), it is up to the substituted class or this method to inform the user.  Note, also, that substituting another panel only "applies" to the methods in this category; the MiscFindPanel class retains the former panel or nil (if there was an error creating the panel).  Substituting another panel for a successfully loaded find panel is not recommended.  This method is called from within this category's findPanel method.



findPanelWillLoad:
	- findPanelWillLoad:(Class)theClass

Notifies NXApp's delegate that the class theClass (usually the MiscFindPanel class) is about to create the find panel instance.  The find panel instance should not be accessed from within this method; use the findPanelDidLoad: method to configure parts of the find panel before the panel is put on-screen.  This method is called from within this category's findPanel method.  The return value is ignored.



These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.