mirror of
https://github.com/SuspiciousActivity/ByteEdit.git
synced 2026-08-13 17:56:17 +00:00
Fixes and updates
This commit is contained in:
1 parent
d1710ea6a5
commit
fb4da77359
211 files changed
+45363
-45571
No files matched your search
@@ -15,22 +15,22 @@ import javax.swing.JList;
|
||||
import javax.swing.ListCellRenderer;
|
||||
|
||||
/**
|
||||
* List cell renderer that delegates to a {@link CompletionProvider}'s
|
||||
* renderer, if it has one. If it doesn't, it calls into a fallback renderer.
|
||||
* If a fallback renderer isn't specified, it simply renders
|
||||
* List cell renderer that delegates to a {@link CompletionProvider}'s renderer,
|
||||
* if it has one. If it doesn't, it calls into a fallback renderer. If a
|
||||
* fallback renderer isn't specified, it simply renders
|
||||
* <code>(({@link Completion})value).toString()</code>.
|
||||
*
|
||||
* @author Robert Futrell
|
||||
* @version 1.0
|
||||
*/
|
||||
class DelegatingCellRenderer extends DefaultListCellRenderer {
|
||||
|
||||
|
||||
/**
|
||||
* The renderer to fall back on if one isn't specified by a provider.
|
||||
* This is usually <tt>this</tt>.
|
||||
* The renderer to fall back on if one isn't specified by a provider. This is
|
||||
* usually <tt>this</tt>.
|
||||
*/
|
||||
private ListCellRenderer fallback;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the fallback cell renderer.
|
||||
*
|
||||
@@ -40,12 +40,13 @@ class DelegatingCellRenderer extends DefaultListCellRenderer {
|
||||
public ListCellRenderer getFallbackCellRenderer() {
|
||||
return fallback;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean selected, boolean hasFocus) {
|
||||
public Component getListCellRendererComponent(JList list, Object value, int index, boolean selected,
|
||||
boolean hasFocus) {
|
||||
Completion c = (Completion) value;
|
||||
CompletionProvider p = c.getProvider();
|
||||
ListCellRenderer r = p.getListCellRenderer();
|
||||
@@ -57,19 +58,18 @@ class DelegatingCellRenderer extends DefaultListCellRenderer {
|
||||
}
|
||||
return fallback.getListCellRendererComponent(list, value, index, selected, hasFocus);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the fallback cell renderer.
|
||||
*
|
||||
* @param fallback
|
||||
* The fallback cell renderer. If this is
|
||||
* <code>null</code>, <tt>this</tt> will be used.
|
||||
* @param fallback The fallback cell renderer. If this is <code>null</code>,
|
||||
* <tt>this</tt> will be used.
|
||||
* @see #getFallbackCellRenderer()
|
||||
*/
|
||||
public void setFallbackCellRenderer(ListCellRenderer fallback) {
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user