View Javadoc

1   package org.opensync.engine.admin.gui;
2   
3   import javax.swing.*;
4   import java.awt.event.*;
5   import org.opensync.engine.server.Agenda;
6   import org.opensync.engine.util.I18n;
7   
8   /***
9    *
10   * @version	1.0
11   * @author	SOFTMED
12   *
13   */
14  
15  public class AgendaTreeNode extends OpenSyncTreeNode {
16    /****/
17    protected static ImageIcon icon;
18    /***
19     * @param	agenda
20     */
21    public AgendaTreeNode(Agenda agenda) {
22      super(agenda);
23      icon = new ImageIcon(AgendaTreeNode.class.getResource("/images/agenda.gif"));
24  
25      popup = new JPopupMenu();
26      JMenuItem menuItem = new JMenuItem(I18n.getInstance().get("gui.popup-menu.properties"));
27      menuItem.addActionListener(new ActionListener(){
28          public void actionPerformed(ActionEvent e){
29            try {
30              AgendaIFrm frm = new AgendaIFrm(getAgenda());
31              AppPnl.getInstance().addIFrame(frm);
32            }
33            catch (Exception ex) {
34              ex.printStackTrace();
35            }
36          }
37        }
38      );
39      popup.add(menuItem);
40    }
41    /****/
42    public String toString() {
43      return getAgenda().getName();
44    }
45    /****/
46    public Agenda getAgenda(){
47      return (Agenda)userObject;
48    }
49    /****/
50    public ImageIcon getIcon(){
51      return icon;
52    }
53  }