Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8e1c1e1cf1fd02e5279d16f66476c170c5689544 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*******************************************************************************
 * Copyright (c) 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.common.internal.environment.eclipse;

import org.eclipse.wst.common.environment.IEnvironment;
import org.eclipse.wst.common.environment.ILog;
import org.eclipse.wst.common.environment.NullStatusHandler;
import org.eclipse.wst.common.environment.IStatusHandler;
import org.eclipse.wst.common.environment.uri.SimpleURIFactory;
import org.eclipse.wst.common.environment.uri.IURIFactory;
import org.eclipse.wst.common.internal.environment.uri.file.FileScheme;


/**
 *  This class is intended for use in a headless Eclipse environment.  
 */
public class ConsoleEclipseEnvironment implements IEnvironment
{
	private SimpleURIFactory  uriFactory_      = null;
	private IStatusHandler     statusHandler_   = null;
	  
	public ConsoleEclipseEnvironment()
	{
	  this( new NullStatusHandler() );	
	}
	
	public ConsoleEclipseEnvironment( IStatusHandler  statusHandler )
	{
	  uriFactory_      = new SimpleURIFactory();
	  statusHandler_   = statusHandler;
	    
	  uriFactory_.registerScheme( "platform", new EclipseScheme( this ) );
	  uriFactory_.registerScheme( "file", new FileScheme() );
	}
			
	/* (non-Javadoc)
	 * @see org.eclipse.wst.common.environment.IEnvironment#getLog()
	 */
	public ILog getLog() 
	{
		return new EclipseLog();
	}
		
	/* (non-Javadoc)
	 * @see org.eclipse.wst.common.environment.IEnvironment#getStatusHandler()
	 */
	public IStatusHandler getStatusHandler() 
	{
		return statusHandler_;
	}
	
	/* (non-Javadoc)
	 * @see org.eclipse.wst.common.environment.IEnvironment#getURIFactory()
	 */
	public IURIFactory getURIFactory() 
	{
		return uriFactory_;
	}
}

Back to the top