All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cdc.issues.ui.swing.LocationsCellRenderer Maven / Gradle / Ivy

package cdc.issues.ui.swing;

import javax.swing.JLabel;

import cdc.issues.locations.Location;
import cdc.ui.swing.cells.BaseCellRenderer;
import cdc.ui.swing.cells.CellParams;

public class LocationsCellRenderer extends BaseCellRenderer {
    public LocationsCellRenderer() {
        super(Location[].class, new JLabel());

        getDelegate().setOpaque(true);
    }

    @Override
    public void configure(Location[] value,
                          CellParams params) {
        super.configure(value, params);
        final StringBuilder builder = new StringBuilder();
        builder.append("");
        boolean first = true;
        for (final Location location : value) {
            if (first) {
                first = false;
            } else {
                builder.append("
"); } builder.append(location); } builder.append(""); getDelegate().setText(builder.toString()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy