/*
 * Copyright (c) 2006-2014 DMDirc Developers
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.addons.dcc.events;

import com.dmdirc.events.DisplayableEvent;

import java.util.concurrent.atomic.AtomicReference;

/**
 * Base class for displayable DCC events.
 */
public abstract class DccDisplayableEvent extends DccEvent implements DisplayableEvent {

    /** The display format to use for this event. */
    private final AtomicReference<String> displayFormatRef = new AtomicReference<>("");

    @Override
    public String getDisplayFormat() {
        return displayFormatRef.get();
    }

    @Override
    public void setDisplayFormat(final String format) {
        this.displayFormatRef.set(format);
    }
}

@@ -1192,25 +1192,153 @@
 .Display
-ableEvent
+Property;%0Aimport com.dmdirc.events.DisplayPropertyMap;%0Aimport com.dmdirc.events.DisplayableEvent;%0A%0Aimport com.google.common.base.Optional
 ;%0A%0Aimpor
@@ -1665,16 +1665,146 @@
 e%3C%3E(%22%22);
+%0A    /** The properties associated with this event. */%0A    private final DisplayPropertyMap properties = new DisplayPropertyMap();
 %0A%0A    @O
@@ -1978,13 +1978,8 @@
     
-this.
 disp
@@ -2010,10 +2010,309 @@
 ;%0A    %7D%0A
+%0A    @Override%0A    public %3CT%3E void setDisplayProperty(final DisplayProperty%3CT%3E property, final T value) %7B%0A        properties.put(property, value);%0A    %7D%0A%0A    @Override%0A    public %3CT%3E Optional%3CT%3E getDisplayProperty(final DisplayProperty%3CT%3E property) %7B%0A        return properties.get(property);%0A    %7D%0A%0A
 %7D%0A

Support for display properties.