<commit_before>package de.oliver_heger.mediastore.client.pages.overview;

import com.google.gwt.cell.client.TextCell;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.view.client.ProvidesKey;

import de.oliver_heger.mediastore.client.pages.Pages;
import de.oliver_heger.mediastore.shared.BasicMediaServiceAsync;
import de.oliver_heger.mediastore.shared.model.SongInfo;

/**
 * <p>
 * The concrete overview page for songs.
 * </p>
 *
 * @author <NAME>
 * @version $Id: $
 */
public class SongOverviewPage extends AbstractOverviewTable<SongInfo>
{
    /** The key provider. */
    private static final ProvidesKey<SongInfo> KEY_PROVIDER =
            new ProvidesKey<SongInfo>()
            {
                @Override
                public Object getKey(SongInfo item)
                {
                    return item.getSongID();
                }
            };

    /**
     * Creates a new instance of {@code SongOverviewPage}.
     */
    public SongOverviewPage()
    {
        super(KEY_PROVIDER, new SongOverviewQueryHandler());
    }

    /**
     * Initializes the handlers for multiple elements.
     */
    @Override
    protected void initMultiElementHandlers()
    {
        addMultiElementHandler(getImageResources().removeItem(), ACTION_REMOVE,
                new RemoveElementHandler(createRemoveSongHandler(), this,
                        getRemoveController()));
    }

    /**
     * Initializes the columns of the main table.
     *
     * @param table the table to be initialized
     */
    @Override
    protected void initCellTableColumns(CellTable<SongInfo> table)
    {
        Column<SongInfo, String> colName = createNameColumn();
        addColumn(colName, "Name", "name", true);
        cellTable.setColumnWidth(colName, 20, Unit.PCT);
        Column<SongInfo, String> colArtist = createArtistColumn();
        addColumn(colArtist, "Artist", null, false);
        cellTable.setColumnWidth(colArtist, 20, Unit.PCT);
        Column<SongInfo, String> colDuration = createDurationColumn();
        addColumn(colDuration, "Duration", "duration", false);
        cellTable.setColumnWidth(colDuration, 8, Unit.PCT);
        Column<SongInfo, String> colYear = createYearColumn();
        addColumn(colYear, "year", "inceptionYear", false);
        cellTable.setColumnWidth(colYear, 8, Unit.PCT);
        Column<SongInfo, String> colAlbum = createAlbumColumn();
        addColumn(colAlbum, "Album", null, false);
        cellTable.setColumnWidth(colAlbum, 20, Unit.PCT);
        Column<SongInfo, String> colTrack = createTrackColumn();
        addColumn(colTrack, "Track", "track", false);
        cellTable.setColumnWidth(colTrack, 8, Unit.PCT);
        Column<SongInfo, String> colPlayCount = createPlayCountColumn();
        addColumn(colPlayCount, "Played", "playCount", false);
        cellTable.setColumnWidth(colPlayCount, 8, Unit.PCT);
        Column<SongInfo, String> colDate = createDateColumn();
        addColumn(colDate, "Date", "creationDate", false);
        cellTable.setColumnWidth(colDate, 8, Unit.PCT);
    }

    /**
     * Creates the column for the name of the song.
     *
     * @return the name column
     */
    Column<SongInfo, String> createNameColumn()
    {
        Column<SongInfo, String> col =
                new LinkColumn<SongInfo>(getPageManager(), Pages.SONGDETAILS)
                {
                    @Override
                    protected Object getID(SongInfo obj)
                    {
                        return obj.getSongID();
                    }

                    @Override
                    public String getValue(SongInfo object)
                    {
                        return object.getName();
                    }
                };
        col.setSortable(true);
        return col;<commit_msg>Fine-tuning of some properties of SongOverviewPage.<commit_after>package de.oliver_heger.mediastore.client.pages.overview;

import com.google.gwt.cell.client.TextCell;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.view.client.ProvidesKey;

import de.oliver_heger.mediastore.client.pages.Pages;
import de.oliver_heger.mediastore.shared.BasicMediaServiceAsync;
import de.oliver_heger.mediastore.shared.model.SongInfo;

/**
 * <p>
 * The concrete overview page for songs.
 * </p>
 *
 * @author <NAME>
 * @version $Id: $
 */
public class SongOverviewPage extends AbstractOverviewTable<SongInfo>
{
    /** The key provider. */
    private static final ProvidesKey<SongInfo> KEY_PROVIDER =
            new ProvidesKey<SongInfo>()
            {
                @Override
                public Object getKey(SongInfo item)
                {
                    return item.getSongID();
                }
            };

    /**
     * Creates a new instance of {@code SongOverviewPage}.
     */
    public SongOverviewPage()
    {
        super(KEY_PROVIDER, new SongOverviewQueryHandler());
    }

    /**
     * Initializes the handlers for multiple elements.
     */
    @Override
    protected void initMultiElementHandlers()
    {
        addMultiElementHandler(getImageResources().removeItem(), ACTION_REMOVE,
                new RemoveElementHandler(createRemoveSongHandler(), this,
                        getRemoveController()));
    }

    /**
     * Initializes the columns of the main table.
     *
     * @param table the table to be initialized
     */
    @Override
    protected void initCellTableColumns(CellTable<SongInfo> table)
    {
        Column<SongInfo, String> colName = createNameColumn();
        addColumn(colName, "Name", "name", true);
        cellTable.setColumnWidth(colName, 20, Unit.PCT);
        Column<SongInfo, String> colArtist = createArtistColumn();
        addColumn(colArtist, "Artist", null, false);
        cellTable.setColumnWidth(colArtist, 20, Unit.PCT);
        Column<SongInfo, String> colDuration = createDurationColumn();
        addColumn(colDuration, "Duration", "duration", false);
        cellTable.setColumnWidth(colDuration, 8, Unit.PCT);
        Column<SongInfo, String> colYear = createYearColumn();
        addColumn(colYear, "Year", "inceptionYear", false);
        cellTable.setColumnWidth(colYear, 8, Unit.PCT);
        Column<SongInfo, String> colAlbum = createAlbumColumn();
        addColumn(colAlbum, "Album", null, false);
        cellTable.setColumnWidth(colAlbum, 20, Unit.PCT);
        Column<SongInfo, String> colTrack = createTrackColumn();
        addColumn(colTrack, "Track", "trackNo", false);
        cellTable.setColumnWidth(colTrack, 5, Unit.PCT);
        Column<SongInfo, String> colPlayCount = createPlayCountColumn();
        addColumn(colPlayCount, "Played", "playCount", false);
        cellTable.setColumnWidth(colPlayCount, 5, Unit.PCT);
        Column<SongInfo, String> colDate = createDateColumn();
        addColumn(colDate, "Date", "creationDate", false);
        cellTable.setColumnWidth(colDate, 14, Unit.PCT);
    }

    /**
     * Creates the column for the name of the song.
     *
     * @return the name column
     */
    Column<SongInfo, String> createNameColumn()
    {
        Column<SongInfo, String> col =
                new LinkColumn<SongInfo>(getPageManager(), Pages.SONGDETAILS)
                {
                    @Override
                    protected Object getID(SongInfo obj)
                    {
                        return obj.getSongID();
                    }

                    @Override
                    public String getValue(SongInfo object)
                    {
                        return object.getName();
                    }
                };
        col.setSortable(true);
        return col;
{'fraction_non_alphanumeric': 0.1072816142373731, 'fraction_numerical': 0.0028825667376864267, 'mean_word_length': 2.3842239185750635, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6893981', 'n_tokens_mistral': 2333, 'n_tokens_neox': 2182, 'n_words': 460}