MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / showText

Method showText

ij/src/main/java/ij/macro/Functions.java:4976–5002  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4974 }
4975
4976 void showText() {
4977 String title = getFirstString();
4978 String text = null;
4979 if (interp.nextToken()==',')
4980 text = getLastString();
4981 else
4982 interp.getRightParen();
4983 if (text==null) {
4984 text = title;
4985 title = "Untitled";
4986 }
4987 Frame frame = WindowManager.getFrame(title);
4988 Editor ed = null;
4989 boolean useExisting = frame instanceof Editor;
4990 if (useExisting) {
4991 ed = (Editor)frame;
4992 TextArea ta = ed.getTextArea();
4993 ta.selectAll();
4994 ta.replaceRange(text, ta.getSelectionStart(), ta.getSelectionEnd());
4995 } else {
4996 ed = new Editor();
4997 ed.setSize(350, 300);
4998 ed.create(title, text);
4999 }
5000 if (title.equals("Untitled") && text.contains("Test Action Tool"))
5001 new MacroInstaller().installSingleTool(text);
5002 }
5003
5004 Variable[] newMenu() {
5005 String name = getFirstString();

Callers 2

doFunctionMethod · 0.95
showStringMethod · 0.95

Calls 14

getFirstStringMethod · 0.95
getLastStringMethod · 0.95
getFrameMethod · 0.95
getTextAreaMethod · 0.95
createMethod · 0.95
getRightParenMethod · 0.80
installSingleToolMethod · 0.80
nextTokenMethod · 0.45
selectAllMethod · 0.45
getSelectionStartMethod · 0.45
getSelectionEndMethod · 0.45
setSizeMethod · 0.45

Tested by

no test coverage detected