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.samples.ui.texteditor.myplugin.actions;
006    
007    import graphlab.platform.core.BlackBoard;
008    import graphlab.ui.extension.UIActionExtension;
009    
010    import javax.swing.*;
011    
012    public class NewAction implements UIActionExtension {
013        public void actionPerformed(BlackBoard blackBoard) {
014            //fetch the text area (body of application) from blackboard
015            JTextArea editor = Utils.getMainEditor(blackBoard);
016    
017            //read the file and put it in editor
018            editor.setText("");
019    
020            //put the file address in blackboard to use later in save
021            blackBoard.setData("last file", "");
022    
023        }
024    }