Following document describes steps needed for module writers to plug in
their view into Navigator window for certain document (data) type.
Write NavigatorPanel implementation
Register impl class in layer
(OPTIONAL) Enhance your Node's lookup by NavigatorPanel impl
Writing NavigatorPanel implementation
Implementing NavigatorPanel interface is easy, you can copy from
template basic implementation BasicNavPanelImpl.java.
Only interesting parts are following:
Constructor: Make sure that your implementation class has
public no-arg constructor, which is needed for system to
instantiate your provider.
getComponent method: Simply create and return your UI
representation of your data in Swing's JComponent envelope. Just be sure
that you don't create new JComponent subclass per every call, as
performance will suffer then.
panelActivated and panelDeactivated methods: Data context
methods - in panelActivated, grab your data from given Node somehow,
for example through its asociated DataObject/FileObject or Lookup.
Attach listeners to asociated data and trigger UI update with new data.
Do *not* perform any long computation here, see below.
In panelDeactivated, be sure to remove all listeners to data given
to you in panelActivated.
Long computation of content: What if rendering your
Navigator view takes long time, more than several milliseconds?
Right approach is to create and run new task using RequestProcessor
each time when panelActivated call arrived or your listeners on
data context got called. While computing, UI of Navigator view
should show some please wait message.
Registering NavigatorPanel impl in a layer
Declarative registration of your NavigatorPanel impl is easy again,
you can copy from template layer basicNavLayer.xml
Additional interesting info:
System looks up for navigator providers only in
navigator/panels folder, nowhere else.
Multiple mime types can be specified for one provider,
separated by a comma char.
System will print a warning to the error output if some attribute
is missing or NavigatorPanel implementation class can't be found
or instantiated.