/** * Creates a new FilePopupMenu. */ public FilePopupMenu(FileTextArea w) { JMenuItem item; add(item = new JMenuItem("Set Breakpoint")); item.addActionListener(w); add(item = new JMenuItem("Clear Breakpoint")); item.addActionListener(w); add(item = new JMenuItem("Run")); item.addActionListener(w); }
/** * Checks if the popup menu should be shown. */ private void checkPopup(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(this, e.getX(), e.getY()); } }
/** * Creates a new FileTextArea. */ public FileTextArea(FileWindow w) { this.w = w; popup = new FilePopupMenu(this); popup.addPopupMenuListener(this); addMouseListener(this); addKeyListener(this); setFont(new Font("Monospaced", 0, 12)); }
/** * Performs an action. */ public void actionPerformed(ActionEvent e) { int pos = viewToModel(new Point(popup.x, popup.y)); popup.setVisible(false); String cmd = e.getActionCommand(); int line = -1; try { line = getLineOfOffset(pos); } catch (Exception exc) { } if (cmd.equals("Set Breakpoint")) { w.setBreakPoint(line + 1); } else if (cmd.equals("Clear Breakpoint")) { w.clearBreakPoint(line + 1); } else if (cmd.equals("Run")) { w.load(); } }
/** * Creates a new FileTextArea. */ public FileTextArea(FileWindow w) { this.w = w; popup = new FilePopupMenu(this); popup.addPopupMenuListener(this); addMouseListener(this); addKeyListener(this); setFont(new Font("Monospaced", 0, 12)); }
/** * Performs an action. */ public void actionPerformed(ActionEvent e) { int pos = viewToModel(new Point(popup.x, popup.y)); popup.setVisible(false); String cmd = e.getActionCommand(); int line = -1; try { line = getLineOfOffset(pos); } catch (Exception exc) { } if (cmd.equals("Set Breakpoint")) { w.setBreakPoint(line + 1); } else if (cmd.equals("Clear Breakpoint")) { w.clearBreakPoint(line + 1); } else if (cmd.equals("Run")) { w.load(); } }
/** * Creates a new FileTextArea. */ public FileTextArea(FileWindow w) { this.w = w; popup = new FilePopupMenu(this); popup.addPopupMenuListener(this); addMouseListener(this); addKeyListener(this); setFont(new Font("Monospaced", 0, 12)); }
/** * Creates a new FilePopupMenu. */ public FilePopupMenu(FileTextArea w) { JMenuItem item; add(item = new JMenuItem("Set Breakpoint")); item.addActionListener(w); add(item = new JMenuItem("Clear Breakpoint")); item.addActionListener(w); add(item = new JMenuItem("Run")); item.addActionListener(w); }
/** * Checks if the popup menu should be shown. */ private void checkPopup(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(this, e.getX(), e.getY()); } }
/** * Performs an action. */ public void actionPerformed(ActionEvent e) { int pos = viewToModel(new Point(popup.x, popup.y)); popup.setVisible(false); String cmd = e.getActionCommand(); int line = -1; try { line = getLineOfOffset(pos); } catch (Exception exc) { } if (cmd.equals("Set Breakpoint")) { w.setBreakPoint(line + 1); } else if (cmd.equals("Clear Breakpoint")) { w.clearBreakPoint(line + 1); } else if (cmd.equals("Run")) { w.load(); } }
/** * Creates a new FilePopupMenu. */ public FilePopupMenu(FileTextArea w) { JMenuItem item; add(item = new JMenuItem("Set Breakpoint")); item.addActionListener(w); add(item = new JMenuItem("Clear Breakpoint")); item.addActionListener(w); add(item = new JMenuItem("Run")); item.addActionListener(w); }
/** * Checks if the popup menu should be shown. */ private void checkPopup(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(this, e.getX(), e.getY()); } }