<commit_before>package com.niafikra.meddela.ui.vaadin.dashboard.settings.themes

import com.vaadin.ui.ComboBox
import com.vaadin.ui.VerticalLayout
import com.vaadin.data.Property
import com.niafikra.meddela.meddela
import com.vaadin.data.util.IndexedContainer

/**
 * This class allows the user to change the themes
 *
 * @author mb<NAME>
 * Date: 21/07/12
 * Time: 12:26
 */
class ThemesPanel extends VerticalLayout implements Property.ValueChangeListener {
    ComboBox themeComboBox

    ThemesPanel() {
        setSizeFull()
        setMargin(true)
        buildUI()
    }

    void buildUI() {
        themeComboBox = new ComboBox('theme')
        themeComboBox.addListener(this)
        themeComboBox.setImmediate(true)
        addComponent(themeComboBox)

        loadThemes()
    }

    /**
     * load themes from themes directory
     */
    void loadThemes() {
        def sep = File.separator
        def path = meddela.appPath + sep + 'VAADIN' + sep + 'themes'<commit_msg>UI to refer on path from conroller for UI<commit_after>package com.niafikra.meddela.ui.vaadin.dashboard.settings.themes

import com.vaadin.ui.ComboBox
import com.vaadin.ui.VerticalLayout
import com.vaadin.data.Property
import com.niafikra.meddela.meddela
import com.vaadin.data.util.IndexedContainer
import com.niafikra.meddela.ui.vaadin.Controller

/**
 * This class allows the user to change the themes
 *
 * @author mb<NAME>
 * Date: 21/07/12
 * Time: 12:26
 */
class ThemesPanel extends VerticalLayout implements Property.ValueChangeListener {
    ComboBox themeComboBox

    ThemesPanel() {
        setSizeFull()
        setMargin(true)
        buildUI()
    }

    void buildUI() {
        themeComboBox = new ComboBox('theme')
        themeComboBox.addListener(this)
        themeComboBox.setImmediate(true)
        addComponent(themeComboBox)

        loadThemes()
    }

    /**
     * load themes from themes directory
     */
    void loadThemes() {
        def sep = File.separator
        def path = Controller.appPath + sep + 'VAADIN' + sep + 'themes'
{'fraction_non_alphanumeric': 0.09609756097560976, 'fraction_numerical': 0.00975609756097561, 'mean_word_length': 2.9594594594594597, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5836367', 'n_tokens_mistral': 672, 'n_tokens_neox': 630, 'n_words': 139}