001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.activities;
011:
012: /**
013: * An instance of this class describes changes to an instance of
014: * <code>ICategory</code>. This class does not give details as to the
015: * specifics of a change, only that the given property on the source object has
016: * changed.
017: *
018: * <p>
019: * This class is not intended to be extended by clients.
020: * </p>
021: *
022: * @since 3.0
023: * @see ICategoryListener#categoryChanged(CategoryEvent)
024: */
025: public final class CategoryEvent {
026: private ICategory category;
027:
028: private boolean categoryActivityBindingsChanged;
029:
030: private boolean definedChanged;
031:
032: private boolean nameChanged;
033:
034: private boolean descriptionChanged;
035:
036: /**
037: * Creates a new instance of this class.
038: *
039: * @param category
040: * the instance of the interface that changed.
041: * @param categoryActivityBindingsChanged
042: * <code>true</code>, iff the categoryActivityBindings property changed.
043: * @param definedChanged
044: * <code>true</code>, iff the defined property changed.
045: * @param descriptionChanged
046: * <code>true</code>, iff the description property changed.
047: * @param nameChanged
048: * <code>true</code>, iff the name property changed.
049: */
050: public CategoryEvent(ICategory category,
051: boolean categoryActivityBindingsChanged,
052: boolean definedChanged, boolean descriptionChanged,
053: boolean nameChanged) {
054: if (category == null) {
055: throw new NullPointerException();
056: }
057:
058: this .category = category;
059: this .categoryActivityBindingsChanged = categoryActivityBindingsChanged;
060: this .definedChanged = definedChanged;
061: this .nameChanged = nameChanged;
062: this .descriptionChanged = descriptionChanged;
063: }
064:
065: /**
066: * Returns the instance of the interface that changed.
067: *
068: * @return the instance of the interface that changed. Guaranteed not to be
069: * <code>null</code>.
070: */
071: public ICategory getCategory() {
072: return category;
073: }
074:
075: /**
076: * Returns whether or not the defined property changed.
077: *
078: * @return <code>true</code>, iff the defined property changed.
079: */
080: public boolean hasDefinedChanged() {
081: return definedChanged;
082: }
083:
084: /**
085: * Returns whether or not the name property changed.
086: *
087: * @return <code>true</code>, iff the name property changed.
088: */
089: public boolean hasNameChanged() {
090: return nameChanged;
091: }
092:
093: /**
094: * Returns whether or not the description property changed.
095: *
096: * @return <code>true</code>, iff the description property changed.
097: */
098: public boolean hasDescriptionChanged() {
099: return descriptionChanged;
100: }
101:
102: /**
103: * Returns whether or not the categoryActivityBindings property changed.
104: *
105: * @return <code>true</code>, iff the categoryActivityBindings property changed.
106: */
107: public boolean haveCategoryActivityBindingsChanged() {
108: return categoryActivityBindingsChanged;
109: }
110: }
|