Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WebGUI
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kieker
WebGUI
Commits
ab1c9c7d
Commit
ab1c9c7d
authored
11 years ago
by
Nils Christian Ehmke
Browse files
Options
Downloads
Patches
Plain Diff
Continued with the cockpit
parent
bbf18c92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CockpitBean.java
+90
-62
90 additions, 62 deletions
...c/main/java/kieker/webgui/web/beans/view/CockpitBean.java
with
90 additions
and
62 deletions
Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CockpitBean.java
+
90
−
62
View file @
ab1c9c7d
...
...
@@ -496,10 +496,14 @@ public final class CockpitBean {
if
(
isAlreadyCorrectlyInitialized
)
{
htmlOutputText
=
(
HtmlOutputText
)
component
.
getChildren
().
get
(
0
);
}
else
{
final
FacesContext
facesContext
=
FacesContext
.
getCurrentInstance
();
facesContext
.
getApplication
();
htmlOutputText
=
new
HtmlOutputText
();
component
.
getChildren
().
clear
();
component
.
getChildren
().
add
(
htmlOutputText
);
this
.
addButtonBoxToComponent
(
component
,
displayConnectorName
,
DisplayType
.
PLAIN_TEXT
);
}
try
{
...
...
@@ -548,6 +552,7 @@ public final class CockpitBean {
component
.
getChildren
().
clear
();
component
.
getChildren
().
add
(
tagCloud
);
this
.
addButtonBoxToComponent
(
component
,
displayConnectorName
,
DisplayType
.
TAG_CLOUD
);
}
try
{
...
...
@@ -598,20 +603,9 @@ public final class CockpitBean {
meterGaugeChartModel
=
new
MeterGaugeChartModel
();
meterGaugeChart
.
setValue
(
meterGaugeChartModel
);
// Create the Primefaces Commandbutton component
final
CommandButton
button
=
(
CommandButton
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.CommandButton"
,
"org.primefaces.component.CommandButtonRenderer"
);
button
.
setValue
(
"Settings"
);
button
.
setAjax
(
true
);
button
.
setUpdate
(
":displaySettingsDialogForm"
);
final
Separator
separator
=
(
Separator
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.Separator"
,
"org.primefaces.component.SeparatorRenderer"
);
component
.
getChildren
().
clear
();
component
.
getChildren
().
add
(
meterGaugeChart
);
component
.
getChildren
().
add
(
separator
);
component
.
getChildren
().
add
(
button
);
this
.
addButtonBoxToComponent
(
component
,
displayConnectorName
,
DisplayType
.
METER_GAUGE
);
}
try
{
...
...
@@ -682,20 +676,9 @@ public final class CockpitBean {
pieChartModel
=
new
PieChartModel
();
pieChart
.
setValue
(
pieChartModel
);
// Create the Primefaces Commandbutton component
final
CommandButton
button
=
(
CommandButton
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.CommandButton"
,
"org.primefaces.component.CommandButtonRenderer"
);
button
.
setValue
(
"Settings"
);
button
.
setAjax
(
true
);
button
.
setUpdate
(
":displaySettingsDialogForm"
);
final
Separator
separator
=
(
Separator
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.Separator"
,
"org.primefaces.component.SeparatorRenderer"
);
component
.
getChildren
().
clear
();
component
.
getChildren
().
add
(
pieChart
);
component
.
getChildren
().
add
(
separator
);
component
.
getChildren
().
add
(
button
);
this
.
addButtonBoxToComponent
(
component
,
displayConnectorName
,
DisplayType
.
PIE_CHART
);
}
try
{
...
...
@@ -728,6 +711,87 @@ public final class CockpitBean {
}
}
private
void
addButtonBoxToSettingsDialog
()
{
final
FacesContext
facesContext
=
FacesContext
.
getCurrentInstance
();
final
Application
application
=
facesContext
.
getApplication
();
// Create the components rendering the div elements
final
HtmlPanelGroup
div
=
new
HtmlPanelGroup
();
div
.
setLayout
(
"block"
);
div
.
setStyle
(
"text-align: right"
);
// Create the components for the horizontal line
final
Separator
separator
=
(
Separator
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.Separator"
,
"org.primefaces.component.SeparatorRenderer"
);
// Create the button to close the settings dialog
final
CommandButton
button
=
(
CommandButton
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.CommandButton"
,
"org.primefaces.component.CommandButtonRenderer"
);
button
.
setValue
(
"Ok"
);
button
.
setOnclick
(
"displaySettingsDlg.hide()"
);
// Add all components
div
.
getChildren
().
add
(
separator
);
div
.
getChildren
().
add
(
button
);
this
.
displaySettingsDialog
.
getChildren
().
add
(
div
);
}
private
void
addButtonBoxToComponent
(
final
UIComponent
component
,
final
String
displayConnectorName
,
final
DisplayType
type
)
{
final
FacesContext
facesContext
=
FacesContext
.
getCurrentInstance
();
final
Application
application
=
facesContext
.
getApplication
();
// Create the components rendering the div elements
final
HtmlPanelGroup
div
=
new
HtmlPanelGroup
();
div
.
setLayout
(
"block"
);
div
.
setStyle
(
"text-align: right"
);
// Create the button to show the settings dialog
final
CommandButton
button
=
(
CommandButton
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.CommandButton"
,
"org.primefaces.component.CommandButtonRenderer"
);
button
.
setValue
(
"Settings"
);
button
.
setOnclick
(
"displaySettingsDlg.show()"
);
button
.
setAjax
(
true
);
button
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
processAction
(
final
ActionEvent
event
)
throws
AbortProcessingException
{
switch
(
type
)
{
case
HTML_TEXT:
break
;
case
IMAGE:
break
;
case
METER_GAUGE:
break
;
case
PIE_CHART:
break
;
case
PLAIN_TEXT:
break
;
case
TAG_CLOUD:
break
;
case
XY_PLOT:
CockpitBean
.
this
.
updateXYPlotDisplaySettings
(
displayConnectorName
);
break
;
default
:
break
;
}
}
});
button
.
setUpdate
(
":displaySettingsDialogForm"
);
final
Separator
separator
=
(
Separator
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.Separator"
,
"org.primefaces.component.SeparatorRenderer"
);
div
.
getChildren
().
add
(
separator
);
div
.
getChildren
().
add
(
button
);
component
.
getChildren
().
add
(
div
);
}
@SuppressWarnings
(
"unchecked"
)
private
void
updateXYPlotDisplay
(
final
UIComponent
component
,
final
String
displayConnectorName
)
{
final
boolean
isAlreadyCorrectlyInitialized
=
(
component
.
getChildCount
()
==
2
)
&&
(
component
.
getChildren
().
get
(
0
)
instanceof
LineChart
)
...
...
@@ -754,29 +818,9 @@ public final class CockpitBean {
linearModel
=
new
CartesianChartModel
();
lineChart
.
setValue
(
linearModel
);
// Create the Primefaces Commandbutton component
final
CommandButton
button
=
(
CommandButton
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.CommandButton"
,
"org.primefaces.component.CommandButtonRenderer"
);
button
.
setValue
(
"Settings"
);
button
.
setOnclick
(
"displaySettingsDlg.show()"
);
button
.
setAjax
(
true
);
button
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
processAction
(
final
ActionEvent
event
)
throws
AbortProcessingException
{
CockpitBean
.
this
.
updateXYPlotDisplaySettings
(
displayConnectorName
);
}
});
button
.
setUpdate
(
":displaySettingsDialogForm"
);
final
Separator
separator
=
(
Separator
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.Separator"
,
"org.primefaces.component.SeparatorRenderer"
);
component
.
getChildren
().
clear
();
component
.
getChildren
().
add
(
lineChart
);
component
.
getChildren
().
add
(
separator
);
component
.
getChildren
().
add
(
button
);
this
.
addButtonBoxToComponent
(
component
,
displayConnectorName
,
DisplayType
.
XY_PLOT
);
}
try
{
...
...
@@ -855,23 +899,7 @@ public final class CockpitBean {
this
.
displaySettingsDialog
.
getChildren
().
clear
();
this
.
displaySettingsDialog
.
getChildren
().
add
(
selectManyCheckbox
);
final
HtmlPanelGroup
div
=
new
HtmlPanelGroup
();
div
.
setLayout
(
"block"
);
div
.
setStyle
(
"align: right"
);
final
Separator
separator
=
(
Separator
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.Separator"
,
"org.primefaces.component.SeparatorRenderer"
);
final
CommandButton
button
=
(
CommandButton
)
application
.
createComponent
(
facesContext
,
"org.primefaces.component.CommandButton"
,
"org.primefaces.component.CommandButtonRenderer"
);
button
.
setValue
(
"Ok"
);
button
.
setOnclick
(
"displaySettingsDlg.hide()"
);
div
.
getChildren
().
add
(
separator
);
div
.
getChildren
().
add
(
button
);
this
.
displaySettingsDialog
.
getChildren
().
add
(
div
);
this
.
addButtonBoxToSettingsDialog
();
}
catch
(
final
Exception
ex
)
{
// NOCS NOPMD (Temporary catch)
ex
.
printStackTrace
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment