本文整理汇总了Java中org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider.SMALL_SIZE属性的典型用法代码示例。如果您正苦于以下问题:Java JavaElementImageProvider.SMALL_SIZE属性的具体用法?Java JavaElementImageProvider.SMALL_SIZE怎么用?Java JavaElementImageProvider.SMALL_SIZE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider
的用法示例。
在下文中一共展示了JavaElementImageProvider.SMALL_SIZE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MethodDeclarationCompletionProposal
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,代码行数:18,代码来源:MethodDeclarationCompletionProposal.java
示例2: decorateImageDescriptor
/**
* Returns a version of <code>descriptor</code> decorated according to
* the passed <code>modifier</code> flags.
*
* @param descriptor the image descriptor to decorate
* @param proposal the proposal
* @return an image descriptor for a method proposal
* @see Flags
*/
private ImageDescriptor decorateImageDescriptor(ImageDescriptor descriptor, CompletionProposal proposal) {
int adornments= 0;
int flags= proposal.getFlags();
int kind= proposal.getKind();
boolean deprecated= Flags.isDeprecated(flags);
if (!deprecated) {
CompletionProposal[] requiredProposals= proposal.getRequiredProposals();
if (requiredProposals != null) {
for (int i= 0; i < requiredProposals.length; i++) {
CompletionProposal requiredProposal= requiredProposals[i];
if (requiredProposal.getKind() == CompletionProposal.TYPE_REF) {
deprecated |= Flags.isDeprecated(requiredProposal.getFlags());
}
}
}
}
if (deprecated)
adornments |= JavaElementImageDescriptor.DEPRECATED;
if (kind == CompletionProposal.FIELD_REF || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.METHOD_NAME_REFERENCE
|| kind == CompletionProposal.METHOD_REF || kind == CompletionProposal.CONSTRUCTOR_INVOCATION)
if (Flags.isStatic(flags))
adornments |= JavaElementImageDescriptor.STATIC;
if (kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.METHOD_NAME_REFERENCE || kind == CompletionProposal.METHOD_REF
|| kind == CompletionProposal.CONSTRUCTOR_INVOCATION)
if (Flags.isSynchronized(flags))
adornments |= JavaElementImageDescriptor.SYNCHRONIZED;
if (kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.METHOD_NAME_REFERENCE || kind == CompletionProposal.METHOD_REF)
if (Flags.isDefaultMethod(flags))
adornments|= JavaElementImageDescriptor.DEFAULT_METHOD;
if (kind == CompletionProposal.ANNOTATION_ATTRIBUTE_REF)
if (Flags.isAnnnotationDefault(flags))
adornments|= JavaElementImageDescriptor.ANNOTATION_DEFAULT;
if (kind == CompletionProposal.TYPE_REF && Flags.isAbstract(flags) && !Flags.isInterface(flags))
adornments |= JavaElementImageDescriptor.ABSTRACT;
if (kind == CompletionProposal.FIELD_REF) {
if (Flags.isFinal(flags))
adornments |= JavaElementImageDescriptor.FINAL;
if (Flags.isTransient(flags))
adornments |= JavaElementImageDescriptor.TRANSIENT;
if (Flags.isVolatile(flags))
adornments |= JavaElementImageDescriptor.VOLATILE;
}
return new JavaElementImageDescriptor(descriptor, adornments, JavaElementImageProvider.SMALL_SIZE);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:59,代码来源:CompletionProposalLabelProvider.java
示例3: evaluateVisibleMatches
private List<Variable> evaluateVisibleMatches(String expectedType, IJavaElement[] suggestions) throws JavaModelException {
IType currentType= null;
if (fEnclosingElement != null) {
currentType= (IType) fEnclosingElement.getAncestor(IJavaElement.TYPE);
}
ArrayList<Variable> res= new ArrayList<Variable>();
for (int i= 0; i < suggestions.length; i++) {
Variable variable= createVariable(suggestions[i], currentType, expectedType, i);
if (variable != null) {
if (fAlreadyMatchedNames.contains(variable.name)) {
variable.alreadyMatched= true;
}
res.add(variable);
}
}
// add 'this'
if (currentType != null && !(fEnclosingElement instanceof IMethod && Flags.isStatic(((IMethod) fEnclosingElement).getFlags()))) {
String fullyQualifiedName= currentType.getFullyQualifiedName('.');
if (fullyQualifiedName.equals(expectedType)) {
ImageDescriptor desc= new JavaElementImageDescriptor(JavaPluginImages.DESC_FIELD_PUBLIC, JavaElementImageDescriptor.FINAL | JavaElementImageDescriptor.STATIC, JavaElementImageProvider.SMALL_SIZE);
res.add(new Variable(fullyQualifiedName, "this", Variable.LITERALS, false, res.size(), new char[] {'.'}, desc)); //$NON-NLS-1$
}
}
Code primitiveTypeCode= getPrimitiveTypeCode(expectedType);
if (primitiveTypeCode == null) {
// add 'null'
res.add(new Variable(expectedType, "null", Variable.LITERALS, false, res.size(), NO_TRIGGERS, null)); //$NON-NLS-1$
} else {
String typeName= primitiveTypeCode.toString();
boolean isAutoboxing= !typeName.equals(expectedType);
if (primitiveTypeCode == PrimitiveType.BOOLEAN) {
// add 'true', 'false'
res.add(new Variable(typeName, "true", Variable.LITERALS, isAutoboxing, res.size(), NO_TRIGGERS, null)); //$NON-NLS-1$
res.add(new Variable(typeName, "false", Variable.LITERALS, isAutoboxing, res.size(), NO_TRIGGERS, null)); //$NON-NLS-1$
} else {
// add 0
res.add(new Variable(typeName, "0", Variable.LITERALS, isAutoboxing, res.size(), NO_TRIGGERS, null)); //$NON-NLS-1$
}
}
return res;
}
示例4: getCPListElementBaseImage
private ImageDescriptor getCPListElementBaseImage(CPListElement cpentry) {
switch (cpentry.getEntryKind()) {
case IClasspathEntry.CPE_SOURCE:
if (cpentry.getPath().segmentCount() == 1) {
return fProjectImage;
} else {
return fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_PACKFRAG_ROOT);
}
case IClasspathEntry.CPE_LIBRARY:
IResource res= cpentry.getResource();
IPath path= (IPath) cpentry.getAttribute(CPListElement.SOURCEATTACHMENT);
if (res == null) {
if (ArchiveFileFilter.isArchivePath(cpentry.getPath(), true)) {
if (path == null || path.isEmpty()) {
return fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE);
} else {
return fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_EXTERNAL_ARCHIVE_WITH_SOURCE);
}
} else {
if (path == null || path.isEmpty()) {
return JavaPluginImages.DESC_OBJS_CLASSFOLDER;
} else {
return JavaPluginImages.DESC_OBJS_CLASSFOLDER_WSRC;
}
}
} else if (res instanceof IFile) {
if (path == null || path.isEmpty()) {
return fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_JAR);
} else {
return fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_JAR_WITH_SOURCE);
}
} else {
return fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_PACKFRAG_ROOT);
}
case IClasspathEntry.CPE_PROJECT:
return fProjectImage;
case IClasspathEntry.CPE_VARIABLE:
ImageDescriptor variableImage= fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_CLASSPATH_VAR_ENTRY);
if (cpentry.isDeprecated()) {
return new JavaElementImageDescriptor(variableImage, JavaElementImageDescriptor.DEPRECATED, JavaElementImageProvider.SMALL_SIZE);
}
return variableImage;
case IClasspathEntry.CPE_CONTAINER:
return fSharedImages.getImageDescriptor(ISharedImages.IMG_OBJS_LIBRARY);
default:
return null;
}
}
示例5: decorateImageDescriptor
/**
* Returns a version of <code>descriptor</code> decorated according to
* the passed <code>modifier</code> flags.
*
* @param descriptor the image descriptor to decorate
* @param proposal the proposal
* @return an image descriptor for a method proposal
* @see Flags
*/
private ImageDescriptor decorateImageDescriptor(ImageDescriptor descriptor, CompletionProposal proposal) {
int adornments= 0;
int flags= proposal.getFlags();
int kind= proposal.getKind();
boolean deprecated= Flags.isDeprecated(flags);
if (!deprecated) {
CompletionProposal[] requiredProposals= proposal.getRequiredProposals();
if (requiredProposals != null) {
for (int i= 0; i < requiredProposals.length; i++) {
CompletionProposal requiredProposal= requiredProposals[i];
if (requiredProposal.getKind() == CompletionProposal.TYPE_REF) {
deprecated |= Flags.isDeprecated(requiredProposal.getFlags());
}
}
}
}
if (deprecated)
adornments |= JavaElementImageDescriptor.DEPRECATED;
if (kind == CompletionProposal.FIELD_REF || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.METHOD_NAME_REFERENCE
|| kind == CompletionProposal.METHOD_REF || kind == CompletionProposal.CONSTRUCTOR_INVOCATION)
if (Flags.isStatic(flags))
adornments |= JavaElementImageDescriptor.STATIC;
if (kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.METHOD_DECLARATION || kind == CompletionProposal.METHOD_NAME_REFERENCE || kind == CompletionProposal.METHOD_REF
|| kind == CompletionProposal.CONSTRUCTOR_INVOCATION)
if (Flags.isSynchronized(flags))
adornments |= JavaElementImageDescriptor.SYNCHRONIZED;
if (kind == CompletionProposal.TYPE_REF && Flags.isAbstract(flags) && !Flags.isInterface(flags))
adornments |= JavaElementImageDescriptor.ABSTRACT;
if (kind == CompletionProposal.FIELD_REF) {
if (Flags.isFinal(flags))
adornments |= JavaElementImageDescriptor.FINAL;
if (Flags.isTransient(flags))
adornments |= JavaElementImageDescriptor.TRANSIENT;
if (Flags.isVolatile(flags))
adornments |= JavaElementImageDescriptor.VOLATILE;
}
return new JavaElementImageDescriptor(descriptor, adornments, JavaElementImageProvider.SMALL_SIZE);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:53,代码来源:CompletionProposalLabelProvider.java