Example usage for com.google.gwt.event.logical.shared ValueChangeEvent getValue

List of usage examples for com.google.gwt.event.logical.shared ValueChangeEvent getValue

Introduction

In this page you can find the example usage for com.google.gwt.event.logical.shared ValueChangeEvent getValue.

Prototype

public T getValue() 

Source Link

Document

Gets the value.

Usage

From source file:com.google.gerrit.client.editor.EditPreferencesBox.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.setLineLength(prefs.lineLength());
        }/*w  w  w.  j a  v a  2  s  .  com*/
    }
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("indentUnit")
void onIndentUnit(ValueChangeEvent<String> e) {
    String v = e.getValue();
    if (v != null && v.length() > 0) {
        prefs.indentUnit(Math.max(0, Integer.parseInt(v)));
        if (view != null) {
            view.setIndentUnit(prefs.indentUnit());
        }/*from   ww  w  . j  ava2 s.c  o  m*/
    }
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.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)));
        if (view != null) {
            view.setOption("cursorBlinkRate", prefs.cursorBlinkRate());
        }//  w  ww  .  ja  v  a 2  s  . c  o  m
    }
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("topMenu")
void onTopMenu(ValueChangeEvent<Boolean> e) {
    prefs.hideTopMenu(!e.getValue());
    if (view != null) {
        Gerrit.setHeaderVisible(!prefs.hideTopMenu());
        view.adjustHeight();/*from   w  w w.  ja v  a2s .  c  o  m*/
    }
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("whitespaceErrors")
void onshowTrailingSpace(ValueChangeEvent<Boolean> e) {
    prefs.showWhitespaceErrors(e.getValue());
    if (view != null) {
        view.setShowWhitespaceErrors(prefs.showWhitespaceErrors());
    }// w  w w  .  ja v a 2  s.c o m
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("lineNumbers")
void onLineNumbers(ValueChangeEvent<Boolean> e) {
    prefs.hideLineNumbers(e.getValue());
    if (view != null) {
        view.setShowLineNumbers(prefs.hideLineNumbers());
    }/*w w  w . j  av  a  2s  .  co m*/
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("syntaxHighlighting")
void onSyntaxHighlighting(ValueChangeEvent<Boolean> e) {
    prefs.syntaxHighlighting(e.getValue());
    if (view != null) {
        view.setSyntaxHighlighting(prefs.syntaxHighlighting());
    }//w  w  w.  j a  va2s .co  m
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("matchBrackets")
void onMatchBrackets(ValueChangeEvent<Boolean> e) {
    prefs.matchBrackets(e.getValue());
    if (view != null) {
        view.setOption("matchBrackets", prefs.matchBrackets());
    }//from  ww w . ja va  2  s .co  m
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("lineWrapping")
void onLineWrapping(ValueChangeEvent<Boolean> e) {
    prefs.lineWrapping(e.getValue());
    if (view != null) {
        view.getEditor().setOption("lineWrapping", prefs.lineWrapping());
    }//ww  w. j  a va 2  s. c  om
}

From source file:com.google.gerrit.client.editor.EditPreferencesBox.java

License:Apache License

@UiHandler("autoCloseBrackets")
void onCloseBrackets(ValueChangeEvent<Boolean> e) {
    prefs.autoCloseBrackets(e.getValue());
    if (view != null) {
        view.getEditor().setOption("autoCloseBrackets", prefs.autoCloseBrackets());
    }/*from w  ww . ja  v  a  2s.  com*/
}