kieker.webgui.web.beans.view
Class CockpitEditorBean

java.lang.Object
  extended by kieker.webgui.web.beans.view.CockpitEditorBean

@Component
@Scope(value="view")
public final class CockpitEditorBean
extends Object

The CockpitEditorBean contains the necessary data behind an instance of the cockpit editor.

The class is a Spring managed bean with view scope to make sure that one user (even in one session) can open multiple projects at a time without causing any problems.

Author:
Nils Christian Ehmke

Constructor Summary
CockpitEditorBean()
          Creates a new instance of this class.
 
Method Summary
 void addDisplayToView(kieker.analysis.model.analysisMetaModel.MIDisplay display)
          This method adds the given display to the currently active view.
 void addView(NewViewBean newViewBean)
          This method adds a new view to the project.
 void copyView(CopyViewBean copyViewBean)
          Copies a view.
 void deleteView(kieker.analysis.model.analysisMetaModel.MIView view)
          Deletes the given view from the model.
 void editView(EditViewBean editViewBean)
          Edits an existing view.
 kieker.analysis.model.analysisMetaModel.MIView getActiveView()
           
 org.primefaces.component.dashboard.Dashboard getDashboard()
           
 String getDescription(kieker.analysis.model.analysisMetaModel.MIDisplay display)
          This method can be used to get the description of a MIDisplay.
 kieker.analysis.model.analysisMetaModel.MIProject getProject()
           
 String getProjectName()
           
 Collection<Object> getProperties()
          This is a dummy method returning just a collection of null objects.
 kieker.analysis.model.analysisMetaModel.MIDisplayConnector getSelectedNode()
           
 kieker.analysis.model.analysisMetaModel.MIView getSelectedView()
           
 void handleReorder(org.primefaces.event.DashboardReorderEvent event)
          This handler should be executed when the user moves an element within the dashboard.
 void initalize()
          This method initializes the bean by using the current project name to load the project.
 boolean isUnsavedModification()
           
 void nodeSelected()
          This is the event if a node has been clicked and should be selected.
 void saveProject(boolean overwriteNewerProject)
          This method tries to save the current project and informs the user about success or fail.
 void setActiveView(kieker.analysis.model.analysisMetaModel.MIView view)
          Sets the active view and updates the dashboard.
 void setDashboard(org.primefaces.component.dashboard.Dashboard dashboard)
          Setter for the property dashboard.
 void setProjectName(String newName)
           
 void setSelectedView(kieker.analysis.model.analysisMetaModel.MIView view)
           
 void updateName()
          Performs an update on the dashboard once a name has been changed.
 void validateDisplayConnectorName(javax.faces.context.FacesContext context, javax.faces.component.UIComponent toValidate, Object value)
          This method is used as a validator for new display connector names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CockpitEditorBean

public CockpitEditorBean()
Creates a new instance of this class. Do not call this constructor manually. It will only be accessed by Spring.

Method Detail

initalize

public void initalize()
This method initializes the bean by using the current project name to load the project. Do not call this method manually. It will only be accessed by Spring.


isUnsavedModification

public boolean isUnsavedModification()

getProperties

public Collection<Object> getProperties()
This is a dummy method returning just a collection of null objects. This is necessary due to Primefaces.

Returns:
A collection with three null objects.

getSelectedView

public kieker.analysis.model.analysisMetaModel.MIView getSelectedView()

setSelectedView

public void setSelectedView(kieker.analysis.model.analysisMetaModel.MIView view)

getActiveView

public kieker.analysis.model.analysisMetaModel.MIView getActiveView()

setActiveView

public void setActiveView(kieker.analysis.model.analysisMetaModel.MIView view)
Sets the active view and updates the dashboard.

Parameters:
view - The new view.

deleteView

public void deleteView(kieker.analysis.model.analysisMetaModel.MIView view)
Deletes the given view from the model.

Parameters:
view - The view to be removed.

copyView

public void copyView(CopyViewBean copyViewBean)
Copies a view.

Parameters:
copyViewBean - The bean containing the necessary data to copy the view.

editView

public void editView(EditViewBean editViewBean)
Edits an existing view.

Parameters:
editViewBean - The bean containing the necessary data to edit the view.

addView

public void addView(NewViewBean newViewBean)
This method adds a new view to the project.

Parameters:
newViewBean - The bean containing the necessary data to create the view.

getDashboard

public org.primefaces.component.dashboard.Dashboard getDashboard()

setDashboard

public void setDashboard(org.primefaces.component.dashboard.Dashboard dashboard)
Setter for the property dashboard.

Parameters:
dashboard - The new value for the property.

getProject

public kieker.analysis.model.analysisMetaModel.MIProject getProject()

setProjectName

public void setProjectName(String newName)

getProjectName

public String getProjectName()

getSelectedNode

public kieker.analysis.model.analysisMetaModel.MIDisplayConnector getSelectedNode()

updateName

public void updateName()
Performs an update on the dashboard once a name has been changed.


getDescription

public String getDescription(kieker.analysis.model.analysisMetaModel.MIDisplay display)
This method can be used to get the description of a MIDisplay. Currently it is a little bit expensive to search for the description.

Parameters:
display - The display whose description should be extracted.
Returns:
The description for the display or a substitute if none is available. This is in either case human readable.

saveProject

public void saveProject(boolean overwriteNewerProject)
This method tries to save the current project and informs the user about success or fail.

Parameters:
overwriteNewerProject - This flag determines whether a newer project should be overwritten.

addDisplayToView

public void addDisplayToView(kieker.analysis.model.analysisMetaModel.MIDisplay display)
This method adds the given display to the currently active view. If no view exists, this method does nothing.

Parameters:
display - The display which should be added to the current view.

handleReorder

public void handleReorder(org.primefaces.event.DashboardReorderEvent event)
This handler should be executed when the user moves an element within the dashboard.

Parameters:
event - The move event.

validateDisplayConnectorName

public void validateDisplayConnectorName(javax.faces.context.FacesContext context,
                                         javax.faces.component.UIComponent toValidate,
                                         Object value)
This method is used as a validator for new display connector names.

Parameters:
context - The context of the validation.
toValidate - The components which has be validated.
value - The new value.

nodeSelected

public void nodeSelected()
This is the event if a node has been clicked and should be selected.



Copyright © 2015. All rights reserved.