Package com.google.gwt.editor.client

Examples of com.google.gwt.editor.client.EditorError


    try {
      currentValue = getValueOrThrow();
    } catch (ParseException e) {

      String current = getText();
      EditorError error = new DefaultEditorError(this, DefaultMessages.getMessages().field_parseExceptionText(current),
          current);

      ArrayList<EditorError> errors = new ArrayList<EditorError>();
      errors.add(error);
View Full Code Here


  public String getPath() {
    return path;
  }

  public void recordError(String message, Object value, Object userData) {
    EditorError error = new SimpleError(this, message, value, userData);
    errors.add(error);
  }
View Full Code Here

    errors.add(error);
  }

  public void recordError(String message, Object value, Object userData,
      String extraPath) {
    EditorError error = new SimpleError(this, message, value, userData,
        extraPath);
    errors.add(error);
  }
View Full Code Here

  private void showErrors(List<EditorError> errorAccumulator) {
    assert errors != errorAccumulator;
    if (hasEditorErrors != null) {
      // Allow higher-priority co-editor to spy on errors
      for (Iterator<EditorError> it = errorAccumulator.iterator(); it.hasNext();) {
        EditorError error = it.next();
        if (error.getAbsolutePath().startsWith(getPath())) {
          errors.add(error);
          it.remove();
        }
      }
      // Include the trailing dot
      int length = getPath().length();
      int pathPrefixLength = length == 0 ? 0 : (length + 1);
      for (EditorError error : errors) {
        ((SimpleError) error).setPathPrefixLength(pathPrefixLength);
      }
      // Give all of the errors to the handler and use a new local accumulator
      hasEditorErrors.showErrors(Collections.unmodifiableList(errors));

      for (EditorError error : errors) {
        if (!error.isConsumed()) {
          errorAccumulator.add(error);
        }
      }

      // Reset local error list
View Full Code Here

                    assertEquals(1, errors.size());
                    ConstraintViolation<?> v = errors.iterator().next();

                    driver.setConstraintViolations(errors);
                    assertEquals(1, editor.errors.size());
                    EditorError error = editor.errors.get(0);
                    assertEquals("userName", error.getAbsolutePath());
                    assertSame(editor.userName, error.getEditor());
                    assertTrue(error.getMessage().length() > 0);
                    assertEquals("userName", error.getPath());
                    assertSame(v, error.getUserData());
                    assertNull(error.getValue());
                    finishTestAndReset();
                  }

                  @Override
                  public void onSuccess(SimpleFooProxy response) {
View Full Code Here

                    com.google.web.bindery.requestfactory.shared.Violation v =
                        errors.iterator().next();

                    driver.setViolations(errors);
                    assertEquals(1, editor.errors.size());
                    EditorError error = editor.errors.get(0);
                    assertEquals("userName", error.getAbsolutePath());
                    assertSame(editor.userName, error.getEditor());
                    assertTrue(error.getMessage().length() > 0);
                    assertEquals("userName", error.getPath());
                    assertSame(v, error.getUserData());
                    assertNull(error.getValue());
                    finishTestAndReset();
                  }
                });
            // Set to an illegal value
            editor.userName.setValue("");
View Full Code Here

    driver.setConstraintViolations(doHorribleCast(violations));
    List<EditorError> errors = bookWidget.author.errors;
    // Note: Is the fact that there are 2 errors here (rather than just one) also a bug?
    assertEquals(2, errors.size());
   
    EditorError error = errors.get(0);
    assertEquals(bookWidget.author.lastName.asEditor(), error.getEditor());
    // There is a bug here - error.getPath() throws a StringIndexOutOfBoundsException.
    // The pathPrefixLength is set in ErrorCollector line 63. It breaks the toString() method
    // of SimpleError as well.
    assertEquals("author.lastName", error.getAbsolutePath());
  }
View Full Code Here

          line=line.trim();
          if(line.equals("")){
            break;
          }
          if(!line.contains("=")){
            EditorError ee=new DefaultEditorError(editor, "格式不正确", value);
            result.add(ee);
          }
        }
        return result;
      }
View Full Code Here

  public boolean isDirty() {
    return dirty;
  }

  public void recordError(String message, Object value, Object userData) {
    EditorError error = new SimpleError(this, message, value, userData);
    errors.add(error);
  }
View Full Code Here

    errors.add(error);
  }

  public void recordError(String message, Object value, Object userData,
      String extraPath, Editor<?> leafEditor) {
    EditorError error = new SimpleError(this, message, value, userData,
        extraPath, leafEditor);
    errors.add(error);
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.editor.client.EditorError

Copyright © 2018 www.massapicom. 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.