ide/src/wombat/gui/actions/LoadAndRun.java
public void actionPerformed(ActionEvent event) {
		System.out.println("load and run");
		
		if (MainFrame.Singleton().ToolBarStop.isEnabled()) {
			JOptionPane.showMessageDialog(MainFrame.Singleton(), "Unable to load file, Scheme process busy.", "Error in load", JOptionPane.ERROR_MESSAGE);
			return;
		}
		
		FileDialog fc = new FileDialog(MainFrame.Singleton(), "Load into Scheme", FileDialog.LOAD);
        fc.setVisible(true);

        if (fc.getFile() == null)
        	return;

        File file = new File(fc.getDirectory(), fc.getFile());
        try {
	        if (!file.exists()) {
	        	JOptionPane.showMessageDialog(MainFrame.Singleton(), "Unable to load file '" + file.getCanonicalPath() + "', file does not exist.", "Error in load", JOptionPane.ERROR_MESSAGE);
				return;
	        }
	        
	        MainFrame.Singleton().doCommand("(load \"" + file.getCanonicalPath().replace("\\", "\\\\") + "\")");
        } catch (IOException ex) {
        	JOptionPane.showMessageDialog(MainFrame.Singleton(), "Unable to load file: " + ex.getMessage(), "Error in load", JOptionPane.ERROR_MESSAGE);
			return;
        }
	}
/**
	 * Tell the DocumentManger to open a document.
	 * @param event Event parameters (ignored).
	 * @see DocumentManager, ActionEvent
	 */
Tell the DocumentManger to open a document.
@param event Event parameters (ignored).
Tell the DocumentManger to open a document . @param event Event parameters ( ignored ) .
public void actionPerformed(ActionEvent event) {
		System.out.println("load and run");
		if (MainFrame.Singleton().ToolBarStop.isEnabled()) {
			JOptionPane.showMessageDialog(MainFrame.Singleton(), "Unable to load file, Scheme process busy.", "Error in load", JOptionPane.ERROR_MESSAGE);
			return;
		}
		FileDialog fc = new FileDialog(MainFrame.Singleton(), "Load into Scheme", FileDialog.LOAD);
        fc.setVisible(true);
        if (fc.getFile() == null)
        	return;
        File file = new File(fc.getDirectory(), fc.getFile());
        try {
	        if (!file.exists()) {
	        	JOptionPane.showMessageDialog(MainFrame.Singleton(), "Unable to load file '" + file.getCanonicalPath() + "', file does not exist.", "Error in load", JOptionPane.ERROR_MESSAGE);
				return;
	        }
	        MainFrame.Singleton().doCommand("(load \"" + file.getCanonicalPath().replace("\\", "\\\\") + "\")");
        } catch (IOException ex) {
        	JOptionPane.showMessageDialog(MainFrame.Singleton(), "Unable to load file: " + ex.getMessage(), "Error in load", JOptionPane.ERROR_MESSAGE);
			return;
        }
	}
public void actionPerformed ( ActionEvent event ) { System . out . println ( "load and run" ) ; if ( MainFrame . Singleton ( ) . ToolBarStop . isEnabled ( ) ) { JOptionPane . showMessageDialog ( MainFrame . Singleton ( ) , "Unable to load file, Scheme process busy." , "Error in load" , JOptionPane . ERROR_MESSAGE ) ; return ; } FileDialog fc = new FileDialog ( MainFrame . Singleton ( ) , "Load into Scheme" , FileDialog . LOAD ) ; fc . setVisible ( true ) ; if ( fc . getFile ( ) == null ) return ; File file = new File ( fc . getDirectory ( ) , fc . getFile ( ) ) ; try { if ( ! file . exists ( ) ) { JOptionPane . showMessageDialog ( MainFrame . Singleton ( ) , "Unable to load file '" + file . getCanonicalPath ( ) + "', file does not exist." , "Error in load" , JOptionPane . ERROR_MESSAGE ) ; return ; } MainFrame . Singleton ( ) . doCommand ( "(load \"" + file . getCanonicalPath ( ) . replace ( "\\" , "\\\\" ) + "\")" ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( MainFrame . Singleton ( ) , "Unable to load file: " + ex . getMessage ( ) , "Error in load" , JOptionPane . ERROR_MESSAGE ) ; return ; } }
Tell the DocumentManger to open a document.
Tell the DocumentManger to open a document .