]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.g2d/src/org/simantics/g2d/diagram/handler/Validator.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.g2d / src / org / simantics / g2d / diagram / handler / Validator.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 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  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.g2d.diagram.handler;
13
14 import java.util.Collection;
15
16 import org.simantics.g2d.canvas.ICanvasContext;
17 import org.simantics.g2d.diagram.IDiagram;
18 import org.simantics.g2d.diagram.handler.impl.DiagramIssue;
19
20 /**
21  * Validates diagram 
22  * 
23  * @See {@link DiagramIssue}
24  * @author Toni Kalajainen
25  */
26 public interface Validator extends DiagramHandler {
27
28         public interface Suggestion {
29                 String  getMessage();
30                 boolean fix(IDiagram d, ICanvasContext ctx);
31         }
32         
33         public interface Issue {
34                 String  getMessage(IDiagram d, ICanvasContext ctx);
35                 void    addSuggestions(IDiagram d, ICanvasContext ctx, Collection<Suggestion> suggestionList);
36         }
37                 
38         void validate(IDiagram d, ICanvasContext ctx, Collection<Issue> lst);   
39         
40 }