Package | Description |
---|---|
org.jeditor.gui |
The presentation package for managing scripts presentation and modification.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractGutterHandler
The AbstractGutterHandler is a
GutterHandler which allows to:
Show a specific image on specific lines
Have a custom behavior upon clicking on the Gutter
Have a custom behavior upon hovering on a line the gutter, such as for example showing a tooltip
Example
The following handler:
Handles a right-click on the gutter and shows a menu for each line
Shows a tooltip on lines which paint an image
private class MyGutterHandler extends AbstractGutterHandler {
public boolean handleClick(Gutter gutter, int mouseButton, int x, int y) {
if (mouseButton == MouseEvent.BUTTON3) {
JPopupMenu menu = new JPopupMenu();
int number = gutter.getLineNumber(y);
menu.add(new JMenuItem("An Action on " + number));
menu.show(gutter, x, y);
return true;
} else {
return false;
}
}
public void handleMoved(Gutter gutter, int x, int y) {
int number = gutter.getLineNumber(y);
if (isPainting(number)) {
this.showTooltip("The tooltip on line" + number);
} else {
this.hideTooltip();
}
}
}
|
Modifier and Type | Method and Description |
---|---|
GutterHandler |
Gutter.getGutterHandler()
Return the gutter handler which draws specific graphics and handles right clicks on the gutter.
|
GutterHandler |
JEditor.getGutterHandler()
Return the gutter handler which draws specific graphcis and handles right clicks on the gutter.
|
Modifier and Type | Method and Description |
---|---|
void |
Gutter.setGutterHandler(GutterHandler gutterHandler)
Set the gutter handler for drawing specific graphcis and handling right clicks on the gutter.
|
void |
JEditor.setGutterHandler(GutterHandler gutterHandler)
Set the gutter handler for drawing specific graphcis and handling right clicks on the gutter.
|
Copyright © 2016, 2017, 2018, 2019, 2023 Herve Girod. All Rights Reserved. Documentation and source under the MIT licence