- private Read<Evaluation> validationRequest(IEditorPart editorPart) {
- return new UnaryRead<IEditorPart, Evaluation>(editorPart) {
- @Override
- public Evaluation perform(ReadGraph graph) throws DatabaseException {
- IEditorInput input = parameter.getEditorInput();
- IResourceEditorInput resourceInput = getResourceInput(parameter);
-
- //System.out.println(ResourceEditorSupport.this + ": checking input " + input);
-
- boolean exists = true;
- boolean valid = true;
- if (resourceInput != null) {
- exists = resourceInput.exists(graph);
- if (exists && inputValidator != null) {
- valid = graph.syncRequest(inputValidator.get(resourceInput));
- }
- } else {
- exists = input.exists();
+ private class ValidationRequest extends UniqueRead<Evaluation> {
+ @Override
+ public Evaluation perform(ReadGraph graph) throws DatabaseException {
+ IEditorPart part = editorPart;
+ if (part == null)
+ return new Evaluation(null, null, InputState.INVALID, "", "");
+
+ IEditorInput input = part.getEditorInput();
+ IResourceEditorInput resourceInput = getResourceInput(part);
+
+ if (DEBUG)
+ LOGGER.trace("ValidationRequest: checking input " + input);
+
+ boolean exists = true;
+ boolean valid = true;
+ if (resourceInput != null) {
+ exists = resourceInput.exists(graph);
+ if (exists && inputValidator != null) {
+ valid = graph.syncRequest(inputValidator.get(resourceInput));