public final class Models extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Models.ActionPerformer
Support interface for
Models.createAction(String,Models.ActionPerformer,int) method. |
static class |
Models.CompoundModel
This model encapsulates all currently supported models.
|
static class |
Models.TreeFeatures
Tree expansion control.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Models() |
Modifier and Type | Method and Description |
---|---|
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 Node |
createNodes(Models.CompoundModel compoundModel,
TreeView treeView)
Creates a root node of the nodes tree structure
for given
Models.CompoundModel . |
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.
|
public static Models.CompoundModel EMPTY_MODEL
public static int MULTISELECTION_TYPE_EXACTLY_ONE
public static int MULTISELECTION_TYPE_ALL
public static int MULTISELECTION_TYPE_ANY
public static JComponent createView(Models.CompoundModel compoundModel)
Models.CompoundModel
.compoundModel
- a compound model instancepublic static Node createNodes(Models.CompoundModel compoundModel, TreeView treeView)
Models.CompoundModel
.compoundModel
- a compound model instancetreeView
- The tree view component where nodes are going to be displayed.public static void setModelsToView(JComponent view, Models.CompoundModel compoundModel)
view
- a view instance - must be an instance created by Models.createView(org.netbeans.spi.viewmodel.Models.CompoundModel)
method.compoundModel
- a compound model instancepublic static Models.CompoundModel createCompoundModel(List models)
Models.CompoundModel
from given list of models.
If this list does not include any instance of TreeModel or TreeExpansionModel, a default implementation of these models is created based on the instance of this list. Thus you get one implementation per provided instance of the models list.
models
- a list of modelsModels.CompoundModel
encapsulating given list of modelspublic static Models.CompoundModel createCompoundModel(List models, String propertiesHelpID)
Models.CompoundModel
from given list of models.
If this list does not include any instance of TreeModel or TreeExpansionModel, a default implementation of these models is created based on the instance of this list. Thus you get one implementation per provided instance of the models list.
models
- a list of modelspropertiesHelpID
- The help ID, which is set for the properties
sheets created from this model.Models.CompoundModel
encapsulating given list of modelspublic static Action createAction(String displayName, Models.ActionPerformer performer, int multiselectionType)
Action
for given parameters.displayName
- a display name for actionperformer
- a performer for actionmultiselectionType
- The type of the multi selection - one of the
MULTISELECTION_TYPE_* constants.Action
for given parameterspublic static Models.TreeFeatures treeFeatures(JComponent view) throws UnsupportedOperationException
view
- a view created by this Models classUnsupportedOperationException
- in the case that given
view is not tree view