Search in sources :

Example 1 with IMarkerDelta

use of org.eclipse.core.resources.IMarkerDelta in project flux by eclipse.

the class LiveEditUnits method checkForLiveUnitsInvolved.

protected void checkForLiveUnitsInvolved(IResourceDelta delta) {
    IProject project = delta.getResource().getProject();
    IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
    if (project != null && repository.isConnected(project) && markerDeltas != null && markerDeltas.length > 0) {
        IResource resource = delta.getResource();
        String resourcePath = project.getName() + "/" + resource.getProjectRelativePath().toString();
        ICompilationUnit unit = getLiveEditUnit(repository.getUsername(), resourcePath);
        if (unit != null) {
            try {
                unit.reconcile(ICompilationUnit.NO_AST, true, null, null);
            } catch (JavaModelException e) {
                e.printStackTrace();
            }
        }
    }
}
Also used : ICompilationUnit(org.eclipse.jdt.core.ICompilationUnit) JavaModelException(org.eclipse.jdt.core.JavaModelException) IMarkerDelta(org.eclipse.core.resources.IMarkerDelta) IProject(org.eclipse.core.resources.IProject) IResource(org.eclipse.core.resources.IResource)

Example 2 with IMarkerDelta

use of org.eclipse.core.resources.IMarkerDelta in project flux by eclipse.

the class Repository method metadataChanged.

public void metadataChanged(IResourceDelta delta) {
    IProject project = delta.getResource().getProject();
    IMarkerDelta[] markerDeltas = delta.getMarkerDeltas();
    if (project != null && isConnected(project) && markerDeltas != null && markerDeltas.length > 0) {
        sendMetadataUpdate(delta.getResource());
    }
}
Also used : IMarkerDelta(org.eclipse.core.resources.IMarkerDelta) IProject(org.eclipse.core.resources.IProject)

Aggregations

IMarkerDelta (org.eclipse.core.resources.IMarkerDelta)2 IProject (org.eclipse.core.resources.IProject)2 IResource (org.eclipse.core.resources.IResource)1 ICompilationUnit (org.eclipse.jdt.core.ICompilationUnit)1 JavaModelException (org.eclipse.jdt.core.JavaModelException)1