// // MyDocument.java // ScriptableCJ // // Created by Mike Butler on Tue Aug 03 2004. // Copyright (c) 2004 __MyCompanyName__. All rights reserved. // import com.apple.cocoa.application.*; import com.apple.cocoa.foundation.*; public class MyDocument extends NSDocument { /** IBOutlet **/ public NSTextView mainTextView; public MyDocument() { super(); } public MyDocument(String fileName, String fileType) { super(fileName, fileType); } public String windowNibName() { return "MyDocument"; } public void windowControllerDidLoadNib(NSWindowController aController) { super.windowControllerDidLoadNib(aController); // Add any code here that needs to be executed once the windowController has loaded the document's window. } public NSData dataRepresentationOfType(String aType) { // Insert code here to create and return the data for your document. return null; } public boolean loadDataRepresentation(NSData data, String aType) { // Insert code here to read your document from the given data. return true; } public NSTextStorage myContents(){ return mainTextView.textStorage(); } public void setMyContents( NSTextStorage inStorage ){ mainTextView.textStorage().setAttributedString( inStorage ); } public void handleExport( NSScriptCommand inCommand ) { System.out.println( "handleExport called" ); } }