Interface Portlet
- All Known Subinterfaces:
DashboardApi
,ResultMatrix
- All Known Implementing Classes:
AbstractChartBuilder
,AbstractPortletDto
,BarLineChart
,BoxplotChart
,BubbleChart
,ConfiguratorEntry
,ConfiguratorEntryArray
,DashboardController
,DataTableChart
,DetailedTimeSeriesChart
,HeatmapChart
,HistogramChart
,PieChart
,ResultFlexChart
,ResultGauge
,ResultHighchart
,ResultHighmap
,ResultMatrix
,ScatterChart
,TimeSeriesChart
,TimeSeriesScatterChart
,WaterfallChart
,WaterfallComparisonChart
public interface Portlet
Common interface for the portlet behavior.
Note: These settings done on Portlet are inherited for embedded dashboard which contains this Portlet.
From embedded dashboard point of view, you can override these settings via
DashboardApi
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionwithDragDrop
(boolean enabled) Enables or disables the drag&drop feature for portlets.Adds an error message to the given portlet.withHeight
(int height) Builder style method for setting the height in pixels.withHeight
(int height, String unit) Builder style method for setting the height in supported units.Adds an info message to the given portlet.withLayout
(int width, int height) Builder style method for setting width and height in pixels.withLayout
(int width, int height, String unit) Builder style method for setting width and height in specified units.withResizing
(boolean enabled) Enables or disables the resizing feature for portlets.withWarning
(String code, String userMsg, String techMsg) Adds a warning message to the given portlet.withWidth
(int width) Builder style method for setting the width in pixels.Builder style method for setting the width in supported units.
-
Field Details
-
UNIT_PX
The pixels unit.- See Also:
-
UNIT_GRID
The grid unit for 12 column layout system.- See Also:
-
-
Method Details
-
withWidth
Builder style method for setting the width in pixels.- Parameters:
width
- specify the width of the portlet (in pixels)- Returns:
- The current portlet object of the specified size.
- Since:
- 9.0 - Hurricane
- See Also:
-
withHeight
Builder style method for setting the height in pixels.- Parameters:
height
- specify the height of the portlet (in pixels)- Returns:
- The current portlet object of the specified size.
- Since:
- 9.0 - Hurricane
- See Also:
-
withLayout
Builder style method for setting width and height in pixels.- Parameters:
width
- specify the width of the portlet (in pixels)height
- specify the height of the portlet (in pixels)- Returns:
- The current portlet object of the specified size.
- Since:
- 9.0 - Hurricane
- See Also:
-
withDragDrop
Enables or disables the drag&drop feature for portlets. Set tofalse
to disable the drag&drop option. Default state is ENABLED.Example - disables the drag&drop of the Result Matrix portlet:
def matrix = api.newMatrix("column1", "column2", "column3") matrix.addRow(1, "a", "f") matrix.addRow(2, "b", "g") matrix.withDragDrop(false) return matrix
- Parameters:
enabled
- on/off switch. Default =true
.- Returns:
- this Portlet instance
-
withResizing
Enables or disables the resizing feature for portlets. Set tofalse
to disable the resizing of the portlet. Default state is ENABLED.Example - disables the resizing option of the Result Matrix portlet:
def matrix = api.newMatrix("column1", "column2", "column3") matrix.addRow(1, "a", "f") matrix.addRow(2, "b", "g") matrix.withResizing(false) return matrix
- Parameters:
enabled
- on/off switch. Default =true
.- Returns:
- this Portlet instance
-
withWidth
Builder style method for setting the width in supported units.Example – setting the width using the 12-column system (grid):
Example – setting the width using pixels:portlet.withWidth(12, "grid")
portlet.withWidth(400, "px") // == portlet.withWidth(400)
-
withHeight
Builder style method for setting the height in supported units.Example – setting the height using the 12-column system (grid):
Example – setting the height using pixels:portlet.withHeight(12, "grid")
portlet.withHeight(800, "px") // == portlet.withHeight(800)
-
withLayout
Builder style method for setting width and height in specified units.Example - sets the portlet size to the specified grid size:
def matrix = api.newMatrix("column1", "column2", "column3") matrix.addRow(1, "a", "f") matrix.addRow(2, "b", "g") matrix.withLayout(3, 3, "grid") return matrix
-
withInfo
Adds an info message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
Example:portlet.withInfo("101", "Chart data may be outdated", "Bubble Chart data is outdated, because of ...")
- Parameters:
code
- Info code allows to pinpoint the place of the related issue in code.userMsg
- Info message is displayed to a user in UI.techMsg
- Technical message is hidden by default, only for the investigation purposes.
-
withWarning
Adds a warning message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
Example:portlet.withWarning("102", "Chart data is missing", "Bubble Chart data is missing, because of ...")
- Parameters:
code
- Warning code allows to pinpoint the place where the warning is thrown in code.userMsg
- Warning message is displayed to a user in UI.techMsg
- Technical message is hidden by default, only for the investigation purposes.
-
withError
Adds an error message to the given portlet. One portlet can have multiple messages. It is a different concept than yellow/red alerts.
Example:portlet.withError("103", "Chart was not found", "Bubble Chart could not be found, because of ...")
- Parameters:
code
- Error code allows to pinpoint the place where the error is thrown in code.userMsg
- Error message is displayed to a user in UI.techMsg
- Technical message is hidden by default, only for the investigation purposes.
-