List of usage examples for com.google.gwt.event.logical.shared ValueChangeEvent getValue
public T getValue()
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("tabWidth") void onTabWidth(ValueChangeEvent<String> e) { String v = e.getValue(); if (v != null && v.length() > 0) { prefs.tabSize(Math.max(1, Integer.parseInt(v))); if (view != null) { view.operation(() -> {//from w ww . ja v a 2s . c o m int size = prefs.tabSize(); for (CodeMirror cm : view.getCms()) { cm.setOption("tabSize", size); } }); } } }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("lineLength") void onLineLength(ValueChangeEvent<String> e) { String v = e.getValue(); if (v != null && v.length() > 0) { prefs.lineLength(Math.max(1, Integer.parseInt(v))); if (view != null) { view.operation(() -> view.setLineLength(prefs.lineLength())); }//from w ww. j a v a 2 s .c o m } }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("expandAllComments") void onExpandAllComments(ValueChangeEvent<Boolean> e) { prefs.expandAllComments(e.getValue()); if (view != null) { view.getCommentManager().setExpandAllComments(prefs.expandAllComments()); }// w ww .j ava 2s . c o m }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("cursorBlinkRate") void onCursoBlinkRate(ValueChangeEvent<String> e) { String v = e.getValue(); if (v != null && v.length() > 0) { // A negative value hides the cursor entirely: // don't let user shoot himself in the foot. prefs.cursorBlinkRate(Math.max(0, Integer.parseInt(v))); view.getCmFromSide(DisplaySide.A).setOption("cursorBlinkRate", prefs.cursorBlinkRate()); view.getCmFromSide(DisplaySide.B).setOption("cursorBlinkRate", prefs.cursorBlinkRate()); }/* w w w . ja v a 2 s . c o m*/ }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("showTabs") void onShowTabs(ValueChangeEvent<Boolean> e) { prefs.showTabs(e.getValue()); if (view != null) { view.setShowTabs(prefs.showTabs()); }/*from w ww .j a va 2 s .c o m*/ }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("lineNumbers") void onLineNumbers(ValueChangeEvent<Boolean> e) { prefs.showLineNumbers(e.getValue()); if (view != null) { view.setShowLineNumbers(prefs.showLineNumbers()); }/*from w ww .j av a 2 s .co m*/ }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("leftSide") void onLeftSide(ValueChangeEvent<Boolean> e) { if (view.getDiffTable() instanceof SideBySideTable) { ((SideBySideTable) view.getDiffTable()).setVisibleA(e.getValue()); }//from w ww .j a v a 2 s .c o m }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("emptyPane") void onHideEmptyPane(ValueChangeEvent<Boolean> e) { prefs.hideEmptyPane(!e.getValue()); if (view != null) { view.getDiffTable().setHideEmptyPane(prefs.hideEmptyPane()); if (prefs.hideEmptyPane()) { if (view.getDiffTable().getChangeType() == ChangeType.ADDED) { leftSide.setValue(false); leftSide.setEnabled(false); }/* w w w . j a v a 2 s .c o m*/ } else { leftSide.setValue(view.getDiffTable().isVisibleA()); leftSide.setEnabled(true); } } }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("topMenu") void onTopMenu(ValueChangeEvent<Boolean> e) { prefs.hideTopMenu(!e.getValue()); if (view != null) { Gerrit.setHeaderVisible(!prefs.hideTopMenu()); view.resizeCodeMirror();/*ww w .java 2s . co m*/ } }
From source file:com.google.gerrit.client.diff.PreferencesBox.java
License:Apache License
@UiHandler("autoHideDiffTableHeader") void onAutoHideDiffTableHeader(ValueChangeEvent<Boolean> e) { prefs.autoHideDiffTableHeader(!e.getValue()); if (view != null) { view.setAutoHideDiffHeader(!e.getValue()); }//from w w w . j a v a 2s.co m }