diff options
author | mvanmeek | 2004-02-13 19:49:39 +0000 |
---|---|---|
committer | mvanmeek | 2004-02-13 19:49:39 +0000 |
commit | 0a727d3434687c212d4090a75e90d9f948db4910 (patch) | |
tree | bebe95a0e973aa79295a7edbf3c5c5dcf4560aba /bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntModel.java | |
parent | 86d619367f901271f9e1abdb4622e4bf4a8ae340 (diff) | |
download | eclipse.platform.ui-0a727d3434687c212d4090a75e90d9f948db4910.tar.gz eclipse.platform.ui-0a727d3434687c212d4090a75e90d9f948db4910.tar.xz eclipse.platform.ui-0a727d3434687c212d4090a75e90d9f948db4910.zip |
merge_new_look_into_HEAD_20040213
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntModel.java')
-rw-r--r-- | bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntModel.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntModel.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntModel.java new file mode 100644 index 00000000000..cef098c9a64 --- /dev/null +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntModel.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.ui.internal; + +/** + * Represents a single integer that can send notifications when it changes. + * IChangeListeners can be attached which will receive notifications whenever + * the integer changes. + */ +public class IntModel extends Model { + public IntModel(int initialValue) { + super(new Integer(initialValue)); + } + + /** + * Sets the value of the integer and notifies all change listeners + * of the change. + * + * @param newValue the new value of the integer + */ + public void set(int newValue) { + setState(new Integer(newValue), null); + } + + /** + * Returns the value of the integer. + * + * @return the value of the integer + */ + public int get() { + return ((Integer)getState()).intValue(); + } +} |