本文整理汇总了Java中com.intellij.util.PlatformIcons类的典型用法代码示例。如果您正苦于以下问题:Java PlatformIcons类的具体用法?Java PlatformIcons怎么用?Java PlatformIcons使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PlatformIcons类属于com.intellij.util包,在下文中一共展示了PlatformIcons类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPresentation
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@NotNull
@Override
public ItemPresentation getPresentation() {
return new ItemPresentation() {
@Nullable
@Override
public String getPresentableText() {
return packageName;
}
@Nullable
@Override
public String getLocationString() {
return "";
}
@Nullable
@Override
public Icon getIcon(boolean b) {
return PlatformIcons.PACKAGE_ICON;
}
};
}
示例2: getPresentation
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@NotNull
@Override
public ItemPresentation getPresentation() {
return new ItemPresentation() {
@Nullable
@Override
public String getPresentableText() {
return presText;
}
@Nullable
@Override
public String getLocationString() {
return null;
}
@Nullable
@Override
public Icon getIcon(boolean b) {
return PlatformIcons.CLASS_ICON;
}
};
}
示例3: copyAction
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@NotNull
public CheckBoxListModelEditor<T> copyAction(final @NotNull Consumer<T> consumer) {
toolbarDecorator.addExtraAction(new ToolbarDecorator.ElementActionButton(IdeBundle.message("button.copy"), PlatformIcons.COPY_ICON) {
@Override
public void actionPerformed(AnActionEvent e) {
int[] indices = list.getSelectedIndices();
if (indices == null || indices.length == 0) {
return;
}
for (int index : indices) {
T item = list.getItemAt(index);
if (item != null) {
consumer.consume(item);
}
}
}
});
return this;
}
示例4: addCompletions
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext processingContext,
@NotNull CompletionResultSet result) {
final PsiElement original = parameters.getOriginalPosition();
if (original != null) {
result = result.withPrefixMatcher(getPrefix(parameters.getOffset(), parameters.getOriginalFile()));
SyntheticTypeInfo sti = processingContext.get(SYNTHETIC_TYPE_INFO_KEY);
if (sti.hasSyntheticConstructor()) {
for (SyntheticMemberInfo smi : sti.getMembers()) {
LookupElement lookupElement =
LookupElementBuilder
.create(smi.getName() + "=")
.withIcon(PlatformIcons.PARAMETER_ICON);
result.addElement(lookupElement);
}
}
}
}
示例5: lookupElementForFile
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
public FilePathLookupElement lookupElementForFile(
Project project, VirtualFile file, @Nullable WorkspacePath workspacePath) {
NullableLazyValue<Icon> icon =
new NullableLazyValue<Icon>() {
@Override
protected Icon compute() {
if (file.findChild("BUILD") != null) {
return BlazeIcons.BuildFile;
}
if (file.isDirectory()) {
return PlatformIcons.FOLDER_ICON;
}
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
return psiFile != null ? psiFile.getIcon(0) : AllIcons.FileTypes.Any_type;
}
};
String fullLabel =
workspacePath != null ? getFullLabel(workspacePath.relativePath()) : file.getPath();
String itemText = workspacePath != null ? getItemText(workspacePath.relativePath()) : fullLabel;
return new FilePathLookupElement(fullLabel, itemText, quoteType, icon);
}
示例6: getIcon
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@Override
public Icon getIcon(int flags) {
if (isValid()) {
final Property property = getProperty();
if (property != null) {
if (property.getGetter().valueOrNull() == this) {
return PythonIcons.Python.PropertyGetter;
}
if (property.getSetter().valueOrNull() == this) {
return PythonIcons.Python.PropertySetter;
}
if (property.getDeleter().valueOrNull() == this) {
return PythonIcons.Python.PropertyDeleter;
}
return PlatformIcons.PROPERTY_ICON;
}
if (getContainingClass() != null) {
return PlatformIcons.METHOD_ICON;
}
}
return PythonIcons.Python.Function;
}
示例7: getVariants
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@NotNull
public Object[] getVariants() {
final ASTNode categoryNode = getCategoryNode();
if (categoryNode != null && categoryNode.getText().startsWith("In") && !categoryNode.getText().startsWith("Intelli")) {
return UNICODE_BLOCKS;
}
else {
boolean startsWithIs = categoryNode != null && categoryNode.getText().startsWith("Is");
Collection<LookupElement> result = ContainerUtil.newArrayList();
for (String[] properties : RegExpLanguageHosts.getInstance().getAllKnownProperties(getElement())) {
String name = ArrayUtil.getFirstElement(properties);
if (name != null) {
String typeText = properties.length > 1 ? properties[1] : ("Character.is" + name.substring("java".length()) + "()");
result.add(PrioritizedLookupElement.withPriority(LookupElementBuilder.create(name)
.withPresentableText(startsWithIs ? "Is" + name : name)
.withIcon(PlatformIcons.PROPERTY_ICON)
.withTypeText(typeText), getPriority(name)));
}
}
return ArrayUtil.toObjectArray(result);
}
}
示例8: addToArrayConversion
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
private static void addToArrayConversion(final PsiElement element, final String prefix, @NonNls final String expressionString, @NonNls String presentableString, final Consumer<LookupElement> result, PsiElement qualifier) {
final boolean callSpace = CodeStyleSettingsManager.getSettings(element.getProject()).SPACE_WITHIN_METHOD_CALL_PARENTHESES;
final PsiExpression conversion;
try {
conversion = createExpression(
getQualifierText(qualifier) + prefix + ".toArray(" + getSpace(callSpace) + expressionString + getSpace(callSpace) + ")", element);
}
catch (IncorrectOperationException e) {
return;
}
String[] lookupStrings = {prefix + ".toArray(" + getSpace(callSpace) + expressionString + getSpace(callSpace) + ")", presentableString};
result.consume(new ExpressionLookupItem(conversion, PlatformIcons.METHOD_ICON, prefix + ".toArray(" + presentableString + ")", lookupStrings) {
@Override
public void handleInsert(InsertionContext context) {
FeatureUsageTracker.getInstance().triggerFeatureUsed(JavaCompletionFeatures.SECOND_SMART_COMPLETION_TOAR);
context.commitDocument();
JavaCodeStyleManager.getInstance(context.getProject()).shortenClassReferences(context.getFile(), context.getStartOffset(), context.getTailOffset());
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ReferenceExpressionCompletionContributor.java
示例9: getListCellRendererComponent
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
final Component rendererComponent = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof String) {
final String path = (String)value;
final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(path);
if (file == null) {
setForeground(JBColor.RED);
setIcon(null);
}
else {
setForeground(myFilesList.getForeground());
setIcon(file.isDirectory() ? PlatformIcons.FOLDER_ICON : VirtualFilePresentation.getIcon(file));
}
setText(path);
}
return rendererComponent;
}
示例10: createComponent
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@NotNull
public JComponent createComponent() {
return toolbarDecorator.addExtraAction(
new ToolbarDecorator.ElementActionButton(IdeBundle.message("button.copy"), PlatformIcons.COPY_ICON) {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
TableUtil.stopEditing(table);
List<T> selectedItems = table.getSelectedObjects();
if (selectedItems.isEmpty()) {
return;
}
for (T item : selectedItems) {
model.addRow(itemEditor.clone(item, false));
}
table.requestFocus();
TableUtil.updateScroller(table);
}
}
).createPanel();
}
示例11: createActions
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
public VcsCommittedViewAuxiliary createActions(DecoratorManager decoratorManager, RepositoryLocation repositoryLocation) {
AnAction copyHashAction = new AnAction("Copy &Hash", "Copy hash to clipboard", PlatformIcons.COPY_ICON) {
@Override
public void actionPerformed(AnActionEvent e) {
ChangeList[] changeLists = e.getData(VcsDataKeys.CHANGE_LISTS);
if (changeLists != null && changeLists[0] instanceof HgCommittedChangeList) {
HgRevisionNumber revisionNumber = ((HgCommittedChangeList)changeLists[0]).getRevision();
CopyPasteManager.getInstance().setContents(new StringSelection(revisionNumber.getChangeset()));
}
}
};
return new VcsCommittedViewAuxiliary(Collections.singletonList(copyHashAction), new Runnable() {
public void run() {
}
}, Collections.singletonList(copyHashAction));
}
示例12: render
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@Override
public void render(@NotNull PresentationData presentationData, SimpleTextAttributes mainAttributes,
SimpleTextAttributes commentAttributes) {
final String name = myLibrary.getName();
if (name != null) {
presentationData.setIcon(PlatformIcons.LIBRARY_ICON);
presentationData.addText(name, mainAttributes);
presentationData.addText(LibraryElementPresentation.getLibraryTableComment(myLibrary), commentAttributes);
}
else {
if (((LibraryEx)myLibrary).isDisposed()) {
//todo[nik] disposed library should not be shown in the tree
presentationData.addText("Invalid Library", SimpleTextAttributes.ERROR_ATTRIBUTES);
return;
}
final VirtualFile[] files = myLibrary.getFiles(OrderRootType.CLASSES);
if (files.length > 0) {
final VirtualFile file = files[0];
presentationData.setIcon(VirtualFilePresentation.getIcon(file));
presentationData.addText(file.getName(), mainAttributes);
}
else {
presentationData.addText("Empty Library", SimpleTextAttributes.ERROR_ATTRIBUTES);
}
}
}
示例13: subInit
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@Override
protected void subInit() {
super.subInit();
this.myMessageTextField = new EditorTextField("");
this.myKindUpDownHint = new JLabel();
this.myKindUpDownHint.setIcon(PlatformIcons.UP_DOWN_ARROWS);
this.myKindUpDownHint.setToolTipText(PhpBundle.message("actions.new.php.base.arrows.kind.tooltip"));
this.myKindComboBox = new ComboBox<String>();
this.myKindComboBox.setMinimumAndPreferredWidth(400);
this.myKindComboBox.setRenderer(new ListCellRendererWrapper<Trinity>() {
public void customize(JList list, Trinity value, int index, boolean selected, boolean hasFocus) {
this.setText((String)value.first);
this.setIcon((Icon)value.second);
}
});
ComboboxSpeedSearch var10001 = new ComboboxSpeedSearch(this.myKindComboBox) {
protected String getElementText(Object element) {
return (String)((Trinity)element).first;
}
};
KeyboardShortcut up = new KeyboardShortcut(KeyStroke.getKeyStroke(38, 0), (KeyStroke)null);
KeyboardShortcut down = new KeyboardShortcut(KeyStroke.getKeyStroke(40, 0), (KeyStroke)null);
AnAction kindArrow = PhpNewFileDialog.getCbArrowAction(this.myKindComboBox);
kindArrow.registerCustomShortcutSet(new CustomShortcutSet(new Shortcut[]{up, down}), this.myNameTextField);
List<Trinity> exceptionTypes = this.getExceptionTypes();
for(Trinity type : exceptionTypes) {
this.myKindComboBox.addItem(type);
}
}
示例14: getPresentation
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@NotNull
@Override
public ItemPresentation getPresentation() {
return new ItemPresentation() {
@Nullable
@Override
public String getPresentableText() {
if (refDecl.getText().trim().startsWith("ref*")) {
return "*" + relText(refDecl) + " : " + simpleType;
} else {
return relText(refDecl) + " : " + simpleType;
}
}
@Nullable
@Override
public String getLocationString() {
return null;
}
@Nullable
@Override
public Icon getIcon(boolean b) {
return PlatformIcons.PROPERTY_ICON;
}
};
}
示例15: update
import com.intellij.util.PlatformIcons; //导入依赖的package包/类
@Override
public void update(AnActionEvent e) {
super.update(e);
final InspectionProfileImpl inspectionProfile = getInspectionProfile();
final Icon icon = AllIcons.General.Gear;
e.getPresentation().setIcon(
(inspectionProfile != null && inspectionProfile.isProfileLocked()) ? LayeredIcon.create(icon, PlatformIcons.LOCKED_ICON) : icon);
}