Merge branch 'stable-2.12' into stable-2.13

* stable-2.12:
  Adds a new pref config called lineWrapping to Edit and Diff

Change-Id: Id52cfeb3522690028e158590b87da94c695a3722
This commit is contained in:
Paladox
2016-09-13 22:28:08 +01:00
committed by David Pursehouse
14 changed files with 72 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ public class EditPreferencesBox extends Composite {
@UiField ToggleButton whitespaceErrors;
@UiField ToggleButton lineNumbers;
@UiField ToggleButton matchBrackets;
@UiField ToggleButton lineWrapping;
@UiField ToggleButton autoCloseBrackets;
@UiField ToggleButton showBase;
@UiField ListBox theme;
@@ -104,6 +105,7 @@ public class EditPreferencesBox extends Composite {
whitespaceErrors.setValue(prefs.showWhitespaceErrors());
lineNumbers.setValue(prefs.hideLineNumbers());
matchBrackets.setValue(prefs.matchBrackets());
lineWrapping.setValue(prefs.lineWrapping());
autoCloseBrackets.setValue(prefs.autoCloseBrackets());
showBase.setValue(prefs.showBase());
setTheme(prefs.theme());
@@ -205,6 +207,14 @@ public class EditPreferencesBox extends Composite {
}
}
@UiHandler("lineWrapping")
void onLineWrapping(ValueChangeEvent<Boolean> e) {
prefs.lineWrapping(e.getValue());
if (view != null) {
view.getEditor().setOption("lineWrapping", prefs.lineWrapping());
}
}
@UiHandler("autoCloseBrackets")
void onCloseBrackets(ValueChangeEvent<Boolean> e) {
prefs.autoCloseBrackets(e.getValue());

View File

@@ -238,6 +238,13 @@ limitations under the License.
<g:downFace><ui:msg>On</ui:msg></g:downFace>
</g:ToggleButton></td>
</tr>
<tr>
<th><ui:msg>Line Wrapping</ui:msg></th>
<td><g:ToggleButton ui:field='lineWrapping'>
<g:upFace><ui:msg>Off</ui:msg></g:upFace>
<g:downFace><ui:msg>On</ui:msg></g:downFace>
</g:ToggleButton></td>
</tr>
<tr>
<th><ui:msg>Auto Close Brackets</ui:msg></th>
<td><g:ToggleButton ui:field='autoCloseBrackets'>