final SourceInfo sourceInfo = new SourceInfo(source, functions, url); for (int i = 0; i != sourceInfo.functionSourcesTop(); ++i) { FunctionSource fsource = sourceInfo.functionSource(i); String name = fsource.name(); if (name.length() != 0) { FunctionSource fsource = sourceInfo.functionSource(i); functionToSource.put(functions[i], fsource);
/** * Sets or clears the breakpoint flag for the given line. */ public boolean breakpoint(int line, boolean value) { if (!breakableLine(line)) { throw new IllegalArgumentException(String.valueOf(line)); } boolean changed; synchronized (breakpoints) { if (breakpoints[line] != value) { breakpoints[line] = value; changed = true; } else { changed = false; } } return changed; }
/** * Clears all breakpoints. */ public void clearAllBreakpoints() { for (SourceInfo si: urlToSourceInfo.values()) { si.removeAllBreakpoints(); } }
String fileName = sourceInfo.url(); if (!debugGui.updateFileWindow(sourceInfo) && !fileName.equals("<stdin>")) {
String fileName = sourceInfo.url(); if (!debugGui.updateFileWindow(sourceInfo) && !fileName.equals("<stdin>")) {
String fileName = sourceInfo.url(); if (!debugGui.updateFileWindow(sourceInfo) && !fileName.equals("<stdin>")) {
boolean activate = true; String url = sourceInfo.url(); FileWindow w = new FileWindow(this, sourceInfo); fileWindows.put(url, w);
boolean activate = true; String url = sourceInfo.url(); FileWindow w = new FileWindow(this, sourceInfo); fileWindows.put(url, w);
boolean activate = true; String url = sourceInfo.url(); FileWindow w = new FileWindow(this, sourceInfo); fileWindows.put(url, w);
final SourceInfo sourceInfo = new SourceInfo(source, functions, url); for (int i = 0; i != sourceInfo.functionSourcesTop(); ++i) { FunctionSource fsource = sourceInfo.functionSource(i); String name = fsource.name(); if (name.length() != 0) { FunctionSource fsource = sourceInfo.functionSource(i); functionToSource.put(functions[i], fsource);
final SourceInfo sourceInfo = new SourceInfo(source, functions, url); for (int i = 0; i != sourceInfo.functionSourcesTop(); ++i) { FunctionSource fsource = sourceInfo.functionSource(i); String name = fsource.name(); if (name.length() != 0) { FunctionSource fsource = sourceInfo.functionSource(i); functionToSource.put(functions[i], fsource);
/** * Performs an action. */ public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if (cmd.equals("Cancel")) { setVisible(false); value = null; } else if (cmd.equals("Select")) { if (list.getSelectedIndex() < 0) { return; } try { value = (String)list.getSelectedValue(); } catch (ArrayIndexOutOfBoundsException exc) { return; } setVisible(false); Dim.FunctionSource item = debugGui.dim.functionSourceByName(value); if (item != null) { Dim.SourceInfo si = item.sourceInfo(); String url = si.url(); int lineNumber = item.firstLine(); debugGui.showFileWindow(url, lineNumber); } } }
/** * Performs an action. */ public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if (cmd.equals("Cancel")) { setVisible(false); value = null; } else if (cmd.equals("Select")) { if (list.getSelectedIndex() < 0) { return; } try { value = (String)list.getSelectedValue(); } catch (ArrayIndexOutOfBoundsException exc) { return; } setVisible(false); Dim.FunctionSource item = debugGui.dim.functionSourceByName(value); if (item != null) { Dim.SourceInfo si = item.sourceInfo(); String url = si.url(); int lineNumber = item.firstLine(); debugGui.showFileWindow(url, lineNumber); } } }
/** * Performs an action. */ public void actionPerformed(ActionEvent e) { String cmd = e.getActionCommand(); if (cmd.equals("Cancel")) { setVisible(false); value = null; } else if (cmd.equals("Select")) { if (list.getSelectedIndex() < 0) { return; } try { value = (String)list.getSelectedValue(); } catch (ArrayIndexOutOfBoundsException exc) { return; } setVisible(false); Dim.FunctionSource item = debugGui.dim.functionSourceByName(value); if (item != null) { Dim.SourceInfo si = item.sourceInfo(); String url = si.url(); int lineNumber = item.firstLine(); debugGui.showFileWindow(url, lineNumber); } } }
/** * Creates a new FileWindow. */ public FileWindow(SwingGui debugGui, Dim.SourceInfo sourceInfo) { super(SwingGui.getShortName(sourceInfo.url()), true, true, true, true); this.debugGui = debugGui; this.sourceInfo = sourceInfo; updateToolTip(); currentPos = -1; textArea = new FileTextArea(this); textArea.setRows(24); textArea.setColumns(80); p = new JScrollPane(); fileHeader = new FileHeader(this); p.setViewportView(textArea); p.setRowHeaderView(fileHeader); setContentPane(p); pack(); updateText(sourceInfo); textArea.select(0); }
/** * Creates a new FileWindow. */ public FileWindow(SwingGui debugGui, Dim.SourceInfo sourceInfo) { super(SwingGui.getShortName(sourceInfo.url()), true, true, true, true); this.debugGui = debugGui; this.sourceInfo = sourceInfo; updateToolTip(); currentPos = -1; textArea = new FileTextArea(this); textArea.setRows(24); textArea.setColumns(80); p = new JScrollPane(); fileHeader = new FileHeader(this); p.setViewportView(textArea); p.setRowHeaderView(fileHeader); setContentPane(p); pack(); updateText(sourceInfo); textArea.select(0); }
/** * Creates a new FileWindow. */ public FileWindow(SwingGui debugGui, Dim.SourceInfo sourceInfo) { super(SwingGui.getShortName(sourceInfo.url()), true, true, true, true); this.debugGui = debugGui; this.sourceInfo = sourceInfo; updateToolTip(); currentPos = -1; textArea = new FileTextArea(this); textArea.setRows(24); textArea.setColumns(80); p = new JScrollPane(); fileHeader = new FileHeader(this); p.setViewportView(textArea); p.setRowHeaderView(fileHeader); setContentPane(p); pack(); updateText(sourceInfo); textArea.select(0); }
/** * Update the source text for <code>sourceInfo</code>. This returns true * if a {@link FileWindow} for the given source exists and could be updated. * Otherwise, this does nothing and returns false. * @param sourceInfo the source info * @return true if a {@link FileWindow} for the given source exists * and could be updated, false otherwise. */ protected boolean updateFileWindow(Dim.SourceInfo sourceInfo) { String fileName = sourceInfo.url(); FileWindow w = getFileWindow(fileName); if (w != null) { w.updateText(sourceInfo); w.show(); return true; } return false; }
/** * Update the source text for <code>sourceInfo</code>. This returns true * if a {@link FileWindow} for the given source exists and could be updated. * Otherwise, this does nothing and returns false. * @param sourceInfo the source info * @return true if a {@link FileWindow} for the given source exists * and could be updated, false otherwise. */ protected boolean updateFileWindow(Dim.SourceInfo sourceInfo) { String fileName = sourceInfo.url(); FileWindow w = getFileWindow(fileName); if (w != null) { w.updateText(sourceInfo); w.show(); return true; } return false; }
/** * Sets or clears the breakpoint flag for the given line. */ public boolean breakpoint(int line, boolean value) { if (!breakableLine(line)) { throw new IllegalArgumentException(String.valueOf(line)); } boolean changed; synchronized (breakpoints) { if (breakpoints[line] != value) { breakpoints[line] = value; changed = true; } else { changed = false; } } return changed; }