FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

following syntax guidelines · andrey-/processing@e231b2d · GitHub

Repository navigation

Commit e231b2d

Browse files
committed
following syntax guidelines
1 parent c2dbc71 commit e231b2d

1 file changed

Lines changed: 26 additions & 25 deletions

File tree

‎java/src/processing/mode/java/pdex/CompletionCandidate.java‎

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,22 @@
3131
import org.eclipse.jdt.core.dom.TypeDeclaration;
3232
import org.eclipse.jdt.core.dom.VariableDeclarationFragment;
3333

34-
public class CompletionCandidate implements Comparable<CompletionCandidate>{
35-
36-
private String elementName; //
3734

35+
public class CompletionCandidate implements Comparable<CompletionCandidate>{
36+
private String elementName;
3837
private String label; // the toString value
39-
4038
private String completionString;
41-
4239
private Object wrappedObject;
43-
4440
private int type;
4541

46-
public static final int PREDEF_CLASS = 0, PREDEF_FIELD = 1,
47-
PREDEF_METHOD = 2, LOCAL_CLASS = 3, LOCAL_METHOD = 4, LOCAL_FIELD = 5,
48-
LOCAL_VAR = 6;
42+
static final int PREDEF_CLASS = 0;
43+
static final int PREDEF_FIELD = 1;
44+
static final int PREDEF_METHOD = 2;
45+
static final int LOCAL_CLASS = 3;
46+
static final int LOCAL_METHOD = 4;
47+
static final int LOCAL_FIELD = 5;
48+
static final int LOCAL_VAR = 6;
49+
4950

5051
public CompletionCandidate(Method method) {
5152
method.getDeclaringClass().getName();
@@ -72,7 +73,7 @@ public CompletionCandidate(Method method) {
7273
type = PREDEF_METHOD;
7374
wrappedObject = method;
7475
}
75-
76+
7677
public Object getWrappedObject() {
7778
return wrappedObject;
7879
}
@@ -87,7 +88,7 @@ public CompletionCandidate(SingleVariableDeclaration svd) {
8788
label = svd.getName() + " : " + svd.getType();
8889
wrappedObject = svd;
8990
}
90-
91+
9192
public CompletionCandidate(VariableDeclarationFragment vdf) {
9293
completionString = vdf.getName().toString();
9394
elementName = vdf.getName().toString();
@@ -98,16 +99,16 @@ public CompletionCandidate(VariableDeclarationFragment vdf) {
9899
label = vdf.getName() + " : " + ASTGenerator.extracTypeInfo2(vdf);
99100
wrappedObject = vdf;
100101
}
101-
102+
102103
public CompletionCandidate(MethodDeclaration method) {
103104
// log("ComCan " + method.getName());
104105
elementName = method.getName().toString();
105106
type = LOCAL_METHOD;
106-
107+
107108
@SuppressWarnings("unchecked")
108-
List<ASTNode> params = (List<ASTNode>)
109+
List<ASTNode> params = (List<ASTNode>)
109110
method.getStructuralProperty(MethodDeclaration.PARAMETERS_PROPERTY);
110-
111+
111112
StringBuilder label = new StringBuilder(elementName + "(");
112113
StringBuilder cstr = new StringBuilder(method.getName() + "(");
113114
for (int i = 0; i < params.size(); i++) {
@@ -145,18 +146,18 @@ public CompletionCandidate(Field f) {
145146
// + matchedClass + " : " + "<font color=#777777>"
146147
// + matchedClass2.substring(0, d) + "</font>", matchedClass
147148
// + "</html>"
148-
label = "<html>" + f.getName() + " : " + f.getType().getSimpleName() +
149-
" - <font color=#777777>" + f.getDeclaringClass().getSimpleName() +
149+
label = "<html>" + f.getName() + " : " + f.getType().getSimpleName() +
150+
" - <font color=#777777>" + f.getDeclaringClass().getSimpleName() +
150151
"</font></html>";
151152
completionString = elementName;
152153
wrappedObject = f;
153154
}
154155

155-
public CompletionCandidate(String name, String labelStr, String completionStr, int type) {
156+
public CompletionCandidate(String name, String labelStr, String completionStr, int type) {
156157
elementName = name;
157158
label = labelStr;
158159
completionString = completionStr;
159-
this.type = type;
160+
this.type = type;
160161
}
161162

162163
public CompletionCandidate(String name, int type) {
@@ -181,11 +182,11 @@ public String toString() {
181182
public int getType() {
182183
return type;
183184
}
184-
185+
185186
public String getLabel() {
186187
return label;
187188
}
188-
189+
189190
public String getNoHtmlLabel(){
190191
if(!label.contains("<html>")) {
191192
return label;
@@ -217,15 +218,15 @@ public int compareTo(CompletionCandidate cc) {
217218
}
218219
return (elementName.compareTo(cc.getElementName()));
219220
}
220-
221+
221222
public void regenerateCompletionString(){
222223
if (wrappedObject instanceof MethodDeclaration) {
223224
MethodDeclaration method = (MethodDeclaration)wrappedObject;
224-
225+
225226
@SuppressWarnings("unchecked")
226-
List<ASTNode> params = (List<ASTNode>)
227+
List<ASTNode> params = (List<ASTNode>)
227228
method.getStructuralProperty(MethodDeclaration.PARAMETERS_PROPERTY);
228-
229+
229230
StringBuilder label = new StringBuilder(elementName + "(");
230231
StringBuilder cstr = new StringBuilder(method.getName() + "(");
231232
for (int i = 0; i < params.size(); i++) {

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL