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 = [
2727 ToggleModule
2828]
2929
30- // The list of option toggles displayed in the viewer
30+ // The list of toggles displayed in the options of the viewer
3131export const options = [
3232 {
3333 // The name displayed over the toggle
@@ -40,7 +40,7 @@ export const options = [
4040 toggles .myToggle = value // replace "myToggle" by the name of the toggle you want to use
4141 ToggleModule .refreshContent ()
4242 },
43- // What will be displayed depending of the state of your toggle
43+ // The labels for the on/off states of your toggle
4444 values: {
4545 ' TOGGLED ON' : true ,
4646 ' TOGGLED OFF' : false
@@ -65,9 +65,14 @@ export const toggles = {
6565
6666` Referee.java `
6767``` 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`
6973 toggleModule. displayOnToggleState(myEntity, " myToggle" , true );
7074 // My entity will only be displayed when `myToggle` is true
7175 // (on the `TOGGLED ON` position according to our previous setup)
76+ }
7277```
7378
You can’t perform that action at this time.
0 commit comments