All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.core.internal.refresh.InternalRefreshProvider Maven / Gradle / Ivy

Go to download

AspectJ tools most notably contains the AspectJ compiler (AJC). AJC applies aspects to Java classes during compilation, fully replacing Javac for plain Java classes and also compiling native AspectJ or annotation-based @AspectJ syntax. Furthermore, AJC can weave aspects into existing class files in a post-compile binary weaving step. This library is a superset of AspectJ weaver and hence also of AspectJ runtime.

There is a newer version: 1.9.22.1
Show newest version
/*******************************************************************************
 * Copyright (c) 2004, 2005 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM - Initial API and implementation
 *******************************************************************************/
package org.eclipse.core.internal.refresh;

import org.eclipse.core.internal.resources.Workspace;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.refresh.IRefreshMonitor;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubMonitor;

/**
 * Internal abstract superclass of all refresh providers.  This class must not be
 * subclassed directly by clients.  All refresh providers must subclass the public
 * API class org.eclipse.core.resources.refresh.RefreshProvider.
 *
 * @since 3.0
 */
public class InternalRefreshProvider {
	/* (non-Javadoc)
	 * @see org.eclipse.core.resources.refresh.RefreshProvider#createPollingMonitor(IResource)
	 */
	protected IRefreshMonitor createPollingMonitor(IResource resource) {
		Workspace workspace = (Workspace) resource.getWorkspace();
		RefreshManager refreshManager = workspace.getRefreshManager();
		MonitorManager monitors = refreshManager.monitors;
		PollingMonitor pollingMonitor = monitors.pollMonitor;
		pollingMonitor.monitor(resource);
		return pollingMonitor;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.core.resources.refresh.RefreshProvider#resetMonitors(IResource)
	 */
	public void resetMonitors(IResource resource, IProgressMonitor progressMonitor) {
		SubMonitor subMonitor = SubMonitor.convert(progressMonitor, 2);
		MonitorManager manager = ((Workspace) resource.getWorkspace()).getRefreshManager().monitors;
		manager.unmonitor(resource, subMonitor.split(1));
		manager.monitor(resource, subMonitor.split(1));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy