當前位置: 首頁>>代碼示例>>Java>>正文


Java PlatformIcons類代碼示例

本文整理匯總了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;
        }
    };
}
 
開發者ID:datathings,項目名稱:greycat-idea-plugin,代碼行數:24,代碼來源:GCMStructureViewPackageElement.java

示例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;
        }
    };
}
 
開發者ID:datathings,項目名稱:greycat-idea-plugin,代碼行數:24,代碼來源:GCMStructureViewClassElement.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:CheckBoxListModelEditor.java

示例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);
            }
        }
    }
}
 
開發者ID:jhominal,項目名稱:pysynthetic-intellij,代碼行數:21,代碼來源:SyntheticInitArgsCompletionContributor.java

示例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);
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:22,代碼來源:FileLookupData.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:PyFunctionImpl.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:RegExpPropertyImpl.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:AppEngineFacetEditor.java

示例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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:24,代碼來源:TableModelEditor.java

示例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));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:HgCachingCommittedChangesProvider.java

示例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);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:LibrarySourceItem.java

示例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);
    }
}
 
開發者ID:aurimasniekis,項目名稱:idea-php-class-templates,代碼行數:34,代碼來源:PhpNewExceptionClassDialog.java

示例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;
        }
    };
}
 
開發者ID:datathings,項目名稱:greycat-idea-plugin,代碼行數:28,代碼來源:GCMStructureViewReferenceElement.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:AdvancedSettingsAction.java


注:本文中的com.intellij.util.PlatformIcons類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。