mirror of
https://github.com/processing/processing4.git
synced 2026-02-07 15:49:17 +01:00
added show usage menu item
This commit is contained in:
@@ -156,13 +156,23 @@ public class DebugEditor extends JavaEditor implements ActionListener {
|
||||
// access to customized (i.e. subclassed) text area
|
||||
ta = (TextArea) textarea;
|
||||
|
||||
// Add show usage option
|
||||
JMenuItem showUsageItem = new JMenuItem("Show Usage..");
|
||||
showUsageItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
handleShowUsage();
|
||||
}
|
||||
});
|
||||
ta.getRightClickPopup().add(showUsageItem);
|
||||
|
||||
// add refactor option
|
||||
JMenuItem renameItem = new JMenuItem("Rename..");
|
||||
renameItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
handleRefactor();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// TODO: Add support for word select on right click and rename.
|
||||
// ta.customPainter.addMouseListener(new MouseAdapter() {
|
||||
// public void mouseClicked(MouseEvent evt) {
|
||||
@@ -1144,6 +1154,12 @@ public class DebugEditor extends JavaEditor implements ActionListener {
|
||||
errorCheckerService.astGenerator.handleRefactor();
|
||||
}
|
||||
|
||||
private void handleShowUsage() {
|
||||
System.out.println("Caret at:");
|
||||
System.out.println(ta.getLineText(ta.getCaretLine()));
|
||||
errorCheckerService.astGenerator.handleShowUsage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the sketch contains java tabs. If it does, XQMode ain't built
|
||||
* for it, yet. Also, user should really start looking at Eclipse. Disable
|
||||
|
||||
Reference in New Issue
Block a user