Class AbstractDashletFactory
- java.lang.Object
-
- org.opennms.features.vaadin.dashboard.model.AbstractDashletFactory
-
- All Implemented Interfaces:
DashletFactory
- Direct Known Subclasses:
AlarmDetailsDashletFactory
,AlarmsDashletFactory
,BSMDashletFactory
,ChartsDashletFactory
,GrafanaDashletFactory
,ImageDashletFactory
,KscDashletFactory
,MapDashletFactory
,RrdDashletFactory
,RtcDashletFactory
,SummaryDashletFactory
,SurveillanceDashletFactory
,TopologyDashletFactory
,UndefinedDashletFactory
,UrlDashletFactory
public abstract class AbstractDashletFactory extends Object implements DashletFactory
This class represents an abstract factory for instantiatingDashlet
objects.- Author:
- Christian Pape
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_boostable
boostable flagprotected boolean
m_dashboardSuitable
Are this dashlet suitable for displaying in the dashboard view.protected String
m_name
The name of the providedDashlet
protected Map<String,String>
m_requiredParameterDescriptions
A map holding the required parameter descriptions for theDashlet
protected Map<String,String>
m_requiredParameters
A map holding the required parameters for theDashlet
-
Constructor Summary
Constructors Constructor Description AbstractDashletFactory()
Constructor for instantiating a new factory.AbstractDashletFactory(String name)
Constructor for instantiating a new factory with the given name.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addRequiredParameter(String key, String defaultValue)
Add a required parameter for this factory.DashletConfigurationWindow
configurationWindow(DashletSpec dashletSpec)
Returns the window used for configuring aDashletSpec
instance.com.vaadin.ui.Component
getHelpComponent()
Returns the help component for theDashlet
.abstract String
getHelpContentHTML()
Returns the help contentString
String
getName()
Returns the name of theDashlet
instances this object provides.Map<String,String>
getRequiredParameterDescriptions()
Returns theMap
with the required parameter descriptions.Map<String,String>
getRequiredParameters()
Returns theMap
with the required parameters and default values.boolean
isBoostable()
This method returns whether this dashlet is boostable.boolean
isSuitableForDashboard()
Returns whether this dashlet is suitable for displaying in the dashboard view.boolean
providesHelpComponent()
Returns true, if the factory provides a help component for theDashlet
.void
setBoostable(boolean boostable)
This method sets the boostable flag.void
setDashboardSuitable(boolean dashletSuitable)
This method sets whether this dashlet is suitable for displaying in the dashboard view.void
setName(String name)
Sets the name of theDashlet
instances this object provides.void
setRequiredParameterDescriptions(Map<String,String> requiredParameterDescriptions)
This method sets the required parameter descriptionsMap
.void
setRequiredParameters(Map<String,String> requiredParameters)
This method sets the required parametersMap
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.features.vaadin.dashboard.model.DashletFactory
newDashletInstance
-
-
-
-
Field Detail
-
m_requiredParameters
protected Map<String,String> m_requiredParameters
A map holding the required parameters for theDashlet
-
m_requiredParameterDescriptions
protected Map<String,String> m_requiredParameterDescriptions
A map holding the required parameter descriptions for theDashlet
-
m_boostable
protected boolean m_boostable
boostable flag
-
m_dashboardSuitable
protected boolean m_dashboardSuitable
Are this dashlet suitable for displaying in the dashboard view.
-
-
Constructor Detail
-
AbstractDashletFactory
public AbstractDashletFactory()
Constructor for instantiating a new factory.
-
AbstractDashletFactory
public AbstractDashletFactory(String name)
Constructor for instantiating a new factory with the given name.- Parameters:
name
- the dashlet's name
-
-
Method Detail
-
addRequiredParameter
protected void addRequiredParameter(String key, String defaultValue)
Add a required parameter for this factory.- Parameters:
key
- the key to usedefaultValue
- the default value for this parameter
-
getName
public String getName()
Returns the name of theDashlet
instances this object provides.- Specified by:
getName
in interfaceDashletFactory
- Returns:
- the name
-
setName
public void setName(String name)
Sets the name of theDashlet
instances this object provides.- Parameters:
name
- the name
-
getRequiredParameters
public Map<String,String> getRequiredParameters()
Returns theMap
with the required parameters and default values.- Specified by:
getRequiredParameters
in interfaceDashletFactory
- Returns:
- the
Map
holding the requires parameters
-
getRequiredParameterDescriptions
public Map<String,String> getRequiredParameterDescriptions()
Returns theMap
with the required parameter descriptions.- Returns:
- the
Map
holding the requires parameter descriptions
-
setRequiredParameters
public void setRequiredParameters(Map<String,String> requiredParameters)
This method sets the required parametersMap
.- Parameters:
requiredParameters
- the parameterMap
to be set
-
setRequiredParameterDescriptions
public void setRequiredParameterDescriptions(Map<String,String> requiredParameterDescriptions)
This method sets the required parameter descriptionsMap
.- Parameters:
requiredParameterDescriptions
- the parameter descriptionMap
to be set
-
setBoostable
public void setBoostable(boolean boostable)
This method sets the boostable flag.
-
setDashboardSuitable
public void setDashboardSuitable(boolean dashletSuitable)
This method sets whether this dashlet is suitable for displaying in the dashboard view.
-
isSuitableForDashboard
public boolean isSuitableForDashboard()
Returns whether this dashlet is suitable for displaying in the dashboard view.- Specified by:
isSuitableForDashboard
in interfaceDashletFactory
- Returns:
- true if suitable, false otherwise
-
isBoostable
public boolean isBoostable()
This method returns whether this dashlet is boostable.- Specified by:
isBoostable
in interfaceDashletFactory
-
providesHelpComponent
public boolean providesHelpComponent()
Returns true, if the factory provides a help component for theDashlet
.- Specified by:
providesHelpComponent
in interfaceDashletFactory
- Returns:
- true, if help component is provided, false otherwise
-
getHelpComponent
public com.vaadin.ui.Component getHelpComponent()
Returns the help component for theDashlet
.- Specified by:
getHelpComponent
in interfaceDashletFactory
- Returns:
- the help component
-
getHelpContentHTML
public abstract String getHelpContentHTML()
Returns the help contentString
- Returns:
- the help content
-
configurationWindow
public DashletConfigurationWindow configurationWindow(DashletSpec dashletSpec)
Returns the window used for configuring aDashletSpec
instance.- Specified by:
configurationWindow
in interfaceDashletFactory
- Parameters:
dashletSpec
- theDashletSpec
instance- Returns:
- the
DashletConfigurationWindow
-
-