本文整理汇总了Java中org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getFieldImageDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java JavaElementImageProvider.getFieldImageDescriptor方法的具体用法?Java JavaElementImageProvider.getFieldImageDescriptor怎么用?Java JavaElementImageProvider.getFieldImageDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider
的用法示例。
在下文中一共展示了JavaElementImageProvider.getFieldImageDescriptor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeCompletionProposals
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
public ICompletionProposal[] computeCompletionProposals(IContentAssistSubjectControl contentAssistSubject, int documentOffset) {
if (fFieldNameProposals.length == 0)
return null;
String input= contentAssistSubject.getDocument().get();
ArrayList<JavaCompletionProposal> proposals= new ArrayList<JavaCompletionProposal>();
String prefix= input.substring(0, documentOffset);
ImageDescriptor imageDescriptor= JavaElementImageProvider.getFieldImageDescriptor(false, fRefactoring.getVisibility());
Image image= fImageRegistry.get(imageDescriptor);
for (int i= 0; i < fFieldNameProposals.length; i++) {
String tempName= fFieldNameProposals[i];
if (tempName.length() == 0 || ! tempName.startsWith(prefix))
continue;
JavaCompletionProposal proposal= new JavaCompletionProposal(tempName, 0, input.length(), image, tempName, 0);
proposals.add(proposal);
}
fErrorMessage= proposals.size() > 0 ? null : JavaUIMessages.JavaEditor_codeassist_noCompletions;
return proposals.toArray(new ICompletionProposal[proposals.size()]);
}
示例2: getImageDescriptor
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
@Override
public ImageDescriptor getImageDescriptor(Context context, Bookmark bookmark) {
ImageDescriptorRegistry registry = JavaPlugin
.getImageDescriptorRegistry();
ImageDescriptor descriptor = null;
String kind = bookmark.getPropertyValue(PROP_JAVA_ELEMENT_KIND);
if (KIND_METHOD.equals(kind)) {
descriptor = JavaElementImageProvider
.getMethodImageDescriptor(false, 0);
}
if (KIND_FIELD.equals(kind)) {
descriptor = JavaElementImageProvider
.getFieldImageDescriptor(false, 0);
}
if (KIND_ANNOTATION.equals(kind)) {
descriptor = JavaElementImageProvider
.getTypeImageDescriptor(false, true, Flags.AccAnnotation, false);
}
if (KIND_ENUM.equals(kind)) {
descriptor = JavaElementImageProvider
.getTypeImageDescriptor(false, false, Flags.AccEnum, false);
}
if (KIND_INTERFACE.equals(kind)) {
descriptor = JavaElementImageProvider
.getTypeImageDescriptor(false, true, Flags.AccInterface, false);
}
if (KIND_CLASS.equals(kind)) {
descriptor = JavaElementImageProvider
.getTypeImageDescriptor(false, false, 0, false);
}
if (KIND_TYPE.equals(kind)) {
descriptor = JavaElementImageProvider
.getTypeImageDescriptor(false, false, 0, false);
}
return descriptor;
}
示例3: getLocalsImage
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
public Image getLocalsImage() {
int accessorFlags_JVM = Flags.AccDefault;
int accessorFlags_JDT = 0;
ImageDescriptor desc = JavaElementImageProvider.getFieldImageDescriptor(false, accessorFlags_JVM);
ApexElementImageDescriptor decoratedDesc =
new ApexElementImageDescriptor(desc, accessorFlags_JDT, APEX_ICON_SIZE);
return ForceImages.get(ForceImages.JDT_LOCAL_VAR, accessorFlags_JVM, decoratedDesc);
}
示例4: getFieldImage
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
public Image getFieldImage() {
int accessorFlags_JVM = Flags.AccDefault;
int accessorFlags_JDT = JavaElementImageDescriptor.FINAL;
ImageDescriptor desc = JavaElementImageProvider.getFieldImageDescriptor(false, accessorFlags_JVM);
ApexElementImageDescriptor decoratedDesc =
new ApexElementImageDescriptor(desc, accessorFlags_JDT, APEX_ICON_SIZE);
return ForceImages.get(ForceImages.JDT_FIELD, accessorFlags_JVM, decoratedDesc);
}
示例5: createImageDescriptor
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
/**
* Creates and returns a decorated image descriptor for a completion proposal.
*
* @param proposal the proposal for which to create an image descriptor
* @return the created image descriptor, or <code>null</code> if no image is available
*/
public ImageDescriptor createImageDescriptor(CompletionProposal proposal) {
final int flags = proposal.getFlags();
ImageDescriptor descriptor;
switch (proposal.getKind()) {
case CompletionProposal.METHOD_DECLARATION:
case CompletionProposal.METHOD_NAME_REFERENCE:
case CompletionProposal.METHOD_REF:
case CompletionProposal.CONSTRUCTOR_INVOCATION:
case CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER:
case CompletionProposal.ANNOTATION_ATTRIBUTE_REF:
case CompletionProposal.POTENTIAL_METHOD_DECLARATION:
case CompletionProposal.ANONYMOUS_CLASS_DECLARATION:
case CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION:
descriptor = JavaElementImageProvider.getMethodImageDescriptor(false, flags);
break;
case CompletionProposal.TYPE_REF:
switch (Signature.getTypeSignatureKind(proposal.getSignature())) {
case Signature.CLASS_TYPE_SIGNATURE:
descriptor =
JavaElementImageProvider.getTypeImageDescriptor(false, false, flags, false);
break;
case Signature.TYPE_VARIABLE_SIGNATURE:
descriptor = JavaPluginImages.DESC_OBJS_TYPEVARIABLE;
break;
default:
descriptor = null;
}
break;
case CompletionProposal.FIELD_REF:
case CompletionProposal.FIELD_REF_WITH_CASTED_RECEIVER:
descriptor = JavaElementImageProvider.getFieldImageDescriptor(false, flags);
break;
case CompletionProposal.LOCAL_VARIABLE_REF:
case CompletionProposal.VARIABLE_DECLARATION:
descriptor = JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE;
break;
case CompletionProposal.PACKAGE_REF:
descriptor = JavaPluginImages.DESC_OBJS_PACKAGE;
break;
case CompletionProposal.KEYWORD:
case CompletionProposal.LABEL_REF:
descriptor = null;
break;
case CompletionProposal.JAVADOC_METHOD_REF:
case CompletionProposal.JAVADOC_TYPE_REF:
case CompletionProposal.JAVADOC_FIELD_REF:
case CompletionProposal.JAVADOC_VALUE_REF:
case CompletionProposal.JAVADOC_BLOCK_TAG:
case CompletionProposal.JAVADOC_INLINE_TAG:
case CompletionProposal.JAVADOC_PARAM_REF:
descriptor = JavaPluginImages.DESC_OBJS_JAVADOCTAG;
break;
default:
descriptor = null;
Assert.isTrue(false);
}
if (descriptor == null) return null;
return decorateImageDescriptor(descriptor, proposal);
}
示例6: createImageDescriptor
import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
/**
* Creates and returns a decorated image descriptor for a completion proposal.
*
* @param proposal the proposal for which to create an image descriptor
* @return the created image descriptor, or <code>null</code> if no image is available
*/
public ImageDescriptor createImageDescriptor(CompletionProposal proposal) {
final int flags= proposal.getFlags();
ImageDescriptor descriptor;
switch (proposal.getKind()) {
case CompletionProposal.METHOD_DECLARATION:
case CompletionProposal.METHOD_NAME_REFERENCE:
case CompletionProposal.METHOD_REF:
case CompletionProposal.CONSTRUCTOR_INVOCATION:
case CompletionProposal.METHOD_REF_WITH_CASTED_RECEIVER:
case CompletionProposal.ANNOTATION_ATTRIBUTE_REF:
case CompletionProposal.POTENTIAL_METHOD_DECLARATION:
case CompletionProposal.ANONYMOUS_CLASS_DECLARATION:
case CompletionProposal.ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION:
descriptor= JavaElementImageProvider.getMethodImageDescriptor(false, flags);
break;
case CompletionProposal.TYPE_REF:
switch (Signature.getTypeSignatureKind(proposal.getSignature())) {
case Signature.CLASS_TYPE_SIGNATURE:
descriptor= JavaElementImageProvider.getTypeImageDescriptor(false, false, flags, false);
break;
case Signature.TYPE_VARIABLE_SIGNATURE:
descriptor= JavaPluginImages.DESC_OBJS_TYPEVARIABLE;
break;
default:
descriptor= null;
}
break;
case CompletionProposal.FIELD_REF:
case CompletionProposal.FIELD_REF_WITH_CASTED_RECEIVER:
descriptor= JavaElementImageProvider.getFieldImageDescriptor(false, flags);
break;
case CompletionProposal.LOCAL_VARIABLE_REF:
case CompletionProposal.VARIABLE_DECLARATION:
descriptor= JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE;
break;
case CompletionProposal.PACKAGE_REF:
descriptor= JavaPluginImages.DESC_OBJS_PACKAGE;
break;
case CompletionProposal.KEYWORD:
case CompletionProposal.LABEL_REF:
descriptor= null;
break;
case CompletionProposal.JAVADOC_METHOD_REF:
case CompletionProposal.JAVADOC_TYPE_REF:
case CompletionProposal.JAVADOC_FIELD_REF:
case CompletionProposal.JAVADOC_VALUE_REF:
case CompletionProposal.JAVADOC_BLOCK_TAG:
case CompletionProposal.JAVADOC_INLINE_TAG:
case CompletionProposal.JAVADOC_PARAM_REF:
descriptor = JavaPluginImages.DESC_OBJS_JAVADOCTAG;
break;
default:
descriptor= null;
Assert.isTrue(false);
}
if (descriptor == null)
return null;
return decorateImageDescriptor(descriptor, proposal);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:68,代码来源:CompletionProposalLabelProvider.java