View Javadoc

1   /* ====================================================================
2    *   Copyright 2003-2005 Fabrizio Giustina.
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   * ====================================================================
16   */
17  package net.sf.commonclipse;
18  
19  import org.eclipse.core.resources.IWorkspace;
20  import org.eclipse.core.resources.ResourcesPlugin;
21  import org.eclipse.ui.plugin.AbstractUIPlugin;
22  
23  
24  /***
25   * Main plugin class.
26   * @author fgiust
27   * @version $Revision: 1.7 $ ($Author: fgiust $)
28   */
29  public class CCPlugin extends AbstractUIPlugin
30  {
31  
32      /***
33       * "commonclipse".
34       */
35      public static final String PLUGIN_NAME = "commonclipse"; //$NON-NLS-1$
36  
37      /***
38       * key for ToStringStyle name.
39       */
40      public static final String P_TOSTRING_STYLE = "tostring_style"; //$NON-NLS-1$
41  
42      /***
43       * key for "javabean-style toString()".
44       */
45      public static final String P_TOSTRING_BEAN = "tostring_bean"; //$NON-NLS-1$
46  
47      /***
48       * add appendSuper() in toString.
49       */
50      public static final String P_TOSTRING_SUPER = "tostring_super"; //$NON-NLS-1$
51  
52      /***
53       * add an instance equality check to the generated equals() method.
54       */
55      public static final String P_EQUALS_INSTANCECHECK = "equals_instancecheck"; //$NON-NLS-1$
56  
57      /***
58       * add appendSuper() in toString.
59       */
60      public static final String P_HASHCODE_SUPER = "hashcode_super"; //$NON-NLS-1$
61  
62      /***
63       * add appendSuper() in toString.
64       */
65      public static final String P_EQUALS_SUPER = "equals_super"; //$NON-NLS-1$
66  
67      /***
68       * add appendSuper() in toString.
69       */
70      public static final String P_COMPARETO_SUPER = "compareto_super"; //$NON-NLS-1$
71  
72      /***
73       * esclusion list.
74       */
75      public static final String P_EXCLUDE = "exclude"; //$NON-NLS-1$
76  
77      /***
78       * use final parameters in generated methods.
79       */
80      public static final String P_FINALPARAMETERS = "final_param"; //$NON-NLS-1$
81  
82      /***
83       * don't ask for overwriting existing methods.
84       */
85      public static final String P_DONTASKONOVERWRITE = "dontask"; //$NON-NLS-1$
86  
87      /***
88       * value for the P_TOSTRING_BEAN properties: use javabean properties in toString().
89       */
90      public static final String TOSTRINGSTYLE_BEAN = "bean"; //$NON-NLS-1$
91  
92      /***
93       * value for the P_TOSTRING_BEAN properties: use fields in toString().
94       */
95      public static final String TOSTRINGSTYLE_FIELDS = "fields"; //$NON-NLS-1$
96  
97      /***
98       * Shared instance.
99       */
100     private static CCPlugin plugin;
101 
102     /***
103      * Constructor.
104      */
105     public CCPlugin()
106     {
107         plugin = this;
108     }
109 
110     /***
111      * Returns the shared instance.
112      * @return shared instance
113      */
114     public static CCPlugin getDefault()
115     {
116         return plugin;
117     }
118 
119     /***
120      * Returns the workspace instance.
121      * @return IWorkspace workspace instance
122      */
123     public static IWorkspace getWorkspace()
124     {
125         return ResourcesPlugin.getWorkspace();
126     }
127 
128 }