01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: ******************************************************************************/package org.eclipse.ui.ide.fileSystem;
11:
12: import java.net.URI;
13:
14: import org.eclipse.core.filesystem.URIUtil;
15: import org.eclipse.swt.widgets.Shell;
16:
17: /**
18: * The abstract base class for all UI file system contributors. This class
19: * provides the infrastructure for defining a contributor and fulfills the contract
20: * specified by the <code>org.eclipse.ui.ide.filesystemSupport</code>
21: * extension point.
22: *
23: * @since 3.2
24: * @see org.eclipse.core.filesystem.IFileSystem
25: */
26: public abstract class FileSystemContributor {
27:
28: /**
29: * Browse the file system for a URI to display to the user.
30: * @param initialPath The path to initialize the selection with.
31: * @param shell The shell to parent any required dialogs from
32: * @return URI if the file system is browsed successfully or
33: * <code>null</code> if a URI could not be determined.
34: */
35: public abstract URI browseFileSystem(String initialPath, Shell shell);
36:
37: /**
38: * Return a URI for the supplied String from the user.
39: * @param string
40: * @return URI or <code>null</code> if the string is
41: * invalid.
42: */
43: public URI getURI(String string) {
44: return URIUtil.toURI(string);
45: }
46:
47: }
|