de.cau.cs.kieler.synccharts.listener
Class SyncchartsContentUtil

java.lang.Object
  extended by de.cau.cs.kieler.synccharts.listener.SyncchartsContentUtil

public final class SyncchartsContentUtil
extends Object

Static helper methods for Synccharts.

Rating proposed yellow
(2010-01-19) proposed by haf

Method Summary
static void addTriggerListeners(TransactionalEditingDomain domain)
          Add all TriggerListener classes that are registered via the corresponding extension point as a listener to the passed TransactionalEditingDomain.
static String getNewUniqueString(EObject target, EAttribute attribute, String prefix, UniqueStringCache cache)
          Deprecated. use the more specific getNewUniqueString(Scope,String,UniqueStringCache)
static String getNewUniqueString(Scope target, String prefix, UniqueStringCache cache)
          Determine a new unique ID for a given Scope (e.g.
static List<ResourceSetListener> getTriggerListeners(TransactionalEditingDomain domain)
           
static int getUniquePrio(Transition transition)
          Get a new unique priority to a given Transition.
static String getValidId(String label)
          Transform a given arbitrary String to a valid identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addTriggerListeners

public static void addTriggerListeners(TransactionalEditingDomain domain)
Add all TriggerListener classes that are registered via the corresponding extension point as a listener to the passed TransactionalEditingDomain.

Parameters:
domain - the given TransactionalEditingDomain

getTriggerListeners

public static List<ResourceSetListener> getTriggerListeners(TransactionalEditingDomain domain)

getValidId

public static String getValidId(String label)
Transform a given arbitrary String to a valid identifier. Replace all whitespace by underscores '_' and add an underscore prefix if the String does not start with a word-character.

Parameters:
label -
Returns:

getNewUniqueString

public static String getNewUniqueString(EObject target,
                                        EAttribute attribute,
                                        String prefix,
                                        UniqueStringCache cache)
Deprecated. use the more specific getNewUniqueString(Scope,String,UniqueStringCache)

Determine a new unique ID for a given EObject (e.g. a Region or a State). Will search siblings (e.g. regions within the same State) and compare their IDs. Will return the next ID with the "PrefixN" where N is the next free integer number available, e.g. R0, R1, R2...

Parameters:
target - given EObject to look for a unique ID
attribute - the feature in which the String is stored, e.g. a "name" feature of a State
prefix - A String Prefix with which the unique String should start.
Returns:
a new unique ID within the State

getNewUniqueString

public static String getNewUniqueString(Scope target,
                                        String prefix,
                                        UniqueStringCache cache)
Determine a new unique ID for a given Scope (e.g. a Region or a State). Will search siblings (e.g. regions within the same State) and compare their IDs. Will return the next ID with the "PrefixN" where N is the next free integer number available, e.g. R, R2, R3... N=1 will be omitted.

Parameters:
target - given Scope to look for a unique ID
prefix - A String Prefix with which the unique String should start.
Returns:
a new unique ID within the parent Scope

getUniquePrio

public static int getUniquePrio(Transition transition)
Get a new unique priority to a given Transition. That is the current priority will be changed if there is a conflict with any sibling Transition. Set it to the max priority of all siblings plus one.

Parameters:
transition - the input Transition whose prio will be changed
Returns:
a new unique priority