com.alveole.interfaces
Class ProjectContext

java.lang.Object
  extended by com.alveole.interfaces.ProjectContext

public class ProjectContext
extends java.lang.Object

This class is the current project's context. Project context contains reference to project. Context is used to perform some basic GUI operations, such as opening a panel on properties View, or getting focus on graph. It also keeps references to JavaProject, and to current Editor. All methods must be called in SWT dispkay thread.

Author:
sylvain

Field Summary
protected  org.eclipse.core.resources.IProject javaProject
          Reference to the containing project.
protected  Project project
          The currently edited Project.
protected  ProjectEditor projectEditor
          Reference to the current graph editor.
protected  org.eclipse.core.resources.IResource projectResource
          The reference to the current edited XML file.
protected  org.eclipse.swt.widgets.Shell shell
          The editor shell.
 
Constructor Summary
ProjectContext(org.eclipse.core.resources.IResource projectResource)
          Constructor.
 
Method Summary
 org.eclipse.core.resources.IProject getJavaProject()
          Get the containing IProject.
 NodePropertiesView getNodePropertiesView()
          Gets the Nodes View.
 Project getProject()
          Gets the current edited project's file.
 ProjectEditor getProjectEditor()
          Get a reference to the editor.
 org.eclipse.swt.widgets.Shell getShell()
          Get the editor shell.
 void setFocus()
          Calls focus on editor.
 void setProject(Project project)
          Sets the current edited project's file.
 void setProjectEditor(ProjectEditor projectEditor)
          Set the referenc to the editor.
 void setShell(org.eclipse.swt.widgets.Shell shell)
          Sets the editor shell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

project

protected Project project
The currently edited Project.


shell

protected org.eclipse.swt.widgets.Shell shell
The editor shell. May be null.


projectResource

protected org.eclipse.core.resources.IResource projectResource
The reference to the current edited XML file.


javaProject

protected org.eclipse.core.resources.IProject javaProject
Reference to the containing project.


projectEditor

protected ProjectEditor projectEditor
Reference to the current graph editor. May be null.

Constructor Detail

ProjectContext

public ProjectContext(org.eclipse.core.resources.IResource projectResource)
Constructor.

Parameters:
projectResource - The currently edited XML file.
Method Detail

getProject

public Project getProject()
Gets the current edited project's file.


setProject

public void setProject(Project project)
Sets the current edited project's file.


getShell

public org.eclipse.swt.widgets.Shell getShell()
Get the editor shell.

Returns:
The shell.

setShell

public void setShell(org.eclipse.swt.widgets.Shell shell)
Sets the editor shell.

Parameters:
shell - The shell.

getNodePropertiesView

public NodePropertiesView getNodePropertiesView()
Gets the Nodes View. This view enables to display currently selected node's specific properties. It is an addon panel. If this view is not visible when this method is called, the it becomes visible.

Returns:
The properties view.

setFocus

public void setFocus()
Calls focus on editor.


getJavaProject

public org.eclipse.core.resources.IProject getJavaProject()
Get the containing IProject.

Returns:
The project.

getProjectEditor

public ProjectEditor getProjectEditor()
Get a reference to the editor.

Returns:
The editor.

setProjectEditor

public void setProjectEditor(ProjectEditor projectEditor)
Set the referenc to the editor.

Parameters:
projectEditor - The editor.