Search
Custom Themes

JPlanner enables the creation of user-defined themes. To create a custom theme, derive from Theme and implement all abstract members.

In order to work properly, all properties of the theme must be explicitly initialized. The theme properties cannot have undefined values. That is, a property should not be null. This ensues from the fact that the theme is the last layer in the appearance hierarchy and the mechanism to propagate a request further in the hierarchy when a theme property is undefined will fail.

The following sample code illustrates what is the usual structure of a custom theme class:

Java  Copy Code

public class MyTheme extends com.mindfusion.scheduling.Theme
{
    public MyTheme()
    {
        this._listViewSettings = super.createListViewSettings();
        this._itemSettings = super.createItemSettings();
        // Instantiate the rest of the fields

        // Initialize all objects
    }


    @Override
    public ListViewSettings getListViewSettings()
    {
        return this._listViewSettings;
    }

    @Override
    public ItemSettings getItemSettings()
    {
        return this._itemSettings;
    }

    // Override all other theme properties and return
    // the corresponding objects


    private ListViewSettings _listViewSettings;
    private ItemSettings _itemSettings;
    // Declare all other necessary fields
}

All objects that cannot be instantiated directly, such as MonthSettings, can be created by calling various protected methods of the base Theme class. For example, in order to create a MonthSettings object, you need to invoke Theme.createMonthSettings.