/*
 * Copyright 2013 - 2014 Eveoh
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package nl.eveoh.mytimetable.apiclient.configuration;

import java.util.Properties;

/**
 * Extended Configuration object, which contains extra properties especially suited for widgets like building blocks.
 *
 * @author Erik van Paassen
 */
public class WidgetConfiguration extends Configuration {

    private static final String CUSTOM_CSS = "customCss";
    private static final String APPLICATION_URI_DESCRIPTION_OVERRIDE = "applicationUriDescriptionOverride";

    /**
     * Custom CSS to be included in the building block.
     */
    private String customCss;

    private String applicationUriDescriptionOverride;


    public WidgetConfiguration() {
    }

    public WidgetConfiguration(Properties properties) {
        super(properties);

        customCss = properties.getProperty(CUSTOM_CSS);
    }

    public String getCustomCss() {
        return customCss;
    }

    public void setCustomCss(String customCss) {
        this.customCss = customCss;
    }

    public String getApplicationUriDescriptionOverride() {
        return applicationUriDescriptionOverride;
    }

    public void setApplicationUriDescriptionOverride(String applicationUriDescriptionOverride) {
        this.applicationUriDescriptionOverride = applicationUriDescriptionOverride;
    }

    @Override
    public Properties toProperties() {
        Properties ret = super.toProperties();

        if (customCss != null) {
            ret.setProperty(CUSTOM_CSS, customCss);
        }

        if (applicationUriDescriptionOverride != null) {
            ret.setProperty(APPLICATION_URI_DESCRIPTION_OVERRIDE, applicationUriDescriptionOverride);
        }

        return ret;
    }
}

@@ -1060,164 +1060,525 @@
 e%22;%0A
-%0A    /**%0A     * Custom CSS to be included in the building block.%0A     */%0A    private String customCss;%0A%0A    private String applicationUriDescriptionOverride
+    private static final String SHOW_STAFF = %22showStaff%22;%0A    private static final String USE_STUDENT_ID = %22useStudentId%22;%0A%0A    /**%0A     * Custom CSS to be included in the building block.%0A     */%0A    private String customCss;%0A%0A    /**%0A     * Description to be shown for the application link%0A     */%0A    private String applicationUriDescriptionOverride;%0A%0A    /**%0A     * Show staff column%0A     */%0A    private boolean showStaff;%0A%0A    /**%0A     * Use student id instead of username%0A     */%0A    private boolean useStudentId
 ;%0A%0A%0A
@@ -2238,101 +2238,580 @@
     
-@Override%0A    public Properties toProperties() %7B%0A        Properties ret = super.toProperties(
+public boolean isShowStaff() %7B%0A        return showStaff;%0A    %7D%0A%0A    public void setShowStaff(boolean showStaff) %7B%0A        this.showStaff = showStaff;%0A    %7D%0A%0A    public boolean isUseStudentId() %7B%0A        return useStudentId;%0A    %7D%0A%0A    public void setUseStudentId(boolean useStudentId) %7B%0A        this.useStudentId = useStudentId;%0A    %7D%0A%0A    @Override%0A    public Properties toProperties() %7B%0A        Properties ret = super.toProperties();%0A        ret.setProperty(SHOW_STAFF, Boolean.toString(showStaff));%0A        ret.setProperty(USE_STUDENT_ID, Boolean.toString(useStudentId)
 );%0A%0A

Add support for show staff and use student id WidgetConfiguration.