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


Java JavaElementImageProvider类代码示例

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


JavaElementImageProvider类属于org.eclipse.jdt.internal.ui.viewsupport包,在下文中一共展示了JavaElementImageProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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()]);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:FieldNameProcessor.java

示例3: getImage

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
@Override
public Image getImage(Object element) {
	if (element instanceof JavadocLinkRef) {
		JavadocLinkRef ref= (JavadocLinkRef) element;
		ImageDescriptor desc;
		if (ref.isProjectRef()) {
			desc= PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
		} else {
			desc= JavaUI.getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_JAR);
		}
		if (ref.getURL() == null) {
			return JavaPlugin.getImageDescriptorRegistry().get(new JavaElementImageDescriptor(desc, JavaElementImageDescriptor.WARNING, JavaElementImageProvider.SMALL_SIZE));
		}
		return JavaPlugin.getImageDescriptorRegistry().get(desc);
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:JavadocLinkDialogLabelProvider.java

示例4: MethodDeclarationCompletionProposal

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
public MethodDeclarationCompletionProposal(IType type, String methodName, String returnTypeSig, int start, int length, int relevance) {
	super("", type.getCompilationUnit(), start, length, null, getDisplayName(methodName, returnTypeSig), relevance); //$NON-NLS-1$
	Assert.isNotNull(type);
	Assert.isNotNull(methodName);

	fType= type;
	fMethodName= methodName;
	fReturnTypeSig= returnTypeSig;

	if (returnTypeSig == null) {
		setProposalInfo(new ProposalInfo(type));

		ImageDescriptor desc= new JavaElementImageDescriptor(JavaPluginImages.DESC_MISC_PUBLIC, JavaElementImageDescriptor.CONSTRUCTOR, JavaElementImageProvider.SMALL_SIZE);
		setImage(JavaPlugin.getImageDescriptorRegistry().get(desc));
	} else {
		setImage(JavaPluginImages.get(JavaPluginImages.IMG_MISC_PRIVATE));
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:MethodDeclarationCompletionProposal.java

示例5: getColumnImage

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
public Image getColumnImage(Object element, int columnIndex) {
	if (columnIndex != 0) {
		return null;
	}

	NameConventionEntry entry= (NameConventionEntry) element;
	ImageDescriptorRegistry registry= JavaPlugin.getImageDescriptorRegistry();
	switch (entry.kind) {
		case FIELD:
			return registry.get(JavaPluginImages.DESC_FIELD_PUBLIC);
		case STATIC:
			return registry.get(new JavaElementImageDescriptor(JavaPluginImages.DESC_FIELD_PUBLIC, JavaElementImageDescriptor.STATIC, JavaElementImageProvider.SMALL_SIZE));
		case STATIC_FINAL:
			return registry.get(new JavaElementImageDescriptor(JavaPluginImages.DESC_FIELD_PUBLIC, JavaElementImageDescriptor.STATIC | JavaElementImageDescriptor.FINAL, JavaElementImageProvider.SMALL_SIZE));
		case ARGUMENT:
			return registry.get(JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE);
		default:
			return registry.get(JavaPluginImages.DESC_OBJS_LOCAL_VARIABLE);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:NameConventionConfigurationBlock.java

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

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

示例8: createTypeImageDescriptor

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
ImageDescriptor createTypeImageDescriptor(CompletionProposal proposal) {
  final int flags = proposal.getFlags();
  boolean isInterfaceOrAnnotation = Flags.isInterface(flags) || Flags.isAnnotation(flags);
  return decorateImageDescriptor(
      JavaElementImageProvider.getTypeImageDescriptor(
          true /* in order to get all visibility decorations */,
          isInterfaceOrAnnotation,
          flags,
          false),
      proposal);
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:CompletionProposalLabelProvider.java

示例9: getImageDescriptor

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
private ImageDescriptor getImageDescriptor(IJavaElement elem) {
  JavaElementImageProvider imageProvider = new JavaElementImageProvider();
  ImageDescriptor desc =
      imageProvider.getBaseImageDescriptor(elem, JavaElementImageProvider.OVERLAY_ICONS);
  imageProvider.dispose();
  return desc;
}
 
开发者ID:eclipse,项目名称:che,代码行数:8,代码来源:ParameterGuesser.java

示例10: getImageDescriptor

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
public ImageDescriptor getImageDescriptor(Object element) {
	TypeNameMatch type= (TypeNameMatch)element;
	if (fProviderExtension != null) {
		fAdapter.setMatch(type);
		ImageDescriptor descriptor= fProviderExtension.getImageDescriptor(fAdapter);
		if (descriptor != null)
			return descriptor;
	}
	return JavaElementImageProvider.getTypeImageDescriptor(
		isInnerType(type), false, type.getModifiers(), false);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:TypeInfoViewer.java

示例11: createTypeHierarchyLabel

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
private void createTypeHierarchyLabel(Composite composite) {
	fSimilarElementsLabel= new Label(composite, SWT.WRAP);
	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	gd.heightHint= JavaElementImageProvider.SMALL_SIZE.x;
	fSimilarElementsLabel.setLayoutData(gd);
	fSimilarElementsLabel.setText(RefactoringMessages.RenameTypeWizardSimilarElementsPage_review_similar_elements);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:RenameTypeWizardSimilarElementsPage.java

示例12: createSourceViewerLabel

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
private void createSourceViewerLabel(Composite c) {
	fCurrentElementLabel= new CLabel(c, SWT.NONE);
	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	gd.heightHint= JavaElementImageProvider.SMALL_SIZE.x;
	fCurrentElementLabel.setText(RefactoringMessages.RenameTypeWizardSimilarElementsPage_select_element_to_view_source);
	fCurrentElementLabel.setLayoutData(gd);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:RenameTypeWizardSimilarElementsPage.java

示例13: JavaElementLabelProvider

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
/**
 * Creates a new label provider.
 *
 * @param flags the initial options; a bitwise OR of <code>SHOW_* </code> constants
 */
public JavaElementLabelProvider(int flags) {
	fImageLabelProvider= new JavaElementImageProvider();
	fStorageLabelProvider= new StorageLabelProvider();
	fFlags= flags;
	updateImageProviderFlags();
	updateTextProviderFlags();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:JavaElementLabelProvider.java

示例14: updateImageProviderFlags

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
private void updateImageProviderFlags() {
	fImageFlags= 0;
	if (getFlag(SHOW_OVERLAY_ICONS)) {
		fImageFlags |= JavaElementImageProvider.OVERLAY_ICONS;
	}
	if (getFlag(SHOW_SMALL_ICONS)) {
		fImageFlags |= JavaElementImageProvider.SMALL_ICONS;
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:JavaElementLabelProvider.java

示例15: PackageExplorerLabelProvider

import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; //导入依赖的package包/类
public PackageExplorerLabelProvider(PackageExplorerContentProvider cp) {
	super(DEFAULT_TEXTFLAGS | JavaElementLabels.P_COMPRESSED | JavaElementLabels.ALL_CATEGORY, DEFAULT_IMAGEFLAGS | JavaElementImageProvider.SMALL_ICONS);

	fProblemDecorator= new PackageExplorerProblemsDecorator();
	addLabelDecorator(fProblemDecorator);
	Assert.isNotNull(cp);
	fContentProvider= cp;
	fWorkingSetImages= null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:PackageExplorerLabelProvider.java


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