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.catalog.ui;
16:
17: import org.eclipse.jface.action.IStatusLineManager;
18: import org.eclipse.jface.action.StatusLineManager;
19:
20: /**
21: * Adapts a {@link StatusLineManager} as a {@link IMessageBoard}
22: * @author Jesse
23: * @since 1.1.0
24: */
25: public class StatusLineMessageBoardAdapter implements IMessageBoard {
26:
27: final IStatusLineManager manager;
28:
29: public StatusLineMessageBoardAdapter(
30: final IStatusLineManager manager) {
31: this .manager = manager;
32: }
33:
34: public void putMessage(String message, Type type) {
35: if (type == Type.ERROR)
36: manager.setErrorMessage(message);
37: else {
38: manager.setErrorMessage(null);
39: manager.setMessage(message);
40: }
41: }
42:
43: }
|