at.spardat.xma.mdl.ModelChangeEvent Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* s IT Solutions AT Spardat GmbH - initial API and implementation
*******************************************************************************/
// @(#) $Id: ModelChangeEvent.java 2089 2007-11-28 13:56:13Z s3460 $
package at.spardat.xma.mdl;
/**
* The base class for all changes applied to WidgetModels. Usually this
* event modifes a model in its execute method.
*/
public abstract class ModelChangeEvent {
/**
* Constructs a ModelChangeEvent.
*
* @param destination the WidgetModel that is the recipient of this event
* @param fromUI specifies if this event originated from the programmer or
* from the UI library.
*/
public ModelChangeEvent (WModel destination, boolean fromUI) {
wModel_ = destination;
fromUI_ = fromUI;
}
/**
* Indicates that the source of this event is an UI action and not a programmer
* rooted action.
*/
public boolean isFromUI () {
return fromUI_;
}
/**
* Applies this change to the WidgetModel.
*/
public abstract boolean execute ();
/**
* The WidgetModel that is the destination of this event.
*/
protected WModel wModel_;
/**
* Indicates whether this event originated from the UIDelegateClient of from the programmer.
*/
protected boolean fromUI_;
}