Skip to content
Snippets Groups Projects
Commit da992aa6 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Checkstyle

parent a41c1870
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,13 @@ import org.primefaces.model.TreeNode;
@ApplicationScoped
public class AvailableProjectsBean {
/**
* A list containing all available projects.
*/
private final List<MIProject> projects;
/**
* The factory used to create new projects.
*/
private final MAnalysisMetaModelFactory factory;
/**
......@@ -55,13 +61,13 @@ public class AvailableProjectsBean {
}
/**
* Uses the given name to create a new project. If a project with the same
* name does already exist, nothing happens.
* Uses the given name to create a new project. If a project with the
* same name does already exist, nothing happens.
*
* @param projectName
* The name of the new project.
*/
public synchronized void addProject(final String projectName) {
public final synchronized void addProject(final String projectName) {
/*
* Create a new project.
*/
......@@ -73,8 +79,8 @@ public class AvailableProjectsBean {
*/
if (FileManager.getInstance().saveNewProject(project)) {
/*
* Set the new project as the main project, if the current user
* doesn't have one.
* Set the new project as the main project, if the current
* user doesn't have one.
*/
final FacesContext context = FacesContext.getCurrentInstance();
final SelectedProjectBean bean = context.getApplication().evaluateExpressionGet(context, "#{selectedProjectBean}",
......@@ -92,7 +98,7 @@ public class AvailableProjectsBean {
*
* @returns The root of the currently available projects.
*/
public synchronized TreeNode getProjectsRoot() {
public final synchronized TreeNode getProjectsRoot() {
final TreeNode root = new DefaultTreeNode("Root", null);
for (final MIProject project : this.projects) {
......@@ -107,14 +113,34 @@ public class AvailableProjectsBean {
return root;
}
/**
* This method saved a given project on the file system. The project
* should already exist.
*
* @param project
* The project to be saved.
*/
public synchronized void saveProject(final MIProject project) {
}
/**
* Deletes a given project from the file system.
*
* @param project
* The project to be removed.
*/
public synchronized void deleteProject(final MIProject project) {
}
/**
* Reloads a given project from the file system. In other words: The
* state of the project is restored from the file system.
*
* @param project
* The project to be reloaded.
*/
public synchronized void resetProject(final MIProject project) {
}
......
......@@ -28,8 +28,9 @@ import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
/**
* This bean is an application-wide bean, responsible for storing the possible themes (look and feels) available within the program. It is not possible to import new
* themes during runtime.
* This bean is an application-wide bean, responsible for storing the possible
* themes (look and feels) available within the program. It is not possible to
* import new themes during runtime.
*
* @author Nils Christian Ehmke
*/
......@@ -37,29 +38,34 @@ import javax.faces.bean.ManagedBean;
@ApplicationScoped
public class ThemeSwitcherBean {
private Map<String, String> themes;
/**
* A map containing all available themes.
*/
private final Map<String, String> themes;
/**
* Creates a new instance of this class.
*/
public ThemeSwitcherBean() {}
public ThemeSwitcherBean() {
this.themes = new TreeMap<String, String>();
}
/**
* Returns the available themes.
*
* @return A map containing the user readable names of the themes as a key and the actual theme-names as the corresponding value.
* @return A map containing the user readable names of the themes as a key
* and the actual theme-names as the corresponding value.
*/
public Map<String, String> getThemes() {
public final Map<String, String> getThemes() {
return this.themes;
}
/**
* Initializes the bean. If one wants to add new themes to the program, this is the right place.
* Initializes the bean. If one wants to add new themes to the program,
* this is the right place.
*/
@PostConstruct
public void init() {
this.themes = new TreeMap<String, String>();
public final void init() {
this.themes.put("Aristo", "aristo");
this.themes.put("Black-Tie", "black-tie");
this.themes.put("Blitzer", "blitzer");
......
......@@ -86,7 +86,7 @@ public class SelectedDependenciesBean {
*
* @return The dependencies dual model.
*/
public DualListModel<MIDependency> getDependencies() {
public final DualListModel<MIDependency> getDependencies() {
return this.dependencies;
}
......@@ -96,7 +96,7 @@ public class SelectedDependenciesBean {
* @param dependencies
* The new dependencies dual model.
*/
public void setDependencies(final DualListModel<MIDependency> dependencies) {
public final void setDependencies(final DualListModel<MIDependency> dependencies) {
System.out.println(dependencies);
this.dependencies = dependencies;
......
......@@ -29,8 +29,10 @@ import javax.faces.context.FacesContext;
import kieker.webgui.beans.application.ThemeSwitcherBean;
/**
* This bean can be used for a single session of a user and stores the currently used theme (look and feel) for this user. Currently the default value being used is
* the "glass-x"-theme, if none is find within the parameters of the faces context.
* This bean can be used for a single session of a user and stores the
* currently used theme (look and feel) for this user. Currently the
* default value being used is the "glass-x"-theme, if none is find within
* the parameters of the faces context.
*
* @author Nils Christian Ehmke
*
......@@ -63,7 +65,7 @@ public class CurrentThemeBean {
*
* @return The currently used theme.
*/
public String getTheme() {
public final String getTheme() {
return this.theme;
}
......@@ -73,7 +75,7 @@ public class CurrentThemeBean {
* @param theme
* The new theme to be stored within this instance.
*/
public void setTheme(final String theme) {
public final void setTheme(final String theme) {
this.theme = theme;
}
}
......@@ -52,7 +52,7 @@ public class SelectedProjectBean {
*
* @return The user's main project.
*/
public MIProject getMainProject() {
public final MIProject getMainProject() {
return this.mainProject;
}
......@@ -62,7 +62,7 @@ public class SelectedProjectBean {
* @param mainProject
* The new main project of the current user.
*/
public void setMainProject(final MIProject mainProject) {
public final void setMainProject(final MIProject mainProject) {
this.mainProject = mainProject;
}
......@@ -71,23 +71,23 @@ public class SelectedProjectBean {
*
* @return The user's currently selected project.
*/
public MIProject getSelectedProject() {
public final MIProject getSelectedProject() {
return this.selectedProject;
}
public void setSelectedProject(final MIProject selectedProject) {
public final void setSelectedProject(final MIProject selectedProject) {
this.selectedProject = selectedProject;
}
public TreeNode getSelectedNode() {
public final TreeNode getSelectedNode() {
return this.selectedNode;
}
public void onNodeSelect(final NodeSelectEvent event) {
public final void onNodeSelect(final NodeSelectEvent event) {
this.setSelectedNode(event.getTreeNode());
}
public void setSelectedNode(final TreeNode selectedNode) {
public final void setSelectedNode(final TreeNode selectedNode) {
this.selectedNode = selectedNode;
if (selectedNode != null && selectedNode.getData() instanceof MIProject) {
this.setSelectedProject((MIProject) selectedNode.getData());
......@@ -105,7 +105,7 @@ public class SelectedProjectBean {
* The project to be checked.
* @return "bold" if the given project is the current main project, "normal" otherwise.
*/
public String getFontWeight(final MIProject project) {
public final String getFontWeight(final MIProject project) {
if (project == this.mainProject) {
return "bold";
} else {
......@@ -118,7 +118,7 @@ public class SelectedProjectBean {
*
* @return A tree with the available plugins.
*/
public TreeNode getAvailablePluginsRoot() {
public final TreeNode getAvailablePluginsRoot() {
final TreeNode root = new DefaultTreeNode("Root", null);
final TreeNode readerNode = new DefaultTreeNode("default", "Reader", root);
......
......@@ -99,7 +99,7 @@ public final class FileManager {
* @return true iff the project-directory does already exist and the storage
* was successful.
*/
public synchronized boolean saveProject(final MIProject project) {
public final synchronized boolean saveProject(final MIProject project) {
final String projectName = project.getName();
final File dirProject = new File(FileManager.PROJECT_DIR + File.separator + projectName);
......@@ -133,7 +133,7 @@ public final class FileManager {
* @return true iff the project-directory does not already exist and the
* storage was successful.
*/
public synchronized boolean saveNewProject(final MIProject project) {
public final synchronized boolean saveNewProject(final MIProject project) {
final String projectName = project.getName();
final File dirProject = new File(FileManager.PROJECT_DIR + File.separator + projectName);
......@@ -157,7 +157,7 @@ public final class FileManager {
* @return A list containing the loaded projects. If something went wrong,
* an empty list will be returned, never null.
*/
public synchronized List<MIProject> loadAllProjects() {
public final synchronized List<MIProject> loadAllProjects() {
final List<MIProject> resultList = new ArrayList<MIProject>();
/*
......@@ -202,7 +202,7 @@ public final class FileManager {
* @return The new dependency iff the uploading was sucesfull, null
* otherwise.
*/
public synchronized MIDependency uploadDependency(final UploadedFile file) {
public final synchronized MIDependency uploadDependency(final UploadedFile file) {
final File depFile = new File(FileManager.LIB_DIR, file.getFileName());
InputStream in = null;
......@@ -251,7 +251,7 @@ public final class FileManager {
*
* @return The singleton instance of this class.
*/
public synchronized static FileManager getInstance() {
public final synchronized static FileManager getInstance() {
return FileManager.INSTANCE;
}
......@@ -260,7 +260,7 @@ public final class FileManager {
*
* @return A list containing all available dependencies. If there are no files, an empty list will be returned.
*/
public synchronized List<MIDependency> loadAllDependencies() {
public final synchronized List<MIDependency> loadAllDependencies() {
final List<MIDependency> resultList = new ArrayList<MIDependency>();
/*
* Try to get all files within the library directory.
......@@ -288,7 +288,7 @@ public final class FileManager {
* The dependency to be removed.
* @return true iff the dependency exists and the removal was succesful.
*/
public synchronized boolean deleteDependency(final MIDependency dependency) {
public final synchronized boolean deleteDependency(final MIDependency dependency) {
final File file = new File(dependency.getFilePath());
if (file.isFile()) {
return file.delete();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment