Merge remote-tracking branch 'origin/master'

This commit is contained in:
Kirill Kirichenko
2017-03-31 15:04:12 +03:00
@@ -190,7 +190,7 @@ public abstract class FinderRecursivePanel<T> extends OnePixelSplitter implement
ScrollPaneFactory.createScrollPane(myList,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
return ListWithFilter.wrap(myList, pane, (Function<T, String>)o -> getItemText(o));
return ListWithFilter.wrap(myList, pane, o -> getItemText(o));
}
protected JBList<T> createList() {
@@ -298,13 +298,8 @@ public abstract class FinderRecursivePanel<T> extends OnePixelSplitter implement
}
private void installSpeedSearch(JBList list) {
final ListSpeedSearch search = new ListSpeedSearch(list, new Function<Object, String>() {
@Override
public String fun(Object o) {
//noinspection unchecked
return getItemText((T)o);
}
});
//noinspection unchecked
final ListSpeedSearch search = new ListSpeedSearch(list, (Function<Object, String>)o -> getItemText((T)o));
search.setComparator(new SpeedSearchComparator(false));
}
@@ -346,6 +341,7 @@ public abstract class FinderRecursivePanel<T> extends OnePixelSplitter implement
try {
setIcon(getItemIcon(t));
append(getItemText(t));
this.setToolTipText(getItemTooltipText(t));
}
catch (IndexNotReadyException e) {
append("loading...");
@@ -379,6 +375,7 @@ public abstract class FinderRecursivePanel<T> extends OnePixelSplitter implement
: AllIcons.Icons.Ide.NextStepGrayed);
result.add(this, BorderLayout.CENTER);
result.add(childrenLabel, BorderLayout.EAST);
result.setToolTipText(this.getToolTipText());
return result;
}
return this;
@@ -393,6 +390,20 @@ public abstract class FinderRecursivePanel<T> extends OnePixelSplitter implement
protected void doCustomizeCellRenderer(SimpleColoredComponent comp, JList list, T value, int index, boolean selected, boolean hasFocus) {
}
/**
* This method is invoked by panel's list cell render in order to set a tool tip text for the list cell render component.
* It is invoked before {@link #doCustomizeCellRenderer(SimpleColoredComponent, JList, Object, int, boolean, boolean)},
* thus the tool tip may still be reset in {@link #doCustomizeCellRenderer(SimpleColoredComponent, JList, Object, int, boolean, boolean)}.
*
* @param t the list item
* @return the text to display in a tool tip for the given list item
* @since 2017.2
*/
@Nullable
protected String getItemTooltipText(T t) {
return null;
}
@Nullable
@Override
public Object getData(@NonNls String dataId) {