Skip to content

Commit c7a423a

Browse files
committed
fix(tooltip): better tuto
1 parent 0235e89 commit c7a423a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

playground/extensions/extensions-3-tooltip.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,18 @@ export const modules = [
3030

3131
`Referee.java`
3232
```java
33-
// adding a tooltip to an entity
34-
tooltip.setTooltipText(myEntity, "the tooltip text linked to this entity");
33+
@Inject TooltipModule tooltips;
3534

36-
// removing the tooltip from an other entity
37-
tooltip.removeTooltipText(otherEntity);
35+
@Override
36+
public void init() {
37+
// adding a tooltip to an entity
38+
tooltips.setTooltipText(myEntity, "the tooltip text linked to this entity");
3839

39-
// getting the tooltip text associated to an entity
40-
String text = tooltip.getTooltipText(myEntity);
41-
// in this case text will now be "the tooltip text linked to this entity"
42-
```
40+
// removing the tooltip from an other entity
41+
tooltips.removeTooltipText(otherEntity);
42+
43+
// getting the tooltip text associated to an entity
44+
String text = tooltips.getTooltipText(myEntity);
45+
// in this case text will now be "the tooltip text linked to this entity"
46+
}
47+
```

0 commit comments

Comments
 (0)