de.cau.cs.kieler.core.model.validation
Class ValidationManager

java.lang.Object
  extended by de.cau.cs.kieler.core.model.validation.ValidationManager

public final class ValidationManager
extends Object

Handler for managing check files and validate actions.

Rating proposed yellow
(2010-06-11) soh

Field Summary
static String PREFERENCE_PREFIX
          Prefix for the preference store.
 
Method Summary
static void addListener(IPropertyChangeListener listener)
          Registers a new listener on the manager.
static void deregisterChecks()
          Deregisters all checkfiles on all editors editor.
static void disableAll()
          Hide all checks.
static void disableCheck(String id)
          Disable a check file.
static void enableAll()
          Show all checks.
static void enableCheck(String id)
          Enable the given check.
static String getDisplay(String id)
          Get the displayed name for a given checkfile.
static EPackage getEPackage(String id)
          Get the Epackage of the file.
static Set<String> getRegisteredFiles()
          Get all registered check files.
static Set<String> getRegisteredFiles(EPackage ePackage)
          Get all files registered for a specific ePackage.
static String getTooltip(String id)
          Get the tooltip for the file.
static boolean hasValidateActionsForActiveEditor()
          Determine whether there is a validate action present for the given editor.
static Boolean isEnabled(String id)
          Determine whether or not a file is enabled.
static boolean isVisible(String id)
          Determine whether a file should be visible.
static void refreshChecks()
          Refreshes all checks by deregistering all of them and registering them again.
static void registerCheckFile(String id, EPackage ePackage, String file, boolean isWrapExistingValidator, List<String> referencedEPackageNsURIs, String name, String tooltip, boolean isEnabledByDefault)
          Register a new check file.
static void removeCheck(String id)
          Remove a checkfile from the list.
static void removeListener(IPropertyChangeListener listener)
          Removes a listener from the manager.
static void restoreChecks()
          Restore all checks.
static void restoreChecks(EPackage ePackage)
          Restore the checks for a certain epackage.
static void setEnabled(String id, boolean enabled)
          Set the enablement of a file.
static void validateActiveEditor()
          Run the validate action of the currently active editor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFERENCE_PREFIX

public static final String PREFERENCE_PREFIX
Prefix for the preference store.

See Also:
Constant Field Values
Method Detail

getRegisteredFiles

public static Set<String> getRegisteredFiles()
Get all registered check files.

Returns:
the set of registered files

getRegisteredFiles

public static Set<String> getRegisteredFiles(EPackage ePackage)
Get all files registered for a specific ePackage.

Parameters:
ePackage - the package
Returns:
the files

getEPackage

public static EPackage getEPackage(String id)
Get the Epackage of the file.

Parameters:
id - the file
Returns:
the package

isEnabled

public static Boolean isEnabled(String id)
Determine whether or not a file is enabled.

Parameters:
id - the file
Returns:
true if enabled, false if not, null if unknown.

enableAll

public static void enableAll()
Show all checks.


disableAll

public static void disableAll()
Hide all checks.


registerCheckFile

public static void registerCheckFile(String id,
                                     EPackage ePackage,
                                     String file,
                                     boolean isWrapExistingValidator,
                                     List<String> referencedEPackageNsURIs,
                                     String name,
                                     String tooltip,
                                     boolean isEnabledByDefault)
Register a new check file.

Parameters:
id - the id of the check file
ePackage - the package
file - the file
isWrapExistingValidator - True if the checkfile wraps around another checkfile and thus has to be added after it.
referencedEPackageNsURIs - ???
name - the name to display
tooltip - the tooltip to display
isEnabledByDefault - true if the checkfile should be enabled by default

getTooltip

public static String getTooltip(String id)
Get the tooltip for the file.

Parameters:
id - the file
Returns:
the tooltip

getDisplay

public static String getDisplay(String id)
Get the displayed name for a given checkfile.

Parameters:
id - the id of the checkfile
Returns:
the displayed name

validateActiveEditor

public static void validateActiveEditor()
Run the validate action of the currently active editor.


deregisterChecks

public static void deregisterChecks()
Deregisters all checkfiles on all editors editor.


removeCheck

public static void removeCheck(String id)
Remove a checkfile from the list.

Parameters:
id - the id

restoreChecks

public static void restoreChecks(EPackage ePackage)
Restore the checks for a certain epackage.

Parameters:
ePackage - the package.

restoreChecks

public static void restoreChecks()
Restore all checks.


refreshChecks

public static void refreshChecks()
Refreshes all checks by deregistering all of them and registering them again.


enableCheck

public static void enableCheck(String id)
Enable the given check.

Parameters:
id - the file

disableCheck

public static void disableCheck(String id)
Disable a check file.

Parameters:
id - the file

setEnabled

public static void setEnabled(String id,
                              boolean enabled)
Set the enablement of a file.

Parameters:
id - the file
enabled - true if visible

addListener

public static void addListener(IPropertyChangeListener listener)
Registers a new listener on the manager.

Parameters:
listener - the listener

removeListener

public static void removeListener(IPropertyChangeListener listener)
Removes a listener from the manager.

Parameters:
listener - the listener

hasValidateActionsForActiveEditor

public static boolean hasValidateActionsForActiveEditor()
Determine whether there is a validate action present for the given editor.

Returns:
true if there is a validate action

isVisible

public static boolean isVisible(String id)
Determine whether a file should be visible.

Parameters:
id - the id of the file
Returns:
true if it should be visible