jack.plugin
Class JackPlugin

java.lang.Object
  extended byorg.eclipse.core.runtime.Plugin
      extended byorg.eclipse.ui.plugin.AbstractUIPlugin
          extended byjack.plugin.JackPlugin
All Implemented Interfaces:
org.osgi.framework.BundleActivator

public class JackPlugin
extends org.eclipse.ui.plugin.AbstractUIPlugin

Eclipse plugin for the Java Applet Correctness Kit.

Author:
A. Requet, L. Burdy

Field Summary
static java.lang.String ALWAYS_COMPILE_BEFORE_EDITING
           
static java.lang.String ALWAYS_COMPILE_BEFORE_PROVING
           
static java.lang.String ALWAYS_SAVE_BEFORE_COMPILING
           
static java.lang.String ALWAYS_SAVE_BEFORE_EDITING
           
static java.lang.String ALWAYS_SAVE_BEFORE_PROVING
           
static java.lang.String CASE_EXPLORER_VIEW_ID
          The Id corresponding to
static org.eclipse.core.runtime.QualifiedName DEPENDS
          The property corresponding to the depends file.
static java.lang.String DIALOG_TITLE
          The default title that should be used for error and information dialogs.
static java.lang.String IMAGE_NAME
          Name of the serialized image file.
static org.eclipse.core.runtime.QualifiedName JACK_DIR_PROPERTY
           
static java.lang.String JACK_GENERATE
           
static java.lang.String JACK_METRICS_VIEW_ID
          The Id corresponding to the Jack Metrics view.
static java.lang.String JACK_OBVIOUS_PO
           
static java.lang.String JACK_PERSPECTIVE_ID
           
static java.lang.String JACK_PROOF_TASK_MAX_RUNNING
           
static java.lang.String JACK_PROOF_VIEW_ID
          The Id corresponding to the Jack Prover view.
static java.lang.String JACK_SUBDIRECTORY
          Directory used to store the jpo files.
static java.lang.String JACK_VIEW_ID
          The Id corresponding to the Jack PO Viewer view.
static java.lang.String JACK_VIEW_SHOW
          Boolean preference indicating wether a view should be displayed.
static java.lang.String JACK_VIEWER_FONT
          Font used within the source viewer.
static java.lang.String JACK_WELLDEF_LEMMA
           
static org.eclipse.core.runtime.QualifiedName JML_COMPILED
          The property corresponding to the fact that a file is compiled or not.
static java.lang.String JML_KEYWORD_COLOR
           
static java.lang.String JMLPATH_PREFERENCE
          Preference corresponding to the search path used when loading files.
static java.lang.String LEMMA_VIEWER
          The Id corresponding to
static org.eclipse.core.runtime.QualifiedName LOCK
           
static java.lang.String MULTI_COMMENT_JML_COLOR
           
static java.lang.String OBVIOUS_PROVER
           
static java.lang.String PROVER_EXTENSION_ID
           
static org.eclipse.core.runtime.QualifiedName SERIALIZED_IMAGE_PROPERTY
          Name of the property corresponding to the image file used.
static java.lang.String SINGLE_COMMENT_JML_COLOR
           
static java.lang.String SOURCE_CASE_VIEWER_ID
          The Id corresponding to
static org.eclipse.core.runtime.QualifiedName USE_SERIALIZED_IMAGE_PROPERTY
          Name of the property allowing the use of an image file.
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
JackPlugin(org.eclipse.core.runtime.IPluginDescriptor descriptor)
          The constructor.
 
Method Summary
static JackPlugin getDefault()
          Returns the shared instance.
static java.lang.String getDefaultOutputDir()
          Returns the default output directory.
static boolean getFileGeneration(java.lang.String name)
           
static java.net.URL getIconDir()
          Returns the directory where the icons are stored.
static org.eclipse.swt.graphics.RGB getJmlKeywordColor()
           
static java.lang.String[] getJmlPath(org.eclipse.core.resources.IProject project)
          Returns the Jml search path preference.
static org.eclipse.core.resources.IFile getJpoFile(org.eclipse.jdt.core.ICompilationUnit compilation_unit)
          Returns the jpo file corresponding to the given compilation unit.
static int getMaxProofRunning()
          Returns the integer indicating the maximum number of running proof tasks.
static org.eclipse.swt.graphics.RGB getMultiCommentJmlColor()
           
static boolean getObviousPoGeneration()
          Returns the boolean indicating obvious goal generation.
static org.eclipse.core.resources.IFolder getOutputDir(org.eclipse.core.resources.IProject project)
          Returns the ouput directory for the given project.
 java.lang.String getProperty(org.eclipse.core.resources.IResource resource, org.eclipse.core.runtime.QualifiedName property_name, java.lang.String preference_name)
          Return the property property_name for the given resource.
 java.util.ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle,
static java.lang.String getResourceString(java.lang.String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
static java.lang.String[] getSerializedImageRoots(org.eclipse.core.resources.IProject project)
          Returns the list of fully qualifed class name corresponding to the additional roots used for generating the serialized image.
static org.eclipse.swt.graphics.RGB getSingleCommentJmlColor()
           
static org.eclipse.swt.graphics.FontData getViewerFont()
           
static boolean getWellDefPoGeneration()
           
static org.eclipse.core.resources.IWorkspace getWorkspace()
          Returns the workspace instance.
static boolean isLock(org.eclipse.core.resources.IResource cu)
           
static boolean isObviousProver(java.lang.String name)
           
static void lock(org.eclipse.core.resources.IResource cu)
           
static void setJmlPath(org.eclipse.core.resources.IProject project, java.lang.String[] new_path)
          Sets the jml search path for the given project.
static void setSerializedImageRoots(org.eclipse.core.resources.IProject project, java.lang.String[] classes)
          Sets the list of additional roots used for generating the serialized image.
static void unJmlCompile(org.eclipse.core.resources.IResource r)
           
static void unLock(org.eclipse.core.resources.IResource cu)
           
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, shutdown, start, startup, stop
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIALOG_TITLE

public static final java.lang.String DIALOG_TITLE
The default title that should be used for error and information dialogs.

See Also:
Constant Field Values

JMLPATH_PREFERENCE

public static final java.lang.String JMLPATH_PREFERENCE
Preference corresponding to the search path used when loading files.

See Also:
Constant Field Values

JACK_SUBDIRECTORY

public static final java.lang.String JACK_SUBDIRECTORY
Directory used to store the jpo files.

See Also:
Constant Field Values

JACK_VIEWER_FONT

public static final java.lang.String JACK_VIEWER_FONT
Font used within the source viewer.

See Also:
Constant Field Values

MULTI_COMMENT_JML_COLOR

public static final java.lang.String MULTI_COMMENT_JML_COLOR
See Also:
Constant Field Values

SINGLE_COMMENT_JML_COLOR

public static final java.lang.String SINGLE_COMMENT_JML_COLOR
See Also:
Constant Field Values

JML_KEYWORD_COLOR

public static final java.lang.String JML_KEYWORD_COLOR
See Also:
Constant Field Values

JACK_OBVIOUS_PO

public static final java.lang.String JACK_OBVIOUS_PO
See Also:
Constant Field Values

JACK_WELLDEF_LEMMA

public static final java.lang.String JACK_WELLDEF_LEMMA
See Also:
Constant Field Values

JACK_GENERATE

public static final java.lang.String JACK_GENERATE
See Also:
Constant Field Values

OBVIOUS_PROVER

public static final java.lang.String OBVIOUS_PROVER
See Also:
Constant Field Values

JACK_PROOF_TASK_MAX_RUNNING

public static final java.lang.String JACK_PROOF_TASK_MAX_RUNNING
See Also:
Constant Field Values

JACK_VIEW_SHOW

public static final java.lang.String JACK_VIEW_SHOW
Boolean preference indicating wether a view should be displayed. It is completed with the language name.

See Also:
Constant Field Values

PROVER_EXTENSION_ID

public static final java.lang.String PROVER_EXTENSION_ID
See Also:
Constant Field Values

JACK_DIR_PROPERTY

public static final org.eclipse.core.runtime.QualifiedName JACK_DIR_PROPERTY

SERIALIZED_IMAGE_PROPERTY

public static final org.eclipse.core.runtime.QualifiedName SERIALIZED_IMAGE_PROPERTY
Name of the property corresponding to the image file used.


USE_SERIALIZED_IMAGE_PROPERTY

public static final org.eclipse.core.runtime.QualifiedName USE_SERIALIZED_IMAGE_PROPERTY
Name of the property allowing the use of an image file.


JML_COMPILED

public static final org.eclipse.core.runtime.QualifiedName JML_COMPILED
The property corresponding to the fact that a file is compiled or not.


LOCK

public static final org.eclipse.core.runtime.QualifiedName LOCK

DEPENDS

public static final org.eclipse.core.runtime.QualifiedName DEPENDS
The property corresponding to the depends file.


JACK_VIEW_ID

public static final java.lang.String JACK_VIEW_ID
The Id corresponding to the Jack PO Viewer view.

See Also:
Constant Field Values

JACK_PROOF_VIEW_ID

public static final java.lang.String JACK_PROOF_VIEW_ID
The Id corresponding to the Jack Prover view.

See Also:
Constant Field Values

JACK_PERSPECTIVE_ID

public static final java.lang.String JACK_PERSPECTIVE_ID
See Also:
Constant Field Values

JACK_METRICS_VIEW_ID

public static final java.lang.String JACK_METRICS_VIEW_ID
The Id corresponding to the Jack Metrics view.

See Also:
Constant Field Values

SOURCE_CASE_VIEWER_ID

public static final java.lang.String SOURCE_CASE_VIEWER_ID
The Id corresponding to

See Also:
Constant Field Values

CASE_EXPLORER_VIEW_ID

public static final java.lang.String CASE_EXPLORER_VIEW_ID
The Id corresponding to

See Also:
Constant Field Values

LEMMA_VIEWER

public static final java.lang.String LEMMA_VIEWER
The Id corresponding to

See Also:
Constant Field Values

IMAGE_NAME

public static final java.lang.String IMAGE_NAME
Name of the serialized image file. This file is located in the jack subdirectory.

See Also:
Constant Field Values

ALWAYS_SAVE_BEFORE_EDITING

public static final java.lang.String ALWAYS_SAVE_BEFORE_EDITING
See Also:
Constant Field Values

ALWAYS_SAVE_BEFORE_COMPILING

public static final java.lang.String ALWAYS_SAVE_BEFORE_COMPILING
See Also:
Constant Field Values

ALWAYS_SAVE_BEFORE_PROVING

public static final java.lang.String ALWAYS_SAVE_BEFORE_PROVING
See Also:
Constant Field Values

ALWAYS_COMPILE_BEFORE_EDITING

public static final java.lang.String ALWAYS_COMPILE_BEFORE_EDITING
See Also:
Constant Field Values

ALWAYS_COMPILE_BEFORE_PROVING

public static final java.lang.String ALWAYS_COMPILE_BEFORE_PROVING
See Also:
Constant Field Values
Constructor Detail

JackPlugin

public JackPlugin(org.eclipse.core.runtime.IPluginDescriptor descriptor)
The constructor.

Method Detail

unJmlCompile

public static void unJmlCompile(org.eclipse.core.resources.IResource r)
                         throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

lock

public static void lock(org.eclipse.core.resources.IResource cu)

unLock

public static void unLock(org.eclipse.core.resources.IResource cu)

isLock

public static boolean isLock(org.eclipse.core.resources.IResource cu)

getDefault

public static JackPlugin getDefault()
Returns the shared instance.


getWorkspace

public static org.eclipse.core.resources.IWorkspace getWorkspace()
Returns the workspace instance.


getResourceString

public static java.lang.String getResourceString(java.lang.String key)
Returns the string from the plugin's resource bundle, or 'key' if not found.


getProperty

public java.lang.String getProperty(org.eclipse.core.resources.IResource resource,
                                    org.eclipse.core.runtime.QualifiedName property_name,
                                    java.lang.String preference_name)
Return the property property_name for the given resource. If the property is not defined for this resource, return the value of the preference preference_name.


getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Returns the plugin's resource bundle,


getDefaultOutputDir

public static java.lang.String getDefaultOutputDir()
Returns the default output directory. That is, the directory that is set in the properties dialog.


getJmlPath

public static java.lang.String[] getJmlPath(org.eclipse.core.resources.IProject project)
Returns the Jml search path preference.


setJmlPath

public static void setJmlPath(org.eclipse.core.resources.IProject project,
                              java.lang.String[] new_path)
                       throws org.eclipse.core.runtime.CoreException
Sets the jml search path for the given project.

Throws:
org.eclipse.core.runtime.CoreException

getOutputDir

public static org.eclipse.core.resources.IFolder getOutputDir(org.eclipse.core.resources.IProject project)
Returns the ouput directory for the given project. Note that this directory is not created if it does not exists yet.


getObviousPoGeneration

public static boolean getObviousPoGeneration()
Returns the boolean indicating obvious goal generation.


getWellDefPoGeneration

public static boolean getWellDefPoGeneration()

getFileGeneration

public static boolean getFileGeneration(java.lang.String name)

isObviousProver

public static boolean isObviousProver(java.lang.String name)

getMaxProofRunning

public static int getMaxProofRunning()
Returns the integer indicating the maximum number of running proof tasks.


getMultiCommentJmlColor

public static org.eclipse.swt.graphics.RGB getMultiCommentJmlColor()

getSingleCommentJmlColor

public static org.eclipse.swt.graphics.RGB getSingleCommentJmlColor()

getJmlKeywordColor

public static org.eclipse.swt.graphics.RGB getJmlKeywordColor()

getSerializedImageRoots

public static java.lang.String[] getSerializedImageRoots(org.eclipse.core.resources.IProject project)
                                                  throws org.eclipse.core.runtime.CoreException
Returns the list of fully qualifed class name corresponding to the additional roots used for generating the serialized image. Return an array with zero size if the roots are empty.

Throws:
org.eclipse.core.runtime.CoreException

setSerializedImageRoots

public static void setSerializedImageRoots(org.eclipse.core.resources.IProject project,
                                           java.lang.String[] classes)
                                    throws org.eclipse.core.runtime.CoreException
Sets the list of additional roots used for generating the serialized image.

Throws:
org.eclipse.core.runtime.CoreException

getIconDir

public static java.net.URL getIconDir()
Returns the directory where the icons are stored.


getJpoFile

public static org.eclipse.core.resources.IFile getJpoFile(org.eclipse.jdt.core.ICompilationUnit compilation_unit)
Returns the jpo file corresponding to the given compilation unit. Returns null if no jpo file could be found.

Note that this method needs to be updated if JmlFile.getFlatName is modified.


getViewerFont

public static org.eclipse.swt.graphics.FontData getViewerFont()