diff options
author | bvosburgh | 2012-03-13 20:45:22 +0000 |
---|---|---|
committer | bvosburgh | 2012-03-13 20:45:22 +0000 |
commit | 92ba70a7074c92f165d559c2666659ea1ff76c8d (patch) | |
tree | 1471bcbae5dc86ec31fc3e3ca8fa435dd735cb28 /jpa | |
parent | 7ed7e6cf5c5665347cfe040d6d471fe1465f2dcd (diff) | |
download | webtools.dali-92ba70a7074c92f165d559c2666659ea1ff76c8d.tar.gz webtools.dali-92ba70a7074c92f165d559c2666659ea1ff76c8d.tar.xz webtools.dali-92ba70a7074c92f165d559c2666659ea1ff76c8d.zip |
add JpaProjectsModel public API
Diffstat (limited to 'jpa')
3 files changed, 44 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaProjectManager.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaProjectManager.java index 2198a3faee..96cb7cd567 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaProjectManager.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaProjectManager.java @@ -9,6 +9,7 @@ ******************************************************************************/ package org.eclipse.jpt.jpa.core; +import org.eclipse.core.resources.IWorkspace; import org.eclipse.jpt.common.utility.BooleanReference; import org.eclipse.jpt.common.utility.command.Command; import org.eclipse.jpt.common.utility.command.ExtendedCommandExecutor; @@ -37,6 +38,12 @@ import org.eclipse.jpt.common.utility.model.Model; public interface JpaProjectManager extends Model { + /** + * Return the JPA project manager's workspace. + */ + IWorkspace getWorkspace(); + + // ********** JPA projects ********** /** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/InternalJpaProjectManager.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/InternalJpaProjectManager.java index 5d4ab4175f..4196e773ca 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/InternalJpaProjectManager.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/InternalJpaProjectManager.java @@ -856,6 +856,10 @@ public class InternalJpaProjectManager // ********** misc ********** + public IWorkspace getWorkspace() { + return this.workspace; + } + private IWorkspaceRoot getWorkspaceRoot() { return this.workspace.getRoot(); } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectsModel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectsModel.java new file mode 100644 index 0000000000..33a8a50325 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectsModel.java @@ -0,0 +1,33 @@ +/******************************************************************************* + * Copyright (c) 2012 Oracle. All rights reserved. + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0, which accompanies this distribution + * and is available at http://www.eclipse.org/legal/epl-v10.html. + * + * Contributors: + * Oracle - initial API and implementation + ******************************************************************************/ +package org.eclipse.jpt.jpa.ui; + +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.jpt.common.utility.model.value.CollectionValueModel; +import org.eclipse.jpt.jpa.core.JpaProject; + +/** + * Standard adapter for retrieving a model of a workspace's + * {@link JpaProject JPA project}s + * with change notification when the model changes: + * <pre> + * IWorkspace workspace = ResourcesPlugin.getWorkspace(); + * JpaProjectsModel jpaProjectsModel = (JpaProjectsModel) workspace.getAdapter(JpaProjectsModel.class); + * </pre> + * @see org.eclipse.jpt.jpa.ui.internal.WorkspaceAdapterFactory + */ +public interface JpaProjectsModel + extends CollectionValueModel<JpaProject> +{ + /** + * Return the workspace corresponding to the JPA projects model. + */ + IWorkspace getWorkspace(); +} |