コード例 #1
0
 private void initValidationJob() {
   final IFile file = ((IFileEditorInput) getEditorInput()).getFile();
   validationJob = new SCTValidationJob(getDiagram());
   IExpressionLanguageProvider registeredProvider =
       ExpressionLanguageProviderExtensions.getRegisteredProvider(
           SemanticTarget.StatechartSpecification, file.getFileExtension());
   Injector injector = registeredProvider.getInjector();
   injector.injectMembers(validationJob);
   validationJob.setRule(file);
 }
コード例 #2
0
 @Override
 public void dispose() {
   validationJob.cancel();
   getEditingDomain().removeResourceSetListener(validationListener);
   getEditingDomain().removeResourceSetListener(domainAdapter);
   domainAdapter.dispose();
   IFileEditorInput editorInput = (IFileEditorInput) getEditorInput();
   try {
     // Touch the file for revalidation, when the user did not save
     // the changes
     if (editorInput.getFile() != null && editorInput.getFile().exists()) {
       editorInput.getFile().touch(new NullProgressMonitor());
     }
   } catch (CoreException e) {
     e.printStackTrace();
   }
   super.dispose();
 }