X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db%2Fsrc%2Forg%2Fsimantics%2Fdb%2FUndoContext.java;h=25630c8ffb4bd799625dc6e5a21c9c5cad80dc15;hb=b2bb3ff110b5bf929b6d676f0122a15a43358440;hp=5fb0c8654f206b8a234e194d37ea1a730569202c;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db/src/org/simantics/db/UndoContext.java b/bundles/org.simantics.db/src/org/simantics/db/UndoContext.java index 5fb0c8654..25630c8ff 100644 --- a/bundles/org.simantics.db/src/org/simantics/db/UndoContext.java +++ b/bundles/org.simantics.db/src/org/simantics/db/UndoContext.java @@ -1,68 +1,68 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * 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: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.db; - -import java.util.Collection; -import java.util.List; - -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.exception.NoHistoryException; -import org.simantics.db.service.UndoRedoSupport; - -public interface UndoContext { - /** - * Called when operation has been committed successfully. - * - * @param operation - */ - void commitOk(Operation operation) throws DatabaseException; - /** - * - * @return the last successfully committed operation. - */ - Operation getLast() throws DatabaseException; - - /** - * - * @return the operation list. - */ - Collection getAll() throws DatabaseException; - - /** - * - * @return the redo operation list. - */ - Collection getRedoList() throws DatabaseException ; - - /** - * Revert the effects of last successfully committed operation in this context. - * - * @param support - * @return Number of change sets reverted. Zero if operation is not supported. - * @throws NoHistoryException if there is no undo history left in this context - * @throws DatabaseException - */ - List undo(UndoRedoSupport support, int count) throws NoHistoryException, DatabaseException; - /** - * Revert the effects of last successfully committed undo operation in this context. - * - * @param support - * @throws NoHistoryException if there is no redo history left in this context - * @throws DatabaseException - */ - List redo(UndoRedoSupport support, int count) throws NoHistoryException, DatabaseException; - - /** - * Remove all undo information. - */ - void clear(); -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.db; + +import java.util.Collection; +import java.util.List; + +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.exception.NoHistoryException; +import org.simantics.db.service.UndoRedoSupport; + +public interface UndoContext { + /** + * Called when operation has been committed successfully. + * + * @param operation + */ + void commitOk(Operation operation) throws DatabaseException; + /** + * + * @return the last successfully committed operation. + */ + Operation getLast() throws DatabaseException; + + /** + * + * @return the operation list. + */ + Collection getAll() throws DatabaseException; + + /** + * + * @return the redo operation list. + */ + Collection getRedoList() throws DatabaseException ; + + /** + * Revert the effects of last successfully committed operation in this context. + * + * @param support + * @return Number of change sets reverted. Zero if operation is not supported. + * @throws NoHistoryException if there is no undo history left in this context + * @throws DatabaseException + */ + List undo(UndoRedoSupport support, int count) throws NoHistoryException, DatabaseException; + /** + * Revert the effects of last successfully committed undo operation in this context. + * + * @param support + * @throws NoHistoryException if there is no redo history left in this context + * @throws DatabaseException + */ + List redo(UndoRedoSupport support, int count) throws NoHistoryException, DatabaseException; + + /** + * Remove all undo information. + */ + void clear(); +}