*** empty log message ***
diff --git a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java
index 39f28a1..2147b79 100644
--- a/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java
+++ b/deprecated/examples/org.eclipse.uml2.examples.ui/src/org/eclipse/uml2/examples/ui/actions/ReferenceMetaclassAction.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - Initial API and implementation
*
- * $Id: ReferenceMetaclassAction.java,v 1.2 2004/05/04 19:16:52 khussey Exp $
+ * $Id: ReferenceMetaclassAction.java,v 1.3 2004/05/13 03:16:06 khussey Exp $
*/
package org.eclipse.uml2.examples.ui.actions;
@@ -27,7 +27,6 @@
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.ui.celleditor.FeatureEditorDialog;
import org.eclipse.jface.action.IAction;
-import org.eclipse.uml2.NamedElement;
import org.eclipse.uml2.Profile;
import org.eclipse.uml2.UML2Package;
import org.eclipse.uml2.edit.util.ChangeCommand;
@@ -86,9 +85,7 @@
Object object = contents.next();
if (org.eclipse.uml2.Class.class.isInstance(object)
- && null != ((org.eclipse.uml2.Class) object)
- .getAppliedStereotype("Basic" //$NON-NLS-1$
- + NamedElement.SEPARATOR + "Metaclass") //$NON-NLS-1$
+ && ((org.eclipse.uml2.Class) object).isMetaclass()
&& !profile.getReferencedMetaclasses().contains(object)) {
choiceOfValues.add(object);
diff --git a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Class.java b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Class.java
index 6354cd5..96b919a 100644
--- a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Class.java
+++ b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Class.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - Initial API and implementation
*
- * $Id: Class.java,v 1.3 2004/05/11 15:24:01 khussey Exp $
+ * $Id: Class.java,v 1.4 2004/05/13 03:16:20 khussey Exp $
*/
package org.eclipse.uml2;
@@ -315,4 +315,16 @@
*/
EList getFeatures();
+ // <!-- begin-custom-operations -->
+
+ /**
+ * Determines whether this class is a metaclass.
+ *
+ * @return <code>true</code> if this class is stereotyped as a metaclass;
+ * <code>false</code> otherwise.
+ */
+ public boolean isMetaclass();
+
+ // <!-- end-custom-operations -->
+
} // Class
diff --git a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Model.java b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Model.java
index 987cb23..0541f93 100644
--- a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Model.java
+++ b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/Model.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - Initial API and implementation
*
- * $Id: Model.java,v 1.2 2004/04/10 04:09:50 khussey Exp $
+ * $Id: Model.java,v 1.3 2004/05/13 03:16:20 khussey Exp $
*/
package org.eclipse.uml2;
@@ -64,4 +64,24 @@
*/
void setViewpoint(String value);
+ // <!-- begin-custom-operations -->
+
+ /**
+ * Determines whether this model is a library.
+ *
+ * @return <code>true</code> if this model is stereotyped as a model
+ * library; <code>false</code> otherwise.
+ */
+ public boolean isLibrary();
+
+ /**
+ * Determines whether this model is a metamodel.
+ *
+ * @return <code>true</code> if this model is stereotyped as a metamodel;
+ * <code>false</code> otherwise.
+ */
+ public boolean isMetamodel();
+
+ // <!-- end-custom-operations -->
+
} // Model
diff --git a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ClassImpl.java b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ClassImpl.java
index df54db8..41f29c3 100644
--- a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ClassImpl.java
+++ b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ClassImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - Initial API and implementation
*
- * $Id: ClassImpl.java,v 1.6 2004/05/11 15:24:00 khussey Exp $
+ * $Id: ClassImpl.java,v 1.7 2004/05/13 03:16:20 khussey Exp $
*/
package org.eclipse.uml2.impl;
@@ -47,6 +47,7 @@
import org.eclipse.uml2.TemplateSignature;
import org.eclipse.uml2.UML2Package;
import org.eclipse.uml2.VisibilityKind;
+import org.eclipse.uml2.internal.operation.ClassOperations;
import org.eclipse.uml2.internal.util.SubsetEObjectContainmentWithInverseEList;
import org.eclipse.uml2.internal.util.SupersetEObjectContainmentWithInverseEList;
import org.eclipse.uml2.internal.util.SupersetEObjectWithInverseResolvingEList;
@@ -1517,4 +1518,17 @@
return result.toString();
}
+ // <!-- begin-custom-operations -->
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.uml2.Class#isMetaclass()
+ */
+ public boolean isMetaclass() {
+ return ClassOperations.isMetaclass(this);
+ }
+
+ // <!-- end-custom-operations -->
+
} //ClassImpl
diff --git a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ModelImpl.java b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ModelImpl.java
index afd2648..c9e9574 100644
--- a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ModelImpl.java
+++ b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/impl/ModelImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - Initial API and implementation
*
- * $Id: ModelImpl.java,v 1.2 2004/04/10 04:09:49 khussey Exp $
+ * $Id: ModelImpl.java,v 1.3 2004/05/13 03:16:20 khussey Exp $
*/
package org.eclipse.uml2.impl;
@@ -27,6 +27,7 @@
import org.eclipse.uml2.TemplateSignature;
import org.eclipse.uml2.UML2Package;
import org.eclipse.uml2.VisibilityKind;
+import org.eclipse.uml2.internal.operation.ModelOperations;
/**
* <!-- begin-user-doc -->
@@ -507,4 +508,26 @@
return result.toString();
}
+ // <!-- begin-custom-operations -->
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.uml2.Model#isLibrary()
+ */
+ public boolean isLibrary() {
+ return ModelOperations.isLibrary(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.uml2.Model#isMetamodel()
+ */
+ public boolean isMetamodel() {
+ return ModelOperations.isMetamodel(this);
+ }
+
+ // <!-- end-custom-operations -->
+
} //ModelImpl
diff --git a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/internal/operation/ClassOperations.java b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/internal/operation/ClassOperations.java
index 0084e4d..9f4768d 100644
--- a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/internal/operation/ClassOperations.java
+++ b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/internal/operation/ClassOperations.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM - Initial API and implementation
*
- * $Id: ClassOperations.java,v 1.2 2004/04/10 04:09:50 khussey Exp $
+ * $Id: ClassOperations.java,v 1.3 2004/05/13 03:16:20 khussey Exp $
*/
package org.eclipse.uml2.internal.operation;
@@ -58,4 +58,17 @@
return inherit;
}
+ /**
+ * Determines whether the specified class is a metaclass.
+ *
+ * @param class_
+ * The class in question.
+ * @return <code>true</code> if the specified class is stereotyped as a
+ * metaclass; <code>false</code> otherwise.
+ */
+ public static boolean isMetaclass(org.eclipse.uml2.Class class_) {
+ return null != class_.getAppliedStereotype("Basic" //$NON-NLS-1$
+ + NamedElement.SEPARATOR + "Metaclass"); //$NON-NLS-1$
+ }
+
}
\ No newline at end of file
diff --git a/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/internal/operation/ModelOperations.java b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/internal/operation/ModelOperations.java
new file mode 100644
index 0000000..c750f3d
--- /dev/null
+++ b/deprecated/plugins/org.eclipse.uml2/src/org/eclipse/uml2/internal/operation/ModelOperations.java
@@ -0,0 +1,58 @@
+/*
+ * 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 - Initial API and implementation
+ *
+ * $Id: ModelOperations.java,v 1.1 2004/05/13 03:16:20 khussey Exp $
+ */
+package org.eclipse.uml2.internal.operation;
+
+import org.eclipse.uml2.Model;
+import org.eclipse.uml2.NamedElement;
+
+/**
+ * A static utility class that provides operations related to models.
+ */
+public final class ModelOperations
+ extends UML2Operations {
+
+ /**
+ * Constructs a new Model Operations. This constructor should never be
+ * called because this is a static utility class.
+ */
+ private ModelOperations() {
+ super();
+ }
+
+ /**
+ * Determines whether the specified model is a library.
+ *
+ * @param model
+ * The model in question.
+ * @return <code>true</code> if the specified model is stereotyped as a
+ * model library; <code>false</code> otherwise.
+ */
+ public static boolean isLibrary(Model model) {
+ return null != model.getAppliedStereotype("Basic" //$NON-NLS-1$
+ + NamedElement.SEPARATOR + "ModelLibrary"); //$NON-NLS-1$
+ }
+
+ /**
+ * Determines whether the specified model is a metamodel.
+ *
+ * @param model
+ * The model in question.
+ * @return <code>true</code> if the specified model is stereotyped as a
+ * metamodel; <code>false</code> otherwise.
+ */
+ public static boolean isMetamodel(Model model) {
+ return null != model.getAppliedStereotype("Complete" //$NON-NLS-1$
+ + NamedElement.SEPARATOR + "Metamodel"); //$NON-NLS-1$
+ }
+
+}
\ No newline at end of file