CheckBoxProvider
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.jdesktop.swingx.renderer.CheckBoxProvider(Showing top 15 results out of 315)

origin: org.swinglabs.swingx/swingx-core

/**
 * Instantiates a CheckBoxProvider with the given StringValue and
 * alignment. 
 * 
 * @param stringValue the StringValue to use for formatting.
 * @param alignment the horizontalAlignment.
 */
public CheckBoxProvider(StringValue stringValue, int alignment) {
  super(stringValue == null ? StringValues.EMPTY : stringValue, alignment);
  setBorderPainted(true);
}
origin: org.swinglabs/swingx-core

/**
 * {@inheritDoc}<p>
 * 
 * Here: set's the buttons horizontal alignment and borderpainted properties
 * to this provider's properties.
 */
@Override
protected void configureState(CellContext context) {
  rendererComponent.setBorderPainted(isBorderPainted());
  rendererComponent.setHorizontalAlignment(getHorizontalAlignment());
}
origin: org.netbeans.modules/org-netbeans-modules-db-dataview

@SuppressWarnings("deprecation")
protected void setDefaultCellRenderers() {
  setDefaultRenderer(Object.class, new ResultSetCellRenderer());
  setDefaultRenderer(String.class, new ResultSetCellRenderer());
  setDefaultRenderer(Number.class, new ResultSetCellRenderer(StringValues.NUMBER_TO_STRING, JLabel.RIGHT));
  setDefaultRenderer(Boolean.class, new ResultSetCellRenderer(new CheckBoxProvider()));
  setDefaultRenderer(java.sql.Date.class, new ResultSetCellRenderer(StringValues.DATE_TO_STRING));
  setDefaultRenderer(java.sql.Time.class, new ResultSetCellRenderer(ResultSetCellRenderer.TIME_TO_STRING));
  setDefaultRenderer(java.sql.Timestamp.class, new ResultSetCellRenderer(ResultSetCellRenderer.DATETIME_TO_STRING));
  setDefaultRenderer(java.util.Date.class, new ResultSetCellRenderer(ResultSetCellRenderer.DATETIME_TO_STRING));
}
origin: org.swinglabs.swingx/swingx-all

/**
 * {@inheritDoc} <p>
 * Overridden to set the button's selected state and text.<p>
 * 
 *  PENDING: set icon?
 *  
 *  @see #getValueAsBoolean(CellContext)
 *  @see #getValueAsString(CellContext)
 */
@Override
protected void format(CellContext context) {
  rendererComponent.setSelected(getValueAsBoolean(context));
  rendererComponent.setText(getValueAsString(context));
}
origin: RaiMan/SikuliX-2014

/**
 * {@inheritDoc}<p>
 *
 * Here: set's the buttons horizontal alignment and borderpainted properties
 * to this provider's properties.
 */
@Override
protected void configureState(CellContext context) {
  rendererComponent.setBorderPainted(isBorderPainted());
  rendererComponent.setHorizontalAlignment(getHorizontalAlignment());
}
origin: RaiMan/SikuliX-2014

/**
 * Instantiates a CheckBoxProvider with the given StringValue and
 * alignment.
 *
 * @param stringValue the StringValue to use for formatting.
 * @param alignment the horizontalAlignment.
 */
public CheckBoxProvider(StringValue stringValue, int alignment) {
  super(stringValue == null ? StringValues.EMPTY : stringValue, alignment);
  setBorderPainted(true);
}
origin: org.swinglabs.swingx/swingx-all

/**
 * Instantiates a CheckBoxProvider with the given StringValue and
 * alignment. 
 * 
 * @param stringValue the StringValue to use for formatting.
 * @param alignment the horizontalAlignment.
 */
public CheckBoxProvider(StringValue stringValue, int alignment) {
  super(stringValue == null ? StringValues.EMPTY : stringValue, alignment);
  setBorderPainted(true);
}
origin: org.swinglabs.swingx/swingx-all

/**
 * {@inheritDoc}<p>
 * 
 * Here: set's the buttons horizontal alignment and borderpainted properties
 * to this provider's properties.
 */
@Override
protected void configureState(CellContext context) {
  rendererComponent.setBorderPainted(isBorderPainted());
  rendererComponent.setHorizontalAlignment(getHorizontalAlignment());
}
origin: org.swinglabs/swingx

/**
 * {@inheritDoc}<p>
 * 
 * Here: set's the buttons horizontal alignment and borderpainted properties
 * to this provider's properties.
 */
@Override
protected void configureState(CellContext context) {
  rendererComponent.setBorderPainted(isBorderPainted());
  rendererComponent.setHorizontalAlignment(getHorizontalAlignment());
}
origin: org.swinglabs.swingx/swingx-core

/**
 * {@inheritDoc}<p>
 * 
 * Here: set's the buttons horizontal alignment and borderpainted properties
 * to this provider's properties.
 */
@Override
protected void configureState(CellContext context) {
  rendererComponent.setBorderPainted(isBorderPainted());
  rendererComponent.setHorizontalAlignment(getHorizontalAlignment());
}
origin: org.swinglabs/swingx

/**
 * Instantiates a CheckBoxProvider with the given StringValue and
 * alignment. 
 * 
 * @param stringValue the StringValue to use for formatting.
 * @param alignment the horizontalAlignment.
 */
public CheckBoxProvider(StringValue stringValue, int alignment) {
  super(stringValue == null ? StringValues.EMPTY : stringValue, alignment);
  setBorderPainted(true);
}
origin: org.swinglabs/swingx-core

/**
 * Instantiates a CheckBoxProvider with the given StringValue and
 * alignment. 
 * 
 * @param stringValue the StringValue to use for formatting.
 * @param alignment the horizontalAlignment.
 */
public CheckBoxProvider(StringValue stringValue, int alignment) {
  super(stringValue == null ? StringValues.EMPTY : stringValue, alignment);
  setBorderPainted(true);
}
origin: org.swinglabs.swingx/swingx-core

/**
 * {@inheritDoc} <p>
 * Overridden to set the button's selected state and text.<p>
 * 
 *  PENDING: set icon?
 *  
 *  @see #getValueAsBoolean(CellContext)
 *  @see #getValueAsString(CellContext)
 */
@Override
protected void format(CellContext context) {
  rendererComponent.setSelected(getValueAsBoolean(context));
  rendererComponent.setText(getValueAsString(context));
}
origin: RaiMan/SikuliX-2014

/**
 * {@inheritDoc} <p>
 * Overridden to set the button's selected state and text.<p>
 *
 *  PENDING: set icon?
 *
 *  @see #getValueAsBoolean(CellContext)
 *  @see #getValueAsString(CellContext)
 */
@Override
protected void format(CellContext context) {
  rendererComponent.setSelected(getValueAsBoolean(context));
  rendererComponent.setText(getValueAsString(context));
}
origin: org.swinglabs/swingx

/**
 * {@inheritDoc} <p>
 * Overridden to set the button's selected state and text.<p>
 * 
 *  PENDING: set icon?
 *  
 *  @see #getValueAsBoolean(CellContext)
 *  @see #getValueAsString(CellContext)
 */
@Override
protected void format(CellContext context) {
  rendererComponent.setSelected(getValueAsBoolean(context));
  rendererComponent.setText(getValueAsString(context));
}
org.jdesktop.swingx.rendererCheckBoxProvider

Javadoc

A component provider which uses a JCheckBox.

This implementation respects a BooleanValue and a StringValue to configure the button's selected and text property. By default, the selected is mapped to a Boolean-type value and the text is empty.

To allow mapping to different types, client code can supply a custom StringValue which also implements BooleanValue. F.i. to render a cell value of type TableColumnExt with the column's visibility mapped to the selected and the column's title to the text:

 
BooleanValue bv = new BooleanValue(){ 
public boolean getBoolean(Object value) { 
if (value instanceof TableColumnExt) 
return ((TableColumnExt) value).isVisible(); 
return false; 
} 
}; 
StringValue sv = new StringValue() { 
public String getString(Object value) { 
if (value instanceof TableColumnExt) 
return ((TableColumnExt) value).getTitle(); 
return ""; 
} 
}; 
list.setCellRenderer(new DefaultListRenderer( 
new CheckBoxProvider(new MappedValue(sv, null, bv), JLabel.LEADING))); 

Most used methods

  • <init>
    Instantiates a CheckBoxProvider with the given StringValue and alignment.
  • getHorizontalAlignment
  • getValueAsBoolean
    Returns a boolean representation of the content. This method messages theBooleanValue to get the boo
  • getValueAsString
  • isBorderPainted
    Returns the border painted flag.
  • setBorderPainted
    Sets the border painted flag. The underlying checkbox is configured with this value on every request

Popular classes and methods

  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • HashSet (java.util)
    This class implements the Set interface, backed by a java.util.HashMap.
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • BoxLayout (javax.swing)

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)