01: package org.conform.wings.devel;
02:
03: import org.wings.*;
04: import org.conform.BeanMeta;
05: import org.conform.wings.devel.MetaViewer;
06:
07: import javax.swing.*;
08: import java.awt.event.ActionEvent;
09: import java.awt.event.ActionListener;
10:
11: /**
12: * @author hengels
13: * @version $Revision: 653 $
14: */
15: public class MetaViewerPopup extends SPopupMenu {
16: private SComponent component;
17:
18: public MetaViewerPopup() {
19: }
20:
21: public MetaViewerPopup(SComponent component) {
22: this .component = component;
23: }
24:
25: public SComponent getComponent() {
26: return component;
27: }
28:
29: public void setComponent(SComponent component) {
30: this .component = component;
31: }
32:
33: public void addMeta(BeanMeta beanMeta) {
34: add(new SMenuItem(new ViewerAction(beanMeta)));
35: }
36:
37: class ViewerAction extends AbstractAction {
38: BeanMeta beanMeta;
39:
40: public ViewerAction(BeanMeta beanMeta) {
41: this .beanMeta = beanMeta;
42: putValue(Action.NAME, beanMeta.getName());
43: }
44:
45: public void actionPerformed(ActionEvent e) {
46: SOptionPane.showInputDialog(component, beanMeta.getName(),
47: "Meta", new MetaViewer(beanMeta),
48: new ActionListener() {
49: public void actionPerformed(ActionEvent e) {
50: }
51: });
52: }
53: }
54: }
|