/** * The default implementation will display, but not consume, received errors * whose {@link EditorError#getEditor() getEditor()} method returns the Editor * passed into {@link #setEditor}. * * @param errors a List of {@link EditorError} instances */ public void showErrors(List<EditorError> errors) { StringBuilder sb = new StringBuilder(); for (EditorError error : errors) { if (error.getEditor().equals(editor)) { sb.append("\n").append(error.getMessage()); } } if (sb.length() == 0) { errorLabel.setInnerText(""); errorLabel.getStyle().setDisplay(Display.NONE); return; } errorLabel.setInnerText(sb.substring(1)); errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK); } }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(editor)); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(this.asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(this.asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(this.asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(this.asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(this.asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(this.asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
/** * Checks if a error belongs to this widget. * * @param perror editor error to check * @return true if the error belongs to this widget */ protected boolean editorErrorMatches(final EditorError perror) { return perror != null && perror.getEditor() != null && (equals(perror.getEditor()) || perror.getEditor().equals(asEditor())); }
protected EditorError mockEditorError(final Editor<?> editor, final String message) { EditorError error = mock(EditorError.class); doReturn(editor).when(error).getEditor(); doReturn(message).when(error).getMessage(); return error; }
protected EditorError mockEditorError(final Editor<?> editor, final String message) { EditorError error = mock(EditorError.class); doReturn(editor).when(error).getEditor(); doReturn(message).when(error).getMessage(); return error; }