Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/aspectj/tools/ajde/jbuilder/JBuilderPreferencesAdapter.java


1   
2   /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3    *
4    * This file is part of the IDE support for the AspectJ(tm)
5    * programming language; see http://aspectj.org
6    *
7    * The contents of this file are subject to the Mozilla Public License
8    * Version 1.1 (the "License"); you may not use this file except in
9    * compliance with the License. You may obtain a copy of the License at
10   * either http://www.mozilla.org/MPL/ or http://aspectj.org/MPL/.
11   *
12   * Software distributed under the License is distributed on an "AS IS" basis,
13   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14   * for the specific language governing rights and limitations under the
15   * License.
16   *
17   * The Original Code is AspectJ.
18   *
19   * The Initial Developer of the Original Code is Xerox Corporation. Portions
20   * created by Xerox Corporation are Copyright (C) 1999-2002 Xerox Corporation.
21   * All Rights Reserved.
22   *
23   * Contributor(s):
24   */
25   
26  package org.aspectj.tools.ajde.jbuilder;
27  
28  import java.util.List;
29  import com.borland.primetime.ide.*;
30  import org.aspectj.ajde.*;
31  import org.aspectj.ajde.ui.*;
32  
33  public class JBuilderPreferencesAdapter implements UserPreferencesAdapter {
34  
35    private static final String CATEGORY = "ajde";
36  
37    public String getGlobalPreference(String name) {
38      // not implemented
39      return null;
40    }
41  
42    public List getGlobalMultivalPreference(String name) {
43      // not implemented  
44      return null;
45    }
46  
47    public void setGlobalPreference(String name, String value) {
48       // not implemented  
49    }
50  
51    public void setGlobalMultivalPreference(String name, List values) {
52      // not implemented  
53    }
54  
55    public String getProjectPreference(String name) {
56      return getProperty(name);
57    }
58    
59    public String getProjectPreference(String category, String name) {
60      return getProperty(category, name);  
61    }
62   
63    public List getProjectMultivalPreference(String name) {
64      // not implemented  
65      return null;
66    }
67    
68    public void setProjectPreference(String name, String value) {
69      setProperty(name, value);
70    }
71  
72    public void setProjectMultivalPreference(String name, List values) {
73      // not implemented
74    }
75    
76    private String getProperty(String category, String name) {
77      return Browser.getActiveBrowser().getActiveProject().getProperty(category, name, "");
78    }
79    
80      private void setProperty(String category, String name, String value) {
81      Browser.getActiveBrowser().getActiveProject().setProperty(category, name, value);
82      }
83    
84      private String getProperty(String name) {
85      return Browser.getActiveBrowser().getActiveProject().getProperty(CATEGORY, name, "");
86      }
87      
88      private void setProperty(String name, String value) {
89      Browser.getActiveBrowser().getActiveProject().setProperty(CATEGORY, name, value);
90      }
91  }