FinderRecursivePanel: reorder methods

This commit is contained in:
Konstantin Aleev
2017-03-31 15:23:54 +03:00
parent 54b51e7b41
commit a4e4356f7c
@@ -156,6 +156,22 @@ public abstract class FinderRecursivePanel<T> extends OnePixelSplitter implement
return null;
}
/**
* Returns tooltip text for the given list item or null if no tooltip is available.
*
* <p>This method is invoked by panel's list cell render in order to set a tooltip text for the list cell render component.
* It is invoked before {@link #doCustomizeCellRenderer(SimpleColoredComponent, JList, Object, int, boolean, boolean)},
* thus the tooltip may still be reset in {@code doCustomizeCellRenderer}.
*
* @param t the list item
* @return the text to display in a tooltip for the given list item
* @since 2017.2
*/
@Nullable
protected String getItemTooltipText(T t) {
return null;
}
protected abstract boolean hasChildren(T t);
/**
@@ -341,7 +357,7 @@ public abstract class FinderRecursivePanel<T> extends OnePixelSplitter implement
try {
setIcon(getItemIcon(t));
append(getItemText(t));
this.setToolTipText(getItemTooltipText(t));
setToolTipText(getItemTooltipText(t));
}
catch (IndexNotReadyException e) {
append("loading...");
@@ -375,7 +391,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());
result.setToolTipText(getToolTipText());
return result;
}
return this;
@@ -390,20 +406,6 @@ 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) {