]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/dnd/DropSuggestion.java
Ask to link library to model when dropping symbol from unlinked library
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / diagramEditor / dnd / DropSuggestion.java
1 /*******************************************************************************
2  * Copyright (c) 2018 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     Semantum Oy - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.modeling.ui.diagramEditor.dnd;
13
14 import org.simantics.db.WriteGraph;
15 import org.simantics.db.exception.DatabaseException;
16
17 /**
18  * Represents a suggestion of a fix/change that must be made to the target model
19  * before actually performing the element to diagram drop database changes.
20  * 
21  * The {@link #toString()} method should return a clear description of the
22  * suggested fix/change.
23  * 
24  * @author Tuukka Lehtonen
25  * @since 1.37.0
26  */
27 public interface DropSuggestion {
28
29     /**
30      * Perform the suggested database fix/change encapsulated by this instance.
31      * 
32      * @param graph
33      * @throws DatabaseException
34      */
35     void fix(WriteGraph graph) throws DatabaseException;
36
37     /**
38      * @return a clear end-user readable description of the suggested fix/change
39      */
40     @Override
41     String toString();
42
43 }