org.netbeans.spi.viewmodel/2 1.9.22

org.netbeans.spi.viewmodel
Class Models

java.lang.Object
  extended by org.netbeans.spi.viewmodel.Models

public final class Models
extends Object

Contains various utility methods for various models.


Nested Class Summary
static interface Models.ActionPerformer
          Support interface for createAction(String,Models.ActionPerformer,int) method.
static class Models.CompoundModel
          This model encapsulates all currently supported models.
static class Models.TreeFeatures
          Implements set of tree view features.
 
Field Summary
static Models.CompoundModel EMPTY_MODEL
          Empty model - returns default root node with no children.
static int MULTISELECTION_TYPE_ALL
           
static int MULTISELECTION_TYPE_ANY
           
static int MULTISELECTION_TYPE_EXACTLY_ONE
           
 
Constructor Summary
Models()
           
 
Method Summary
static Action createAction(String displayName, Models.ActionPerformer performer, int multiselectionType)
          Returns Action for given parameters.
static Models.CompoundModel createCompoundModel(List models)
          Creates one Models.CompoundModel from given list of models.
static Models.CompoundModel createCompoundModel(List models, String propertiesHelpID)
          Creates one Models.CompoundModel from given list of models.
static JComponent createView(Models.CompoundModel compoundModel)
          Creates a new instance of TreeTableView for given Models.CompoundModel.
static void setModelsToView(JComponent view, Models.CompoundModel compoundModel)
          Set given models to given view instance.
static Models.TreeFeatures treeFeatures(JComponent view)
          Returns implementation of tree view features for given view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_MODEL

public static Models.CompoundModel EMPTY_MODEL
Empty model - returns default root node with no children.


MULTISELECTION_TYPE_EXACTLY_ONE

public static int MULTISELECTION_TYPE_EXACTLY_ONE

MULTISELECTION_TYPE_ALL

public static int MULTISELECTION_TYPE_ALL

MULTISELECTION_TYPE_ANY

public static int MULTISELECTION_TYPE_ANY
Constructor Detail

Models

public Models()
Method Detail

createView

public static JComponent createView(Models.CompoundModel compoundModel)
Creates a new instance of TreeTableView for given Models.CompoundModel.

Parameters:
compoundModel - a compound model instance
Returns:
new instance of complete model view

setModelsToView

public static void setModelsToView(JComponent view,
                                   Models.CompoundModel compoundModel)
Set given models to given view instance.

Parameters:
view - a view instance - must be an instance created by createView(org.netbeans.spi.viewmodel.Models.CompoundModel) method.
compoundModel - a compound model instance

createCompoundModel

public static Models.CompoundModel createCompoundModel(List models)
Creates one Models.CompoundModel from given list of models.

Parameters:
models - a list of models
Returns:
Models.CompoundModel encapsulating given list of models

createCompoundModel

public static Models.CompoundModel createCompoundModel(List models,
                                                       String propertiesHelpID)
Creates one Models.CompoundModel from given list of models.

Parameters:
models - a list of models
propertiesHelpID - The help ID, which is set for the properties sheets created from this model.
Returns:
Models.CompoundModel encapsulating given list of models
Since:
1.7

createAction

public static Action createAction(String displayName,
                                  Models.ActionPerformer performer,
                                  int multiselectionType)
Returns Action for given parameters.

Parameters:
displayName - a display name for action
performer - a performer for action
multiselectionType - The type of the multiselection - one of the MULTISELECTION_TYPE_* constants.
Returns:
a new instance of Action for given parameters

treeFeatures

public static Models.TreeFeatures treeFeatures(JComponent view)
                                        throws UnsupportedOperationException
Returns implementation of tree view features for given view.

Parameters:
view - a view created by this Models class
Returns:
implementation of tree view features
Throws:
UnsupportedOperationException - in the case that given view is not tree view

org.netbeans.spi.viewmodel/2 1.9.22

Built on July 11 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.