C
- the (generic) type parameter for the interface representing the type of ProgramNodeContribution
created by this SwingProgramNodeServiceV
- the (generic) type parameter for the interface representing the type of the view used by all the
ProgramNodeContribution
created by this servicepublic interface SwingProgramNodeService<C extends ProgramNodeContribution,V extends SwingProgramNodeView<C>> extends URCapProgramNodeService
Modifier and Type | Method and Description |
---|---|
void |
configureContribution(ContributionConfiguration configuration)
This method is called once after the this service is registered.
|
C |
createNode(ProgramAPIProvider apiProvider,
V view,
DataModel model,
CreationContext context)
Creates a new program node instance.
|
V |
createView(ViewAPIProvider apiProvider)
Creates a new View instance which implements the UI for your program node screen.
|
String |
getId()
Get the unique identifier for this kind of program node.
|
String |
getTitle(Locale locale) |
String getId()
void configureContribution(ContributionConfiguration configuration)
This method is called once after the this service is registered. Modify the configuration parameter to configure your contribution. The configuration object will already have default values for its properties matching most use cases.
The values of the ContributionConfiguration object will be read once immediately after this method call. Changing values at a later stage will have no effect, so do not store a reference to the configuration object.
If the default values are appropriate, leave this method empty.configuration
- a modifiable ContributionConfiguration with default valuesString getTitle(Locale locale)
locale
- The current locale of PolyScope. Can be used for supporting titles in several languages.V createView(ViewAPIProvider apiProvider)
apiProvider
- Provides access to functionality and services available from within PolyScope related to user
interface and end user interactionC createNode(ProgramAPIProvider apiProvider, V view, DataModel model, CreationContext context)
Creates a new program node instance. This happens when the end user clicks the button on the Structure tab or when an existing program node is loaded
The returned node must use the supplied data model object to retrieve and store the data contained in it. All modifications to the supplied data model from the program node constructor are ignored when an existing program node is loaded or copy/pasted.
apiProvider
- Provides access to functionality and services available from within PolyScope relevant for the
program node.view
- the View created by createView(ViewAPIProvider)
. This reference can be stored
and used in ProgramNodeContribution.openView()
or as a result of an event for a Swing UI-component.
Note: The view must not be used in the node contribution constructor. The view is a shared entity between several contributions and is not ready to be used at this time.
model
- object where all configuration data of the new program node instance is to be stored in and
retrieved fromcontext
- the context in which this node is createdCopyright © 2020. All rights reserved.