<!DOCTYPE ACTIONS SYSTEM "actions.dtd">
<ACTIONS>
+ <ACTION NAME="factor-listener">
+ <CODE>
+ wm.addDockableWindow("console");
+ wm.getDockableWindow("console").setShell("Factor");
+ </CODE>
+ </ACTION>
<ACTION NAME="factor-restart">
<CODE>
FactorPlugin.stopExternalInstance();
if(sel == null)
view.toolkit.beep();
else
- FactorPlugin.eval(view,sel);
+ FactorPlugin.evalInListener(view,sel);
</CODE>
</ACTION>
<ACTION NAME="factor-run-file">
view.toolkit.beep();
else
{
- FactorPlugin.eval(view,
+ FactorPlugin.evalInListener(view,
"\""
+ FactorReader.charsToEscapes(word)
+ "\" apropos.");
</ACTION>
<ACTION NAME="factor-see">
<CODE>
- FactorPlugin.factorWordOperation(view,"see");
+ FactorPlugin.factorWordOutputOp(view,"see");
</CODE>
</ACTION>
<ACTION NAME="factor-edit">
<CODE>
- FactorPlugin.factorWordOperation(view,"jedit");
+ FactorPlugin.factorWordWireOp(view,"jedit");
</CODE>
</ACTION>
<ACTION NAME="factor-edit-dialog">
</ACTION>
<ACTION NAME="factor-usages">
<CODE>
- FactorPlugin.factorWordOperation(view,"usages.");
+ FactorPlugin.factorWordOutputOp(view,"usages.");
</CODE>
</ACTION>
<ACTION NAME="factor-insert-use">
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
+import java.io.IOException;
import java.util.List;
import org.gjt.sp.jedit.gui.EnhancedDialog;
import org.gjt.sp.jedit.*;
+import org.gjt.sp.util.Log;
public class EditWordDialog extends WordListDialog
{
return;
}
- String code = FactorPlugin.factorWord(word);
- FactorPlugin.eval(view,code + " jedit");
+ try
+ {
+ FactorPlugin.evalInWire(FactorPlugin.factorWord(word) + " jedit");
+ }
+ catch(IOException e)
+ {
+ /* Don't care */
+ Log.log(Log.ERROR,this,e);
+ }
dispose();
} //}}}
"sidekick.SideKickParser","factor");
} //}}}
- //{{{ eval() method
- public static void eval(View view, String cmd)
+ //{{{ evalInListener() method
+ public static void evalInListener(View view, String cmd)
{
DockableWindowManager wm = view.getDockableWindowManager();
wm.addDockableWindow("console");
console.run(Shell.getShell("Factor"),console,cmd);
} //}}}
+ //{{{ evalInWire() method
+ public static void evalInWire(String cmd) throws IOException
+ {
+ getExternalInstance().eval(cmd);
+ } //}}}
+
//{{{ factorWord() method
/**
* Build a Factor expression for pushing the selected word on the stack
return null;
} //}}}
- //{{{ factorWordOperation() method
+ //{{{ factorWordOutputOp() method
+ /**
+ * Apply a Factor word to the selected word.
+ */
+ public static void factorWordOutputOp(View view, String op)
+ {
+ String word = factorWord(view);
+ if(word == null)
+ view.getToolkit().beep();
+ else
+ evalInListener(view,word + " " + op);
+ } //}}}
+
+ //{{{ factorWordWireOp() method
/**
* Apply a Factor word to the selected word.
*/
- public static void factorWordOperation(View view, String op)
+ public static void factorWordWireOp(View view, String op) throws IOException
{
String word = factorWord(view);
if(word == null)
view.getToolkit().beep();
else
- eval(view,word + " " + op);
+ evalInWire(word + " " + op);
} //}}}
//{{{ getCompletions() method
{
View view = textArea.getView();
- SideKickParsedData data = SideKickParsedData
- .getParsedData(view);
+ SideKickParsedData data = SideKickParsedData.getParsedData(view);
if(data instanceof FactorParsedData)
{
int line = textArea.getCaretLine();