File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export const modules = [
27
27
ToggleModule
28
28
]
29
29
30
- // The list of option toggles displayed in the viewer
30
+ // The list of toggles displayed in the options of the viewer
31
31
export const options = [
32
32
{
33
33
// The name displayed over the toggle
@@ -40,7 +40,7 @@ export const options = [
40
40
toggles .myToggle = value // replace "myToggle" by the name of the toggle you want to use
41
41
ToggleModule .refreshContent ()
42
42
},
43
- // What will be displayed depending of the state of your toggle
43
+ // The labels for the on/off states of your toggle
44
44
values: {
45
45
' TOGGLED ON' : true ,
46
46
' TOGGLED OFF' : false
@@ -65,9 +65,14 @@ export const toggles = {
65
65
66
66
` Referee.java `
67
67
``` java
68
- // Associating `myEntity` to the true state of `myToggle`
68
+ @Inject ToggleModule toggleModule;
69
+
70
+ @Override
71
+ public void init() {
72
+ // Only display `myEntity` when the state of `myToggle` is `true`
69
73
toggleModule. displayOnToggleState(myEntity, " myToggle" , true );
70
74
// My entity will only be displayed when `myToggle` is true
71
75
// (on the `TOGGLED ON` position according to our previous setup)
76
+ }
72
77
```
73
78
You can’t perform that action at this time.
0 commit comments