@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData(ID, null, GoIcons.PACKAGE); }
private static void addNavigationElements(@NotNull TreeElement root, @NotNull TIntArrayList navigationOffsets, boolean start) { if (root instanceof PsiTreeElementBase) { PsiElement element = ((PsiTreeElementBase)root).getValue(); int offset; if (start) { offset = element.getTextRange().getStartOffset(); if (element.getLanguage().getID().equals("JAVA")) { // HACK: for Java classes and methods, we want to jump to the opening brace int textOffset = element.getTextOffset(); int braceIndex = element.getText().indexOf('{', textOffset - offset); if (braceIndex >= 0) { offset += braceIndex; } } } else { offset = element.getTextRange().getEndOffset() - 1; } if (!navigationOffsets.contains(offset)) { navigationOffsets.add(offset); } } for (TreeElement child : root.getChildren()) { addNavigationElements(child, navigationOffsets, start); } }
@Override public Comparator getComparator() { return (o1, o2) -> { String s1 = SorterUtil.getStringPresentation(o1); String s2 = SorterUtil.getStringPresentation(o2); return s1.compareTo(s2); }; }
List<String> passedFilters = new ArrayList<>(); for (Filter filter : structureViewModel.getFilters()) { if (filter.isVisible(currentElement)) { passedFilters.add(filter.getName()); Grouper grouper = groupPair.first; Group group = groupPair.second; ItemPresentation groupPresentation = group.getPresentation(); sb.append(prefix) .append("Grouped by: '").append(grouper.getPresentation().getText()).append("' (").append(grouper.getName()).append(") to ") .append(groupPresentation.getPresentableText()).append(" in ").append(groupPresentation.getLocationString()) .append("\n"); for (Grouper grouper : structureViewModel.getGroupers()) { for (Group group : grouper .group(new TreeElementWrapper(getProject(), currentElement, structureViewModel), Arrays.asList(children))) { for (TreeElement element : group.getChildren()) { groupingResults.putValue(element, Pair.create(grouper, group));
public void test(StructureViewComponent component) { StructureViewModel tree = component.getTreeModel(); Assert.assertNotNull(tree); StructureViewTreeElement root = tree.getRoot(); Assert.assertNotNull(root); TreeElement[] children = root.getChildren(); Assert.assertEquals(1, children.length); TreeElement firstChild = children[0]; Assert.assertNotNull(firstChild); Assert.assertEquals("a()", firstChild.getPresentation().getPresentableText()); Assert.assertNotNull(firstChild.getChildren()); Assert.assertEquals(0, firstChild.getChildren().length); } };
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData(PRIVATE_MEMBERS_FILTER_TEXT, null, PlatformIcons.PRIVATE_ICON); }
@Override public int compare(final Group o1, final Group o2) { if (o1 instanceof AssignmentTypeGroup && o2 instanceof AssignmentTypeGroup) { return ((AssignmentTypeGroup) o1).getPosition() - ((AssignmentTypeGroup) o2).getPosition(); } String s1 = SorterUtil.getStringPresentation(o1); String s2 = SorterUtil.getStringPresentation(o2); return s1.compareToIgnoreCase(s2); } }
/** * Returns the presentation for the action. * * @return the action presentation. * @see ActionPresentationData#ActionPresentationData(String, String, Icon) */ @NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData( "Sort by Visibility", "Sort into public, unknown, and private", AllIcons.ObjectBrowser.VisibilitySort ); }
/** * Returns the presentation for the action. * * @return the action presentation. * @see ActionPresentationData#ActionPresentationData(String, String, Icon) */ @NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData( "Sort by Time", "Sort into Compile Time, mixed, and Runtime groups", // TODO make an icon that is arrow + (compile + run) on side like SortByType does with type symbols AllIcons.ObjectBrowser.SortByType ); }
@NotNull public ActionPresentation getPresentation() { // how it's described in sort by dropdown in nav window. String name = "Sort by rule type"; return new ActionPresentationData(name, name, AllIcons.ObjectBrowser.SortByType); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show methods", null, PerlIcons.METHOD_GUTTER_ICON); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show documentation", null, PerlIcons.POD_FILE); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show constants", null, PerlIcons.CONSTANT_GUTTER_ICON); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show variables", null, PerlIcons.SCALAR_GUTTER_ICON); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show typeglobs", null, PerlIcons.GLOB_GUTTER_ICON); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show imported", null, AllIcons.ToolbarDecorator.Import); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show inherited", null, AllIcons.Hierarchy.Supertypes); }
@NotNull @Override public ActionPresentation getPresentation() { return new ActionPresentationData("Show declarations", null, PerlIcons.SUB_DECLARATION_GUTTER_ICON); }
@Override @NotNull public ActionPresentation getPresentation() { String message = ProtostuffBundle.message("action.structureview.show.fields"); return new ActionPresentationData(message, null, Icons.FIELD); }
@Override @NotNull public ActionPresentation getPresentation() { return new ActionPresentationData(IdeBundle.message("action.sort.alphabetically"), IdeBundle.message("action.sort.alphabetically"), ObjectBrowser.Sorted); }