improved undo/redo , able to load xpad command into scilab -nw
[scilab.git] / scilab / modules / xpad / src / java / org / scilab / modules / xpad / actions / LoadIntoScilabAction.java
index 85fa408..446cd53 100644 (file)
 
 package org.scilab.modules.xpad.actions;
 
+import java.util.ArrayList;
+
+import org.scilab.modules.action_binding.InterpreterManagement;
 import org.scilab.modules.gui.console.ScilabConsole;
 import org.scilab.modules.gui.menuitem.MenuItem;
 import org.scilab.modules.xpad.Xpad;
+import org.scilab.modules.xpad.style.ScilabStyleDocument;
 
 public class LoadIntoScilabAction extends DefaultAction {
 
@@ -24,8 +28,15 @@ public class LoadIntoScilabAction extends DefaultAction {
 
        public void doAction() {
            /* Will do the job as if it was copy / paste in scilab Console */
-           //InterpreterManagement.requestScilabExec(getEditor().getTextPane().getText());
-           ScilabConsole.getConsole().getAsSimpleConsole().sendCommandsToScilab(getEditor().getTextPane().getText(), true, false);
+           
+           try {
+               ScilabConsole.getConsole().getAsSimpleConsole().sendCommandsToScilab(getEditor().getTextPane().getText(), true, false);
+           }catch (NoClassDefFoundError noClass){
+               InterpreterManagement.requestScilabExec(  getEditor().getTextPane().getText().replaceAll("\n", ","));
+               
+           }
+               
+               
        }
        
        public static MenuItem createMenu(Xpad editor) {