View | Details | Raw Unified | Return to bug 255345 | Differences between
and this patch

Collapse All | Expand All

(-)model/org/eclipse/jdt/core/NamingConventions.java (-17 / +24 lines)
Lines 11-16 Link Here
11
package org.eclipse.jdt.core;
11
package org.eclipse.jdt.core;
12
12
13
import org.eclipse.jdt.core.compiler.CharOperation;
13
import org.eclipse.jdt.core.compiler.CharOperation;
14
14
import org.eclipse.jdt.internal.codeassist.impl.AssistOptions;
15
import org.eclipse.jdt.internal.codeassist.impl.AssistOptions;
15
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
16
import org.eclipse.jdt.internal.compiler.parser.ScannerHelper;
16
import org.eclipse.jdt.internal.core.INamingRequestor;
17
import org.eclipse.jdt.internal.core.INamingRequestor;
Lines 25-42 Link Here
25
 * The possible options are :
26
 * The possible options are :
26
 * <ul>
27
 * <ul>
27
 * <li> {@link JavaCore#CODEASSIST_FIELD_PREFIXES} : Define the Prefixes for Field Name.</li>
28
 * <li> {@link JavaCore#CODEASSIST_FIELD_PREFIXES} : Define the Prefixes for Field Name.</li>
28
 * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.</li>
29
 * <li> {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.</li>
30
 * <li> {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.</li>
31
 * <li> {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} : Define the Suffixes for Field Name.</li>
29
 * <li> {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} : Define the Suffixes for Field Name.</li>
30
 * 
31
 * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.</li>
32
 * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} : Define the Suffixes for Static Field Name.</li>
32
 * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} : Define the Suffixes for Static Field Name.</li>
33
 * 
34
 * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} : Define the Prefixes for Static Final Field Name.</li>
35
 * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES} : Define the Suffixes for Static Final Field Name.</li>
36
 * 
37
 * <li> {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.</li>
33
 * <li> {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES} : Define the Suffixes for Local Variable Name.</li>
38
 * <li> {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES} : Define the Suffixes for Local Variable Name.</li>
39
 * 
40
 * <li> {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.</li>
34
 * <li> {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES} : Define the Suffixes for Argument Name.</li>
41
 * <li> {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES} : Define the Suffixes for Argument Name.</li>
35
 * </ul>
42
 * </ul>
36
 * </p>
43
 * </p>
37
 * <p>
44
 * <p>
38
 * For a complete description of the configurable options, see <code>getDefaultOptions</code>.
45
 * For a complete description of the configurable options, see {@link JavaCore#getDefaultOptions()}.
39
 * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>.
46
 * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)}.
40
 * </p>
47
 * </p>
41
 * <p>
48
 * <p>
42
 * This class provides static methods and constants only.
49
 * This class provides static methods and constants only.
Lines 1041-1056 Link Here
1041
	 *
1048
	 *
1042
	 * <p>
1049
	 * <p>
1043
	 * The base name is used to compute the variable name.
1050
	 * The base name is used to compute the variable name.
1044
	 * Some different kinds of base name are possible and each kind is associated to a different heuristic to compute variable names.<br>
1051
	 * Some different kinds of base names are possible and each kind is associated to a different heuristic to compute variable names.<br>
1045
	 * The heuristic depends also on the kind of the variable. Each kind of variable is identified by a constant starting with <code>VK_</code>.<br>
1052
	 * The heuristic depends also on the kind of the variable. Each kind of variable is identified by a constant starting with <code>VK_</code>.<br>
1046
	 * When a prefix and a suffix can be added then all combinations of prefix and suffix are suggested.
1053
	 * When a prefix and a suffix can be added then all combinations of prefix and suffix are suggested.
1047
	 * If the name is <code>name</code>, the prefix is <code>pre</code> and the suffix is <code>suf</code> then the suggested names will be
1054
	 * If the name is <code>name</code>, the prefix is <code>pre</code> and the suffix is <code>suf</code> then the suggested names will be
1048
	 * <code>prenamesuf</code>, <code>prename</code>, <code>namesuf</code> and <code>name</code>.<br>
1055
	 * <code>prenamesuf</code>, <code>prename</code>, <code>namesuf</code> and <code>name</code>.<br>
1049
	 * <br>
1056
	 * <br>
1050
	 * The different kinds of base name are:
1057
	 * The different kinds of base names are:
1051
	 * <ul>
1058
	 * <ul>
1052
	 * <li>{@link #BK_NAME}: the base name is a Java name and the whole base name is considered to compute the variable names. A prefix and a suffix can be added.<br>
1059
	 * <li>{@link #BK_NAME}: the base name is a Java name and the whole base name is considered to compute the variable names. A prefix and a suffix can be added.<br>
1053
	 * There is an heuristic by variable kind.
1060
	 * There is a heuristic by variable kind.
1054
	 * <ul>
1061
	 * <ul>
1055
	 * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br>
1062
	 * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br>
1056
	 * In this case the first character will be converted to lower case and the other characters won't be changed.<br>
1063
	 * In this case the first character will be converted to lower case and the other characters won't be changed.<br>
Lines 1060-1066 Link Here
1060
	 * If the base name is <code>SimpleName</code> then the suggested name will be <code>SIMPLE_NAME</code>.</li>
1067
	 * If the base name is <code>SimpleName</code> then the suggested name will be <code>SIMPLE_NAME</code>.</li>
1061
	 * </ul></li>
1068
	 * </ul></li>
1062
	 * <li>{@link #BK_TYPE_NAME}: the base name is a Java simple type name (e.g. <code>HashMap</code>) and all the words of the base name are considered to compute the variable names. A prefix and a suffix can be added to these names.<br>
1069
	 * <li>{@link #BK_TYPE_NAME}: the base name is a Java simple type name (e.g. <code>HashMap</code>) and all the words of the base name are considered to compute the variable names. A prefix and a suffix can be added to these names.<br>
1063
	 * There is an heuristic by variable kind.
1070
	 * There is a heuristic by variable kind.
1064
	 * <ul>
1071
	 * <ul>
1065
	 * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br>
1072
	 * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br>
1066
	 * In this case a variable name will contain some words of the base name and the first character will be converted to lower case.<br>
1073
	 * In this case a variable name will contain some words of the base name and the first character will be converted to lower case.<br>
Lines 1083-1099 Link Here
1083
	 * </ul>
1090
	 * </ul>
1084
	 * </p>
1091
	 * </p>
1085
	 * <p>
1092
	 * <p>
1086
	 * For a complete description of these configurable options, see <code>getDefaultOptions</code>.
1093
	 * For a complete description of these configurable options, see {@link JavaCore#getDefaultOptions()}.
1087
	 * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>.
1094
	 * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)} and {@link IJavaProject#setOptions(java.util.Map)}
1088
	 * </p>
1095
	 * </p>
1089
	 * <p>
1096
	 * <p>
1090
	 * Proposed names are sorted by relevance (best proposal first).<br>
1097
	 * Proposed names are sorted by relevance (best proposal first).<br>
1091
	 * The names are proposed in the following order:
1098
	 * The names are proposed in the following order:
1092
	 * <ol>
1099
	 * <ol>
1093
	 * <li>Names with prefix and suffix. Longest name are proposed first</li>
1100
	 * <li>Names with prefix and suffix. Longer names are proposed first</li>
1094
	 * <li>Names with prefix. Longest name are proposed first</li>
1101
	 * <li>Names with prefix. Longer names are proposed first</li>
1095
	 * <li>Names with suffix. Longest name are proposed first</li>
1102
	 * <li>Names with suffix. Longer names are proposed first</li>
1096
	 * <li>Names without prefix and suffix. Longest name are proposed first</li>
1103
	 * <li>Names without prefix and suffix. Longer names are proposed first</li>
1097
	 * </ol>
1104
	 * </ol>
1098
	 * </p>
1105
	 * </p>
1099
	 *
1106
	 *
Lines 1104-1111 Link Here
1104
	 * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings.
1111
	 * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings.
1105
	 * @param dim variable dimension (0 if the field is not an array).
1112
	 * @param dim variable dimension (0 if the field is not an array).
1106
	 * @param excluded a list of names which cannot be suggested (already used names).
1113
	 * @param excluded a list of names which cannot be suggested (already used names).
1107
	 *         Can be <code>null</code> if there is no excluded names.
1114
	 *         Can be <code>null</code> if there are no excluded names.
1108
	 * @param evaluateDefault if set, the result is guaranteed to contain at least one result. If not, the result can be an empty array. 
1115
	 * @param evaluateDefault if <code>true</code>, the result is guaranteed to contain at least one result. If <code>false</code>, the result can be an empty array.
1109
	 * @return String[] an array of names.
1116
	 * @return String[] an array of names.
1110
	 * @see JavaCore#setOptions(java.util.Hashtable)
1117
	 * @see JavaCore#setOptions(java.util.Hashtable)
1111
	 * @see JavaCore#getDefaultOptions()
1118
	 * @see JavaCore#getDefaultOptions()

Return to bug 255345