- Inherits From:
- NSObject
- Conforms To:
- WTool
- Declared In:
- GeneralTool.h
Most importantly, the class contains "empty" definitions of most of the methods required by the WTool protocol. Only dealloc and wakeupBundle:toolbox should inherit the behavior of super.
IBOutlet NSView *oMainView;
IBOutlet NSView *oInitialFirstResponder;
IBOutlet NSDrawer *oDetailDrawer;
IBOutlet NSDrawer *oConfigurationDrawer;
WToolbox *mWToolbox;
ParseManager *mParseManager;
oMainView Outlet to main view oInitialFirstResponder Outlet to initial first responder in view oDetailDrawer Outlet to the detail drawer oConfigurationDrawer Outlet to the configuration drawer mWToolbox Reference to the toolbox object mParseManager Reference to the ParseManager created for you
Methods that are part of GeneralTool and are not part of the WTool protocol.Methods dealing with creation, selection, and deselection of a tool
- - toolbox
- - parseManager
- - loadSuccess:handle:parameter:
- - loadSuccess:parameter:
- - loadCancelledParameter:
- - loadError:parameter:
Built-in periodic events
- - wakeupBundle:toolbox:
- - wakeupBundle:toolbox:loaders:capacity:
- - initialFirstResponder
- - needsConfiguration
- - toolSelected
- - toolDeselected
Views and drawers
- - toolPeriodic
Selection opening and saving
- - configurationDrawer
- - detailDrawer
- - mainView
Filling menus
- - canOpenSelection
- - canSaveSelection
- - openSelection:
- - selectedItemName
- - selectedItemExtension
- - saveSelectedItemToPath:hideExtension:
New as of 1.5
- - multiParsers
- - addHomePagesToDictionary:
- - loadMore
- - stopLoading
- (void)addHomePagesToDictionary:(NSMutableDictionary *)inDictionary
don't add anything to the home page list.
- (BOOL)canOpenSelection
Empty method that returns NO; subclasses can override this if desired.
- (BOOL)canSaveSelection
Empty method that returns NO; subclasses can override this if desired.
- (id)configurationDrawer
Return the configuration drawer from the outlet. That drawer should have its content view set.
- (id)detailDrawer
Return the detail drawer from the outlet. That drawer should have its content view set.
- (id)initialFirstResponder
Return the initial first responder from the outlet. If this is not hooked up, a warning will be logged. If this is hooked up to something invalid (such as an item inside a tab view that is not visible, a strange menu behavior where certain menus (Close, Customize Toolbar, etc.) are disabled.
- (void)loadCancelledParameter:(id)inParam
Empty method; subclasses may override this if they use the built-in ParseManager
- (void)loadError:(id)inError parameter:(id)inParam
Generic method that just shows an alert; subclasses may override this if they use the built-in ParseManager
- (void)loadMore
Load more results, from clicking the More button. New as of 1.2.
- (void)loadSuccess:(id)inData handle:(id)inURLHandle parameter:(id)inParam
General method that just invokes loadSuccess:parameter: and ignores the handle parameter. For backward compatibility, since most tools are written not needing the handle.
- (void)loadSuccess:(id)inData parameter:(id)inParam
Empty method; subclasses must override this if they use the built-in ParseManager. Or, they can override loadSuccess:handle:parameter:
- (id)mainView
Return the main view from the outlet
- (NSArray *)multiParsers
No multiparsers associated with the tool unless overridden.
- (BOOL)needsConfiguration
Return NO; subclasses can override this if configuration may be needed when the tool is chosen.
- (IBAction)openSelection:(id)sender
Empty method; subclasses should override this if canOpenSelection overridden.
- (ParseManager *)parseManager
Return the ParseManager that is automatically managed for all subclasses of GeneralTool.
- (BOOL)saveSelectedItemToPath:(NSString *)inPath hideExtension:(BOOL)inHideExtension
Empty method that returns NO; subclasses should override this canSaveSelection is overridden.
- (NSString *)selectedItemExtension
Empty method that returns nil; subclasses should override this canSaveSelection is overridden.
- (NSString *)selectedItemName
Empty method that returns nil; subclasses should override this canSaveSelection is overridden.
- (void)stopLoading
Stop loading, from clicking the Stop button. This handles the parseManager here; subclasses must implement any other functionality. New as of 1.2.
- (void)toolDeselected
Stop any loading in progress; subclasses can override this if desired to do additional deeds.
- (NSString *)toolPeriodic
Empty method that returns nil; subclasses can override this if desired.
- (void)toolSelected
Empty method; subclasses can override this if desired.
- (WToolbox *)toolbox
Return the toolbox associated with the window that the tool is displayed on.
- (BOOL)wakeupBundle:(NSBundle *)inBundle toolbox:(WToolbox *)inToolbox
Store the toolbox away, and create a ParseManager for use by these subclasses. Subclasses should invoke super in order to make use of the toolbox and parseManager methods.
- (BOOL)wakeupBundle:(NSBundle *)inBundle toolbox:(WToolbox *)inToolbox loaders:(int)inLoaders capacity:(int)inCapacity
Store the toolbox away, and create a ParseManager for use by these subclasses. Subclasses should invoke super in order to make use of the toolbox and parseManager methods. This variant creates a URLStackManager behind the scenes with the given number of concurrent loaders and max capacity.