public void installTool(String path) { String text = open(path); if (text!=null) installSingleTool(text); }
public void installTool(String path) { String text = open(path); if (text!=null) installSingleTool(text); }
private boolean installToolsetTool(String name) { String path = IJ.getDir("macros")+"toolsets"+File.separator+name+".ijm"; if (!((new File(path)).exists())) { name = name.replaceAll(" ", "_"); path = IJ.getDir("macros")+"toolsets"+File.separator+name+".ijm"; } String text = IJ.openAsString(path); if (text==null || text.startsWith("Error")) return false; new MacroInstaller().installSingleTool(text); return true; }
private boolean installToolsetTool(String name) { String path = IJ.getDir("macros")+"toolsets"+File.separator+name+".ijm"; if (!((new File(path)).exists())) { name = name.replaceAll(" ", "_"); path = IJ.getDir("macros")+"toolsets"+File.separator+name+".ijm"; } String text = IJ.openAsString(path); if (text==null || text.startsWith("Error")) return false; new MacroInstaller().installSingleTool(text); return true; }
/** Installs a macro set contained in ij.jar. */ public void installFromIJJar(String path) { String text = openFromIJJar(path); if (text==null) return; if (path.endsWith("StartupMacros.txt")) { if (Toolbar.installStartupMacrosTools()) install(text); Toolbar tb = Toolbar.getInstance(); if (tb!=null) tb.installStartupTools(); } else if (path.contains("Tools")) install(text); else installSingleTool(text); }
/** Installs a macro set contained in ij.jar. */ public void installFromIJJar(String path) { String text = openFromIJJar(path); if (text==null) return; if (path.endsWith("StartupMacros.txt")) { if (Toolbar.installStartupMacrosTools()) install(text); Toolbar tb = Toolbar.getInstance(); if (tb!=null) tb.installStartupTools(); } else if (path.contains("Tools")) install(text); else installSingleTool(text); }
void showText() { String title = getFirstString(); String text = null; if (interp.nextToken()==',') text = getLastString(); else interp.getRightParen(); if (text==null) { text = title; title = "Untitled"; } Frame frame = WindowManager.getFrame(title); Editor ed = null; boolean useExisting = frame instanceof Editor; if (useExisting) { ed = (Editor)frame; TextArea ta = ed.getTextArea(); ta.selectAll(); ta.replaceRange(text, ta.getSelectionStart(), ta.getSelectionEnd()); } else { ed = new Editor(); ed.setSize(350, 300); ed.create(title, text); } if (title.equals("Untitled") && text.contains("Test Action Tool")) new MacroInstaller().installSingleTool(text); }
void showText() { String title = getFirstString(); String text = null; if (interp.nextToken()==',') text = getLastString(); else interp.getRightParen(); if (text==null) { text = title; title = "Untitled"; } Frame frame = WindowManager.getFrame(title); Editor ed = null; boolean useExisting = frame instanceof Editor; if (useExisting) { ed = (Editor)frame; TextArea ta = ed.getTextArea(); ta.selectAll(); ta.replaceRange(text, ta.getSelectionStart(), ta.getSelectionEnd()); } else { ed = new Editor(); ed.setSize(350, 300); ed.create(title, text); } if (title.equals("Untitled") && text.contains("Test Action Tool")) new MacroInstaller().installSingleTool(text); }