01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.core;
11:
12: import org.eclipse.core.runtime.IAdaptable;
13:
14: /**
15: * A base generic model. Classes that implement this
16: * interface are expected to be able to:
17: * <ul>
18: * <li>Dispose (clear all the data and reset)</li>
19: * <li>Tell if they are editable</li>
20: * <li>Tell if they contain valid data</li>
21: * </ul>
22: * @since 2.0
23: */
24: public interface IBaseModel extends IAdaptable {
25: /**
26: * Releases all the data in this model and
27: * clears the state. A disposed model
28: * can be returned to the normal state
29: * by reloading.
30: */
31: void dispose();
32:
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: /**
42: * Tests if this model can be modified. Modification
43: * of a model that is not editable will result
44: * in CoreException being thrown.
45: * @return <code>true</code> if this model can be modified
46: */
47: boolean isEditable();
48:
49: /**
50: * Tests if this model valid. When models
51: * are loaded from the file, they may pass the
52: * syntax error checking and load all the model objects.
53: * However, some of the objects may contain invalid
54: * values that make the model unusable.
55: * @return <code>true</code> only if the model can be safely used in all
56: * computations.
57: */
58: boolean isValid();
59: }
|