Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.spi.viewmodel/2 1.9.22
PREV NEXT | FRAMES NO FRAMES

# NetBeans View Model

Support for tree table view.

See:
Description

View Model
org.netbeans.spi.viewmodel | Defines API for sharing of Tree Table View.

Support for tree table view. The view is described via models - TreeModel, TableModel and NodeModel. Filters can be applied to each model - TreeModelFilter, TableModelFilter and NodeModelFilter. The view listens on changes in the models and filters and updates itself accordingly.

### What is New (see all changes)?

- Aug 25 '05 CompoundModel enhanced with a possibility to set help ID.

  In order to have a help ID defined for the GUI component that is created from the compound model, it's necessary to be able to set that help ID on the compound model instance. Two methods are added for that purpose: `CompoundModel Models.createCompoundModel (List, String)` and `String CompoundModel.getHelpId()`.

- Jul 21 '05 ModelEvent enhanced with more fine-grained changes

  NodeChanged events need to distinguish what node property has changed. Mask constant were added for display name, icon, short description and children properties. By default, mask that aggregates all these properties is used - to assure compatibility.

- Mar 31 '05 I need to add TreeModelEvent to ViewModelAPI.

  NB4.0 version of ViewModelAPI had several event firing related issues: 1) It supported two types of changes only: i) whole tree has been changed notification ii) node and all subnodes change notification There where no support for small grained changes (one table cell change). 2) The same listener type (TreeModelListener) has been used for all model types (TreeModel, NodeModel, ...) 3) There was no TreeModelEvent, so evolving of this api was problematic. I have done folowing incompatible api change, to fix this problem: 1) TreeModelListener has been renamed to ModelListener (Because its used for other models too). 2) ModelEvent class has been added. 3) Two methods removed from TreeModelListener: public void treeNodeChanged (Object node); public void treeNodeChanged (TreeModelEvent event); and replaced by folowing method: public void modelChanged (ModelEvent event); 4) three innerclasses added to ModelEvent TreeChanged TableValueChanged NodeChanged These three innerclasses are designed to support firing of all kinds of model changes. TreeChanged - Designed to notify about chages of whole tree content / structure. This event has no parameters. TableValueChanged - Designed to notify about chages of one cell in table. Two parameters: Object row, String columnID NodeChanged - Designed to notify about chages of one node - icon and display name. One parameter: Object node.

- Jan 13 '05 Access to tree node expansion added.

  This change has been done to cover user requirement #46167. List of changes: 1) new TreeExpansionModel introduced 2) new class Models.TreeFeatures contains tree expansion methods. During implementation of this user requirement I have discovered important problem in ViewModel API. There is no possibility to add a new model to it. List of changes fixing this problem: 1) Models.createView (...) and Models.setModelsToView (...) methods do not use fixed set of models as parameters, but they use Models.CompoundModel. 2) Models.CompoundModel is final class implementing all currently supported models. The only way how to create a new instance of it is Models.createCompoundModel (List listOfModels). It allows future additions of new models. 3) Methods Models.createCompoundTreeModel (...), Models.createCompoundNodeModel (...), Models.createCompoundTableModel (...), Models.createCompoundNodeActionsProvider (...), and field Models.EMPTY_TREE_MODEL has been removed as useless. How to update your code using these exceptions: No changes required for most of clients. You should change your code only if you are providing some new view based on ViewModel. In this case you should put all your model instances to one list, and call Models.createCompountModel (list), in place of calling create*Model* methods.

- Jan 7 '05 Support for synchronous and asynchronous ViewModels implementation fixed.

  Support for synchronous and asynchronous ViewModels implementations is one of the major ViewModel API requirements. During fixing of #46614 (toString update should not run in AWT thread) I have realized, that current support for asynchronous ViewModels implementations is not usable. This change fixes the problem: 1) ComputingException, and NoInformationException removed - as completely useless. 2) All methods throwing these exceptions changed. 3) New ViewModel implementation supports asynchronous model only. Its fast and safe. How to update your code using these exceptions: Old code: public Object getValueAt (Object row, String columnId) throws ComputingException { if (....) throw new ComputingException (); ... } Fixed code: public Object getValueAt (Object row, String columnId) { if (....) return "Computing"; ... }

### Use Cases

Used by debugger to display various information - threads, call stack, variables, etc.

### Exported Interfaces

This table lists all of the module exported APIs with defined stability classifications. It is generated based on answers to questions about the architecture of the module. Read them all...

##### Group of java interfaces

Interface Name | In/Out | Stability | Specified in What Document?
ViewModel | Exported | Official | .../overview-summary.html

### Implementation Details

##### Where are the sources for the module?

The sources for the module are in NetBeans CVS in debuggercore/viewmodel directory.

##### What do other modules need to do to declare a dependency on this one?

OpenIDE-Module-Module-Dependencies: org.netbeans.spi.viewmodel/2

Read more about the implementation in the answers to architecture questions.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.netbeans.spi.viewmodel/2 1.9.22
PREV NEXT | FRAMES NO FRAMES

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.