org.eclipse.xtext.ui.markers.IMarkerContributor Java Examples
The following examples show how to use
org.eclipse.xtext.ui.markers.IMarkerContributor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SCTXtextIntegrationModule.java From statecharts with Eclipse Public License 1.0 | 6 votes |
@Override public void configure(Binder binder) { binder.bind(IResourceValidator.class).to(SCTResourceValidatorImpl.class); binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("sct"); binder.bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class); binder.bind(IQualifiedNameProvider.class).to(StextNameProvider.class); binder.bind(org.eclipse.jface.viewers.ILabelProvider.class) .annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class) .to(DefaultDescriptionLabelProvider.class); binder.bind(IDefaultResourceDescriptionStrategy.class).to(SCTResourceDescriptionStrategy.class); binder.bind(MarkerCreator.class).to(SCTMarkerCreator.class); binder.bind(MarkerTypeProvider.class).to(SCTMarkerTypeProvider.class); binder.bind(IDiagnosticConverter.class).to(SCTDiagnosticConverterImpl.class); binder.bind(IURIEditorOpener.class).annotatedWith(LanguageSpecific.class).to(SCTFileEditorOpener.class); binder.bind(IMarkerContributor.class).to(TaskMarkerContributor.class); binder.bind(ITaskFinder.class).to(DomainSpecificTaskFinder.class); binder.bind(TaskMarkerCreator.class).to(SCTTaskMarkerCreator.class); binder.bind(TaskMarkerTypeProvider.class).to(SCTTaskMarkerTypeProvider.class); }
Example #2
Source File: MarkerUpdaterImpl.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
private void deleteAllContributedMarkers(IFile file, IProgressMonitor monitor) { try { file.deleteMarkers(IMarkerContributor.MARKER_TYPE, true, IResource.DEPTH_ZERO); } catch (CoreException e) { LOG.error(e.getMessage(), e); } }
Example #3
Source File: MarkerUpdaterImpl.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
protected IMarkerContributor getMarkerContributor(URI uri) { IResourceServiceProvider provider = resourceServiceProviderRegistry.getResourceServiceProvider(uri); if (provider != null) { return provider.get(IMarkerContributor.class); } return null; }
Example #4
Source File: GamlMarkerUpdater.java From gama with GNU General Public License v3.0 | 5 votes |
private void deleteAllContributedMarkers(final IFile file, final IProgressMonitor monitor) { try { file.deleteMarkers(IMarkerContributor.MARKER_TYPE, true, IResource.DEPTH_ZERO); } catch (final CoreException e) { DEBUG.ERR(e.getMessage()); } }
Example #5
Source File: DefaultUiModule.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
/** * @since 2.6 */ public Class<? extends IMarkerContributor> bindMarkerContributor() { return TaskMarkerContributor.class; }
Example #6
Source File: MarkerUpdaterImpl.java From xtext-eclipse with Eclipse Public License 2.0 | 4 votes |
private void processDelta(Delta delta, /* @Nullable */ ResourceSet resourceSet, IProgressMonitor monitor) throws OperationCanceledException { URI uri = delta.getUri(); IResourceUIValidatorExtension validatorExtension = getResourceUIValidatorExtension(uri); IMarkerContributor markerContributor = getMarkerContributor(uri); CheckMode normalAndFastMode = CheckMode.NORMAL_AND_FAST; for (Pair<IStorage, IProject> pair : mapper.getStorages(uri)) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } if (pair.getFirst() instanceof IFile) { IFile file = (IFile) pair.getFirst(); if (EXTERNAL_PROJECT_NAME.equals(file.getProject().getName())) { // if the file is found via the source attachment of a classpath entry, which happens // in case of running a test IDE with bundles from the workspace of the development IDE // (the workspace bundles' bin folder is linked to the classpath of bundles in the test IDE), // skip the marker processing of that file, as the user can't react on any markers anyway. continue; } if (delta.getNew() != null) { if (resourceSet == null) throw new IllegalArgumentException("resourceSet may not be null for changed resources."); Resource resource = resourceSet.getResource(uri, true); if (validatorExtension != null) { validatorExtension.updateValidationMarkers(file, resource, normalAndFastMode, monitor); } if (markerContributor != null) { markerContributor.updateMarkers(file, resource, monitor); } } else { if (validatorExtension != null) { validatorExtension.deleteValidationMarkers(file, normalAndFastMode, monitor); } else { deleteAllValidationMarker(file, normalAndFastMode, monitor); } if (markerContributor != null) { markerContributor.deleteMarkers(file, monitor); } else { deleteAllContributedMarkers(file, monitor); } } } } }
Example #7
Source File: GamlMarkerUpdater.java From gama with GNU General Public License v3.0 | 4 votes |
@Override public void updateMarkers(final Delta delta, final ResourceSet resourceSet, final IProgressMonitor monitor) throws OperationCanceledException { final URI uri = delta.getUri(); final IResourceUIValidatorExtension validatorExtension = getResourceUIValidatorExtension(uri); final IMarkerContributor markerContributor = getMarkerContributor(uri); final CheckMode normalAndFastMode = CheckMode.NORMAL_AND_FAST; for (final Pair<IStorage, IProject> pair : mapper.getStorages(uri)) { if (monitor.isCanceled()) { throw new OperationCanceledException(); } if (pair.getFirst() instanceof IFile) { final IFile file = (IFile) pair.getFirst(); if (delta.getNew() != null) { if (resourceSet == null) { throw new IllegalArgumentException( "resourceSet may not be null for changed resources."); } final Resource resource = resourceSet.getResource(uri, true); if (validatorExtension != null) { validatorExtension.updateValidationMarkers(file, resource, normalAndFastMode, monitor); } if (markerContributor != null) { markerContributor.updateMarkers(file, resource, monitor); } // GAMA.getGui().getMetaDataProvider().storeMetadata(file, // info.getInfo(resource, file.getModificationStamp()), // true); } else { if (validatorExtension != null) { validatorExtension.deleteValidationMarkers(file, normalAndFastMode, monitor); } else { deleteAllValidationMarker(file, normalAndFastMode, monitor); } if (markerContributor != null) { markerContributor.deleteMarkers(file, monitor); } else { deleteAllContributedMarkers(file, monitor); } } } } }