blob: 15aa9037de1d22d3071cdeb7adc7af1b11b46919 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
package tesseract.objects.remote;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuItem;
public abstract class RemoteObjectMenuItem extends JMenuItem {
protected RemoteObjectMenuItem(final String theLabel,
final RemoteObjectMenu theMenu) {
super(theLabel);
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RemoteObject o = createRemoteObject();
theMenu.addObject(o);
}
});
}
protected abstract RemoteObject createRemoteObject();
}
|