1 30 31 package com.genimen.djeneric.tools.specifier.menusystem; 32 33 import java.awt.event.ActionEvent ; 34 import java.awt.event.ActionListener ; 35 36 import com.genimen.djeneric.repository.DjObject; 37 import com.genimen.djeneric.tools.specifier.interfaces.DjenericEditorEnvironment; 38 import com.genimen.djeneric.tools.specifier.interfaces.MenuExtension; 39 40 public class MenuExtensionAction implements ActionListener 41 { 42 DjObject[] _sels = null; 43 MenuExtension _ext; 44 DjenericEditorEnvironment _env; 45 String _extentName = null; 46 47 54 public MenuExtensionAction(DjObject[] sels, MenuExtension ext, DjenericEditorEnvironment env) 55 { 56 _sels = sels; 57 _ext = ext; 58 _env = env; 59 } 60 61 69 public MenuExtensionAction(MenuExtension ext, DjenericEditorEnvironment env, String type) 70 { 71 _ext = ext; 72 _env = env; 73 } 74 75 public void actionPerformed(ActionEvent e) 76 { 77 try 78 { 79 if (_sels != null) _ext.execute(_sels); 80 else 81 { 82 _ext.execute(_env.getSelectedObjects(_extentName)); 83 } 84 } 85 catch (Throwable t) 86 { 87 _env.setStatusMessage(t); 88 } 89 } 90 } | Popular Tags |