bundles/org.eclipse.orion.client.ui/web/orion/compare/diffProvider.js
function DiffProvider(serviceRegistry, filter) {
		var allReferences = serviceRegistry.getServiceReferences("orion.core.diff"); //$NON-NLS-0$
		var i, _references = allReferences;
		if (filter) {
			_references = [];
			for(i = 0; i < allReferences.length; ++i) {
				if (filter(allReferences[i])) {
					_references.push(allReferences[i]);
				}
			}
		}
		var _patterns = [];
		var _services = [];
		
		for(i = 0; i < _references.length; ++i) {
			_patterns[i] = new RegExp(_references[i].getProperty("pattern") || ".*");//$NON-NLS-1$ //$NON-NLS-0$
			_services[i] = serviceRegistry.getService(_references[i]);
		}

		this._getService = function(location) {
			location = _normalizeURL(location);
			for(var i = 0; i < _patterns.length; ++i) {
				if (_patterns[i].test(location)) {
					return _services[i];
				}
			}
			throw messages["NoDiffServiceLocationMatched"] + location;
		};
	}
function DiffProvider(serviceRegistry, filter) {
		var allReferences = serviceRegistry.getServiceReferences("orion.core.diff"); //$NON-NLS-0$
		var i, _references = allReferences;
		if (filter) {
			_references = [];
			for(i = 0; i < allReferences.length; ++i) {
				if (filter(allReferences[i])) {
					_references.push(allReferences[i]);
				}
			}
		}
		var _patterns = [];
		var _services = [];
		
		for(i = 0; i < _references.length; ++i) {
			_patterns[i] = new RegExp(_references[i].getProperty("pattern") || ".*");//$NON-NLS-1$ //$NON-NLS-0$
			_services[i] = serviceRegistry.getService(_references[i]);
		}

		this._getService = function(location) {
			location = _normalizeURL(location);
			for(var i = 0; i < _patterns.length; ++i) {
				if (_patterns[i].test(location)) {
					return _services[i];
				}
			}
			throw messages["NoDiffServiceLocationMatched"] + location;
		};
	}
function DiffProvider ( serviceRegistry , filter ) { var allReferences = serviceRegistry . getServiceReferences ( "orion.core.diff" ) ; //$NON-NLS-0$ var i , _references = allReferences ; if ( filter ) { _references = [ ] ; for ( i = 0 ; i < allReferences . length ; ++ i ) { if ( filter ( allReferences [ i ] ) ) { _references . push ( allReferences [ i ] ) ; } } } var _patterns = [ ] ; var _services = [ ] ; for ( i = 0 ; i < _references . length ; ++ i ) { _patterns [ i ] = new RegExp ( _references [ i ] . getProperty ( "pattern" ) || ".*" ) ; //$NON-NLS-1$ //$NON-NLS-0$ _services [ i ] = serviceRegistry . getService ( _references [ i ] ) ; } this . _getService = function ( location ) { location = _normalizeURL ( location ) ; for ( var i = 0 ; i < _patterns . length ; ++ i ) { if ( _patterns [ i ] . test ( location ) ) { return _services [ i ] ; } } throw messages [ "NoDiffServiceLocationMatched" ] + location ; } ; }
Creates a new diff provider.
@class Provides operations on Diff in a compare editor
@name orion.compare.DiffProvider
Creates a new diff provider .