Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7378dc8a9b815ce65df2d9f2e6bed34d88e9d639 (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
68
69
70
71
/*******************************************************************************
 * Copyright (c) 2007, 2008 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 Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.core.filebuffers;

import org.eclipse.core.runtime.IPath;


/**
 * Type-safe enum of the available location kinds.
 *
 * @since 3.3
 * @noinstantiate This class is not intended to be instantiated by clients.
 */
public final class LocationKind {

	/**
	 * The corresponding argument is a location
	 * in a file system.
	 * <p>
	 * <strong>Note:</strong> File buffers that are
	 * connected using a file store will not be found.
	 * </p>
	 *
	 * @see IFileBufferManager#connectFileStore(org.eclipse.core.filesystem.IFileStore, org.eclipse.core.runtime.IProgressMonitor)
	 */
	public static final LocationKind LOCATION= new LocationKind("location"); //$NON-NLS-1$

	/**
	 * The corresponding argument is the full path
	 * of an {@link org.eclipse.core.resources.IFile}.
	 *
	 * @see org.eclipse.core.resources.IFile#getFullPath()
	 */
	public static final LocationKind IFILE= new LocationKind("IFile"); //$NON-NLS-1$

	/**
	 * Tells to normalize the corresponding argument according
	 * to {@link FileBuffers#normalizeLocation(IPath)}.
	 * <p>
	 * <strong>Note:</strong>: If the normalized path is not in the
	 * workspace then a file buffer that might be connected using
	 * a file store will not be found.
	 * </p>
	 *
	 * @see IFileBufferManager#connectFileStore(org.eclipse.core.filesystem.IFileStore, org.eclipse.core.runtime.IProgressMonitor)
	 */
	public static final LocationKind NORMALIZE= new LocationKind("normalize"); //$NON-NLS-1$


	private final String fName;

	LocationKind(String name) {
		fName= name;
	}

	@Override
	public String toString() {
		return fName;
	}
}

Back to the top