pl.edu.agh.cast.backward.resources
Class ProjectStore

java.lang.Object
  extended by pl.edu.agh.cast.backward.resources.ProjectStore

public final class ProjectStore
extends Object

Used to store models during one session.

Author:
AGH CAST Team

Method Summary
static ProjectStore getInstance()
          Returns single, shared instance of ProjectStore.
 IModel getModel(org.eclipse.core.resources.IProject project)
          Returns model for given project.
 org.eclipse.core.resources.IProject getProject(IModel model)
          Returns IProject for given IModel.
 void init(org.eclipse.core.resources.IProject project)
          Initialize the project.
 boolean isInitialized(org.eclipse.core.resources.IProject project)
          Checks if project is initialized.
 void remove(org.eclipse.core.resources.IProject project)
          Removes the given project.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ProjectStore getInstance()
Returns single, shared instance of ProjectStore.

Returns:
single, shared instance of ProjectStore

isInitialized

public boolean isInitialized(org.eclipse.core.resources.IProject project)
Checks if project is initialized.

Parameters:
project - project to check
Returns:
true if project is present in the ProjectStore

init

public void init(org.eclipse.core.resources.IProject project)
Initialize the project. If the project has property "id" set, then the procedure tries to find model with the same id in the DB. If there is no such model then it is created (and stored in the DB). If there are more than one model, then new default model is instantiated, but is not stored in the DB. The same happens if any other problem occurs (especially, when the DB system is not configured properly).

Parameters:
project - project to initialize

getModel

public IModel getModel(org.eclipse.core.resources.IProject project)
Returns model for given project.

Parameters:
project - the project for which the model is returned
Returns:
the model associated with the project or null if no model is associated with the project

getProject

public org.eclipse.core.resources.IProject getProject(IModel model)
Returns IProject for given IModel.

Parameters:
model - the model associated with the project
Returns:
the project associated with the model

remove

public void remove(org.eclipse.core.resources.IProject project)
Removes the given project.

Parameters:
project - project to remove


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.