KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > tasklist > suggestions > SuggestionImplProperties


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.tasklist.suggestions;
21
22 import org.netbeans.modules.tasklist.core.TaskProperties;
23 import org.netbeans.modules.tasklist.core.filter.SuggestionProperty;
24
25
26 /**
27  *
28 import org.netbeans.modules.tasklist.core.filter.SuggestionProperty;ocation.
29  * This class is coupled to SuggestionImpl, but defined outside just
30  * for code readability.
31  */

32 public class SuggestionImplProperties extends TaskProperties {
33
34     public static final String JavaDoc PROPID_LINE_NUMBER = "line";
35     public static final String JavaDoc PROPID_FILENAME = "file";
36     public static final String JavaDoc PROPID_LOCATION = "location";
37     public static final String JavaDoc PROPID_CATEGORY = "category";
38     
39     
40     public static SuggestionProperty getProperty(String JavaDoc propID) {
41         if (propID.equals(PROPID_LINE_NUMBER)) { return PROP_LINE_NUMBER;}
42         else if (propID.equals(PROPID_FILENAME)) { return PROP_FILENAME;}
43         else if (propID.equals(PROPID_LOCATION)) { return PROP_LOCATION;}
44         else if (propID.equals(PROPID_CATEGORY)) { return PROP_CATEGORY;}
45         else return TaskProperties.getProperty(propID);
46     }
47     
48     public static final SuggestionProperty PROP_LINE_NUMBER =
49     new SuggestionProperty(PROPID_LINE_NUMBER, Integer JavaDoc.class) {
50         public Object JavaDoc getValue(Object JavaDoc obj) {return new Integer JavaDoc(((SuggestionImpl) obj).getLineNumber()); }
51     };
52     
53     public static final SuggestionProperty PROP_FILENAME =
54     new SuggestionProperty(PROPID_FILENAME, String JavaDoc.class) {
55         public Object JavaDoc getValue(Object JavaDoc obj) {return ((SuggestionImpl) obj).getFileBaseName(); }
56     };
57     
58     public static final SuggestionProperty PROP_LOCATION =
59     new SuggestionProperty(PROPID_LOCATION, String JavaDoc.class) {
60         public Object JavaDoc getValue(Object JavaDoc obj) {return ((SuggestionImpl) obj).getLocation(); }
61     };
62     
63     public static final SuggestionProperty PROP_CATEGORY =
64     new SuggestionProperty(PROPID_CATEGORY, String JavaDoc.class) {
65         public Object JavaDoc getValue(Object JavaDoc obj) {return ((SuggestionImpl)obj).getCategory(); }
66     };
67     
68 }
69
70
Popular Tags