01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.tools.edit;
16:
17: import net.refractions.udig.project.ui.render.displayAdapter.MapMouseEvent;
18:
19: /**
20: * A behaviour that is responsible for determining whether a tool is valid for a given event
21: *
22: * @author Jesse
23: * @since 1.1.0
24: */
25: public interface EnablementBehaviour {
26: /**
27: * If method returns a String then no other behaviours will be executed and the string will be used as the status bar's Error message.
28: * If null is returned then the te rest of the behaviours can be ran and the error tate will be cleared.
29: *
30: * @param handler {@link EditToolHandler} for the current tool
31: * @param e the event that just occurred
32: * @param eventType the type of event
33: * @return If String then no other behaviours will be executed and the string will be used as the status bar's Error message.
34: * If null is returned then the the rest of the behaviours can be ran and the error tate will be cleared.
35: */
36: String isEnabled(EditToolHandler handler, MapMouseEvent e,
37: EventType eventType);
38: }
|