Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * 12/22/2008
   *
   * DelegatingCellRenderer.java - A renderer for Completions that will delegate
   * to the Completion's provider's renderer, if there is one.
   * Copyright (C) 2008 Robert Futrell
   * robert_futrell at users.sourceforge.net
   * http://fifesoft.com/rsyntaxtextarea
   *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA.
  */
 package org.fife.ui.autocomplete;
 
List cell renderer that delegates to a 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 ((Completion)value).toString().

Author(s):
Robert Futrell
Version:
1.0
 
The renderer to fall back on if one isn't specified by a provider. This is usually this.
 
Returns the fallback cell renderer.

Returns:
The fallback cell renderer.
See also:
setFallbackCellRenderer(javax.swing.ListCellRenderer)
 
 		return ;
 	}


 
 						int indexboolean selectedboolean hasFocus) {
 		Completion c = (Completion)value;
 		if (r!=null) {
 			return r.getListCellRendererComponent(listvalueindexselected,
 													hasFocus);
 		}
 		if (==null) {
 			return super.getListCellRendererComponent(listvalueindex,
 												selectedhasFocus);
 		}
 		return .getListCellRendererComponent(listvalueindex,
 													selectedhasFocus);
 	}


Sets the fallback cell renderer.

Parameters:
fallback The fallback cell renderer. If this is null, this will be used.
See also:
getFallbackCellRenderer()
 
 	public void setFallbackCellRenderer(ListCellRenderer fallback) {
 		this. = fallback;
 	}


 
 	public void updateUI() {
 		super.updateUI();
		if (( instanceof JComponent) && !=this) {
		}
	}
New to GrepCode? Check out our FAQ X