org.rococoa.cocoa.appkit
Class NSDocumentController

java.lang.Object
  extended by org.rococoa.cocoa.foundation.NSObject
      extended by org.rococoa.cocoa.appkit.NSDocumentController
All Implemented Interfaces:
NSUserInterfaceValidations, NSCoding, NSObject, ObjCObject

public abstract class NSDocumentController
extends NSObject
implements ObjCObject, NSCoding, NSUserInterfaceValidations

This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java, Rococoa, or JNA.


Nested Class Summary
static class NSDocumentController._class_
           
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSCoding
NSCoding._static_
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.appkit.protocols.NSUserInterfaceValidations
NSUserInterfaceValidations._static_
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject
NSObject._static_
 
Constructor Summary
NSDocumentController()
           
 
Method Summary
abstract  void addDocument(NSDocument document)
          Add or remove a document from the list of open documents.
static NSDocumentController alloc()
           
 NSDeprecated as_NSDocumentController_NSDeprecated()
           
abstract  NSObject autosavingDelay()
          Original signature : -(id)autosavingDelay
native declaration : NSDocumentController.h:124
abstract  void clearRecentDocuments(ObjCObject sender)
          The action of the Open Recent menu's Clear Menu item.
abstract  void closeAllDocumentsWithDelegate_didCloseAllSelector_contextInfo(ObjCObject delegate, Selector didCloseAllSelector, Pointer contextInfo)
          For each open, modified, document present a document-modal alert panel asking whether the document should be saved and giving the option of canceling, not saving the document, or saving the document.
static NSDocumentController create()
          Factory method
abstract  NSString currentDirectory()
          Return the path of the directory containing the active document's file or file package, if there is an active document and it has a file or file package.
abstract  NSObject currentDocument()
          Return the active document, or nil if there is no active document.
abstract  NSString defaultType()
          Return the name of the document type that should be used when creating new documents.
abstract  NSString displayNameForType(NSString typeName)
          Given a document type name, return a string describing the document type that is fit to present to the user, or nil for failure.
abstract  ObjCClass documentClassForType(NSString typeName)
          Given a document type name, return the subclass of NSDocument that should be instantiated when opening a document of that type, or nil for failure.
abstract  NSArray documentClassNames()
          Return the names of NSDocument subclasses supported by this application.
abstract  NSObject documentForURL(NSURL absoluteURL)
          Given a URL, return the open document whose file or file package is located by the URL, or nil if there is no such open document.
abstract  NSObject documentForWindow(NSWindow window)
          Given a window, return the document corresponding to the window, nil if no document corrresponds to the window.
abstract  NSArray documents()
          Return an array of all open documents.
static NSDocumentController._class_ getNSClass()
           
abstract  boolean hasEditedDocuments()
          Return YES if any open document is modified, NO otherwise.
abstract  NSDocumentController init()
          The designated initializer.
abstract  NSObject makeDocumentForURL_withContentsOfURL_ofType_error(NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, NSString typeName, PointerByReference outError)
          Instantiate a document located by a URL, of a specified type, but by reading the contents for the document from another URL, and return it if successful.
abstract  NSObject makeDocumentWithContentsOfURL_ofType_error(NSURL absoluteURL, NSString typeName, PointerByReference outError)
          Instantiate a document located by a URL, of a specified type, and return it if successful.
abstract  NSObject makeUntitledDocumentOfType_error(NSString typeName, PointerByReference outError)
          Instantiate a new untitled document of the specified type and return it if successful.
abstract  NSUInteger maximumRecentDocumentCount()
          Return the maximum number of items that may be presented in the standard Open Recent menu.
static NSDocumentController new_()
           
abstract  void newDocument(ObjCObject sender)
          The action of the File menu's New item in a document-based application.
abstract  void noteNewRecentDocument(NSDocument document)
          Add an item corresponding to a document to the Open Recent menu, or replace an existing item for the same document.
abstract  void noteNewRecentDocumentURL(NSURL absoluteURL)
          Add an item corresponding to the data located by a URL to the Open Recent menu, or replace an existing item with the same URL.
abstract  void openDocument(ObjCObject sender)
          The action of the File menu's Open... item in a document-based application.
abstract  NSObject openDocumentWithContentsOfURL_display_error(NSURL absoluteURL, boolean displayDocument, PointerByReference outError)
          Open a document located by a URL, present its user interface if displayDocuments is YES, and return the document if successful.
abstract  NSObject openUntitledDocumentAndDisplay_error(boolean displayDocument, PointerByReference outError)
          Create a new untitled document, present its user interface if displayDocument is YES, and return the document if successful.
abstract  void presentError_modalForWindow_delegate_didPresentSelector_contextInfo(NSError error, NSWindow window, ObjCObject delegate, Selector didPresentSelector, Pointer contextInfo)
          Methods that are declared by NSResponder and also implemented by NSDocumentController, even though for historical reasons NSDocumentController is not a subclass of NSResponder.
abstract  boolean presentError(NSError error)
          Original signature : -(BOOL)presentError:(NSError*)
native declaration : NSDocumentController.h:161
abstract  NSArray recentDocumentURLs()
          Return an array of URLs for the entries currently appearing in the Open Recent menu.
abstract  void removeDocument(NSDocument document)
          Original signature : -(void)removeDocument:(NSDocument*)
native declaration : NSDocumentController.h:63
abstract  boolean reopenDocumentForURL_withContentsOfURL_error(NSURL absoluteDocumentURL, NSURL absoluteDocumentContentsURL, PointerByReference outError)
          Reopen a document located by a URL by reading the contents for the document from another URL, present its user interface, and return YES if successful.
abstract  void reviewUnsavedDocumentsWithAlertTitle_cancellable_delegate_didReviewAllSelector_contextInfo(NSString title, boolean cancellable, ObjCObject delegate, Selector didReviewAllSelector, Pointer contextInfo)
          If there is more than one modified document, present an application-modal alert panel telling the user that there are unsaved documents and giving the option of canceling, not saving the documents, or saving the documents.
abstract  NSInteger runModalOpenPanel_forTypes(NSOpenPanel openPanel, NSArray types)
          Present the application-modal open panel to the user, specifying a list of UTIs (in Mac OS 10.5), file name extensions, and encoded HFS file types for openable files.
abstract  void saveAllDocuments(ObjCObject sender)
          The action of the File menu's Save All item in a document-based application.
static NSDocumentController sharedDocumentController()
          Return the application's shared document controller.
abstract  NSString typeForContentsOfURL_error(NSURL inAbsoluteURL, PointerByReference outError)
          Given a URL, return the name of the document type that should be used when opening the document at that location, if successful.
abstract  NSArray URLsFromRunningOpenPanel()
          Present an application-modal open panel to the user and, if the user selects one or more files and indicates that they are to be opened, return an array of those files' URLs.
abstract  boolean validateUserInterfaceItem(NSValidatedUserInterfaceItem anItem)
          Conformance to the NSUserInterfaceValidations protocol.
abstract  NSError willPresentError(NSError error)
          Original signature : -(NSError*)willPresentError:(NSError*)
native declaration : NSDocumentController.h:162
 
Methods inherited from class org.rococoa.cocoa.foundation.NSObject
as_NSObject_NSAccessibility, as_NSObject_NSAccessibilityAdditions, as_NSObject_NSApplicationScriptingDelegation, as_NSObject_NSArchiverCallback, as_NSObject_NSClassDescriptionPrimitives, as_NSObject_NSCoderMethods, as_NSObject_NSColorPanelResponderMethod, as_NSObject_NSComparisonMethods, as_NSObject_NSControlSubclassNotifications, as_NSObject_NSCopyLinkMoveHandler, as_NSObject_NSDelayedPerforming, as_NSObject_NSDeprecatedKeyValueCoding, as_NSObject_NSDeprecatedKeyValueObservingCustomization, as_NSObject_NSDeprecatedMethods, as_NSObject_NSDictionaryControllerKeyValuePair, as_NSObject_NSDistributedObjects, as_NSObject_NSDraggingDestination, as_NSObject_NSDraggingSource, as_NSObject_NSDraggingSourceDeprecated, as_NSObject_NSEditor, as_NSObject_NSEditorRegistration, as_NSObject_NSErrorRecoveryAttempting, as_NSObject_NSFileManagerFileOperationAdditions, as_NSObject_NSFontManagerDelegate, as_NSObject_NSFontManagerResponderMethod, as_NSObject_NSFontPanelValidationAdditions, as_NSObject_NSKeyValueBindingCreation, as_NSObject_NSKeyValueCoding, as_NSObject_NSKeyValueObserverNotification, as_NSObject_NSKeyValueObserverRegistration, as_NSObject_NSKeyValueObserving, as_NSObject_NSKeyValueObservingCustomization, as_NSObject_NSMenuValidation, as_NSObject_NSNibAwaking, as_NSObject_NSPasteboardOwner, as_NSObject_NSPlaceholders, as_NSObject_NSScriptClassDescription, as_NSObject_NSScripting, as_NSObject_NSScriptingComparisonMethods, as_NSObject_NSScriptKeyValueCoding, as_NSObject_NSScriptObjectSpecifiers, as_NSObject_NSThreadPerformAdditions, as_NSObject_NSURLClient, as_NSObject_NSURLConnectionDelegate, as_NSObject_NSURLDownloadDelegate, copy, dealloc, description, doesNotRecognizeSelector, finalize, forwardingTargetForSelector, forwardInvocation, isKindOfClass, isKindOfClass, methodForSelector, methodSignatureForSelector, mutableCopy, release, retain, retainCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSCoding
encodeWithCoder, initWithCoder
 
Methods inherited from interface org.rococoa.ObjCObject
id
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject
autorelease, class_, conformsToProtocol, hash, isEqual, isMemberOfClass, isProxy, performSelector_withObject_withObject, performSelector_withObject, performSelector, respondsToSelector, self, superclass, zone
 

Constructor Detail

NSDocumentController

public NSDocumentController()
Method Detail

as_NSDocumentController_NSDeprecated

public NSDeprecated as_NSDocumentController_NSDeprecated()

sharedDocumentController

public static NSDocumentController sharedDocumentController()
Return the application's shared document controller. This method will create an instance of NSDocumentController if there is no shared document controller yet. Because the first instance of NSDocumentController to be allocate and initialized during application launch is used as the shared document controller, you have two options for installing an instance of a custom subclass of NSDocumentController as the shared document controller:
1) Instantiate your NSDocumentController subclass in the application's main nib, or
2) Allocate and initialize an instance of your subclass in your application delegate's applicationWillFinishLaunching: method.
Original signature : +(id)sharedDocumentController
native declaration : NSDocumentController.h:30


init

public abstract NSDocumentController init()
The designated initializer. The first instance of NSDocumentController to be allocate and initialized during application launch is used as the shared document controller.
Original signature : -(id)init
native declaration : NSDocumentController.h:34

Specified by:
init in class NSObject

create

public static NSDocumentController create()
Factory method

See Also:
init()

documents

public abstract NSArray documents()
Return an array of all open documents.
Original signature : -(NSArray*)documents
native declaration : NSDocumentController.h:40


currentDocument

public abstract NSObject currentDocument()
Return the active document, or nil if there is no active document. The "active" document is the one corresponding to the key window, or the one corresponding to the main window if the key window has no document.
Original signature : -(id)currentDocument
native declaration : NSDocumentController.h:44


currentDirectory

public abstract NSString currentDirectory()
Return the path of the directory containing the active document's file or file package, if there is an active document and it has a file or file package. Return nil otherwise. The default implementation of -URLsFromRunningOpenPanel invokes this to find the current directory to set in the open panel before presenting it.
Original signature : -(NSString*)currentDirectory
native declaration : NSDocumentController.h:48


documentForURL

public abstract NSObject documentForURL(NSURL absoluteURL)
Given a URL, return the open document whose file or file package is located by the URL, or nil if there is no such open document. The default implementation of this method queries each open document to find one whose URL matches, and returns the first one whose URL does match.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self documentForFileName:[url path]] if -documentForFileName: is overridden and the URL uses the "file:" scheme.
Original signature : -(id)documentForURL:(NSURL*)
native declaration : NSDocumentController.h:54


documentForWindow

public abstract NSObject documentForWindow(NSWindow window)
Given a window, return the document corresponding to the window, nil if no document corrresponds to the window.
Original signature : -(id)documentForWindow:(NSWindow*)
native declaration : NSDocumentController.h:58


addDocument

public abstract void addDocument(NSDocument document)
Add or remove a document from the list of open documents. You can override these methods if your application needs to customize what is done when documents are opened and closed. -addDocument is invoked by the default implementations of all NSDocumentController methods whose names start with "open." Your application can invoke -addDocument: manually if it creates a document using something other than one of NSDocument's "open" methods. -removeDocument is invoked by the default implementation of -[NSDocument close].
Original signature : -(void)addDocument:(NSDocument*)
native declaration : NSDocumentController.h:62


removeDocument

public abstract void removeDocument(NSDocument document)
Original signature : -(void)removeDocument:(NSDocument*)
native declaration : NSDocumentController.h:63


newDocument

public abstract void newDocument(ObjCObject sender)
The action of the File menu's New item in a document-based application. The default implementation of this method invokes -openUntitledDocumentAndDisplay:error: and, if nil is returned, presents the error in an application-modal panel.
Original signature : -(void)newDocument:(id)
native declaration : NSDocumentController.h:69


openUntitledDocumentAndDisplay_error

public abstract NSObject openUntitledDocumentAndDisplay_error(boolean displayDocument,
                                                              PointerByReference outError)
Create a new untitled document, present its user interface if displayDocument is YES, and return the document if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new untitled document could not be created. The default implementation of this method invokes [self defaultType] to determine the type of new document to create, invokes -makeUntitledDocumentOfType:error: to create it, then invokes -addDocument: to record its opening. If displayDocument is YES, it then sends the new document -makeWindowControllers and -showWindows messages.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self openUntitledDocumentOfType:[self defaultType] display:displayDocument] if -openUntitledDocumentOfType:display: is overridden.
Original signature : -(id)openUntitledDocumentAndDisplay:(BOOL) error:(NSError**)
native declaration : NSDocumentController.h:75


makeUntitledDocumentOfType_error

public abstract NSObject makeUntitledDocumentOfType_error(NSString typeName,
                                                          PointerByReference outError)
Instantiate a new untitled document of the specified type and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why a new untitled document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initWithType:error: message.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self makeUntitledDocumentOfType:typeName] if -makeUntitledDocumentOfType: is overridden.
Original signature : -(id)makeUntitledDocumentOfType:(NSString*) error:(NSError**)
native declaration : NSDocumentController.h:81


openDocument

public abstract void openDocument(ObjCObject sender)
The action of the File menu's Open... item in a document-based application. The default implementation of this method invokes -URLsFromRunningOpenPanel, unless -fileNamesFromRunningOpenPanel is overridden, in which case that method is invoked instead for backward binary compatibility with Mac OS 10.3 and earlier. If something other than nil is returned, it invokes -openDocumentWithContentsOfURL:display:error: for each URL and, if nil is returned for any of them, presents the error in an application-modal panel and stops trying to open documents.
Original signature : -(void)openDocument:(id)
native declaration : NSDocumentController.h:87


URLsFromRunningOpenPanel

public abstract NSArray URLsFromRunningOpenPanel()
Present an application-modal open panel to the user and, if the user selects one or more files and indicates that they are to be opened, return an array of those files' URLs. Return nil otherwise. The default implementation of this method invokes -runModalOpenPanel:forTypes: after it has set up an open panel.
Original signature : -(NSArray*)URLsFromRunningOpenPanel
native declaration : NSDocumentController.h:91


runModalOpenPanel_forTypes

public abstract NSInteger runModalOpenPanel_forTypes(NSOpenPanel openPanel,
                                                     NSArray types)
Present the application-modal open panel to the user, specifying a list of UTIs (in Mac OS 10.5), file name extensions, and encoded HFS file types for openable files. Return NSOKButton or NSCancelButton depending on how the user dismisses the panel.
Original signature : -(NSInteger)runModalOpenPanel:(NSOpenPanel*) forTypes:(NSArray*)
native declaration : NSDocumentController.h:95


openDocumentWithContentsOfURL_display_error

public abstract NSObject openDocumentWithContentsOfURL_display_error(NSURL absoluteURL,
                                                                     boolean displayDocument,
                                                                     PointerByReference outError)
Open a document located by a URL, present its user interface if displayDocuments is YES, and return the document if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be opened. The default implementation of this method checks to see if the document is already open according to -documentForURL:, and if it is not open determines the type of the document, invokes -makeDocumentWithContentsOfURL:ofType:error: to instantiate it, then invokes -addDocument: to record its opening, and sends the document -makeWindowControllers and -showWindows messages if displayDocument is YES. If the document is already open it is just sent a -showWindows message if displayDocument is YES.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self openDocumentWithContentsOfFile:[absoluteURL path] display:displayDocuments], if -openDocumentWithContentsOfFile:display: is overridden and the URL uses the "file:" scheme.
Original signature : -(id)openDocumentWithContentsOfURL:(NSURL*) display:(BOOL) error:(NSError**)
native declaration : NSDocumentController.h:101


makeDocumentWithContentsOfURL_ofType_error

public abstract NSObject makeDocumentWithContentsOfURL_ofType_error(NSURL absoluteURL,
                                                                    NSString typeName,
                                                                    PointerByReference outError)
Instantiate a document located by a URL, of a specified type, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initWithContentsOfURL:ofType:error: message.
For backward binary compatibility with Mac OS 10.3 and earlier, the default implementation of this method instead invokes [self makeDocumentWithContentsOfFile:[absoluteURL path] ofType:typeName] if -makeDocumentWithContentsOfFile:ofType: is overridden and the URL uses the "file:" scheme.
Original signature : -(id)makeDocumentWithContentsOfURL:(NSURL*) ofType:(NSString*) error:(NSError**)
native declaration : NSDocumentController.h:107


reopenDocumentForURL_withContentsOfURL_error

public abstract boolean reopenDocumentForURL_withContentsOfURL_error(NSURL absoluteDocumentURL,
                                                                     NSURL absoluteDocumentContentsURL,
                                                                     PointerByReference outError)
Reopen a document located by a URL by reading the contents for the document from another URL, present its user interface, and return YES if successful. If not successful, return NO after setting *outError to an NSError that encapsulates the reason why the document could not be reopened. The default implementation of this method determines the type of document being reopened, sends a -makeDocumentForURL:withContentsOfURL:ofType:error: to instantiate it, then invokes -addDocument: to record its opening. It then sends the document -makeWindowControllers and -showWindows messages.
Original signature : -(BOOL)reopenDocumentForURL:(NSURL*) withContentsOfURL:(NSURL*) error:(NSError**)
native declaration : NSDocumentController.h:113


makeDocumentForURL_withContentsOfURL_ofType_error

public abstract NSObject makeDocumentForURL_withContentsOfURL_ofType_error(NSURL absoluteDocumentURL,
                                                                           NSURL absoluteDocumentContentsURL,
                                                                           NSString typeName,
                                                                           PointerByReference outError)
Instantiate a document located by a URL, of a specified type, but by reading the contents for the document from another URL, and return it if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document could not be instantiated. The default implementation of this method invokes -documentClassForType: to find out the class of document to instantiate, allocates a document object, and initializes it by sending it an -initForURL:withContentsOfURL:ofType:error: message.
Original signature : -(id)makeDocumentForURL:(NSURL*) withContentsOfURL:(NSURL*) ofType:(NSString*) error:(NSError**)
native declaration : NSDocumentController.h:117


autosavingDelay

public abstract NSObject autosavingDelay()
Original signature : -(id)autosavingDelay
native declaration : NSDocumentController.h:124


saveAllDocuments

public abstract void saveAllDocuments(ObjCObject sender)
The action of the File menu's Save All item in a document-based application. The default implementation of this method sends each modified document a -saveDocumentWithDelegate:didSaveSelector:contextInfo: message.
Original signature : -(void)saveAllDocuments:(id)
native declaration : NSDocumentController.h:130


hasEditedDocuments

public abstract boolean hasEditedDocuments()
Return YES if any open document is modified, NO otherwise. This method is invoked at application quitting time, to determine whether -reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo: should be invoked.
Original signature : -(BOOL)hasEditedDocuments
native declaration : NSDocumentController.h:136


reviewUnsavedDocumentsWithAlertTitle_cancellable_delegate_didReviewAllSelector_contextInfo

public abstract void reviewUnsavedDocumentsWithAlertTitle_cancellable_delegate_didReviewAllSelector_contextInfo(NSString title,
                                                                                                                boolean cancellable,
                                                                                                                ObjCObject delegate,
                                                                                                                Selector didReviewAllSelector,
                                                                                                                Pointer contextInfo)
If there is more than one modified document, present an application-modal alert panel telling the user that there are unsaved documents and giving the option of canceling, not saving the documents, or saving the documents. If the user indicates that saving should be done, or if there was only one modified document in the first place, invoke -closeAllDocumentsWithDelegate:didCloseAllSelector:didReviewAll:contextInfo: to attempt to close all modified documents, doing whatever saving is necessary to not lose data. Finally, send the message selected by didReviewAllSelector to the delegate, with the contextInfo as the last argument. The default implementation of this method ignores the passed-in title string (which is passed in only as the result of a historical quirk). The method selected by didReviewAllSelector must have the same signature as:
- (void)documentController:(NSDocumentController *)documentController didReviewAll:(BOOL)didReviewAll contextInfo:(void *)contextInfo;
Original signature : -(void)reviewUnsavedDocumentsWithAlertTitle:(NSString*) cancellable:(BOOL) delegate:(id) didReviewAllSelector:(SEL) contextInfo:(void*)
native declaration : NSDocumentController.h:142


closeAllDocumentsWithDelegate_didCloseAllSelector_contextInfo

public abstract void closeAllDocumentsWithDelegate_didCloseAllSelector_contextInfo(ObjCObject delegate,
                                                                                   Selector didCloseAllSelector,
                                                                                   Pointer contextInfo)
For each open, modified, document present a document-modal alert panel asking whether the document should be saved and giving the option of canceling, not saving the document, or saving the document. Stop presenting alert panels if the user indicates cancellation in any one of them. The default implementation of this merely sends each open document -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: and -close messages until one of them cannot be closed. The method selected by didCloseAllSelector must have the same signature as:
- (void)documentController:(NSDocumentController *)documentController didCloseAll:(BOOL)didCloseAll contextInfo:(void *)contextInfo;
Original signature : -(void)closeAllDocumentsWithDelegate:(id) didCloseAllSelector:(SEL) contextInfo:(void*)
native declaration : NSDocumentController.h:148


presentError_modalForWindow_delegate_didPresentSelector_contextInfo

public abstract void presentError_modalForWindow_delegate_didPresentSelector_contextInfo(NSError error,
                                                                                         NSWindow window,
                                                                                         ObjCObject delegate,
                                                                                         Selector didPresentSelector,
                                                                                         Pointer contextInfo)
Methods that are declared by NSResponder and also implemented by NSDocumentController, even though for historical reasons NSDocumentController is not a subclass of NSResponder. NSDocumentController's default implementations are equivalent to NSResponder's while treating the application object as the "next responder" and forwarding error presentation messages to it.
NSDocument has overrides of -presentError:modalForWindow:delegate:didPresentSelector:contextInfo: and -presentError: that treat the shared document controller as the "next responder" and forward these messages it.
The default implementations of several NSDocumentController methods invoke -presentError:.
You can customize the presentation of errors for all kinds of documents by overriding -willPresentError:. Your override should follow the advice given for overriding of -[NSResponder willPresentError:].
Original signature : -(void)presentError:(NSError*) modalForWindow:(NSWindow*) delegate:(id) didPresentSelector:(SEL) contextInfo:(void*)
native declaration : NSDocumentController.h:160


presentError

public abstract boolean presentError(NSError error)
Original signature : -(BOOL)presentError:(NSError*)
native declaration : NSDocumentController.h:161


willPresentError

public abstract NSError willPresentError(NSError error)
Original signature : -(NSError*)willPresentError:(NSError*)
native declaration : NSDocumentController.h:162


maximumRecentDocumentCount

public abstract NSUInteger maximumRecentDocumentCount()
Return the maximum number of items that may be presented in the standard Open Recent menu. A value of 0 indicates that NSDocumentController will not attempt to add an Open Recent menu to your application's File menu, though NSDocumentController will not attempt to remove any Open Recent menu item if there is one already there. The default implementation returns a value that is subject to change and may or may not be derived from a setting made by the user in a System Preferences panel.
Original signature : -(NSUInteger)maximumRecentDocumentCount
native declaration : NSDocumentController.h:168


clearRecentDocuments

public abstract void clearRecentDocuments(ObjCObject sender)
The action of the Open Recent menu's Clear Menu item.
Original signature : -(void)clearRecentDocuments:(id)
native declaration : NSDocumentController.h:172


noteNewRecentDocument

public abstract void noteNewRecentDocument(NSDocument document)
Add an item corresponding to a document to the Open Recent menu, or replace an existing item for the same document.
Original signature : -(void)noteNewRecentDocument:(NSDocument*)
native declaration : NSDocumentController.h:176


noteNewRecentDocumentURL

public abstract void noteNewRecentDocumentURL(NSURL absoluteURL)
Add an item corresponding to the data located by a URL to the Open Recent menu, or replace an existing item with the same URL. You can use this even in non-NSDocument-based applications.
Original signature : -(void)noteNewRecentDocumentURL:(NSURL*)
native declaration : NSDocumentController.h:180


recentDocumentURLs

public abstract NSArray recentDocumentURLs()
Return an array of URLs for the entries currently appearing in the Open Recent menu.
Original signature : -(NSArray*)recentDocumentURLs
native declaration : NSDocumentController.h:184


defaultType

public abstract NSString defaultType()
Return the name of the document type that should be used when creating new documents. The default implementation of this method returns the first Editor type declared in the application's Info.plist, or returns nil if no Editor type is declared. You can override it to customize the type of document that is created when, for instance, the user chooses New in the File menu.
Original signature : -(NSString*)defaultType
native declaration : NSDocumentController.h:190


typeForContentsOfURL_error

public abstract NSString typeForContentsOfURL_error(NSURL inAbsoluteURL,
                                                    PointerByReference outError)
Given a URL, return the name of the document type that should be used when opening the document at that location, if successful. If not successful, return nil after setting *outError to an NSError that encapsulates the reason why the document's type could not be determined, or the fact that the document's type is just unrecognized. The default implementation of this method merely returns the URL's NSURLTypeIdentifierKey resource value. You can override this to customize type determination for documents being opened.
For backward binary compatibility with Mac OS 10.4 and earlier, the default implementation of this method actually first does the same thing that it did in Mac OS 10.4 (invoke -typeFromFileExtension:, possibly twice, passing an HFS file type string for the second invocation) if there are any CFBundleDocumentTypes Info.plist entries that don't have LSItemContentTypes subentries, and only gets the URL's NSURLTypeIdentifierKey resource value if that does not succeed.
Original signature : -(NSString*)typeForContentsOfURL:(NSURL*) error:(NSError**)
native declaration : NSDocumentController.h:196


documentClassNames

public abstract NSArray documentClassNames()
Return the names of NSDocument subclasses supported by this application. The default implementation of this method returns information derived from the application's Info.plist. You can override it to return the names of document classes that are dynamically loaded from plugins.
Original signature : -(NSArray*)documentClassNames
native declaration : NSDocumentController.h:200


documentClassForType

public abstract ObjCClass documentClassForType(NSString typeName)
Given a document type name, return the subclass of NSDocument that should be instantiated when opening a document of that type, or nil for failure.
Original signature : -(Class)documentClassForType:(NSString*)
native declaration : NSDocumentController.h:204


displayNameForType

public abstract NSString displayNameForType(NSString typeName)
Given a document type name, return a string describing the document type that is fit to present to the user, or nil for failure.
Original signature : -(NSString*)displayNameForType:(NSString*)
native declaration : NSDocumentController.h:208


validateUserInterfaceItem

public abstract boolean validateUserInterfaceItem(NSValidatedUserInterfaceItem anItem)
Conformance to the NSUserInterfaceValidations protocol. NSDocumentController's implementation of this method conditionally enables menu items for all of the action methods listed in this header file, as well as the private action method for Open Recent menu items.
Original signature : -(BOOL)validateUserInterfaceItem:(id)
native declaration : NSDocumentController.h:214

Specified by:
validateUserInterfaceItem in interface NSUserInterfaceValidations

alloc

public static NSDocumentController alloc()

new_

public static NSDocumentController new_()

getNSClass

public static NSDocumentController._class_ getNSClass()


Copyright © 2009. All Rights Reserved.