public class ElementsDefinitionConstructor extends java.lang.ObjectContains all the relevant logic to bring together all the information which is required to instantiate the workbench elements later. In particular, this is:
- The relation between views and perspectives (and the view position inside the perspectives)
- The names of views, perspectives and footers
- Icons of views perspectives and footers
perspectives()(which contain view definitions) and footer definitions (see
footers()). All of these can be used to instantiate the perspectives (and views) and footers.
This class uses a
WorkbenchElementsRepositoryto get the collected components as well as to access the factory methods and annotations of the collected elements.
For deriving information, usually annotations are used. Those annotations are searched in the order as described in
BeanInformationRepository.from(Object). Based on this, the following strategies are applied in particular cases:
- Views: Each bean for which a
Viewannotation is found, is considered as view in MiniFx. The view annotation describes the perspective in which the view is displayed and the position within the view. Both values are optional. If omitted, the view is displayed in the perspective
Perspectives.DEFAULT_PERSPECTIVEat the position
- Icons: They are derived from the
Iconannotation (both for views and perspectives). If none is specified, then perspectives will get a default icon and views will have no icon.
- Names: Names for views are derived in the following order:
- Order: if an
Orderannotation is specified for a view (or a perspective) then it is taken into account.
Constructors Constructor Description
ElementsDefinitionConstructor(WorkbenchElementsRepository elementsRepository, BeanInformationExtractor beanInformationExtractor, FxNodeFactory fxNodeFactory)Constructor which requires an elements repository, which will be used to look up the collected elements as well as annotations on them and factory methods.
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
displayPropertiesFrom(java.lang.Object view, Purpose purpose)
footers()Returns a footer definition for each footer found in the repository
perspectives()Returns a perspective definition for each perspective used by at least one of the views found in the repository.
public ElementsDefinitionConstructor(WorkbenchElementsRepository elementsRepository, BeanInformationExtractor beanInformationExtractor, FxNodeFactory fxNodeFactory)
elementsRepository- the repository to use
beanInformationExtractor- the instance who knows about the information of the beans
fxNodeFactory- the factory to create java fx nodes
java.lang.NullPointerException- if the given repository is
public java.util.Set<PerspectiveDefinition> perspectives()Returns a perspective definition for each perspective used by at least one of the views found in the repository.
- all perspective definitions as derived from the views in the repository
public java.util.Set<FooterDefinition> footers()Returns a footer definition for each footer found in the repository
- all footer definitions