001    // GraphLab Project: http://graphlab.sharif.edu
002    // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology
003    // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/
004    
005    package graphlab.ui.extension;
006    
007    import graphlab.platform.core.AbstractAction;
008    import graphlab.platform.core.BlackBoard;
009    import graphlab.ui.UIUtils;
010    
011    /**
012     * wrap a UIAction in an AbstractAction
013     *
014     * @author azin azadi
015    
016     */
017    public class UIActionExtensionAction extends AbstractAction {
018        private UIActionExtension ac;
019    
020        public UIActionExtensionAction(BlackBoard bb, UIActionExtension action) {
021            super(bb);
022            this.ac = action;
023        }
024    
025        public void setUIEvent(String actionId) {
026            listen4Event(UIUtils.getUIEventKey(actionId));
027        }
028    
029        public void performAction(String eventName, Object value) {
030            ac.actionPerformed(blackboard);
031        }
032    }