blob: 4a79618d8a5108ebf99bfc56a5d1af6c27bfbfb6 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Andras Schmidt, Andras Balogh, Istvan Rath and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andras Schmidt, Andras Balogh, Istvan Rath - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.core;
import java.util.Collection;
/**
* This interface specifies the required services of a notification manager.
*
* @author Andras Balogh
*/
public interface INotificationManager {
/**
* Notification category for undo managers.
*/
public final static int UNDO_SUPPORT = 0;
/**
* Notification category for transaction managers.
*/
public final static int TRANSACTION_SUPPORT = 1;
/**
* Notification category for other core event listeners.
*/
public final static int CORE_SUPPORT = 2;
/**
* Notification category for interpreter-level notification support.
*/
public final static int INTERPRETER_SUPPORT = 3;
/**
* Notification category for gui managers.
*/
public final static int GUI_SUPPORT = 4;
/**
* Initializes the notification manager.
*
* @param p
* - the collection of runtime properties
* @param l
* - the framework logger
* @param m
* - the owning modelspace
* @throws VPMRuntimeException
*/
// public void init(Logger l, Properties p, IModelSpace m) throws
// VPMRuntimeException;
/**
* Adds a new default listner that has to be associated with all new model
* elements.
*
* @param l
* the new listner object
*/
// public void addDefaultListener(ICoreNotificationListener l);
/**
* Adds a new listner that has to be associated with the whole modelSpace.
*
* @param l
* the new listner object
*/
public void addAllListener(ICoreNotificationListener l);
/**
* Removes a default listener
*
* @param l
* the listener to be removed
*/
// public void removeDefaultListener(ICoreNotificationListener l);
/**
* Removes a listner that was to be associated with the whole modelSpace.
*
* @param l
* the new listner object
*/
public void removeAllListener(ICoreNotificationListener l);
/**
* Returns the current collection of default listeners.
*
* @return collection of listeners
*/
// public Collection getDefaultListeners();
/**
* Returns the current collection of listeners who listen every events in
* modelSpace.
*
* @return collection of listeners
*/
public Collection<ICoreNotificationListener> getListenAllListeners();
/**
* Enables notification dispatching.
*
*/
public void enableNotifications();
/**
* Disablesnotification dispatching.
*
*/
public void disableNotifications();
/**
* Chercks whether notifications are enabled or not.
*
* @return true, if notification dispatching is enabed.
*/
public boolean isNotificationEnabled();
/**
* Sets the notification level. All notifications having a category that is
* less or equal to the level will be dispatched.
*
* @param l
* the new level
*
*/
public void setNotificationLevel(int l);
/**
* Retrives the current notification level.
*
* @return current notification level
*/
public int getNotificationLevel();
/**
* Add a notification listener to a given element.
*
* @param me
* @param l
*/
public void addNotificationListener(IModelElement me,
ICoreNotificationListener l);
/**
* Remove a notification listener from a given element.
*
* @param me
* @param l
*/
public void removeNotificationListener(IModelElement me,
ICoreNotificationListener l);
/**
* Gets the collection of notification listeners registered to a given
* element.
*
* @param me
* @return
*/
public Collection<ICoreNotificationListener> getNotificationListeners(IModelElement me);
}