当前位置: 首页>>代码示例>>Java>>正文


Java JavaElementImageProvider.getMethodImageDescriptor方法代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getMethodImageDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java JavaElementImageProvider.getMethodImageDescriptor方法的具体用法?Java JavaElementImageProvider.getMethodImageDescriptor怎么用?Java JavaElementImageProvider.getMethodImageDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider的用法示例。


在下文中一共展示了JavaElementImageProvider.getMethodImageDescriptor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NewDefiningMethodProposal

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
public NewDefiningMethodProposal(
    String label,
    ICompilationUnit targetCU,
    ASTNode invocationNode,
    ITypeBinding binding,
    IMethodBinding method,
    String[] paramNames,
    int relevance) {
  super(label, targetCU, invocationNode, binding, relevance, null);
  fMethod = method;
  fParamNames = paramNames;

  ImageDescriptor desc =
      JavaElementImageProvider.getMethodImageDescriptor(
          binding.isInterface() || binding.isAnnotation(), method.getModifiers());
  setImage(JavaPlugin.getImageDescriptorRegistry().get(desc));
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:NewDefiningMethodProposal.java

示例2: getImage

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
@Override
public Image getImage(Object element) {
	//access to image registry
	ImageDescriptorRegistry registry= JavaPlugin.getImageDescriptorRegistry();
	ImageDescriptor descriptor= null;

	if (element instanceof String) {
		String s= (String) element;
		if (s.equals(PUBLIC)) {
			descriptor= JavaElementImageProvider.getMethodImageDescriptor(false, Flags.AccPublic);
		} else if (s.equals(PRIVATE)) {
			descriptor= JavaElementImageProvider.getMethodImageDescriptor(false, Flags.AccPrivate);
		} else if (s.equals(PROTECTED)) {
			descriptor= JavaElementImageProvider.getMethodImageDescriptor(false, Flags.AccProtected);
		} else if (s.equals(DEFAULT)) {
			descriptor= JavaElementImageProvider.getMethodImageDescriptor(false, Flags.AccDefault);
		}
		return registry.get(descriptor);
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:MembersOrderPreferencePage.java

示例3: 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;
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:37,代码来源:JavaBookmarkLabelProvider.java

示例4: NewDefiningMethodProposal

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入方法依赖的package包/类
public NewDefiningMethodProposal(String label, ICompilationUnit targetCU, ASTNode invocationNode, ITypeBinding binding, IMethodBinding method, String[] paramNames, int relevance) {
	super(label,targetCU,invocationNode,binding,relevance,null);
	fMethod= method;
	fParamNames= paramNames;

	ImageDescriptor desc= JavaElementImageProvider.getMethodImageDescriptor(binding.isInterface() || binding.isAnnotation(), method.getModifiers());
	setImage(JavaPlugin.getImageDescriptorRegistry().get(desc));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:NewDefiningMethodProposal.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:68,代码来源:CompletionProposalLabelProvider.java

示例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


注:本文中的org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.getMethodImageDescriptor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。