Package com.eagerlogic.cubee.client.components.attributepanel

Source Code of com.eagerlogic.cubee.client.components.attributepanel.AAttributeEditor

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.eagerlogic.cubee.client.components.attributepanel;

import com.eagerlogic.cubee.client.components.AUserControl;
import com.eagerlogic.cubee.client.events.Event;
import com.eagerlogic.cubee.client.events.EventArgs;
import com.eagerlogic.cubee.client.properties.IntegerProperty;

/**
*
* @author dipacs
*/
public abstract class AAttributeEditor<T> extends AUserControl {
   
    private final Event<EventArgs> onClosed = new Event<EventArgs>();
    private final AAttribute<T> attribute;

    public AAttributeEditor(AAttribute<T> attribute) {
        this.attribute = attribute;
    }

    public AAttribute<T> getAttribute() {
        return attribute;
    }
   
    IntegerProperty widthPropertyInner() {
        return widthProperty();
    }
   
    IntegerProperty heightPropertyInner() {
        return heightProperty();
    }
   
    public final boolean close(boolean saveValue) {
        if (this.onClose(saveValue)) {
            onClosed.fireEvent(new EventArgs(this));
            return true;
        }
        return false;
    }
   
    protected abstract boolean onClose(boolean saveValue);

    public final Event<EventArgs> onClosedEvent() {
        return onClosed;
    }
   
    protected final void showValidationError(String message) {
        // TODO implementálni
    }
   
}
TOP

Related Classes of com.eagerlogic.cubee.client.components.attributepanel.AAttributeEditor

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.