FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

RES: OpenCookie example

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Eduardo Maurício da Costa
Posted via mailing list.





PostPosted: Mon Aug 11, 2008 4:07 pm    Post subject: RES: OpenCookie example Reply with quote

Richard,

So far, so good. You must add OpenCookie to your DataObject lookup. I use an
InstanceContent with AbstractLookup to add a new MyOpenCookie instance.

If both DataObject and your editor are on the same module, you can implement
it as an inner class.

If they are on different modules, and you don't care about their isolation
or extensibility, you can use an inner class, too (or pass the Lookup to the
OpenCookie).

Otherwise, you can override the DataNode.getNewTypes, using your preferred
way to locate appropriated instances.

Regards,
Eduardo

-----Mensagem original-----
De: Richard Catlin [mailto:richard.m.catlin@gmail.com]
Enviada em: segunda-feira, 11 de agosto de 2008 12:53
Para: dev@openide.netbeans.org
Assunto: [openide-dev] OpenCookie example

NetBean Platform developers,

WHAT I HAVE DONE:
I created a new Folder in the System Filesystem, using layer.xml, called
CustomFolder.
I created a CustomXMLSchema.xsd and used the New File Type Wizard to
generate the CustomDataObject and CustomDataNode.
I added sample CustomXML1.xml and CustomXML2.xml files to the CustomFolder.
I created a CustomTopComponent to display, edit, and save this File Type.
I have modified the example System Filesystem viewer (Ch 9 Rich Client
Programming) to show only the Custom Folder.
When I open one of the Custom XML files in the Custom Folder, I want the
CustomTopComponent to open instead of the default Text Editor.

WHAT I THINK I NEED TO DO:
I believe I have to create an OpenCookie class and a SaveCookie class,
and add it to the Lookup of the CustomDataNode. (This overrides the
default behavior for OpenCookie, I assume.)

QUESTIONS:
Is there an example of a OpenCookie class, and the code to add it to the
Lookup of the DataNode?
How do I pass or give a reference to the DataNode/DataObject to the
CustomTopComponent from the SFS?

Thank you for any help.

Richard Catlin

--
Esta mensagem foi verificada pelo sistema de antivírus e
acredita-se estar livre de perigo.


--
Esta mensagem foi verificada pelo sistema de antivírus e
acredita-se estar livre de perigo.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB