KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > filebuffers > LocationKind


1 /*******************************************************************************
2  * Copyright (c) 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.filebuffers;
12
13 import org.eclipse.core.runtime.IPath;
14
15
16 /**
17  * Type-safe enum of the available location kinds.
18  *
19  * @since 3.3
20  */

21 public final class LocationKind {
22     
23     /**
24      * The corresponding argument is a location
25      * in a file system.
26      * <p>
27      * <strong>Note:</strong> File buffers that are
28      * connected using a file store will not be found.
29      * </p>
30      *
31      * @see IFileBufferManager#connectFileStore(org.eclipse.core.filesystem.IFileStore, org.eclipse.core.runtime.IProgressMonitor)
32      */

33     public static final LocationKind LOCATION= new LocationKind("location"); //$NON-NLS-1$
34

35     /**
36      * The corresponding argument is the full path
37      * of an {@link org.eclipse.core.resources.IFile}.
38      *
39      * @see org.eclipse.core.resources.IFile#getFullPath()
40      */

41     public static final LocationKind IFILE= new LocationKind("IFile"); //$NON-NLS-1$
42

43     /**
44      * Tells to normalize the corresponding argument according
45      * to {@link FileBuffers#normalizeLocation(IPath)}.
46      * <p>
47      * <strong>Note:</strong>: If the normalized path is not in the
48      * workspace then a file buffer that might be connected using
49      * a file store will not be found.
50      * </p>
51      *
52      * @see IFileBufferManager#connectFileStore(org.eclipse.core.filesystem.IFileStore, org.eclipse.core.runtime.IProgressMonitor)
53      */

54     public static final LocationKind NORMALIZE= new LocationKind("normalize"); //$NON-NLS-1$
55

56     
57     private final String JavaDoc fName;
58     
59     LocationKind(String JavaDoc name) {
60         fName= name;
61     }
62     
63     /*
64      * @see java.lang.Object#toString()
65      */

66     public String JavaDoc toString() {
67         return fName;
68     }
69 }
Popular Tags