SlideShare a Scribd company logo
1 of 32
Download to read offline
Developing Plug-Ins
for NetBeans


Tim Boudreau
Staff Engineer
Sun Microsystems




                       TM                             SM
               NetBeansTM Software Day at 2005 JavaOneSM Conference
Agenda

●   NetBeans Overview
●   Plug-In Development Support
●   Architectural Background
●   Developing a Plug-In




                NetBeansTM Software Day at 2005 JavaOneSM Conference
Modular Design




          NetBeansTM Software Day at 2005 JavaOneSM Conference
Everything is a Plug-In




            NetBeansTM Software Day at 2005 JavaOneSM Conference
What is a plug-in (module)

●   A jar file with some special manifest entries

OpenIDE-Module: org.netbeans.modules.project.ant/1
OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48
OpenIDE-Module-Specification-Version: 1.6
OpenIDE-Module-Implementation-Version: 050219
OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne
tbeans.spi.project.ant.*
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1,
    org.netbeans.modules.queries/1, org.openide.loaders
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun
dle.properties


                         NetBeansTM Software Day at 2005 JavaOneSM Conference
What is a plug-in (module)

●   Module code-name

OpenIDE-Module: org.netbeans.modules.project.ant/1
OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48
OpenIDE-Module-Specification-Version: 1.6
OpenIDE-Module-Implementation-Version: 050219
OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne
tbeans.spi.project.ant.*
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1,
    org.netbeans.modules.queries/1, org.openide.loaders
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun
dle.properties


                         NetBeansTM Software Day at 2005 JavaOneSM Conference
What is a plug-in (module)

●   What version of the main APIs does it need

OpenIDE-Module: org.netbeans.modules.project.ant/1
OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48
OpenIDE-Module-Specification-Version: 1.6
OpenIDE-Module-Implementation-Version: 050219
OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne
tbeans.spi.project.ant.*
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1,
    org.netbeans.modules.queries/1, org.openide.loaders
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun
dle.properties


                         NetBeansTM Software Day at 2005 JavaOneSM Conference
What is a plug-in (module)

●   Modules have version numbers

OpenIDE-Module: org.netbeans.modules.project.ant/1
OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48
OpenIDE-Module-Specification-Version: 1.6
OpenIDE-Module-Implementation-Version: 050219
OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne
tbeans.spi.project.ant.*
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1,
    org.netbeans.modules.queries/1, org.openide.loaders
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun
dle.properties


                         NetBeansTM Software Day at 2005 JavaOneSM Conference
What is a plug-in (module)

●   Modules can expose APIs

OpenIDE-Module: org.netbeans.modules.project.ant/1
OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48
OpenIDE-Module-Specification-Version: 1.6
OpenIDE-Module-Implementation-Version: 050219
OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne
tbeans.spi.project.ant.*
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1,
    org.netbeans.modules.queries/1, org.openide.loaders
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun
dle.properties


                         NetBeansTM Software Day at 2005 JavaOneSM Conference
What is a plug-in (module)

●   Modules can use APIs from other modules

OpenIDE-Module: org.netbeans.modules.project.ant/1
OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48
OpenIDE-Module-Specification-Version: 1.6
OpenIDE-Module-Implementation-Version: 050219
OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne
tbeans.spi.project.ant.*
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1,
    org.netbeans.modules.queries/1, org.openide.loaders
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun
dle.properties


                         NetBeansTM Software Day at 2005 JavaOneSM Conference
What is a plug-in (module)

●   Everything is localized

OpenIDE-Module: org.netbeans.modules.project.ant/1
OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48
OpenIDE-Module-Specification-Version: 1.6
OpenIDE-Module-Implementation-Version: 050219
OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne
tbeans.spi.project.ant.*
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1,
    org.netbeans.modules.queries/1, org.openide.loaders
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun
dle.properties


                         NetBeansTM Software Day at 2005 JavaOneSM Conference
Anatomy of a Module




           NetBeansTM Software Day at 2005 JavaOneSM Conference
Plugin Support in NetBeans 4.2
   ●   NetBeans Plugin Projects
   ●   New Plugin Template
   ●   API class templates
   ●   Build Plugins outside source tree
       –   Deploy to
            ●   Separate Binary
            ●   Platform-only Binary
            ●   Current IDE
   DEMO: Creating a Plugin

                      NetBeansTM Software Day at 2005 JavaOneSM Conference
How the Hello World module works

 ●   Installs a layer file which
     –   Is merged into the system (configuration) filesystem
     –   Defines a virtual filesystem fragment
     –   Installs an instance file
          ●   Points to a standard Swing Action




                       NetBeansTM Software Day at 2005 JavaOneSM Conference
Filesystems API

 ●   FileObjects: Abstraction over java.io.File
     –   “Files” may not be on disk
          ●   XML
          ●   Remote (FTP, NFS)
          ●   Database, etc.
     –   Support
          ●   Listening for changes
          ●   Ad-hoc “attributes” (key-value pairs)
          ●   Live in a FileSystem – a namespace
 ●   Used for both config data + user's files

                        NetBeansTM Software Day at 2005 JavaOneSM Conference
Filesystems – virtual files




              NetBeansTM Software Day at 2005 JavaOneSM Conference
XML Filesystems – very virtual files




             NetBeansTM Software Day at 2005 JavaOneSM Conference
Layered Filesystem




            NetBeansTM Software Day at 2005 JavaOneSM Conference
System (configuration) Filesystem




            NetBeansTM Software Day at 2005 JavaOneSM Conference
A Tour of the System Filesystem

 DEMO: Browsing the layer file and System FS




              NetBeansTM Software Day at 2005 JavaOneSM Conference
DataObjects wrap Files




            NetBeansTM Software Day at 2005 JavaOneSM Conference
DataSystems API

 ●   DataObjects – wrap 1 or more FileObjects
     –   “Typed” files – knows what the content is
          ●   Different DataObject types for different MIME types
     –   Programmatic access to file contents
          ●   Structural or parsed representation of contents
          ●   Support for editing, etc.
 ●   DataLoaders
     –   Factories for DataObject
     –   Recognize and claim FileObjects by extension or
         contents
                        NetBeansTM Software Day at 2005 JavaOneSM Conference
DataSystems




          NetBeansTM Software Day at 2005 JavaOneSM Conference
Nodes API

 ●   Presentation layer on top of DataObjects – add
     –   Icon, display name, menu actions, properties, child
         nodes
 ●   Generic hierarchy API
 ●   Displayed to user with the Explorer API
     –   Tree, List, Combo, Menu, TreeTable and other
         views
 ●   Don't have to represent files


                    NetBeansTM Software Day at 2005 JavaOneSM Conference
From Files to Nodes




            NetBeansTM Software Day at 2005 JavaOneSM Conference
Factory Relationships – Files to Nodes




            NetBeansTM Software Day at 2005 JavaOneSM Conference
Lookup Patterns

 ●   “Glue” between disparate APIs
 ●   Common pattern: To ask an object for an
     implementation of some interface
     –   SomeObject.getLookup().lookup (SomeIFace.class);
     –   SomeObject.getCookie (SomeIFace.class);




                   NetBeansTM Software Day at 2005 JavaOneSM Conference
Lookup API

 ●   A way to find objects (dependency injection)
 ●   Global singletons
     ●   Lookup.getDefault().lookup (SomeInterface.class)
 ●   Objects belonging to another object
     ●   node.getLookup().lookup (SomeInterface.class)
     ●   dataObject.getCookie (SomeInterface.class)

 ●   Why lookup?
 ●   Lazy instantiation – create on demand
 ●   Evolution
     ●   Its hard to add/remove methods
     ●   Its easy to change what lives in an object's Lookup
                        NetBeansTM Software Day at 2005 JavaOneSM Conference
Global Lookup Registration

 ●    Instance file in system filesystem:
 <folder name=”services”>
  <file name=”org-foo-mymodule-MyService.instance”/>
 </folder>

 ●    META-INF/services entry in jar:
  ●   A single file that names the interface implemented
      ●   META-INF/services/org.openide.ErrorManager
  ●   With a single line of text naming the implementation
      class
      ●   com.mycom.mymodule.MyErrorManagerImpl



                        NetBeansTM Software Day at 2005 JavaOneSM Conference
getLookup() vs. getCookie()

 ●   Newer idiom
      ●   someobject.getLookup().lookup (SomeClass.class)

 ●   Older idiom
      ●   someobject.getCookie (SomeClass.class)

 ●   Principle difference
      ●   Lookup is more generic
      ●   Objects in a Lookup don't have to implement the marker
          interface Node.Cookie




                       NetBeansTM Software Day at 2005 JavaOneSM Conference
Povray




         NetBeansTM Software Day at 2005 JavaOneSM Conference
Developing Plug-Ins
for NetBeans


Tim Boudreau
Staff Engineer
Sun Microsystems




               NetBeansTM Software Day at 2005 JavaOneSM Conference
               NetBeansTM Software Day at 2005 JavaOneSM Conference

More Related Content

What's hot

Getting Started with Java EE 7
Getting Started with Java EE 7Getting Started with Java EE 7
Getting Started with Java EE 7Arun Gupta
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Julian Robichaux
 
Managed Beans: When, Why and How
Managed Beans: When, Why and HowManaged Beans: When, Why and How
Managed Beans: When, Why and HowRussell Maher
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Saeed Zarinfam
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsShekhar Gulati
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
OpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentOpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentPaul Withers
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Ryan Cuprak
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppEdureka!
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionStephen Colebourne
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The BasicsPhilip Langer
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xGeertjan Wielenga
 

What's hot (20)

Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Getting Started with Java EE 7
Getting Started with Java EE 7Getting Started with Java EE 7
Getting Started with Java EE 7
 
Hibernate
HibernateHibernate
Hibernate
 
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
 
Managed Beans: When, Why and How
Managed Beans: When, Why and HowManaged Beans: When, Why and How
Managed Beans: When, Why and How
 
Maven
MavenMaven
Maven
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)
 
From JavaEE to AngularJS
From JavaEE to AngularJSFrom JavaEE to AngularJS
From JavaEE to AngularJS
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
 
Developing modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular jsDeveloping modern java web applications with java ee 7 and angular js
Developing modern java web applications with java ee 7 and angular js
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
OpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino DevelopmentOpenNTF Domino API (ODA): Super-Charging Domino Development
OpenNTF Domino API (ODA): Super-Charging Domino Development
 
Maven
MavenMaven
Maven
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web App
 
Gradle como alternativa a maven
Gradle como alternativa a mavenGradle como alternativa a maven
Gradle como alternativa a maven
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introduction
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
Reactjs
ReactjsReactjs
Reactjs
 
What's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.xWhat's New in NetBeans IDE 7.x
What's New in NetBeans IDE 7.x
 

Similar to Developing Plug-Ins for NetBeans

Net Beans61 Platform
Net Beans61 PlatformNet Beans61 Platform
Net Beans61 Platformsatyajit_t
 
blueMarine Or Why You Should Really Ship Swing Applications
blueMarine  Or Why You Should Really Ship Swing  Applications blueMarine  Or Why You Should Really Ship Swing  Applications
blueMarine Or Why You Should Really Ship Swing Applications Fabrizio Giudici
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsSteve Keener
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...Jesse Gallagher
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and SecurityKelwin Yang
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenBert Koorengevel
 
Mac Application Packaging
Mac Application PackagingMac Application Packaging
Mac Application PackagingDell World
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUlrich Krause
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureColin Mackay
 
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and CustomizationThành Nguyễn
 
Frankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGiFrankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGiToni Epple
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsPetr Jiricka
 
Managing Your Runtime With P2
Managing Your Runtime With P2Managing Your Runtime With P2
Managing Your Runtime With P2Pascal Rapicault
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the BasicsUlrich Krause
 
Writing Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason LeeWriting Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason Leejaxconf
 
MyFaces CODI and JBoss Seam3 become Apache DeltaSpike
MyFaces CODI and JBoss Seam3 become Apache DeltaSpikeMyFaces CODI and JBoss Seam3 become Apache DeltaSpike
MyFaces CODI and JBoss Seam3 become Apache DeltaSpikeos890
 
Reversing & malware analysis training part 2 introduction to windows internals
Reversing & malware analysis training part 2   introduction to windows internalsReversing & malware analysis training part 2   introduction to windows internals
Reversing & malware analysis training part 2 introduction to windows internalssecurityxploded
 

Similar to Developing Plug-Ins for NetBeans (20)

Net Beans61 Platform
Net Beans61 PlatformNet Beans61 Platform
Net Beans61 Platform
 
blueMarine Or Why You Should Really Ship Swing Applications
blueMarine  Or Why You Should Really Ship Swing  Applications blueMarine  Or Why You Should Really Ship Swing  Applications
blueMarine Or Why You Should Really Ship Swing Applications
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
 
Introduction to Android Development and Security
Introduction to Android Development and SecurityIntroduction to Android Development and Security
Introduction to Android Development and Security
 
Ordina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - MavenOrdina Accelerator program 2019 - Maven
Ordina Accelerator program 2019 - Maven
 
Mac Application Packaging
Mac Application PackagingMac Application Packaging
Mac Application Packaging
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
Presentation
PresentationPresentation
Presentation
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Liferay Configuration and Customization
Liferay Configuration and CustomizationLiferay Configuration and Customization
Liferay Configuration and Customization
 
Frankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGiFrankenstein's IDE: NetBeans and OSGi
Frankenstein's IDE: NetBeans and OSGi
 
Extending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.jsExtending Build to the Client: A Maven User's Guide to Grunt.js
Extending Build to the Client: A Maven User's Guide to Grunt.js
 
01 spring-intro
01 spring-intro01 spring-intro
01 spring-intro
 
Managing Your Runtime With P2
Managing Your Runtime With P2Managing Your Runtime With P2
Managing Your Runtime With P2
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Writing Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason LeeWriting Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason Lee
 
MyFaces CODI and JBoss Seam3 become Apache DeltaSpike
MyFaces CODI and JBoss Seam3 become Apache DeltaSpikeMyFaces CODI and JBoss Seam3 become Apache DeltaSpike
MyFaces CODI and JBoss Seam3 become Apache DeltaSpike
 
Reversing & malware analysis training part 2 introduction to windows internals
Reversing & malware analysis training part 2   introduction to windows internalsReversing & malware analysis training part 2   introduction to windows internals
Reversing & malware analysis training part 2 introduction to windows internals
 

More from elliando dias

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slideselliando dias
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScriptelliando dias
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structureselliando dias
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de containerelliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agilityelliando dias
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Librarieselliando dias
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!elliando dias
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Webelliando dias
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduinoelliando dias
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorceryelliando dias
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Designelliando dias
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makeselliando dias
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.elliando dias
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebookelliando dias
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Studyelliando dias
 

More from elliando dias (20)

Clojurescript slides
Clojurescript slidesClojurescript slides
Clojurescript slides
 
Why you should be excited about ClojureScript
Why you should be excited about ClojureScriptWhy you should be excited about ClojureScript
Why you should be excited about ClojureScript
 
Functional Programming with Immutable Data Structures
Functional Programming with Immutable Data StructuresFunctional Programming with Immutable Data Structures
Functional Programming with Immutable Data Structures
 
Nomenclatura e peças de container
Nomenclatura  e peças de containerNomenclatura  e peças de container
Nomenclatura e peças de container
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 
Polyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better AgilityPolyglot and Poly-paradigm Programming for Better Agility
Polyglot and Poly-paradigm Programming for Better Agility
 
Javascript Libraries
Javascript LibrariesJavascript Libraries
Javascript Libraries
 
How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!How to Make an Eight Bit Computer and Save the World!
How to Make an Eight Bit Computer and Save the World!
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
A Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the WebA Practical Guide to Connecting Hardware to the Web
A Practical Guide to Connecting Hardware to the Web
 
Introdução ao Arduino
Introdução ao ArduinoIntrodução ao Arduino
Introdução ao Arduino
 
Minicurso arduino
Minicurso arduinoMinicurso arduino
Minicurso arduino
 
Incanter Data Sorcery
Incanter Data SorceryIncanter Data Sorcery
Incanter Data Sorcery
 
Rango
RangoRango
Rango
 
Fab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine DesignFab.in.a.box - Fab Academy: Machine Design
Fab.in.a.box - Fab Academy: Machine Design
 
The Digital Revolution: Machines that makes
The Digital Revolution: Machines that makesThe Digital Revolution: Machines that makes
The Digital Revolution: Machines that makes
 
Hadoop + Clojure
Hadoop + ClojureHadoop + Clojure
Hadoop + Clojure
 
Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.Hadoop - Simple. Scalable.
Hadoop - Simple. Scalable.
 
Hadoop and Hive Development at Facebook
Hadoop and Hive Development at FacebookHadoop and Hive Development at Facebook
Hadoop and Hive Development at Facebook
 
Multi-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case StudyMulti-core Parallelization in Clojure - a Case Study
Multi-core Parallelization in Clojure - a Case Study
 

Recently uploaded

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 

Recently uploaded (20)

UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 

Developing Plug-Ins for NetBeans

  • 1. Developing Plug-Ins for NetBeans Tim Boudreau Staff Engineer Sun Microsystems TM SM NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 2. Agenda ● NetBeans Overview ● Plug-In Development Support ● Architectural Background ● Developing a Plug-In NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 3. Modular Design NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 4. Everything is a Plug-In NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 5. What is a plug-in (module) ● A jar file with some special manifest entries OpenIDE-Module: org.netbeans.modules.project.ant/1 OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48 OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: 050219 OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne tbeans.spi.project.ant.* OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1, org.netbeans.modules.queries/1, org.openide.loaders OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun dle.properties NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 6. What is a plug-in (module) ● Module code-name OpenIDE-Module: org.netbeans.modules.project.ant/1 OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48 OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: 050219 OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne tbeans.spi.project.ant.* OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1, org.netbeans.modules.queries/1, org.openide.loaders OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun dle.properties NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 7. What is a plug-in (module) ● What version of the main APIs does it need OpenIDE-Module: org.netbeans.modules.project.ant/1 OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48 OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: 050219 OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne tbeans.spi.project.ant.* OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1, org.netbeans.modules.queries/1, org.openide.loaders OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun dle.properties NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 8. What is a plug-in (module) ● Modules have version numbers OpenIDE-Module: org.netbeans.modules.project.ant/1 OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48 OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: 050219 OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne tbeans.spi.project.ant.* OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1, org.netbeans.modules.queries/1, org.openide.loaders OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun dle.properties NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 9. What is a plug-in (module) ● Modules can expose APIs OpenIDE-Module: org.netbeans.modules.project.ant/1 OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48 OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: 050219 OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne tbeans.spi.project.ant.* OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1, org.netbeans.modules.queries/1, org.openide.loaders OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun dle.properties NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 10. What is a plug-in (module) ● Modules can use APIs from other modules OpenIDE-Module: org.netbeans.modules.project.ant/1 OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48 OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: 050219 OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne tbeans.spi.project.ant.* OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1, org.netbeans.modules.queries/1, org.openide.loaders OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun dle.properties NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 11. What is a plug-in (module) ● Everything is localized OpenIDE-Module: org.netbeans.modules.project.ant/1 OpenIDE-Module-IDE-Dependencies: IDE/1 > 4.48 OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Implementation-Version: 050219 OpenIDE-Module-Public-Packages: org.netbeans.api.project.ant.*, org.ne tbeans.spi.project.ant.* OpenIDE-Module-Module-Dependencies: org.netbeans.modules.projectapi/1, org.netbeans.modules.queries/1, org.openide.loaders OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bun dle.properties NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 12. Anatomy of a Module NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 13. Plugin Support in NetBeans 4.2 ● NetBeans Plugin Projects ● New Plugin Template ● API class templates ● Build Plugins outside source tree – Deploy to ● Separate Binary ● Platform-only Binary ● Current IDE DEMO: Creating a Plugin NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 14. How the Hello World module works ● Installs a layer file which – Is merged into the system (configuration) filesystem – Defines a virtual filesystem fragment – Installs an instance file ● Points to a standard Swing Action NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 15. Filesystems API ● FileObjects: Abstraction over java.io.File – “Files” may not be on disk ● XML ● Remote (FTP, NFS) ● Database, etc. – Support ● Listening for changes ● Ad-hoc “attributes” (key-value pairs) ● Live in a FileSystem – a namespace ● Used for both config data + user's files NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 16. Filesystems – virtual files NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 17. XML Filesystems – very virtual files NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 18. Layered Filesystem NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 19. System (configuration) Filesystem NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 20. A Tour of the System Filesystem DEMO: Browsing the layer file and System FS NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 21. DataObjects wrap Files NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 22. DataSystems API ● DataObjects – wrap 1 or more FileObjects – “Typed” files – knows what the content is ● Different DataObject types for different MIME types – Programmatic access to file contents ● Structural or parsed representation of contents ● Support for editing, etc. ● DataLoaders – Factories for DataObject – Recognize and claim FileObjects by extension or contents NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 23. DataSystems NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 24. Nodes API ● Presentation layer on top of DataObjects – add – Icon, display name, menu actions, properties, child nodes ● Generic hierarchy API ● Displayed to user with the Explorer API – Tree, List, Combo, Menu, TreeTable and other views ● Don't have to represent files NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 25. From Files to Nodes NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 26. Factory Relationships – Files to Nodes NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 27. Lookup Patterns ● “Glue” between disparate APIs ● Common pattern: To ask an object for an implementation of some interface – SomeObject.getLookup().lookup (SomeIFace.class); – SomeObject.getCookie (SomeIFace.class); NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 28. Lookup API ● A way to find objects (dependency injection) ● Global singletons ● Lookup.getDefault().lookup (SomeInterface.class) ● Objects belonging to another object ● node.getLookup().lookup (SomeInterface.class) ● dataObject.getCookie (SomeInterface.class) ● Why lookup? ● Lazy instantiation – create on demand ● Evolution ● Its hard to add/remove methods ● Its easy to change what lives in an object's Lookup NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 29. Global Lookup Registration ● Instance file in system filesystem: <folder name=”services”> <file name=”org-foo-mymodule-MyService.instance”/> </folder> ● META-INF/services entry in jar: ● A single file that names the interface implemented ● META-INF/services/org.openide.ErrorManager ● With a single line of text naming the implementation class ● com.mycom.mymodule.MyErrorManagerImpl NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 30. getLookup() vs. getCookie() ● Newer idiom ● someobject.getLookup().lookup (SomeClass.class) ● Older idiom ● someobject.getCookie (SomeClass.class) ● Principle difference ● Lookup is more generic ● Objects in a Lookup don't have to implement the marker interface Node.Cookie NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 31. Povray NetBeansTM Software Day at 2005 JavaOneSM Conference
  • 32. Developing Plug-Ins for NetBeans Tim Boudreau Staff Engineer Sun Microsystems NetBeansTM Software Day at 2005 JavaOneSM Conference NetBeansTM Software Day at 2005 JavaOneSM Conference