• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDocument / Java problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument / Java problem


  • Subject: Re: NSDocument / Java problem
  • From: Marc Pergand <email@hidden>
  • Date: Thu, 26 Feb 2004 18:45:20 +0100

Sorry, I can't reproduce this behaviour...

//
// MyDocument.java
// essaiDoc
//
// Created by Marc on Thu Feb 26 2004.
// Copyright (c) 2004 Marc Pergand. All rights reserved.
//
package myPackage;

import com.apple.cocoa.application.*;
import com.apple.cocoa.foundation.*;

public class MyDocument extends NSDocument {

NSData data;

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 data;
}

public boolean loadDataRepresentation(NSData data, String aType) {
// Insert code here to read your document from the given data.
this.data=data;
System.out.println("Doc type: "+aType); // print the document type
return true;
}
}


I defined two doc types:
java doc .java
text doc .txt

The two kind of files are selectable in the open panel and when I save them they do have the correct extension.
It doesn't work the first time because I forgot to specified 'Editor' for one of them.

Anyway, to define a package for CocoaJava class leading to a lot of problems in particular with InterfaceBuilder because it doesn't manage java packages.

I can't help you more...

Marc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: ScalingScrollView with Sketch [workaround]
  • Next by Date: Re: ScalingScrollView with Sketch [workaround]
  • Previous by thread: Re: NSDocument / Java problem
  • Next by thread: Setting scroll position: a nightmare!
  • Index(es):
    • Date
    • Thread