Last change
on this file since 22277 was 22277, checked in by sjm84, 14 years ago |
Added several improvements to the code such as the ability to remove places if they from the text and map if they should not be places
|
File size:
690 bytes
|
Line | |
---|
1 | package org.greenstone.client;
|
---|
2 |
|
---|
3 | import com.google.gwt.event.dom.client.ClickHandler;
|
---|
4 | import com.google.gwt.user.client.DOM;
|
---|
5 | import com.google.gwt.user.client.Element;
|
---|
6 | import com.google.gwt.user.client.ui.Label;
|
---|
7 |
|
---|
8 | public class MenuItem
|
---|
9 | {
|
---|
10 | protected Element _menuElement = DOM.createDiv();
|
---|
11 | protected ClickHandler _onClick = null;
|
---|
12 |
|
---|
13 | public MenuItem(String text, ClickHandler onClick)
|
---|
14 | {
|
---|
15 | _menuElement.getStyle().setProperty("cursor", "pointer");
|
---|
16 | _menuElement.setInnerText(text);
|
---|
17 |
|
---|
18 | _onClick = onClick;
|
---|
19 | }
|
---|
20 |
|
---|
21 | public boolean condition()
|
---|
22 | {
|
---|
23 | return true;
|
---|
24 | }
|
---|
25 |
|
---|
26 | public ClickHandler getClickHandler()
|
---|
27 | {
|
---|
28 | return _onClick;
|
---|
29 | }
|
---|
30 |
|
---|
31 | public Element getMenuElement()
|
---|
32 | {
|
---|
33 | return _menuElement;
|
---|
34 | }
|
---|
35 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.