KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > core > IBaseModel


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.pde.core;
12
13 import org.eclipse.core.runtime.IAdaptable;
14
15 /**
16  * A base generic model. Classes that implement this
17  * interface are expected to be able to:
18  * <ul>
19  * <li>Dispose (clear all the data and reset)</li>
20  * <li>Tell if they are editable</li>
21  * <li>Tell if they contain valid data</li>
22  * </ul>
23  * @since 2.0
24  */

25 public interface IBaseModel extends IAdaptable {
26     /**
27      * Releases all the data in this model and
28      * clears the state. A disposed model
29      * can be returned to the normal state
30      * by reloading.
31      */

32     void dispose();
33     /**
34      * Tests if this model has been disposed.
35      * Disposed model cannot be used until
36      * it is loaded/reloaded.
37      * @return <code>true</code> if the model has been disposed
38      */

39     boolean isDisposed();
40     /**
41      * Tests if this model can be modified. Modification
42      * of a model that is not editable will result
43      * in CoreException being thrown.
44      * @return <code>true</code> if this model can be modified
45      */

46     boolean isEditable();
47     /**
48      * Tests if this model valid. When models
49      * are loaded from the file, they may pass the
50      * syntax error checking and load all the model objects.
51      * However, some of the objects may contain invalid
52      * values that make the model unusable.
53      * @return <code>true</code> only if the model can be safely used in all
54      * computations.
55      */

56     boolean isValid();
57 }
58
Popular Tags