|
19 | 19 | import de.f0rce.ace.enums.AceExportType;
|
20 | 20 | import de.f0rce.ace.enums.AceMarkerColor;
|
21 | 21 | import de.f0rce.ace.enums.AceMode;
|
| 22 | +import de.f0rce.ace.enums.AceStatusbarIndexing; |
22 | 23 | import de.f0rce.ace.enums.AceTheme;
|
23 | 24 | import de.f0rce.ace.events.AceBlurChanged;
|
24 | 25 | import de.f0rce.ace.events.AceChanged;
|
|
36 | 37 | /** @author David "F0rce" Dodlek */
|
37 | 38 | @SuppressWarnings("serial")
|
38 | 39 | @Tag("lit-ace")
|
39 |
| -@NpmPackage(value = "@f0rce/lit-ace", version = "1.9.0") |
40 | 40 | @NpmPackage(value = "@f0rce/lit-ace", version = "1.10.0")
|
41 | 41 | @JsModule("./@f0rce/lit-ace/lit-ace.js")
|
42 | 42 | public class AceEditor extends Component implements HasSize, HasStyle, Focusable<AceEditor> {
|
@@ -67,6 +67,7 @@ public class AceEditor extends Component implements HasSize, HasStyle, Focusable
|
67 | 67 | private List<String> customAutocompletion = new ArrayList<String>();
|
68 | 68 | private List<AceMarker> markers = new ArrayList<AceMarker>();
|
69 | 69 | private boolean statusbarEnabled = true;
|
| 70 | + private AceStatusbarIndexing statusbarIndexing = AceStatusbarIndexing.ONE_BASED; |
70 | 71 |
|
71 | 72 | // Some internal checking
|
72 | 73 | private boolean hasBeenDetached = false;
|
@@ -108,6 +109,10 @@ protected void onAttach(AttachEvent attachEvent) {
|
108 | 109 | this.setSelection(this.selection);
|
109 | 110 | }
|
110 | 111 | }
|
| 112 | + if (this.statusbarIndexing != AceStatusbarIndexing.ONE_BASED) { |
| 113 | + this.setStatusbarIndexing(this.statusbarIndexing); |
| 114 | + } |
| 115 | + this.hasBeenDetached = false; |
111 | 116 | }
|
112 | 117 | }
|
113 | 118 |
|
@@ -1470,4 +1475,24 @@ public Registration addValueChangeListener(ComponentEventListener<AceValueChange
|
1470 | 1475 | public void print(AceExportType exportType) {
|
1471 | 1476 | this.getElement().callJsFunction("print", exportType.getType());
|
1472 | 1477 | }
|
| 1478 | + |
| 1479 | + /** |
| 1480 | + * Change the indexing (starting index) of the statusbar. |
| 1481 | + * |
| 1482 | + * @param statusbarIndexing {@link AceStatusbarIndexing} |
| 1483 | + */ |
| 1484 | + public void setStatusbarIndexing(AceStatusbarIndexing statusbarIndexing) { |
| 1485 | + this.getElement().callJsFunction("setStatusbarIndexing", statusbarIndexing.getIntValue()); |
| 1486 | + this.statusbarIndexing = statusbarIndexing; |
| 1487 | + } |
| 1488 | + |
| 1489 | + /** |
| 1490 | + * Returns the current set indexing of the statusbar (defaults to {@link |
| 1491 | + * AceStatusbarIndexing#ONE_BASED}). |
| 1492 | + * |
| 1493 | + * @return {@link AceStatusbarIndexing} |
| 1494 | + */ |
| 1495 | + public AceStatusbarIndexing getStatusbarIndexing() { |
| 1496 | + return this.statusbarIndexing; |
| 1497 | + } |
1473 | 1498 | }
|
0 commit comments