Skip to content

Package: ECPProject

ECPProject

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eike Stepper - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.core;
15:
16: import java.util.Collection;
17:
18: import org.eclipse.emf.common.util.EList;
19: import org.eclipse.emf.ecp.core.util.ECPContainer;
20: import org.eclipse.emf.ecp.core.util.ECPRepositoryAware;
21: import org.eclipse.emf.edit.domain.IEditingDomainProvider;
22:
23: /**
24: * This class describes a Project. A project has a name, a label. It has zero or one {@link ECPRepository} and one
25: * {@link ECPProvider}.
26: *
27: * @author Eike Stepper
28: * @author Eugen Neufeld
29: * @author Jonas Helming
30: * @noimplement This interface is not intended to be implemented by clients.
31: * @noextend This interface is not intended to be extended by clients.
32: */
33:
34: public interface ECPProject extends ECPContainer, ECPRepositoryAware, IEditingDomainProvider {
35:         /**
36:          * The type of the ECPElement.
37:          */
38:         String TYPE = "Project"; //$NON-NLS-1$
39:
40:         /**
41:          * Returns the list of the direct content objects; each is of type Object.
42:          * The contents may be directly modified.
43:          * Adding an object will remove it from the previous container;
44:          *
45:          * @return A list of {@link Object}
46:          */
47:         EList<Object> getContents();
48:
49:         /**
50:          * Saves the currently pending changes of the model. This method delegates to the provider.
51:          */
52:         void saveContents();
53:
54:         /**
55:          * Checks whether the model, associated with this project is dirty.
56:          *
57:          * @return true if model is dirty, false otherwise
58:          */
59:         boolean hasDirtyContents();
60:
61:         /**
62:          * Deletes a collection of {@link Object}s by delegating the task to the provider.
63:          *
64:          * @param objects the collection of {@link Object}s to delete
65:          */
66:         void deleteElements(Collection<Object> objects);
67:
68:         /**
69:          * Whether an object is open or not.
70:          *
71:          * @return true if it is open, false otherwise
72:          */
73:         boolean isOpen();
74:
75:         /**
76:          * This opens a closed object. If the object was already opened, nothing happens.
77:          */
78:         void open();
79:
80:         /**
81:          * This closes an opened object. If the object was already closed, nothing happens.
82:          */
83:         void close();
84:
85: }