Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.awt 6.7.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.awt
Interface HtmlRenderer.Renderer

All Superinterfaces:
  ListCellRenderer, TableCellRenderer, TreeCellRenderer

Enclosing class:
  HtmlRenderer

    public static interface HtmlRenderer.Renderer

extends TableCellRenderer, TreeCellRenderer, ListCellRenderer

Interface aggregating table, tree, and list cell renderers.

See Also:
  `HtmlRenderer.createRenderer()`, `HtmlRenderer.createLabel()`

Method Summary
`void` | `reset()` Clear any stale data from previous use by other components, clearing the icon, text, disabled state and other customizations, returning the component to its initialized state.
`void` | `setCentered(boolean centered)` Indicate that the text should be painted centered below the icon.
`void` | `setHtml(boolean val)` Explicitly tell the renderer it is going to receive HTML markup, or it is not.
`void` | `setIcon(Icon icon)` Set the icon to be used for painting
`void` | `setIconTextGap(int gap)` Convenience method to set the gap between the icon and text.
`void` | `setIndent(int pixels)` Set a number of pixels the icon and text should be indented.
`void` | `setParentFocused(boolean parentFocused)` Indicate that the component being rendered has keyboard focus.
`void` | `setRenderStyle(int style)` Set the rendering style - this can be JLabel-style truncated-with-elipsis (...) text, or clipped text.
`void` | `setText(String txt)` Set the text to be displayed.

Methods inherited from interface javax.swing.table.TableCellRenderer
`getTableCellRendererComponent`

Methods inherited from interface javax.swing.tree.TreeCellRenderer
`getTreeCellRendererComponent`

Methods inherited from interface javax.swing.ListCellRenderer
`getListCellRendererComponent`

Method Detail

### setParentFocused

    void setParentFocused(boolean parentFocused)

  Indicate that the component being rendered has keyboard focus. NetBeans requires that a different selection color be used depending on whether the view has focus.

  Parameters:
    `parentFocused` - Whether or not the focused selection color should be used

### setCentered

    void setCentered(boolean centered)

  Indicate that the text should be painted centered below the icon. This is primarily used by org.openide.explorer.view.IconView

  Parameters:
    `centered` - Whether or not centered painting should be used.

### setIndent

    void setIndent(int pixels)

  Set a number of pixels the icon and text should be indented. Used by ChoiceView and ListView to fake tree-style nesting. This value has no effect if `setCentered(true)` has been called.

  Parameters:
    `pixels` - The number of pixels to indent

### setHtml

    void setHtml(boolean val)

  Explicitly tell the renderer it is going to receive HTML markup, or it is not. If the renderer should check the string for opening HTML tags to determine this, don't call this method. If you know the string will be compliant HTML, it is preferable to call this method with true; if you want to intentionally render HTML markup literally, call this method with false.

  Parameters:
    `val` -

### setRenderStyle

    void setRenderStyle(int style)

  Set the rendering style - this can be JLabel-style truncated-with-elipsis (...) text, or clipped text. The default is `HtmlRenderer.STYLE_CLIP`.

  Parameters:
    `style` - The text style

### setIcon

    void setIcon(Icon icon)

  Set the icon to be used for painting

  Parameters:
    `icon` - An icon or null

### reset

    void reset()

  Clear any stale data from previous use by other components, clearing the icon, text, disabled state and other customizations, returning the component to its initialized state. This is done automatically when get*CellRenderer() is called, and to the shared instance when `HtmlRenderer.createLabel()` is called.

  Users of the static `HtmlRenderer.createLabel()` method may want to call this method if they use the returned instance more than once without again calling `HtmlRenderer.createLabel()`.

### setText

    void setText(String txt)

  Set the text to be displayed. Use this if the object being rendered's toString() does not return a real user-displayable string, after calling get**CellRenderer(). Typically after calling this one calls `setHtml(boolean)` if the text is known to either be or not be HTML markup.

  Parameters:
    `txt` - The text that should be displayed

### setIconTextGap

    void setIconTextGap(int gap)

  Convenience method to set the gap between the icon and text.

  Parameters:
    `gap` - an integer number of pixels

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.awt 6.7.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.