本文整理汇总了Java中org.eclipse.jdt.core.search.IJavaSearchConstants.FIELD属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaSearchConstants.FIELD属性的具体用法?Java IJavaSearchConstants.FIELD怎么用?Java IJavaSearchConstants.FIELD使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.search.IJavaSearchConstants
的用法示例。
在下文中一共展示了IJavaSearchConstants.FIELD属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findMatches
private Set<IIndexedJavaRef> findMatches(PatternQuerySpecification query) {
// Translate the IJavaSearchConstant element type constants to IJavaElement
// type constants.
int elementType;
switch (query.getSearchFor()) {
case IJavaSearchConstants.TYPE:
elementType = IJavaElement.TYPE;
break;
case IJavaSearchConstants.FIELD:
elementType = IJavaElement.FIELD;
break;
case IJavaSearchConstants.METHOD:
case IJavaSearchConstants.CONSTRUCTOR:
// IJavaElement.METHOD represents both methods & ctors
elementType = IJavaElement.METHOD;
break;
default:
// We only support searching for types, fields, methods, and ctors
return Collections.emptySet();
}
return JavaRefIndex.getInstance().findElementReferences(query.getPattern(),
elementType, query.isCaseSensitive());
}
示例2: createMethodFieldMatchLocationsControls
private void createMethodFieldMatchLocationsControls(Composite contents) {
Composite composite= new Composite(contents, SWT.NONE);
GridData gd= new GridData(SWT.LEFT, SWT.BEGINNING, true, true, 2, 1);
gd.minimumWidth= convertHorizontalDLUsToPixels(200);
composite.setLayoutData(gd);
GridLayout blayout= new GridLayout(1, false);
blayout.marginWidth= 0;
blayout.marginHeight= 0;
composite.setLayout(blayout);
if (fSearchFor == IJavaSearchConstants.METHOD || fSearchFor == IJavaSearchConstants.FIELD) {
createButton(composite, SearchMessages.MatchLocations_this_label, IJavaSearchConstants.THIS_REFERENCE);
createButton(composite, SearchMessages.MatchLocations_implicit_this_label, IJavaSearchConstants.IMPLICIT_THIS_REFERENCE);
createButton(composite, SearchMessages.MatchLocations_super_label, IJavaSearchConstants.SUPER_REFERENCE);
createButton(composite, SearchMessages.MatchLocations_qualified_label, IJavaSearchConstants.QUALIFIED_REFERENCE);
}
if (fSearchFor == IJavaSearchConstants.METHOD || fSearchFor == IJavaSearchConstants.CONSTRUCTOR) {
createButton(composite, SearchMessages.MatchLocations_method_reference_label, IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION);
}
}
示例3: isApplicable
@Override
public boolean isApplicable(JavaSearchQuery query) {
QuerySpecification spec = query.getSpecification();
if (spec instanceof ElementQuerySpecification) {
ElementQuerySpecification elementSpec = (ElementQuerySpecification) spec;
IJavaElement element = elementSpec.getElement();
return element instanceof IField || element instanceof ILocalVariable;
} else if (spec instanceof PatternQuerySpecification) {
PatternQuerySpecification patternSpec = (PatternQuerySpecification) spec;
return patternSpec.getSearchFor() == IJavaSearchConstants.FIELD;
}
return false;
}
示例4: getTotalNumberOfSettings
public static int getTotalNumberOfSettings(int searchFor) {
if (searchFor == IJavaSearchConstants.TYPE) {
return 15;
} else if (searchFor == IJavaSearchConstants.CONSTRUCTOR) {
return 1;
} else if (searchFor == IJavaSearchConstants.METHOD) {
return 5;
} else if (searchFor == IJavaSearchConstants.FIELD) {
return 4;
}
return 0;
}
示例5: isApplicable
@Override
public boolean isApplicable(JavaSearchQuery query) {
QuerySpecification spec= query.getSpecification();
if (spec instanceof ElementQuerySpecification) {
ElementQuerySpecification elementSpec= (ElementQuerySpecification) spec;
IJavaElement element= elementSpec.getElement();
return element instanceof IField || element instanceof ILocalVariable;
} else if (spec instanceof PatternQuerySpecification) {
PatternQuerySpecification patternSpec= (PatternQuerySpecification) spec;
return patternSpec.getSearchFor() == IJavaSearchConstants.FIELD;
}
return false;
}
示例6: getTotalNumberOfSettings
public static int getTotalNumberOfSettings(int searchFor) {
if (searchFor == IJavaSearchConstants.TYPE) {
return 15;
} else if (searchFor == IJavaSearchConstants.CONSTRUCTOR) {
return 1;
} else if (searchFor == IJavaSearchConstants.METHOD) {
return 5;
} else if (searchFor == IJavaSearchConstants.FIELD) {
return 4;
}
return 0;
}
示例7: getTotalNumberOfSettings
public static int getTotalNumberOfSettings(int searchFor) {
if (searchFor == IJavaSearchConstants.TYPE) {
return 15;
} else if (searchFor == IJavaSearchConstants.METHOD || searchFor == IJavaSearchConstants.FIELD) {
return 4;
}
return 0;
}
示例8: getNumberOfSelectedSettings
public static int getNumberOfSelectedSettings(int locations, int searchFor) {
int count = 0;
if (searchFor == IJavaSearchConstants.TYPE) {
if (isSet(locations, IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.FIELD_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.RETURN_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.PARAMETER_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.INSTANCEOF_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.TYPE_ARGUMENT_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CAST_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CATCH_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE)) {
count++;
}
} else if (searchFor == IJavaSearchConstants.METHOD
|| searchFor == IJavaSearchConstants.FIELD) {
if (isSet(locations, IJavaSearchConstants.SUPER_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.QUALIFIED_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.THIS_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.IMPLICIT_THIS_REFERENCE)) {
count++;
}
}
if (searchFor == IJavaSearchConstants.METHOD || searchFor == IJavaSearchConstants.CONSTRUCTOR) {
if (isSet(locations, IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION)) {
count++;
}
}
return count;
}
示例9: getNumberOfSelectedSettings
public static int getNumberOfSelectedSettings(int locations, int searchFor) {
int count= 0;
if (searchFor == IJavaSearchConstants.TYPE) {
if (isSet(locations, IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.FIELD_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.RETURN_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.PARAMETER_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.INSTANCEOF_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.TYPE_ARGUMENT_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CAST_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CATCH_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE)) {
count++;
}
} else if (searchFor == IJavaSearchConstants.METHOD || searchFor == IJavaSearchConstants.FIELD) {
if (isSet(locations, IJavaSearchConstants.SUPER_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.QUALIFIED_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.THIS_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.IMPLICIT_THIS_REFERENCE)) {
count++;
}
}
if (searchFor == IJavaSearchConstants.METHOD || searchFor == IJavaSearchConstants.CONSTRUCTOR) {
if (isSet(locations, IJavaSearchConstants.METHOD_REFERENCE_EXPRESSION)) {
count++;
}
}
return count;
}
示例10: getNumberOfSelectedSettings
public static int getNumberOfSelectedSettings(int locations, int searchFor) {
int count= 0;
if (searchFor == IJavaSearchConstants.TYPE) {
if (isSet(locations, IJavaSearchConstants.IMPORT_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.SUPERTYPE_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.ANNOTATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.FIELD_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.LOCAL_VARIABLE_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.RETURN_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.PARAMETER_DECLARATION_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.THROWS_CLAUSE_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.TYPE_VARIABLE_BOUND_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.WILDCARD_BOUND_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.INSTANCEOF_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.TYPE_ARGUMENT_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CAST_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CATCH_TYPE_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.CLASS_INSTANCE_CREATION_TYPE_REFERENCE)) {
count++;
}
} else if (searchFor == IJavaSearchConstants.METHOD || searchFor == IJavaSearchConstants.FIELD) {
if (isSet(locations, IJavaSearchConstants.SUPER_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.QUALIFIED_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.THIS_REFERENCE)) {
count++;
}
if (isSet(locations, IJavaSearchConstants.IMPLICIT_THIS_REFERENCE)) {
count++;
}
}
return count;
}