/*
* 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
}
}