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 instantiatingDashletobjects.- Author:
- Christian Pape
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanm_boostableboostable flagprotected booleanm_dashboardSuitableAre this dashlet suitable for displaying in the dashboard view.protected Stringm_nameThe name of the providedDashletprotected Map<String,String>m_requiredParameterDescriptionsA map holding the required parameter descriptions for theDashletprotected Map<String,String>m_requiredParametersA 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 voidaddRequiredParameter(String key, String defaultValue)Add a required parameter for this factory.DashletConfigurationWindowconfigurationWindow(DashletSpec dashletSpec)Returns the window used for configuring aDashletSpecinstance.com.vaadin.ui.ComponentgetHelpComponent()Returns the help component for theDashlet.abstract StringgetHelpContentHTML()Returns the help contentStringStringgetName()Returns the name of theDashletinstances this object provides.Map<String,String>getRequiredParameterDescriptions()Returns theMapwith the required parameter descriptions.Map<String,String>getRequiredParameters()Returns theMapwith the required parameters and default values.booleanisBoostable()This method returns whether this dashlet is boostable.booleanisSuitableForDashboard()Returns whether this dashlet is suitable for displaying in the dashboard view.booleanprovidesHelpComponent()Returns true, if the factory provides a help component for theDashlet.voidsetBoostable(boolean boostable)This method sets the boostable flag.voidsetDashboardSuitable(boolean dashletSuitable)This method sets whether this dashlet is suitable for displaying in the dashboard view.voidsetName(String name)Sets the name of theDashletinstances this object provides.voidsetRequiredParameterDescriptions(Map<String,String> requiredParameterDescriptions)This method sets the required parameter descriptionsMap.voidsetRequiredParameters(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 theDashletinstances this object provides.- Specified by:
getNamein interfaceDashletFactory- Returns:
- the name
-
setName
public void setName(String name)
Sets the name of theDashletinstances this object provides.- Parameters:
name- the name
-
getRequiredParameters
public Map<String,String> getRequiredParameters()
Returns theMapwith the required parameters and default values.- Specified by:
getRequiredParametersin interfaceDashletFactory- Returns:
- the
Mapholding the requires parameters
-
getRequiredParameterDescriptions
public Map<String,String> getRequiredParameterDescriptions()
Returns theMapwith the required parameter descriptions.- Returns:
- the
Mapholding the requires parameter descriptions
-
setRequiredParameters
public void setRequiredParameters(Map<String,String> requiredParameters)
This method sets the required parametersMap.- Parameters:
requiredParameters- the parameterMapto be set
-
setRequiredParameterDescriptions
public void setRequiredParameterDescriptions(Map<String,String> requiredParameterDescriptions)
This method sets the required parameter descriptionsMap.- Parameters:
requiredParameterDescriptions- the parameter descriptionMapto 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:
isSuitableForDashboardin interfaceDashletFactory- Returns:
- true if suitable, false otherwise
-
isBoostable
public boolean isBoostable()
This method returns whether this dashlet is boostable.- Specified by:
isBoostablein interfaceDashletFactory
-
providesHelpComponent
public boolean providesHelpComponent()
Returns true, if the factory provides a help component for theDashlet.- Specified by:
providesHelpComponentin 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:
getHelpComponentin 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 aDashletSpecinstance.- Specified by:
configurationWindowin interfaceDashletFactory- Parameters:
dashletSpec- theDashletSpecinstance- Returns:
- the
DashletConfigurationWindow
-
-