<commit_before>package nl.sense_os.commonsense.client.common.utility;

import java.util.List;
import java.util.logging.Logger;

import nl.sense_os.commonsense.client.common.constants.Constants;
import nl.sense_os.commonsense.client.common.models.DeviceModel;
import nl.sense_os.commonsense.client.common.models.GroupModel;
import nl.sense_os.commonsense.client.common.models.SensorModel;
import nl.sense_os.commonsense.client.common.models.UserModel;

import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.ModelIconProvider;
import com.extjs.gxt.ui.client.data.TreeModel;
import com.extjs.gxt.ui.client.util.IconHelper;
import com.google.gwt.user.client.ui.AbstractImagePrototype;

public class SenseIconProvider<M extends TreeModel> implements ModelIconProvider<M> {

    private static final Logger LOGGER = Logger.getLogger(SenseIconProvider.class.getName());

    public static final String GXT_ICONS_PATH = "gxt/images/gxt/icons/";
    public static final String SENSE_ICONS_PATH = "img/icons/16/";

    public static final AbstractImagePrototype ICON_DEVICE = IconHelper.create(SENSE_ICONS_PATH
            + "phone_Android.png");
    public static final AbstractImagePrototype ICON_GROUP = IconHelper.create(SENSE_ICONS_PATH
            + "group.png");
    public static final AbstractImagePrototype ICON_GOOGLE = IconHelper.create(SENSE_ICONS_PATH
            + "google.gif");
    public static final AbstractImagePrototype ICON_GXT_DONE = IconHelper.create(GXT_ICONS_PATH
            + "done.gif");
    public static final AbstractImagePrototype ICON_GXT_FOLDER = IconHelper.create(GXT_ICONS_PATH
            + "folder.gif");
    public static final AbstractImagePrototype ICON_GXT_LEAF = IconHelper.create(GXT_ICONS_PATH
            + "tabs.gif");
    public static final AbstractImagePrototype ICON_SENSOR_DEVICE = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_red-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_DEVICE_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_red-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_ENVIRONMENT = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_FEED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_PUBLIC = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_black-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_STATE = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_magenta-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_ENVIRONMENT_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_FEED_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_PUBLIC_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_black-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_STATE_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_magenta-shared.gif");
    public static final AbstractImagePrototype ICON_USER = IconHelper.create(SENSE_ICONS_PATH
            + "user.png");
    public static final AbstractImagePrototype ICON_USER_ME = IconHelper.create(SENSE_ICONS_PATH
            + "user_zorro.png");

    public static final AbstractImagePrototype ICON_LOADING = IconHelper
            .create("gxt/images/gxt/icons/loading.gif");
    public static final AbstractImagePrototype ICON_BUTTON_GO = IconHelper
            .create("gxt/images/gxt/icons/page-next.gif");

    @Override
    public AbstractImagePrototype getIcon(M model) {

        if (model instanceof GroupModel) {
            return ICON_GROUP;

        } else if (model instanceof DeviceModel) {
            return ICON_DEVICE;

        } else if (model instanceof SensorModel) {
            SensorModel sensor = (SensorModel) model;

            List<UserModel> users = sensor.getUsers();
            UserModel currentUser = Registry.get(Constants.REG_USER);<commit_msg>fix references to old gxt folder<commit_after>package nl.sense_os.commonsense.client.common.utility;

import java.util.List;
import java.util.logging.Logger;

import nl.sense_os.commonsense.client.common.constants.Constants;
import nl.sense_os.commonsense.client.common.models.DeviceModel;
import nl.sense_os.commonsense.client.common.models.GroupModel;
import nl.sense_os.commonsense.client.common.models.SensorModel;
import nl.sense_os.commonsense.client.common.models.UserModel;

import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.data.ModelIconProvider;
import com.extjs.gxt.ui.client.data.TreeModel;
import com.extjs.gxt.ui.client.util.IconHelper;
import com.google.gwt.user.client.ui.AbstractImagePrototype;

public class SenseIconProvider<M extends TreeModel> implements ModelIconProvider<M> {

    private static final Logger LOGGER = Logger.getLogger(SenseIconProvider.class.getName());

    public static final String GXT_ICONS_PATH = "ExtGWT/images/gxt/icons/";
    public static final String SENSE_ICONS_PATH = "img/icons/16/";

    public static final AbstractImagePrototype ICON_DEVICE = IconHelper.create(SENSE_ICONS_PATH
            + "phone_Android.png");
    public static final AbstractImagePrototype ICON_GROUP = IconHelper.create(SENSE_ICONS_PATH
            + "group.png");
    public static final AbstractImagePrototype ICON_GOOGLE = IconHelper.create(SENSE_ICONS_PATH
            + "google.gif");
    public static final AbstractImagePrototype ICON_GXT_DONE = IconHelper.create(GXT_ICONS_PATH
            + "done.gif");
    public static final AbstractImagePrototype ICON_GXT_FOLDER = IconHelper.create(GXT_ICONS_PATH
            + "folder.gif");
    public static final AbstractImagePrototype ICON_GXT_LEAF = IconHelper.create(GXT_ICONS_PATH
            + "tabs.gif");
    public static final AbstractImagePrototype ICON_SENSOR_DEVICE = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_red-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_DEVICE_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_red-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_ENVIRONMENT = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_FEED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_PUBLIC = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_black-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_STATE = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_magenta-unshared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_ENVIRONMENT_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_FEED_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_orange-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_PUBLIC_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_black-shared.gif");
    public static final AbstractImagePrototype ICON_SENSOR_STATE_SHARED = IconHelper
            .create(SenseIconProvider.SENSE_ICONS_PATH + "sense_magenta-shared.gif");
    public static final AbstractImagePrototype ICON_USER = IconHelper.create(SENSE_ICONS_PATH
            + "user.png");
    public static final AbstractImagePrototype ICON_USER_ME = IconHelper.create(SENSE_ICONS_PATH
            + "user_zorro.png");

    public static final AbstractImagePrototype ICON_LOADING = IconHelper
            .create("ExtGWT/images/gxt/icons/loading.gif");
    public static final AbstractImagePrototype ICON_BUTTON_GO = IconHelper
            .create("ExtGWT/images/gxt/icons/page-next.gif");

    @Override
    public AbstractImagePrototype getIcon(M model) {

        if (model instanceof GroupModel) {
            return ICON_GROUP;

        } else if (model instanceof DeviceModel) {
            return ICON_DEVICE;

        } else if (model instanceof SensorModel) {
            SensorModel sensor = (SensorModel) model;

            List<UserModel> users = sensor.getUsers();
            UserModel currentUser = Registry.get(Constants.REG_USER);
{'fraction_non_alphanumeric': 0.07952508960573476, 'fraction_numerical': 0.00044802867383512545, 'mean_word_length': 4.102285714285714, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '4155768', 'n_tokens_mistral': 2716, 'n_tokens_neox': 2673, 'n_words': 472}