KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > resources > mapping > ModelStatus


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.resources.mapping;
12
13 import org.eclipse.core.runtime.Assert;
14 import org.eclipse.core.runtime.Status;
15
16 /**
17  * A status returned by a model from the resource operation validator.
18  * The severity indicates the severity of the possible side effects
19  * of the operation. Any severity other than <code>OK</code> should be
20  * shown to the user. The message should be a human readable message that
21  * will allow the user to make a decision as to whether to continue with the
22  * operation. The model provider id should indicate which model is flagging the
23  * the possible side effects.
24  * <p>
25  * Clients may instantiate or subclass this class.
26  * </p>
27  *
28  * @since 3.2
29  */

30 public class ModelStatus extends Status {
31
32     private final String JavaDoc modelProviderId;
33
34     /**
35      * Create a model status.
36      *
37      * @param severity the severity
38      * @param pluginId the plugin id
39      * @param modelProviderId the model provider id
40      * @param message the message
41      */

42     public ModelStatus(int severity, String JavaDoc pluginId, String JavaDoc modelProviderId, String JavaDoc message) {
43         super(severity, pluginId, 0, message, null);
44         Assert.isNotNull(modelProviderId);
45         this.modelProviderId = modelProviderId;
46     }
47
48     /**
49      * Return the id of the model provider from which this status originated.
50      *
51      * @return the id of the model provider from which this status originated
52      */

53     public String JavaDoc getModelProviderId() {
54         return modelProviderId;
55     }
56 }
57
Popular Tags