public void setDecisionTaskCompletedEventId(Long decisionTaskCompletedEventId) {
        this.decisionTaskCompletedEventId = decisionTaskCompletedEventId;
    }

/**
 * **********************************************************************
 *
 *    You may not use this file except in compliance with the License.
 *    A copy of the License is located at
 *
 *      http://example.com
 *
 *    or in the "license" file accompanying this file. This file is
 *    distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 *    ANY KIND, either express or implied. See the License for the specific
 *    language governing permissions and limitations under the License.
 * **********************************************************************
 */
package com.eucalyptus.simpleworkflow.common.model;

import java.io.Serializable;

/**
 *

 * Provides details of the WorkflowExecutionFailed event.
 *

 */
public class WorkflowExecutionFailedEventAttributes implements Serializable, WorkflowEventAttributes {

    /**
     * The descriptive reason provided for the failure (if any).
     *

     * Constraints:

     * Length: 0 - 256

     */
    private String reason;

    /**
     * The details of the failure (if any).
     *

     * Constraints:

     * Length: 0 - 32768

     */
    private String details;

    /**
     * The ID of the DecisionTaskCompleted event corresponding
     * to the decision task that resulted in the
     * FailWorkflowExecution decision to fail this execution.
     * This information can be useful for diagnosing problems by tracing back
     * the chain of events leading up to this event.
     */
    private Long decisionTaskCompletedEventId;

    /**
     * The descriptive reason provided for the failure (if any).
     *

     * Constraints:

     * Length: 0 - 256

     *
     * @return The descriptive reason provided for the failure (if any).
     */
    public String getReason() {
        return reason;
    }

    /**
     * The descriptive reason provided for the failure (if any).
     *

     * Constraints:

     * Length: 0 - 256

     *
     * @param reason The descriptive reason provided for the failure (if any).
     */
    public void setReason(String reason) {
        this.reason = reason;
    }

    /**
     * The descriptive reason provided for the failure (if any).
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 0 - 256

     *
     * @param reason The descriptive reason provided for the failure (if any).
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public WorkflowExecutionFailedEventAttributes withReason(String reason) {
        this.reason = reason;
        return this;
    }

    /**
     * The details of the failure (if any).
     *

     * Constraints:

     * Length: 0 - 32768

     *
     * @return The details of the failure (if any).
     */
    public String getDetails() {
        return details;
    }

    /**
     * The details of the failure (if any).
     *

     * Constraints:

     * Length: 0 - 32768

     *
     * @param details The details of the failure (if any).
     */
    public void setDetails(String details) {
        this.details = details;
    }

    /**
     * The details of the failure (if any).
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 0 - 32768

     *
     * @param details The details of the failure (if any).
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public WorkflowExecutionFailedEventAttributes withDetails(String details) {
        this.details = details;
        return this;
    }

    /**
     * The ID of the DecisionTaskCompleted event corresponding
     * to the decision task that resulted in the
     * FailWorkflowExecution decision to fail this execution.
     * This information can be useful for diagnosing problems by tracing back
     * the chain of events leading up to this event.
     *
     * @return The ID of the DecisionTaskCompleted event corresponding
     *         to the decision task that resulted in the
     *         FailWorkflowExecution decision to fail this execution.
     *         This information can be useful for diagnosing problems by tracing back
     *         the chain of events leading up to this event.
     */
    public Long getDecisionTaskCompletedEventId() {
        return decisionTaskCompletedEventId;
    }

    /**
     * The ID of the DecisionTaskCompleted event corresponding
     * to the decision task that resulted in the
     * FailWorkflowExecution decision to fail this execution.
     * This information can be useful for diagnosing problems by tracing back
     * the chain of events leading up to this event.
     *
     * @param decisionTaskCompletedEventId The ID of the DecisionTaskCompleted event corresponding
     *         to the decision task that resulted in the
     *         FailWorkflowExecution decision to fail this execution.
     *         This information can be useful for diagnosing problems by tracing back
     *         the chain of events leading up to this event.
     */

/**
     * The ID of the DecisionTaskCompleted event corresponding
     * to the decision task that resulted in the
     * FailWorkflowExecution decision to fail this execution.
     * This information can be useful for diagnosing problems by tracing back
     * the chain of events leading up to this event.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param decisionTaskCompletedEventId The ID of the DecisionTaskCompleted event corresponding
     *         to the decision task that resulted in the
     *         FailWorkflowExecution decision to fail this execution.
     *         This information can be useful for diagnosing problems by tracing back
     *         the chain of events leading up to this event.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public WorkflowExecutionFailedEventAttributes withDecisionTaskCompletedEventId(Long decisionTaskCompletedEventId) {
        this.decisionTaskCompletedEventId = decisionTaskCompletedEventId;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getReason() != null)
            sb.append("Reason: " + getReason() + ",");
        if (getDetails() != null)
            sb.append("Details: " + getDetails() + ",");
        if (getDecisionTaskCompletedEventId() != null)
            sb.append("DecisionTaskCompletedEventId: " + getDecisionTaskCompletedEventId());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getReason() == null) ? 0 : getReason().hashCode());
        hashCode = prime * hashCode + ((getDetails() == null) ? 0 : getDetails().hashCode());
        hashCode = prime * hashCode + ((getDecisionTaskCompletedEventId() == null) ? 0 : getDecisionTaskCompletedEventId().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof WorkflowExecutionFailedEventAttributes == false)
            return false;
        WorkflowExecutionFailedEventAttributes other = (WorkflowExecutionFailedEventAttributes) obj;
        if (other.getReason() == null ^ this.getReason() == null)
            return false;
        if (other.getReason() != null && other.getReason().equals(this.getReason()) == false)
            return false;
        if (other.getDetails() == null ^ this.getDetails() == null)
            return false;
        if (other.getDetails() != null && other.getDetails().equals(this.getDetails()) == false)
            return false;
        if (other.getDecisionTaskCompletedEventId() == null ^ this.getDecisionTaskCompletedEventId() == null)
            return false;
        if (other.getDecisionTaskCompletedEventId() != null && other.getDecisionTaskCompletedEventId().equals(this.getDecisionTaskCompletedEventId()) == false)
            return false;
        return true;
    }

    @Override
    public void attach(HistoryEvent historyEvent) {
        historyEvent.setWorkflowExecutionFailedEventAttributes(this);
    }
}


public void setMinSize(int width, int height) {
        checkWidget();
        if (width == minWidth && height == minHeight)
            return;
        minWidth = Math.max(0, width);
        minHeight = Math.max(0, height);
        layout(false);
    }

package saros.ui.widgets;

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;

/**
 * This composite guarantees that its client area does not fall below the specified size.
 *
 *

 *
Styles:
 *
Styles supported by {@link Composite}
 *
Events:
 *
(none)
 *

 *
 *
This class may be sub-classed by custom control implementors who are building controls that
 * are constructed from aggregates of other controls.
 *
 * @see Composite
 */
public class MinSizeComposite extends Composite {

    protected int minHeight = 0;

    protected int minWidth = 0;

    protected boolean noTrimComputation = false;

    /**
     * Constructs a new {@link MinSizeComposite}.
     *
     * @param parent The parent control
     * @param style Style constants
     */
    public MinSizeComposite(Composite parent, final int style) {
        super(parent, style);
        /*
     * Make sure child widgets respect transparency
     */
        this.setBackgroundMode(SWT.INHERIT_DEFAULT);
    }

    /**
     * Returns the minimum width of the content control.
     *
     * @return the minimum width
     * @exception SWTException
     *

     *
ERROR_WIDGET_DISPOSED - if the receiver has been disposed
     *
ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
     *

     */
    public int getMinWidth() {
        checkWidget();
        return minWidth;
    }

    /**
     * Specify the minimum width at which the ScrolledComposite will begin scrolling the content with
     * the horizontal scroll bar. This value is only relevant if setExpandHorizontal(true) has been
     * set.
     *
     * @param width the minimum width or 0 for default width
     * @exception SWTException
     *

     *
ERROR_WIDGET_DISPOSED - if the receiver has been disposed
     *
ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
     *

     */
    public void setMinWidth(int width) {
        setMinSize(width, minHeight);
    }

    /**
     * Returns the minimum height of the content control.
     *
     * @return the minimum height
     * @exception SWTException
     *

     *
ERROR_WIDGET_DISPOSED - if the receiver has been disposed
     *
ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
     *

     */
    public int getMinHeight() {
        checkWidget();
        return minHeight;
    }

    /**
     * Specify the minimum height at which the ScrolledComposite will begin scrolling the content with
     * the vertical scroll bar. This value is only relevant if setExpandVertical(true) has been set.
     *
     * @param height the minimum height or 0 for default height
     * @exception SWTException
     *

     *
ERROR_WIDGET_DISPOSED - if the receiver has been disposed
     *
ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
     *

     */
    public void setMinHeight(int height) {
        setMinSize(minWidth, height);
    }

    /**
     * Specify the minimum width and height at which the ScrolledComposite will begin scrolling the
     * content with the horizontal scroll bar. This value is only relevant if
     * setExpandHorizontal(true) and setExpandVertical(true) have been set.
     *
     * @param size the minimum size or null for the default size
     * @exception SWTException
     *

     *
ERROR_WIDGET_DISPOSED - if the receiver has been disposed
     *
ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
     *

     */
    public void setMinSize(Point size) {
        if (size == null) {
            setMinSize(0, 0);
        } else {
            setMinSize(size.x, size.y);
        }
    }

    /**
     * Specify the minimum width and height at which the ScrolledComposite will begin scrolling the
     * content with the horizontal scroll bar. This value is only relevant if
     * setExpandHorizontal(true) and setExpandVertical(true) have been set.
     *
     * @param width the minimum width or 0 for default width
     * @param height the minimum height or 0 for default height
     * @exception SWTException
     *

     *
ERROR_WIDGET_DISPOSED - if the receiver has been disposed
     *
ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
     *

     */

    @Override
    public Rectangle getClientArea() {
        Rectangle clientArea = super.getClientArea();
        /*
     * Check minimum size
     */
        if (clientArea.width < minWidth)
            clientArea.width = minWidth;
        if (clientArea.height < minHeight)
            clientArea.height = minHeight;
        return clientArea;
    }

    /**
     * Tries to determine the trim
     *
     * @return determine trim for {@link Rectangle}(0, 0, 0, 0)
     */
    protected Point determineTrim() {
        Rectangle trim = computeTrim(0, 0, 0, 0);
        return new Point(-trim.x + trim.width, -trim.y + trim.height);
    }

    /**
     * Hint for {@link #computeTrim(int, int, int, int)} whether to compute the trim.
     *
     * @return
     */
    protected boolean isNoTrimComputation() {
        return noTrimComputation;
    }

    /**
     * Sets the flag whether {@link #computeTrim(int, int, int, int)} should compute the trim.
     *
     * <p>The flag only works if taken into account by {@link #computeSizeTrimless(int, int)}.
     *
     * @param noTrimComputation
     */
    protected void setNoTrimComputation(boolean noTrimComputation) {
        this.noTrimComputation = noTrimComputation;
    }

    /**
     * In contrast to {@link #computeSize(int, int)} the computed size does not contain the trim.
     *
     * @param wHint
     * @param hHint
     * @return
     */
    public synchronized Point computeSizeTrimless(int wHint, int hHint) {
        this.setNoTrimComputation(true);
        Point size = super.computeSize(wHint, hHint);
        this.setNoTrimComputation(false);
        return size;
    }
}