Package com.google.gwt.regexp.shared

Examples of com.google.gwt.regexp.shared.RegExp.test()


     * @return true if path refers to UI element, false otherwise
     */
    public static boolean isUIElement(String path) {
        String regex = "^\\/{0,2}(com\\.vaadin\\.ui\\.)?V?UI[\\/\\[]?";
        RegExp regexp = RegExp.compile(regex);
        return regexp.test(path);
    }

    /**
     * Checks if path refers to vaadin Notification element
     * com.vaadin.ui.Notification.
 
View Full Code Here


     * @return true if path refers to Notification element, false otherwise
     */
    public static boolean isNotificationElement(String path) {
        String regex = "^\\/{0,2}(com\\.vaadin\\.ui\\.)?V?Notification[\\/\\[]?";
        RegExp regexp = RegExp.compile(regex);
        return regexp.test(path);
    }
}
View Full Code Here

          fieldInput.setAllowBlank(false);
          fieldInput.addValidator(new MaxLengthValidator(20));
          final RegExp regex = RegExp.compile("\\s");
          fieldInput.addValidator(new Validator<String>() {
            public List<EditorError> validate(Editor<String> editor, String value) {
              if (regex.test(value)) {
                List<EditorError> errors = new ArrayList<EditorError>();
                errors.add(new DefaultEditorError(editor, "Field name cannot contain spaces.", ""));
                return errors;
              }
              return null;
View Full Code Here

  
   private void validateAppName()
   {
      String app = appName.getText();
      RegExp validReg = RegExp.compile("^[A-Za-z0-9_-]{4,63}$");
      setAppNameValid(validReg.test(app));
   }
  
   private void setAppNameValid(boolean isValid)
   {
      nameValidatePanel.setVisible(!isValid);
View Full Code Here

                                    // name
        "((\\d{1,3}\\.){3}\\d{1,3}))" + // OR ip (v4) address
        "(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*" + // port and path
        "(\\?[;&a-z\\d%_.~+=-]*)?" + // query string
        "(\\#[-a-z\\d_]*)?$", "i");
    return pattern.test(url);
  }

  public static LayoutSpacer getVSpacer() {
    LayoutSpacer spacer = new LayoutSpacer();
    spacer.setHeight100();
View Full Code Here

    txtPeso.removeStyleName("campoInvalido");
   
    RegExp padrao = RegExp.compile("^[a-zÇ-Üá-ñ\\s]+$", "i");
   
    String origem = txtLocalOrigem.getText().trim();
    if(!padrao.test(origem) || origem.isEmpty()){
      txtLocalOrigem.addStyleName("campoInvalido");
      if(origem.isEmpty()){
        Alerta.exibeErro("O campo local de origem deve estar preenchido");
      }else{
        Alerta.exibeErro("O campo local de origem deve conter apenas letras");
View Full Code Here

     
      return false;
    }
   
    String destino = txtLocalDestino.getText().trim();
    if(!padrao.test(destino) || destino.isEmpty()){
      txtLocalDestino.addStyleName("campoInvalido");
      if(destino.isEmpty()){
        Alerta.exibeErro("O campo local de destino deve estar preenchido");
      }else{
        Alerta.exibeErro("O campo local de destino deve conter apenas letras");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.