| /******************************************************************************* |
| * 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; |
| |
| import org.eclipse.viatra2.errors.VPMRuntimeException; |
| import org.eclipse.viatra2.framework.IFramework; |
| |
| /** |
| * |
| * This interface specifies the container of core functions. Implementations |
| * have to discover and load model manager, merger, notfification, undo and |
| * transaction support classes. |
| * |
| * ModelSpace interface is the common container of the Viatra core functions. |
| * |
| * @author Andras Balogh |
| * |
| * Modification on 2006.08.07 by Istvan Rath: - commented out |
| * getUndoManager(): we should hide the undo manager and use the |
| * transaction manager instead |
| * |
| */ |
| public interface IModelSpace { |
| |
| /** |
| * Initializes the modelspace. |
| * |
| * @param f |
| * - the framework to plug in the model |
| * @throws VPMRuntimeException |
| */ |
| public void init(IFramework f) throws VPMRuntimeException; |
| |
| /** |
| * Returns the model merger associated with this modelspace |
| * |
| * @return the model merger |
| */ |
| public IModelMerger getModelMerger(); |
| |
| /** |
| * Returns the model manager asociated with this modelspace. |
| * |
| * @return the model manager |
| */ |
| public IModelManager getModelManager(); |
| |
| public IFramework getFramework(); |
| |
| /** |
| * Returns the notification manager associated with this modelspace, or null |
| * if notification is not supported. |
| * |
| * @return notification manager |
| */ |
| public INotificationManager getNotificationManager(); |
| |
| /** |
| * Returns the pattern matcher associated with this modelspace. |
| * |
| * @return notification manager |
| */ |
| // public IPatternMatcher getPatternMatcher();
|
| /** |
| * Returns the transaction manager associated with this modelspace, or null |
| * if transactions are not supported. |
| * |
| * @return transaction manager. |
| */ |
| public ITransactionManager getTransactionManager(); |
| |
| /** |
| * Returns the undo manager associated with this modelspace, or null if undo |
| * is not supported. |
| * |
| * @return undo manager. |
| */ |
| // public IUndoManager getUndoManager();
|
| /** |
| * Checks whether transactions are supported |
| * |
| * @return true if transactions are supported, else false. |
| */ |
| public boolean isTransactionAware(); |
| |
| /** |
| * Checks whether notifications are supported |
| * |
| * @return true if notifications are supported, else false. |
| */ |
| public boolean isNotificationAware(); |
| |
| /** |
| * Checks whether undo is supported |
| * |
| * @return true if undo is supported, else false. |
| */ |
| public boolean isUndoAware(); |
| |
| /** |
| * Clones (doubles) the whole modelspace |
| * |
| * @return cloned modelspace |
| */ |
| public IModelSpace cloneModelSpace(); |
| |
| /** |
| * Ancestor elements are handled specially. They need not be saved and |
| * loaded, and their relations are updated automatically. |
| * |
| * @return |
| */ |
| public Collection<IModelElement> getAncestorElements(); |
| |
| } |