01: /*
02: * uDig - User Friendly Desktop Internet GIS client
03: * http://udig.refractions.net
04: * (C) 2004, Refractions Research Inc.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package net.refractions.udig.project.ui.internal.tool.display;
18:
19: import org.eclipse.jface.action.ContributionItem;
20:
21: /**
22: *
23: *
24: * @version UDIG 1.1
25: *
26: */
27: public abstract class CurrentContributionItem extends ContributionItem {
28:
29: /**
30: * Enablement of the contribution item.
31: */
32: protected boolean enabled = true;
33:
34: /**
35: * @see org.eclipse.jface.action.ContributionItem#dispose()
36: */
37: public void dispose() {
38: super .dispose();
39: }
40:
41: /**
42: * indicates whether the widget should appear pressed.
43: *
44: * @param checked indicates whether the widget should appear pressed.
45: */
46: public abstract void setSelection(boolean checked, ModalItem proxy);
47:
48: protected abstract boolean isChecked();
49:
50: /**
51: * Indicates if the item is disposed.
52: */
53: public abstract boolean isDisposed();
54:
55: /**
56: * (non-Javadoc)
57: * @see org.eclipse.jface.action.ContributionItem#isEnabled()
58: */
59: @Override
60: public boolean isEnabled() {
61: return enabled;
62: }
63:
64: /**
65: * @param enabled
66: */
67: public void setEnabled(boolean enabled) {
68: this.enabled = enabled;
69: }
70: }
|