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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kieker
WebGUI
Commits
fbf969ac
Commit
fbf969ac
authored
May 30, 2013
by
Nils Christian Ehmke
Browse files
Options
Downloads
Patches
Plain Diff
Further development of the cockpit editor
parent
8cd0a325
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitEditorBean.java
+51
-38
51 additions, 38 deletions
...ieker/webgui/web/beans/view/CurrentCockpitEditorBean.java
with
51 additions
and
38 deletions
Kieker.WebGUI/src/main/java/kieker/webgui/web/beans/view/CurrentCockpitEditorBean.java
+
51
−
38
View file @
fbf969ac
...
@@ -168,9 +168,6 @@ public class CurrentCockpitEditorBean {
...
@@ -168,9 +168,6 @@ public class CurrentCockpitEditorBean {
// Now add the entries from the current view
// Now add the entries from the current view
if
(
this
.
activeView
!=
null
)
{
if
(
this
.
activeView
!=
null
)
{
final
FacesContext
fc
=
FacesContext
.
getCurrentInstance
();
final
Application
application
=
fc
.
getApplication
();
// Add a panel for every display connector we have
// Add a panel for every display connector we have
this
.
currId
=
0
;
this
.
currId
=
0
;
...
@@ -179,31 +176,11 @@ public class CurrentCockpitEditorBean {
...
@@ -179,31 +176,11 @@ public class CurrentCockpitEditorBean {
final
DashboardColumn
column
=
this
.
dashboard
.
getModel
().
getColumn
(
col
);
final
DashboardColumn
column
=
this
.
dashboard
.
getModel
().
getColumn
(
col
);
for
(
final
MIDisplayConnector
connector
:
displayConnectors
)
{
for
(
final
MIDisplayConnector
connector
:
displayConnectors
)
{
final
Panel
panel
=
(
Panel
)
application
.
createComponent
(
fc
,
"org.primefaces.component.Panel"
,
"org.primefaces.component.PanelRenderer"
);
final
Panel
panel
=
this
.
createPanelFromDisplayConnector
(
connector
);
panel
.
setId
(
"displayConnector_"
+
Integer
.
toString
(
this
.
connectors
.
get
(
connector
)));
panel
.
setHeader
(
connector
.
getName
());
panel
.
setClosable
(
true
);
panel
.
setToggleable
(
false
);
final
AjaxBehavior
behaviour
=
new
AjaxBehavior
();
behaviour
.
setProcess
(
"@this"
);
behaviour
.
addAjaxBehaviorListener
(
new
AjaxBehaviorListenerImpl
()
{
@Override
public
void
processAjaxBehavior
(
final
AjaxBehaviorEvent
event
)
throws
AbortProcessingException
{
System
.
out
.
println
(((
Panel
)
event
.
getSource
()).
getId
());
}
});
panel
.
addClientBehavior
(
"close"
,
behaviour
);
this
.
getDashboard
().
getChildren
().
add
(
panel
);
this
.
dashboard
.
getChildren
().
add
(
panel
);
column
.
addWidget
(
panel
.
getId
());
column
.
addWidget
(
panel
.
getId
());
final
HtmlOutputText
text
=
new
HtmlOutputText
();
text
.
setValue
(
connector
.
getDisplay
().
getName
());
panel
.
getChildren
().
add
(
text
);
this
.
currId
++;
this
.
currId
++;
}
}
}
}
...
@@ -238,6 +215,10 @@ public class CurrentCockpitEditorBean {
...
@@ -238,6 +215,10 @@ public class CurrentCockpitEditorBean {
// Update the class loader and the specific classes used within various methods in this bean
// Update the class loader and the specific classes used within various methods in this bean
this
.
fillDashboard
();
this
.
fillDashboard
();
if
(!
this
.
project
.
getViews
().
isEmpty
())
{
this
.
setActiveView
(
this
.
project
.
getViews
().
get
(
0
));
}
}
}
this
.
unsavedModifications
=
false
;
this
.
unsavedModifications
=
false
;
...
@@ -413,6 +394,50 @@ public class CurrentCockpitEditorBean {
...
@@ -413,6 +394,50 @@ public class CurrentCockpitEditorBean {
this
.
setModificationsFlag
();
this
.
setModificationsFlag
();
}
}
private
Panel
createPanelFromDisplayConnector
(
final
MIDisplayConnector
connector
)
{
final
FacesContext
fc
=
FacesContext
.
getCurrentInstance
();
final
Application
application
=
fc
.
getApplication
();
final
Panel
panel
=
(
Panel
)
application
.
createComponent
(
fc
,
"org.primefaces.component.Panel"
,
"org.primefaces.component.PanelRenderer"
);
final
String
id
=
this
.
displayConnectorToID
(
connector
);
// Set the usual properties of the panel
panel
.
setId
(
id
);
panel
.
setHeader
(
connector
.
getName
());
panel
.
setClosable
(
true
);
panel
.
setToggleable
(
false
);
final
HtmlOutputText
text
=
new
HtmlOutputText
();
text
.
setValue
(
connector
.
getDisplay
().
getName
());
panel
.
getChildren
().
add
(
text
);
// The following code makes sure that the application detects the close event
final
AjaxBehavior
behaviour
=
new
AjaxBehavior
();
behaviour
.
setProcess
(
"@this"
);
behaviour
.
addAjaxBehaviorListener
(
new
AjaxBehaviorListenerImpl
()
{
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
void
processAjaxBehavior
(
final
AjaxBehaviorEvent
event
)
throws
AbortProcessingException
{
CurrentCockpitEditorBean
.
this
.
panelCloseEvent
(
event
);
}
});
panel
.
addClientBehavior
(
"close"
,
behaviour
);
return
panel
;
}
private
void
panelCloseEvent
(
final
AjaxBehaviorEvent
event
)
{
if
(
CurrentCockpitEditorBean
.
this
.
activeView
!=
null
)
{
final
String
id
=
((
Panel
)
event
.
getSource
()).
getId
();
final
MIDisplayConnector
connector
=
CurrentCockpitEditorBean
.
this
.
idToDisplayConnector
(
id
);
CurrentCockpitEditorBean
.
this
.
activeView
.
getDisplayConnectors
().
remove
(
connector
);
CurrentCockpitEditorBean
.
this
.
saveLayoutOfCurrentView
();
}
}
/**
/**
* This method adds the given display to the currently active view. If no view exists, this method does nothing.
* This method adds the given display to the currently active view. If no view exists, this method does nothing.
*
*
...
@@ -427,22 +452,10 @@ public class CurrentCockpitEditorBean {
...
@@ -427,22 +452,10 @@ public class CurrentCockpitEditorBean {
this
.
activeView
.
getDisplayConnectors
().
add
(
connector
);
this
.
activeView
.
getDisplayConnectors
().
add
(
connector
);
// Now add it to the dashboard as well
// Now add it to the dashboard as well
final
FacesContext
fc
=
FacesContext
.
getCurrentInstance
();
final
Panel
panel
=
this
.
createPanelFromDisplayConnector
(
connector
);
final
Application
application
=
fc
.
getApplication
();
final
Panel
panel
=
(
Panel
)
application
.
createComponent
(
fc
,
"org.primefaces.component.Panel"
,
"org.primefaces.component.PanelRenderer"
);
panel
.
setId
(
this
.
displayConnectorToID
(
connector
));
panel
.
setHeader
(
connector
.
getName
());
panel
.
setClosable
(
true
);
panel
.
setToggleable
(
false
);
this
.
getDashboard
().
getChildren
().
add
(
panel
);
this
.
getDashboard
().
getChildren
().
add
(
panel
);
final
DashboardColumn
column
=
this
.
dashboardModel
.
getColumn
(
0
);
final
DashboardColumn
column
=
this
.
dashboardModel
.
getColumn
(
0
);
column
.
addWidget
(
panel
.
getId
());
column
.
addWidget
(
panel
.
getId
());
final
HtmlOutputText
text
=
new
HtmlOutputText
();
text
.
setValue
(
display
.
getName
());
panel
.
getChildren
().
add
(
text
);
this
.
currId
++;
this
.
currId
++;
this
.
setModificationsFlag
();
this
.
setModificationsFlag
();
...
...
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