Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2013-10-23 16:12:19 +0000
committerEd Merks2013-10-23 16:12:19 +0000
commit669f189e964c25e56a2aeff910a7c90e50316366 (patch)
tree853ed2aba0a17408abbcaad3bff702143ed9965d
parentb30981a16eb798f36ea5e7a27d3f05cbd8b0240d (diff)
downloadcdo-669f189e964c25e56a2aeff910a7c90e50316366.tar.gz
cdo-669f189e964c25e56a2aeff910a7c90e50316366.tar.xz
cdo-669f189e964c25e56a2aeff910a7c90e50316366.zip
Improve setup related models
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/NamePredicateItemProvider.java68
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/RepositoryPredicateItemProvider.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java71
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/ExclusionPredicate.gifbin0 -> 1664 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/InclusionPredicate.gifbin0 -> 1677 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.properties4
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.xml7
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/ExclusionPredicateItemProvider.java244
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/InclusionPredicateItemProvider.java197
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetItemProvider.java40
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetsItemProviderAdapterFactory.java198
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetManager.java177
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsActionBarContributor.java298
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsEditor.java85
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecore14
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecorediag89
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.genmodel14
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/ExclusionPredicate.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/InclusionPredicate.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSet.java47
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetGroup.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsFactory.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsPackage.java276
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/ExclusionPredicateImpl.java181
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/InclusionPredicateImpl.java181
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetGroupImpl.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetImpl.java69
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsFactoryImpl.java28
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsPackageImpl.java115
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsAdapterFactory.java70
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsSwitch.java75
31 files changed, 2539 insertions, 196 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/NamePredicateItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/NamePredicateItemProvider.java
index cd592ed15d..7d92c5fa87 100644
--- a/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/NamePredicateItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/NamePredicateItemProvider.java
@@ -13,9 +13,15 @@ package org.eclipse.emf.cdo.releng.predicates.provider;
import org.eclipse.emf.cdo.releng.predicates.NamePredicate;
import org.eclipse.emf.cdo.releng.predicates.PredicatesPackage;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.DragAndDropCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IChildCreationExtender;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
@@ -28,6 +34,8 @@ import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.core.resources.IProject;
+
import java.util.Collection;
import java.util.List;
@@ -142,6 +150,66 @@ public class NamePredicateItemProvider extends ItemProviderAdapter implements IE
super.notifyChanged(notification);
}
+ @Override
+ protected Command createDragAndDropCommand(EditingDomain domain, Object owner, float location, int operations,
+ int operation, Collection<?> collection)
+ {
+ return new DragAndDropCommand(domain, owner, location, operations, operation, collection)
+ {
+ @Override
+ protected boolean analyzeForNonContainment(Command command)
+ {
+ return true;
+ }
+ };
+ }
+
+ @Override
+ protected Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value)
+ {
+ if (feature == null)
+ {
+ if (value instanceof Collection<?>)
+ {
+ NamePredicate namePredicate = (NamePredicate)owner;
+ String pattern = namePredicate.getPattern();
+ StringBuilder projectPattern = new StringBuilder();
+ if (pattern != null)
+ {
+ projectPattern.append(pattern);
+ }
+
+ boolean hasNonProject = false;
+ for (Object item : (Collection<?>)value)
+ {
+ if (item instanceof IProject)
+ {
+ IProject project = (IProject)item;
+ String name = project.getName();
+ if (projectPattern.length() != 0)
+ {
+ projectPattern.append('|');
+ }
+ projectPattern.append(name.replaceAll("\\.", "\\\\."));
+ }
+ else
+ {
+ hasNonProject = true;
+ break;
+ }
+ }
+
+ if (!hasNonProject)
+ {
+ return new SetCommand(domain, owner, PredicatesPackage.Literals.NAME_PREDICATE__PATTERN,
+ projectPattern.toString());
+
+ }
+ }
+ }
+ return super.createSetCommand(domain, owner, feature, value);
+ }
+
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
diff --git a/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/RepositoryPredicateItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/RepositoryPredicateItemProvider.java
index 22840a12cc..98ed076032 100644
--- a/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/RepositoryPredicateItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.predicates.edit/src/org/eclipse/emf/cdo/releng/predicates/provider/RepositoryPredicateItemProvider.java
@@ -13,9 +13,15 @@ package org.eclipse.emf.cdo.releng.predicates.provider;
import org.eclipse.emf.cdo.releng.predicates.PredicatesPackage;
import org.eclipse.emf.cdo.releng.predicates.RepositoryPredicate;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.command.DragAndDropCommand;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IChildCreationExtender;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
@@ -160,6 +166,40 @@ public class RepositoryPredicateItemProvider extends ItemProviderAdapter impleme
super.notifyChanged(notification);
}
+ @Override
+ protected Command createDragAndDropCommand(EditingDomain domain, Object owner, float location, int operations,
+ int operation, Collection<?> collection)
+ {
+ return new DragAndDropCommand(domain, owner, location, operations, operation, collection)
+ {
+ @Override
+ protected boolean analyzeForNonContainment(Command command)
+ {
+ return true;
+ }
+ };
+ }
+
+ @Override
+ protected Command createSetCommand(EditingDomain domain, EObject owner, EStructuralFeature feature, Object value)
+ {
+ if (feature == null)
+ {
+ if (value instanceof Collection<?>)
+ {
+ for (Object item : (Collection<?>)value)
+ {
+ if (item instanceof IProject)
+ {
+ IProject project = (IProject)item;
+ return new SetCommand(domain, owner, PredicatesPackage.Literals.REPOSITORY_PREDICATE__PROJECT, project);
+ }
+ }
+ }
+ }
+ return super.createSetCommand(domain, owner, feature, value);
+ }
+
/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
diff --git a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java
index b4b4f682cc..b6c6847eb9 100644
--- a/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.setup/src/org/eclipse/emf/cdo/releng/setup/impl/WorkingSetTaskImpl.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.emf.cdo.releng.setup.impl;
-import org.eclipse.emf.cdo.releng.internal.setup.Activator;
import org.eclipse.emf.cdo.releng.setup.Branch;
import org.eclipse.emf.cdo.releng.setup.Preferences;
import org.eclipse.emf.cdo.releng.setup.Project;
@@ -31,14 +30,6 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -69,8 +60,6 @@ public class WorkingSetTaskImpl extends SetupTaskImpl implements WorkingSetTask
*/
protected EList<WorkingSet> workingSets;
- private static final String PACKAGE_EXPLORER_ID = "org.eclipse.jdt.ui.PackageExplorer";
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -236,8 +225,6 @@ public class WorkingSetTaskImpl extends SetupTaskImpl implements WorkingSetTask
public void perform(SetupTaskContext context) throws Exception
{
- initPackageExplorer();
-
WorkingSetGroup defaultWorkingSetGroup = WorkingSetsUtil.getWorkingSetGroup();
Set<String> existingIds = new HashSet<String>();
EList<WorkingSet> workingSets = defaultWorkingSetGroup.getWorkingSets();
@@ -271,62 +258,4 @@ public class WorkingSetTaskImpl extends SetupTaskImpl implements WorkingSetTask
Resource resource = defaultWorkingSetGroup.eResource();
resource.save(null);
}
-
- private static void initPackageExplorer()
- {
- final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getWorkbenchWindows()[0];
- final Display display = workbenchWindow.getShell().getDisplay();
- display.asyncExec(new Runnable()
- {
- public void run()
- {
- try
- {
- IViewPart view = workbenchWindow.getActivePage().showView(PACKAGE_EXPLORER_ID, null,
- IWorkbenchPage.VIEW_CREATE);
- if (view != null)
- {
- // Dismiss the WorkingSetConfigurationDialog that comes up the very first time the root mode changes in
- // a new workspace just as if the OK button was pressed.
- display.asyncExec(new Runnable()
- {
- public void run()
- {
- Shell finalActiveShell = display.getActiveShell();
- if (finalActiveShell != null)
- {
- Object data = finalActiveShell.getData();
- if (data != null)
- {
- Class<? extends Object> workingSetConfigurationDialogClass = data.getClass();
- if (workingSetConfigurationDialogClass.getName().equals(
- "org.eclipse.jdt.internal.ui.workingsets.WorkingSetConfigurationDialog"))
- {
- try
- {
- Method method = workingSetConfigurationDialogClass.getDeclaredMethod("okPressed");
- method.setAccessible(true);
- method.invoke(data);
- }
- catch (Exception ex)
- {
- Activator.log(ex);
- }
- }
- }
- }
- }
- });
-
- Method method = view.getClass().getMethod("rootModeChanged", int.class);
- method.invoke(view, 2);
- }
- }
- catch (Exception ex)
- {
- Activator.log(ex);
- }
- }
- });
- }
} // SetWorkingTaskImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/ExclusionPredicate.gif b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/ExclusionPredicate.gif
new file mode 100644
index 0000000000..5688dc6052
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/ExclusionPredicate.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/InclusionPredicate.gif b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/InclusionPredicate.gif
new file mode 100644
index 0000000000..608c9fa9da
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/icons/full/obj16/InclusionPredicate.gif
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.properties b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.properties
index 120c9386f3..cf32c92687 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.properties
@@ -34,3 +34,7 @@ _UI_NamePredicate_pattern_feature = Pattern
_UI_Unknown_feature = Unspecified
_UI_WorkingSet_id_feature = Id
+_UI_ExclusionPredicate_type = Exclusion Predicate
+_UI_InclusionPredicate_type = Inclusion Predicate
+_UI_ExclusionPredicate_excludedWorkingSets_feature = Excluded Working Sets
+_UI_InclusionPredicate_includedWorkingSets_feature = Included Working Sets
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.xml b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.xml
index 73a96f99cd..61e8063758 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.xml
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/plugin.xml
@@ -26,4 +26,11 @@
org.eclipse.emf.edit.provider.IItemPropertySource"/>
</extension>
+ <extension point="org.eclipse.emf.edit.childCreationExtenders">
+ <!-- @generated workingsets -->
+ <extender
+ uri="http://www.eclipse.org/CDO/releng/predicates/1.0"
+ class="org.eclipse.emf.cdo.releng.workingsets.provider.WorkingSetsItemProviderAdapterFactory$PredicatesChildCreationExtender"/>
+ </extension>
+
</plugin>
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/ExclusionPredicateItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/ExclusionPredicateItemProvider.java
new file mode 100644
index 0000000000..576109dd6f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/ExclusionPredicateItemProvider.java
@@ -0,0 +1,244 @@
+/**
+ */
+package org.eclipse.emf.cdo.releng.workingsets.provider;
+
+import org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class ExclusionPredicateItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
+ IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
+{
+ public static void filterCircularWorkingSets(EObject root, Collection<?> objects)
+ {
+ for (EObject eObject = root.eContainer(); eObject != null; eObject = eObject.eContainer())
+ {
+ if (eObject instanceof WorkingSet)
+ {
+ for (Iterator<?> it = objects.iterator(); it.hasNext();)
+ {
+ WorkingSet workingSet = (WorkingSet)it.next();
+ if (workingSet == eObject || getReachableWorkingSets(workingSet).contains(eObject))
+ {
+ it.remove();
+ }
+ }
+ }
+ }
+ }
+
+ public static Set<WorkingSet> getReachableWorkingSets(WorkingSet workingSet)
+ {
+ Set<WorkingSet> workingSets = new HashSet<WorkingSet>();
+ collectReachableWorkingSets(workingSet, workingSets);
+ return workingSets;
+ }
+
+ private static void collectReachableWorkingSets(WorkingSet workingSet, Set<WorkingSet> workingSets)
+ {
+ for (Iterator<EObject> it = workingSet.eAllContents(); it.hasNext();)
+ {
+ EObject child = it.next();
+ for (EObject reference : child.eCrossReferences())
+ {
+ if (reference instanceof WorkingSet)
+ {
+ WorkingSet referecedWorkingSet = (WorkingSet)reference;
+ if (workingSets.add(referecedWorkingSet))
+ {
+ collectReachableWorkingSets(referecedWorkingSet, workingSets);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ExclusionPredicateItemProvider(AdapterFactory adapterFactory)
+ {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
+ {
+ if (itemPropertyDescriptors == null)
+ {
+ super.getPropertyDescriptors(object);
+
+ addExcludedWorkingSetsPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Excluded Working Sets feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected void addExcludedWorkingSetsPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_ExclusionPredicate_excludedWorkingSets_feature"), getString(
+ "_UI_PropertyDescriptor_description", "_UI_ExclusionPredicate_excludedWorkingSets_feature",
+ "_UI_ExclusionPredicate_type"), WorkingSetsPackage.Literals.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS,
+ true, false, true, null, null, null)
+ {
+ @Override
+ public Collection<?> getChoiceOfValues(Object object)
+ {
+ Collection<?> result = super.getChoiceOfValues(object);
+ filterCircularWorkingSets((EObject)object, result);
+ return result;
+ }
+ });
+ }
+
+ /**
+ * This returns ExclusionPredicate.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object)
+ {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/ExclusionPredicate"));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean shouldComposeCreationImage()
+ {
+ return true;
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public String getText(Object object)
+ {
+ ExclusionPredicate exclusionPredicate = (ExclusionPredicate)object;
+ StringBuilder result = new StringBuilder();
+ for (WorkingSet workingSet : exclusionPredicate.getExcludedWorkingSets())
+ {
+ if (result.length() != 0)
+ {
+ result.append(", ");
+ }
+ result.append(workingSet.getName());
+ }
+ return result.toString();
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public void notifyChanged(Notification notification)
+ {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(ExclusionPredicate.class))
+ {
+ case WorkingSetsPackage.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ @Override
+ protected Command factorAddCommand(EditingDomain domain, CommandParameter commandParameter)
+ {
+ if (commandParameter.getFeature() == null)
+ {
+ return new AddCommand(domain, commandParameter.getEOwner(),
+ WorkingSetsPackage.Literals.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS, commandParameter.getCollection());
+ }
+
+ return super.factorAddCommand(domain, commandParameter);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
+ {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator()
+ {
+ return WorkingSetsEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/InclusionPredicateItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/InclusionPredicateItemProvider.java
new file mode 100644
index 0000000000..b9e8e7c080
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/InclusionPredicateItemProvider.java
@@ -0,0 +1,197 @@
+/**
+ */
+package org.eclipse.emf.cdo.releng.workingsets.provider;
+
+import org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
+import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.IItemPropertySource;
+import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * This is the item provider adapter for a {@link org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate} object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class InclusionPredicateItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
+ IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource
+{
+ /**
+ * This constructs an instance from a factory and a notifier.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public InclusionPredicateItemProvider(AdapterFactory adapterFactory)
+ {
+ super(adapterFactory);
+ }
+
+ /**
+ * This returns the property descriptors for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object)
+ {
+ if (itemPropertyDescriptors == null)
+ {
+ super.getPropertyDescriptors(object);
+
+ addIncludedWorkingSetsPropertyDescriptor(object);
+ }
+ return itemPropertyDescriptors;
+ }
+
+ /**
+ * This adds a property descriptor for the Included Working Sets feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ protected void addIncludedWorkingSetsPropertyDescriptor(Object object)
+ {
+ itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
+ .getRootAdapterFactory(), getResourceLocator(),
+ getString("_UI_InclusionPredicate_includedWorkingSets_feature"), getString(
+ "_UI_PropertyDescriptor_description", "_UI_InclusionPredicate_includedWorkingSets_feature",
+ "_UI_InclusionPredicate_type"), WorkingSetsPackage.Literals.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS,
+ true, false, true, null, null, null)
+ {
+ @Override
+ public Collection<?> getChoiceOfValues(Object object)
+ {
+ Collection<?> result = super.getChoiceOfValues(object);
+ ExclusionPredicateItemProvider.filterCircularWorkingSets((EObject)object, result);
+ return result;
+ }
+ });
+ }
+
+ /**
+ * This returns InclusionPredicate.gif.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object getImage(Object object)
+ {
+ return overlayImage(object, getResourceLocator().getImage("full/obj16/InclusionPredicate"));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected boolean shouldComposeCreationImage()
+ {
+ return true;
+ }
+
+ /**
+ * This returns the label text for the adapted class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public String getText(Object object)
+ {
+ InclusionPredicate inclusionPredicate = (InclusionPredicate)object;
+ StringBuilder result = new StringBuilder();
+ for (WorkingSet workingSet : inclusionPredicate.getIncludedWorkingSets())
+ {
+ if (result.length() != 0)
+ {
+ result.append(", ");
+ }
+ result.append(workingSet.getName());
+ }
+ return result.toString();
+ }
+
+ /**
+ * This handles model notifications by calling {@link #updateChildren} to update any cached
+ * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ @Override
+ public void notifyChanged(Notification notification)
+ {
+ updateChildren(notification);
+
+ switch (notification.getFeatureID(InclusionPredicate.class))
+ {
+ case WorkingSetsPackage.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS:
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, true));
+ return;
+ }
+ super.notifyChanged(notification);
+ }
+
+ @Override
+ protected Command factorAddCommand(EditingDomain domain, CommandParameter commandParameter)
+ {
+ if (commandParameter.getFeature() == null)
+ {
+ return new AddCommand(domain, commandParameter.getEOwner(),
+ WorkingSetsPackage.Literals.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS, commandParameter.getCollection());
+ }
+
+ return super.factorAddCommand(domain, commandParameter);
+ }
+
+ /**
+ * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
+ * that can be created under this object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
+ {
+ super.collectNewChildDescriptors(newChildDescriptors, object);
+ }
+
+ /**
+ * Return the resource locator for this item provider's resources.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public ResourceLocator getResourceLocator()
+ {
+ return WorkingSetsEditPlugin.INSTANCE;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetItemProvider.java b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetItemProvider.java
index aac7aa2871..1ab481ac51 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetItemProvider.java
@@ -12,12 +12,15 @@ package org.eclipse.emf.cdo.releng.workingsets.provider;
import org.eclipse.emf.cdo.releng.predicates.PredicatesFactory;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsFactory;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -30,6 +33,7 @@ import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
/**
@@ -160,7 +164,7 @@ public class WorkingSetItemProvider extends ItemProviderAdapter implements IEdit
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public void notifyChanged(Notification notification)
@@ -170,13 +174,37 @@ public class WorkingSetItemProvider extends ItemProviderAdapter implements IEdit
switch (notification.getFeatureID(WorkingSet.class))
{
case WorkingSetsPackage.WORKING_SET__NAME:
+ {
+ EObject notifier = (EObject)notification.getNotifier();
+
+ for (Iterator<EObject> it = EcoreUtil.getRootContainer(notifier).eAllContents(); it.hasNext();)
+ {
+ EObject child = it.next();
+ for (EObject reference : child.eCrossReferences())
+ {
+ if (reference == notifier)
+ {
+ fireNotifyChanged(new ViewerNotification(notification, child, false, true));
+ }
+ }
+ }
+
+ fireNotifyChanged(new ViewerNotification(notification, notifier, false, true));
+ return;
+ }
case WorkingSetsPackage.WORKING_SET__ID:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
+ {
+ Object notifier = notification.getNotifier();
+ fireNotifyChanged(new ViewerNotification(notification, notifier, false, true));
return;
+ }
case WorkingSetsPackage.WORKING_SET__PREDICATES:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ {
+ Object notifier = notification.getNotifier();
+ fireNotifyChanged(new ViewerNotification(notification, notifier, true, false));
return;
}
+ }
super.notifyChanged(notification);
}
@@ -193,6 +221,12 @@ public class WorkingSetItemProvider extends ItemProviderAdapter implements IEdit
super.collectNewChildDescriptors(newChildDescriptors, object);
newChildDescriptors.add(createChildParameter(WorkingSetsPackage.Literals.WORKING_SET__PREDICATES,
+ WorkingSetsFactory.eINSTANCE.createExclusionPredicate()));
+
+ newChildDescriptors.add(createChildParameter(WorkingSetsPackage.Literals.WORKING_SET__PREDICATES,
+ WorkingSetsFactory.eINSTANCE.createInclusionPredicate()));
+
+ newChildDescriptors.add(createChildParameter(WorkingSetsPackage.Literals.WORKING_SET__PREDICATES,
PredicatesFactory.eINSTANCE.createNamePredicate()));
newChildDescriptors.add(createChildParameter(WorkingSetsPackage.Literals.WORKING_SET__PREDICATES,
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetsItemProviderAdapterFactory.java b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetsItemProviderAdapterFactory.java
index 0766222522..8a15659549 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetsItemProviderAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.edit/src/org/eclipse/emf/cdo/releng/workingsets/provider/WorkingSetsItemProviderAdapterFactory.java
@@ -15,10 +15,15 @@ import org.eclipse.emf.cdo.releng.workingsets.util.WorkingSetsAdapterFactory;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ChangeNotifier;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.IChangeNotifier;
+import org.eclipse.emf.edit.provider.IChildCreationExtender;
import org.eclipse.emf.edit.provider.IDisposable;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -29,6 +34,13 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
+import org.eclipse.emf.cdo.releng.predicates.AndPredicate;
+import org.eclipse.emf.cdo.releng.predicates.NotPredicate;
+import org.eclipse.emf.cdo.releng.predicates.OrPredicate;
+import org.eclipse.emf.cdo.releng.predicates.PredicatesPackage;
+import org.eclipse.emf.cdo.releng.predicates.util.PredicatesSwitch;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsFactory;
/**
* This is the factory that is used to provide the interfaces needed to support Viewers.
@@ -132,11 +144,61 @@ public class WorkingSetsItemProviderAdapterFactory extends WorkingSetsAdapterFac
}
/**
- * This returns the root adapter factory that contains this factory.
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
+ protected ExclusionPredicateItemProvider exclusionPredicateItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createExclusionPredicateAdapter()
+ {
+ if (exclusionPredicateItemProvider == null)
+ {
+ exclusionPredicateItemProvider = new ExclusionPredicateItemProvider(this);
+ }
+
+ return exclusionPredicateItemProvider;
+ }
+
+ /**
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate} instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected InclusionPredicateItemProvider inclusionPredicateItemProvider;
+
+ /**
+ * This creates an adapter for a {@link org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Adapter createInclusionPredicateAdapter()
+ {
+ if (inclusionPredicateItemProvider == null)
+ {
+ inclusionPredicateItemProvider = new InclusionPredicateItemProvider(this);
+ }
+
+ return inclusionPredicateItemProvider;
+ }
+
+ /**
+ * This returns the root adapter factory that contains this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public ComposeableAdapterFactory getRootAdapterFactory()
{
return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory();
@@ -246,6 +308,140 @@ public class WorkingSetsItemProviderAdapterFactory extends WorkingSetsAdapterFac
workingSetItemProvider.dispose();
if (workingSetGroupItemProvider != null)
workingSetGroupItemProvider.dispose();
+ if (exclusionPredicateItemProvider != null)
+ exclusionPredicateItemProvider.dispose();
+ if (inclusionPredicateItemProvider != null)
+ inclusionPredicateItemProvider.dispose();
+ }
+
+ /**
+ * A child creation extender for the {@link PredicatesPackage}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static class PredicatesChildCreationExtender implements IChildCreationExtender
+ {
+ /**
+ * The switch for creating child descriptors specific to each extended class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected static class CreationSwitch extends PredicatesSwitch<Object>
+ {
+ /**
+ * The child descriptors being populated.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected List<Object> newChildDescriptors;
+
+ /**
+ * The domain in which to create the children.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EditingDomain editingDomain;
+
+ /**
+ * Creates the a switch for populating child descriptors in the given domain.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ CreationSwitch(List<Object> newChildDescriptors, EditingDomain editingDomain)
+ {
+ this.newChildDescriptors = newChildDescriptors;
+ this.editingDomain = editingDomain;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object caseAndPredicate(AndPredicate object)
+ {
+ newChildDescriptors.add(createChildParameter(PredicatesPackage.Literals.AND_PREDICATE__OPERANDS,
+ WorkingSetsFactory.eINSTANCE.createExclusionPredicate()));
+
+ newChildDescriptors.add(createChildParameter(PredicatesPackage.Literals.AND_PREDICATE__OPERANDS,
+ WorkingSetsFactory.eINSTANCE.createInclusionPredicate()));
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object caseOrPredicate(OrPredicate object)
+ {
+ newChildDescriptors.add(createChildParameter(PredicatesPackage.Literals.OR_PREDICATE__OPERANDS,
+ WorkingSetsFactory.eINSTANCE.createExclusionPredicate()));
+
+ newChildDescriptors.add(createChildParameter(PredicatesPackage.Literals.OR_PREDICATE__OPERANDS,
+ WorkingSetsFactory.eINSTANCE.createInclusionPredicate()));
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object caseNotPredicate(NotPredicate object)
+ {
+ newChildDescriptors.add(createChildParameter(PredicatesPackage.Literals.NOT_PREDICATE__OPERAND,
+ WorkingSetsFactory.eINSTANCE.createExclusionPredicate()));
+
+ newChildDescriptors.add(createChildParameter(PredicatesPackage.Literals.NOT_PREDICATE__OPERAND,
+ WorkingSetsFactory.eINSTANCE.createInclusionPredicate()));
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected CommandParameter createChildParameter(Object feature, Object child)
+ {
+ return new CommandParameter(null, feature, child);
+ }
+
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Collection<Object> getNewChildDescriptors(Object object, EditingDomain editingDomain)
+ {
+ ArrayList<Object> result = new ArrayList<Object>();
+ new CreationSwitch(result, editingDomain).doSwitch((EObject)object);
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ResourceLocator getResourceLocator()
+ {
+ return WorkingSetsEditPlugin.INSTANCE;
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetManager.java b/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetManager.java
index dbaaa5c6a5..bcad632032 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetManager.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetManager.java
@@ -10,7 +10,6 @@
*/
package org.eclipse.emf.cdo.releng.workingsets.presentation;
-import org.eclipse.emf.cdo.releng.predicates.Predicate;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup;
import org.eclipse.emf.cdo.releng.workingsets.util.WorkingSetsUtil;
@@ -32,12 +31,21 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -48,6 +56,8 @@ public class WorkingSetManager
{
private static final String WORKING_SET_PAGE = "org.eclipse.jdt.ui.JavaWorkingSetPage";
+ private static final String PACKAGE_EXPLORER_ID = "org.eclipse.jdt.ui.PackageExplorer";
+
private static final IWorkingSetManager MANAGER = PlatformUI.getWorkbench().getWorkingSetManager();
private static final IWorkspace WORKSPACE = ResourcesPlugin.getWorkspace();
@@ -62,16 +72,20 @@ public class WorkingSetManager
// Compute the working sets for the new working group.
workingSetGroup = WorkingSetsUtil.getWorkingSetGroup();
- EMap<String, Set<IAdaptable>> workingSets = getWorkingSets();
+ EMap<String, Set<IAdaptable>> workingSets = new BasicEMap<String, Set<IAdaptable>>();
- // Update the map to include null (to cause a delete) for any old working set that isn't in the new working set.
+ // Update the map to include null (to cause an delete) for any old working set not present in the new ones
for (WorkingSet workingSet : oldWorkingSetGroup.getWorkingSets())
{
String name = workingSet.getName();
- if (!workingSets.containsKey(name))
- {
- workingSets.put(name, null);
- }
+ workingSets.put(name, null);
+ }
+
+ // Update the map to include empty sets (to cause an add) for any new working set not already present.
+ for (WorkingSet workingSet : workingSetGroup.getWorkingSets())
+ {
+ String name = workingSet.getName();
+ workingSets.put(name, new LinkedHashSet<IAdaptable>());
}
// Update the working sets for all the projects in the workspace and apply the result to the real working sets.
@@ -137,12 +151,6 @@ public class WorkingSetManager
{
workingSetGroup = WorkingSetsUtil.getWorkingSetGroup();
- // Compute the working sets, update them for the projects in the workspace, and apply those results to the real
- // working sets.
- EMap<String, Set<IAdaptable>> workingSets = getWorkingSets();
- updateProjects(workingSets);
- apply(workingSets);
-
// Listen for projects being added or removed from the workspace and for preferences changing.
WORKSPACE.addResourceChangeListener(resourceChangeListener);
WorkingSetsUtil.WORKING_SET_GROUP_PREFERENCES.addPreferenceChangeListener(preferencesListener);
@@ -168,8 +176,8 @@ public class WorkingSetManager
{
String name = workingSet.getName();
IWorkingSet iWorkingSet = MANAGER.getWorkingSet(name);
- workingSets.put(name,
- iWorkingSet == null ? null : new LinkedHashSet<IAdaptable>(Arrays.asList(iWorkingSet.getElements())));
+ workingSets.put(name, iWorkingSet == null ? new LinkedHashSet<IAdaptable>() : new LinkedHashSet<IAdaptable>(
+ Arrays.asList(iWorkingSet.getElements())));
}
return workingSets;
@@ -213,10 +221,112 @@ public class WorkingSetManager
}
}
}
+
+ managePackageExplorer();
}
});
}
+ private void managePackageExplorer()
+ {
+ try
+ {
+ for (IWorkbenchWindow workbenchWindow : PlatformUI.getWorkbench().getWorkbenchWindows())
+ {
+ for (IWorkbenchPage workbenchPage : workbenchWindow.getPages())
+ {
+ IViewPart view = workbenchPage.findView(PACKAGE_EXPLORER_ID);
+ if (view != null)
+ {
+ Method getWorkingSetModelMethod = view.getClass().getMethod("getWorkingSetModel");
+ Object workingSetModel = getWorkingSetModelMethod.invoke(view);
+ if (workingSetModel != null)
+ {
+ Class<?> workingSetModelClass = workingSetModel.getClass();
+ Method getAllWorkingSetsMethod = workingSetModelClass.getMethod("getAllWorkingSets");
+ IWorkingSet[] allWorkingSets = (IWorkingSet[])getAllWorkingSetsMethod.invoke(workingSetModel);
+
+ Map<WorkingSet, IWorkingSet> managedWorkingSets = new HashMap<WorkingSet, IWorkingSet>();
+ for (int i = 0; i < allWorkingSets.length; ++i)
+ {
+ IWorkingSet iWorkingSet = allWorkingSets[i];
+ WorkingSet workingSet = workingSetGroup.getWorkingSet(iWorkingSet.getName());
+ if (workingSet != null)
+ {
+ managedWorkingSets.put(workingSet, iWorkingSet);
+ }
+ }
+
+ Map<IWorkingSet, List<IWorkingSet>> orderedWorkingSetGroups = new LinkedHashMap<IWorkingSet, List<IWorkingSet>>();
+ for (WorkingSet workingSet : workingSetGroup.getWorkingSets())
+ {
+ IWorkingSet iWorkingSet = managedWorkingSets.get(workingSet);
+ List<IWorkingSet> group = new ArrayList<IWorkingSet>();
+ group.add(iWorkingSet);
+ orderedWorkingSetGroups.put(iWorkingSet, group);
+ }
+
+ Method getActiveWorkingSetsMethod = workingSetModelClass.getMethod("getActiveWorkingSets");
+ List<IWorkingSet> activeWorkingSets = Arrays.asList((IWorkingSet[])getActiveWorkingSetsMethod
+ .invoke(workingSetModel));
+
+ List<IWorkingSet> newActiveWorkingSets = new ArrayList<IWorkingSet>();
+ List<IWorkingSet> group = newActiveWorkingSets;
+ for (IWorkingSet iWorkingSet : activeWorkingSets)
+ {
+ List<IWorkingSet> targetGroup = orderedWorkingSetGroups.get(iWorkingSet);
+ if (targetGroup == null)
+ {
+ group.add(iWorkingSet);
+ }
+ else
+ {
+ group = targetGroup;
+ }
+ }
+
+ for (List<IWorkingSet> workingSets : orderedWorkingSetGroups.values())
+ {
+ newActiveWorkingSets.addAll(workingSets);
+ }
+
+ IWorkingSet[] orderedActiveWorkingSetsArray = newActiveWorkingSets
+ .toArray(new IWorkingSet[newActiveWorkingSets.size()]);
+
+ Method setWorkingSetsMethod = workingSetModelClass.getMethod("setActiveWorkingSets", IWorkingSet[].class);
+
+ setWorkingSetsMethod.invoke(workingSetModel, new Object[] { orderedActiveWorkingSetsArray });
+
+ Method getRootModeMethod = view.getClass().getMethod("getRootMode");
+ if (!getRootModeMethod.invoke(view).equals(2))
+ {
+ Method method = view.getClass().getMethod("rootModeChanged", int.class);
+ method.invoke(view, 2);
+ }
+ }
+ return;
+ }
+ }
+ }
+ }
+ catch (NoSuchMethodException ex)
+ {
+ WorkingSetsEditorPlugin.INSTANCE.log(ex);
+ }
+ catch (SecurityException ex)
+ {
+ WorkingSetsEditorPlugin.INSTANCE.log(ex);
+ }
+ catch (IllegalAccessException ex)
+ {
+ WorkingSetsEditorPlugin.INSTANCE.log(ex);
+ }
+ catch (InvocationTargetException ex)
+ {
+ WorkingSetsEditorPlugin.INSTANCE.log(ex);
+ }
+ }
+
/**
* Compute the elements for the working sets based on the projects in the workspace.
*/
@@ -235,23 +345,17 @@ public class WorkingSetManager
{
for (WorkingSet workingSet : workingSetGroup.getWorkingSets())
{
- for (Predicate predicate : workingSet.getPredicates())
+ if (workingSet.matches(project))
{
- if (predicate.matches(project))
+ String name = workingSet.getName();
+ Set<IAdaptable> elements = workingSets.get(name);
+ if (elements == null)
{
- String name = workingSet.getName();
- Set<IAdaptable> elements = workingSets.get(name);
- if (elements == null)
- {
- elements = new LinkedHashSet<IAdaptable>();
- workingSets.put(name, elements);
- }
-
- elements.add(project);
-
- // Add the element only to the first matchinging working set.
- return;
+ elements = new LinkedHashSet<IAdaptable>();
+ workingSets.put(name, elements);
}
+
+ elements.add(project);
}
}
}
@@ -263,18 +367,13 @@ public class WorkingSetManager
{
for (WorkingSet workingSet : workingSetGroup.getWorkingSets())
{
- for (Predicate predicate : workingSet.getPredicates())
+ if (workingSet.matches(project))
{
- if (predicate.matches(project))
+ String name = workingSet.getName();
+ Set<IAdaptable> elements = workingSets.get(name);
+ if (elements != null)
{
- String name = workingSet.getName();
- Set<IAdaptable> elements = workingSets.get(name);
- if (elements != null)
- {
- elements.remove(name);
- }
-
- return;
+ elements.remove(name);
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsActionBarContributor.java b/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsActionBarContributor.java
index 5756beb219..e27a95a712 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsActionBarContributor.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsActionBarContributor.java
@@ -10,17 +10,34 @@
*/
package org.eclipse.emf.cdo.releng.workingsets.presentation;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup;
+import org.eclipse.emf.cdo.releng.workingsets.provider.WorkingSetsEditPlugin;
+
+import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
+import org.eclipse.emf.edit.provider.ItemProvider;
import org.eclipse.emf.edit.ui.action.ControlAction;
import org.eclipse.emf.edit.ui.action.CreateChildAction;
import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
import org.eclipse.emf.edit.ui.action.LoadResourceAction;
import org.eclipse.emf.edit.ui.action.ValidateAction;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider;
import org.eclipse.emf.edit.ui.provider.DiagnosticDecorator;
+import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
@@ -32,17 +49,39 @@ import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.SubContributionItem;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.ISelectionListener;
+import org.eclipse.ui.ISelectionService;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.model.IWorkbenchAdapter;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
+import java.util.EventObject;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.Set;
/**
* This is the action bar contributor for the WorkingSets model editor.
@@ -54,6 +93,241 @@ public class WorkingSetsActionBarContributor extends EditingDomainActionBarContr
ISelectionChangedListener
{
/**
+ * @author Ed Merks
+ */
+ public static final class PreviewDialog extends Dialog
+ {
+ protected static class Input extends ItemProvider
+ {
+ public EList<WorkingSetPresentation> getWorkingSets()
+ {
+ @SuppressWarnings("unchecked")
+ EList<WorkingSetPresentation> result = (EList<WorkingSetPresentation>)(EList<?>)getChildren();
+ return result;
+ }
+ }
+
+ protected static class WorkingSetPresentation extends ItemProvider
+ {
+ private WorkingSet workingSet;
+
+ public WorkingSetPresentation(WorkingSet workingSet)
+ {
+ super(workingSet.getName(), WorkingSetsEditPlugin.INSTANCE.getImage("full/obj16/WorkingSet"));
+
+ this.workingSet = workingSet;
+ }
+
+ public EList<ProjectPresentation> getProjects()
+ {
+ @SuppressWarnings("unchecked")
+ EList<ProjectPresentation> result = (EList<ProjectPresentation>)(EList<?>)getChildren();
+ return result;
+ }
+
+ public WorkingSet getWorkingSet()
+ {
+ return workingSet;
+ }
+ }
+
+ protected static class ProjectPresentation extends ItemProvider
+ {
+ private IProject project;
+
+ public ProjectPresentation(IProject project)
+ {
+ super(project.getName(), ExtendedImageRegistry.INSTANCE.getImage(((IWorkbenchAdapter)project
+ .getAdapter(IWorkbenchAdapter.class)).getImageDescriptor(project)));
+
+ this.project = project;
+ }
+
+ public IProject getProject()
+ {
+ return project;
+ }
+ }
+
+ private TreeViewer tree;
+
+ private IEditorPart activeEditorPart;
+
+ private Input input = new Input();
+
+ private ISelectionListener selectionListener = new ISelectionListener()
+ {
+ public void selectionChanged(IWorkbenchPart part, ISelection selection)
+ {
+ if (selection instanceof IStructuredSelection)
+ {
+ Set<Object> selectedObjects = new HashSet<Object>();
+ for (Object value : ((IStructuredSelection)selection).toArray())
+ {
+ if (value instanceof EObject)
+ {
+ for (EObject eObject = (EObject)value; eObject != null; eObject = eObject.eContainer())
+ {
+ for (WorkingSetPresentation workingSet : input.getWorkingSets())
+ {
+ if (eObject == workingSet.getWorkingSet())
+ {
+ selectedObjects.add(workingSet);
+ }
+ }
+ }
+ }
+ if (value instanceof IAdaptable)
+ {
+ IProject project = (IProject)((IAdaptable)value).getAdapter(IProject.class);
+ if (project != null)
+ {
+ for (WorkingSetPresentation workingSet : input.getWorkingSets())
+ {
+ for (ProjectPresentation p : workingSet.getProjects())
+ {
+ if (project.equals(p.getProject()))
+ {
+ selectedObjects.add(p);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!selectedObjects.isEmpty())
+ {
+ tree.setSelection(new StructuredSelection(new ArrayList<Object>(selectedObjects)));
+ }
+ }
+ }
+ };
+
+ private IWorkbenchWindow workbenchWindow;
+
+ private CommandStackListener commandStackListener = new CommandStackListener()
+ {
+ public void commandStackChanged(EventObject event)
+ {
+ reconcile();
+ tree.expandAll();
+ }
+ };
+
+ public PreviewDialog(Shell parentShell, IEditorPart activeEditorPart)
+ {
+ super(parentShell);
+
+ setActiveEditorPart(activeEditorPart);
+ setShellStyle(getShellStyle() ^ SWT.APPLICATION_MODAL | SWT.MODELESS | SWT.RESIZE);
+ setBlockOnOpen(false);
+
+ workbenchWindow = activeEditorPart.getEditorSite().getWorkbenchWindow();
+ ISelectionService selectionService = workbenchWindow.getSelectionService();
+ selectionService.addPostSelectionListener(selectionListener);
+ }
+
+ @Override
+ public boolean close()
+ {
+ setActiveEditorPart(null);
+ ISelectionService selectionService = workbenchWindow.getSelectionService();
+ selectionService.removePostSelectionListener(selectionListener);
+
+ return super.close();
+ }
+
+ public void setActiveEditorPart(IEditorPart activeEditorPart)
+ {
+ if (this.activeEditorPart != null)
+ {
+ ((IEditingDomainProvider)this.activeEditorPart).getEditingDomain().getCommandStack()
+ .removeCommandStackListener(commandStackListener);
+ }
+
+ this.activeEditorPart = activeEditorPart;
+
+ if (activeEditorPart != null)
+ {
+ ((IEditingDomainProvider)activeEditorPart).getEditingDomain().getCommandStack()
+ .addCommandStackListener(commandStackListener);
+ }
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent)
+ {
+ getShell().setText("Working Sets Preview");
+
+ tree = new TreeViewer(parent);
+ reconcile();
+ tree.setInput(input);
+ tree.expandAll();
+
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
+ layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
+ layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
+ layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
+
+ Tree treeControl = tree.getTree();
+ treeControl.setLayout(layout);
+
+ GridData layoutData = new GridData(GridData.FILL_BOTH);
+ layoutData.heightHint = 800;
+ layoutData.widthHint = 400;
+ treeControl.setLayoutData(layoutData);
+
+ applyDialogFont(treeControl);
+
+ return treeControl;
+ }
+
+ protected void reconcile()
+ {
+ EList<Object> children = input.getChildren();
+ children.clear();
+
+ AdapterFactoryEditingDomain editingDomain = (AdapterFactoryEditingDomain)((IEditingDomainProvider)activeEditorPart)
+ .getEditingDomain();
+ tree.setContentProvider(new AdapterFactoryContentProvider(editingDomain.getAdapterFactory()));
+ DecoratingColumLabelProvider labelProvider = new DecoratingColumLabelProvider(new AdapterFactoryLabelProvider(
+ editingDomain.getAdapterFactory()), new DiagnosticDecorator(editingDomain, tree, WorkingSetsEditorPlugin
+ .getPlugin().getDialogSettings()));
+ tree.setLabelProvider(labelProvider);
+
+ Resource resource = editingDomain.getResourceSet().getResources().get(0);
+ WorkingSetGroup workingSetGroup = (WorkingSetGroup)resource.getContents().get(0);
+
+ Set<IProject> projects = new LinkedHashSet<IProject>(Arrays.asList(ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects()));
+ for (WorkingSet workingSet : workingSetGroup.getWorkingSets())
+ {
+ ItemProvider child = new WorkingSetPresentation(workingSet);
+ EList<Object> contents = child.getChildren();
+ for (Iterator<IProject> it = projects.iterator(); it.hasNext();)
+ {
+ IProject project = it.next();
+ if (workingSet.matches(project))
+ {
+ ItemProvider childProject = new ProjectPresentation(project);
+ contents.add(childProject);
+ }
+ }
+
+ children.add(child);
+ }
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent)
+ {
+ return null;
+ }
+ }
+
+ /**
* This keeps track of the active editor.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -430,8 +704,7 @@ public class WorkingSetsActionBarContributor extends EditingDomainActionBarContr
* <!-- end-user-doc -->
* @generated
*/
- @Override
- public void menuAboutToShow(IMenuManager menuManager)
+ public void menuAboutToShowGen(IMenuManager menuManager)
{
super.menuAboutToShow(menuManager);
MenuManager submenuManager = null;
@@ -445,6 +718,27 @@ public class WorkingSetsActionBarContributor extends EditingDomainActionBarContr
menuManager.insertBefore("edit", submenuManager);
}
+ @Override
+ public void menuAboutToShow(IMenuManager menuManager)
+ {
+ menuAboutToShowGen(menuManager);
+ menuManager.insertBefore("ui-actions", new Action()
+ {
+ @Override
+ public String getText()
+ {
+ return "Preview";
+ }
+
+ @Override
+ public void run()
+ {
+ Dialog dialog = new PreviewDialog(activeEditorPart.getSite().getShell(), activeEditorPart);
+ dialog.open();
+ }
+ });
+ }
+
/**
* This inserts global actions before the "additions-end" separator.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsEditor.java b/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsEditor.java
index 6a2ca92c82..16ca23bf63 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsEditor.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets.editor/src/org/eclipse/emf/cdo/releng/workingsets/presentation/WorkingSetsEditor.java
@@ -53,17 +53,22 @@ import org.eclipse.emf.edit.ui.util.EditUIUtil;
import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IStatusLineManager;
@@ -89,6 +94,8 @@ import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
@@ -932,7 +939,7 @@ public class WorkingSetsEditor extends MultiPageEditorPart implements IEditingDo
* This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
protected void createContextMenuFor(StructuredViewer viewer)
{
@@ -948,7 +955,79 @@ public class WorkingSetsEditor extends MultiPageEditorPart implements IEditingDo
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(),
FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
- viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
+ viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)
+ {
+ @Override
+ protected Collection<?> extractDragSource(Object object)
+ {
+ List<Object> dragSource = new ArrayList<Object>(super.extractDragSource(object));
+ List<Object> result = new ArrayList<Object>();
+ for (Object value : dragSource)
+ {
+ if (value instanceof URI)
+ {
+ URI uri = (URI)value;
+ if (uri.isPlatformResource())
+ {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+
+ Path path = new Path(uri.toPlatformString(true));
+ if (path.segmentCount() == 1)
+ {
+ IProject project = root.getProject(path.segment(0));
+ result.add(project);
+ continue;
+ }
+
+ IFile file = root.getFile(path);
+ if (file.exists())
+ {
+ result.add(file);
+ continue;
+ }
+
+ IFolder folder = root.getFolder(path);
+ if (folder.exists())
+ {
+ result.add(folder);
+ continue;
+ }
+ }
+ }
+ else if (value instanceof IAdaptable)
+ {
+ IResource resource = (IResource)((IAdaptable)value).getAdapter(IResource.class);
+ if (resource != null)
+ {
+ result.add(resource);
+ continue;
+ }
+ }
+
+ result.add(value);
+ }
+ return result;
+ }
+ });
+
+ viewer.getControl().addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseDoubleClick(MouseEvent event)
+ {
+ if (event.button == 1)
+ {
+ try
+ {
+ getEditorSite().getPage().showView("org.eclipse.ui.views.PropertySheet");
+ }
+ catch (PartInitException exception)
+ {
+ WorkingSetsEditorPlugin.INSTANCE.log(exception);
+ }
+ }
+ }
+ });
}
public void createModel()
@@ -1482,7 +1561,7 @@ public class WorkingSetsEditor extends MultiPageEditorPart implements IEditingDo
*/
protected void doSaveAs(URI uri, IEditorInput editorInput)
{
- (editingDomain.getResourceSet().getResources().get(0)).setURI(uri);
+ editingDomain.getResourceSet().getResources().get(0).setURI(uri);
setInputWithNotify(editorInput);
setPartName(editorInput.getName());
IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null ? getActionBars()
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecore b/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecore
index 1b411afac1..05cc9a79f2 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecore
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecore
@@ -3,6 +3,9 @@
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="workingsets" nsURI="http://www.eclipse.org/CDO/releng/workingsets/1.0"
nsPrefix="workingsets">
<eClassifiers xsi:type="ecore:EClass" name="WorkingSet">
+ <eOperations name="matches" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean">
+ <eParameters name="project" eType="#//Project"/>
+ </eOperations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="predicates" upperBound="-1"
eType="ecore:EClass ../../org.eclipse.emf.cdo.releng.predicates/model/predicates.ecore#//Predicate"
@@ -10,9 +13,20 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="WorkingSetGroup">
+ <eOperations name="getWorkingSet" eType="#//WorkingSet">
+ <eParameters name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eOperations>
<eStructuralFeatures xsi:type="ecore:EReference" name="workingSets" upperBound="-1"
eType="#//WorkingSet" containment="true" eKeys="#//WorkingSet/name"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EDataType" name="Project" instanceClassName="org.eclipse.core.resources.IProject"
serializable="false"/>
+ <eClassifiers xsi:type="ecore:EClass" name="ExclusionPredicate" eSuperTypes="../../org.eclipse.emf.cdo.releng.predicates/model/predicates.ecore#//Predicate">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="excludedWorkingSets" upperBound="-1"
+ eType="#//WorkingSet"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="InclusionPredicate" eSuperTypes="../../org.eclipse.emf.cdo.releng.predicates/model/predicates.ecore#//Predicate">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="includedWorkingSets" upperBound="-1"
+ eType="#//WorkingSet"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecorediag b/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecorediag
index e82095abde..83311f08b5 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecorediag
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.ecorediag
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmi:id="_7Ik9wANJEeOzDrIpOa7NnA" type="EcoreTools" measurementUnit="Pixel">
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmi:id="_7Ik9wANJEeOzDrIpOa7NnA" type="EcoreTools" measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_7JI-cANJEeOzDrIpOa7NnA" type="1001">
<children xmi:type="notation:Node" xmi:id="_7JdukANJEeOzDrIpOa7NnA" type="4001"/>
<children xmi:type="notation:Node" xmi:id="_7Je8sANJEeOzDrIpOa7NnA" type="5001">
@@ -16,6 +16,10 @@
<styles xmi:type="notation:FilteringStyle" xmi:id="_7Je8swNJEeOzDrIpOa7NnA"/>
</children>
<children xmi:type="notation:Node" xmi:id="_7JfjwANJEeOzDrIpOa7NnA" type="5002">
+ <children xmi:type="notation:Node" xmi:id="_1ElZEDrCEeO3ROGuCrfS-A" type="2002">
+ <element xmi:type="ecore:EOperation" href="workingsets.ecore#//WorkingSet/matches"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_1ElZETrCEeO3ROGuCrfS-A"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_7JfjwQNJEeOzDrIpOa7NnA"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_7JfjwgNJEeOzDrIpOa7NnA"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_7JfjwwNJEeOzDrIpOa7NnA"/>
@@ -32,6 +36,10 @@
<styles xmi:type="notation:FilteringStyle" xmi:id="_8twL0wNJEeOzDrIpOa7NnA"/>
</children>
<children xmi:type="notation:Node" xmi:id="_8twy4ANJEeOzDrIpOa7NnA" type="5002">
+ <children xmi:type="notation:Node" xmi:id="_rLFX8DvAEeOGErlDG50Krg" type="2002">
+ <element xmi:type="ecore:EOperation" href="workingsets.ecore#//WorkingSetGroup/getWorkingSet"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_rLFX8TvAEeOGErlDG50Krg"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_8twy4QNJEeOzDrIpOa7NnA"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_8twy4gNJEeOzDrIpOa7NnA"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_8twy4wNJEeOzDrIpOa7NnA"/>
@@ -45,7 +53,7 @@
<children xmi:type="notation:Node" xmi:id="_big5gANKEeOzDrIpOa7NnA" type="4009"/>
<styles xmi:type="notation:ShapeStyle" xmi:id="_bidPIQNKEeOzDrIpOa7NnA" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/>
<element xmi:type="ecore:EDataType" href="workingsets.ecore#//Project"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_bidPIgNKEeOzDrIpOa7NnA" x="386" y="260"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_bidPIgNKEeOzDrIpOa7NnA" x="510" y="45"/>
</children>
<children xmi:type="notation:Node" xmi:id="_PXT3gAvHEeOoPqB4RyWmHw" type="1001">
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PXe2oAvHEeOoPqB4RyWmHw" source="Shortcut">
@@ -64,7 +72,39 @@
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_PXT3gQvHEeOoPqB4RyWmHw" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/>
<element xmi:type="ecore:EClass" href="platform:/resource/org.eclipse.emf.cdo.releng.predicates/model/predicates.ecore#//Predicate"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PXT3ggvHEeOoPqB4RyWmHw" x="105" y="330"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PXT3ggvHEeOoPqB4RyWmHw" x="165" y="375"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_KgoUADr8EeOGErlDG50Krg" type="1001">
+ <children xmi:type="notation:Node" xmi:id="_KgpiIDr8EeOGErlDG50Krg" type="4001"/>
+ <children xmi:type="notation:Node" xmi:id="_KgpiITr8EeOGErlDG50Krg" type="5001">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_KgpiIjr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_KgpiIzr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_KgpiJDr8EeOGErlDG50Krg"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_KgqJMDr8EeOGErlDG50Krg" type="5002">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_KgqJMTr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_KgqJMjr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_KgqJMzr8EeOGErlDG50Krg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_KgoUATr8EeOGErlDG50Krg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/>
+ <element xmi:type="ecore:EClass" href="workingsets.ecore#//ExclusionPredicate"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_KgoUAjr8EeOGErlDG50Krg" x="75" y="555"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_fMT44Dr8EeOGErlDG50Krg" type="1001">
+ <children xmi:type="notation:Node" xmi:id="_fMVHADr8EeOGErlDG50Krg" type="4001"/>
+ <children xmi:type="notation:Node" xmi:id="_fMVHATr8EeOGErlDG50Krg" type="5001">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_fMVHAjr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_fMVHAzr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_fMVHBDr8EeOGErlDG50Krg"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_fMWVIDr8EeOGErlDG50Krg" type="5002">
+ <styles xmi:type="notation:DrawerStyle" xmi:id="_fMWVITr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_fMWVIjr8EeOGErlDG50Krg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_fMWVIzr8EeOGErlDG50Krg"/>
+ </children>
+ <styles xmi:type="notation:ShapeStyle" xmi:id="_fMT44Tr8EeOGErlDG50Krg" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/>
+ <element xmi:type="ecore:EClass" href="workingsets.ecore#//InclusionPredicate"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fMT44jr8EeOGErlDG50Krg" x="300" y="555"/>
</children>
<styles xmi:type="notation:DiagramStyle" xmi:id="_7Ik9wQNJEeOzDrIpOa7NnA"/>
<element xmi:type="ecore:EPackage" href="workingsets.ecore#/"/>
@@ -90,7 +130,48 @@
<styles xmi:type="notation:ConnectorStyle" xmi:id="_R8WAEQvHEeOoPqB4RyWmHw" routing="Rectilinear" lineColor="4210752"/>
<styles xmi:type="notation:FontStyle" xmi:id="_R8WAEgvHEeOoPqB4RyWmHw" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
<element xmi:type="ecore:EReference" href="workingsets.ecore#//WorkingSet/predicates"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_R8WAEwvHEeOoPqB4RyWmHw" points="[0, 42, 30, -91]$[0, 133, 30, 0]"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_R8WAEwvHEeOoPqB4RyWmHw" points="[-5, 49, 15, -122]$[-5, 171, 15, 0]"/>
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_R8ctwAvHEeOoPqB4RyWmHw" id="(0.3497942386831276,0.011627906976744186)"/>
</edges>
+ <edges xmi:type="notation:Edge" xmi:id="_omZNsDr8EeOGErlDG50Krg" type="3002" source="_fMT44Dr8EeOGErlDG50Krg" target="_7JI-cANJEeOzDrIpOa7NnA">
+ <children xmi:type="notation:Node" xmi:id="_ombp8Dr8EeOGErlDG50Krg" type="4011">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_ombp8Tr8EeOGErlDG50Krg" x="-8" y="115"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_omc4EDr8EeOGErlDG50Krg" type="4012">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_omc4ETr8EeOGErlDG50Krg" x="-4" y="-27"/>
+ </children>
+ <styles xmi:type="notation:ConnectorStyle" xmi:id="_omZNsTr8EeOGErlDG50Krg" routing="Rectilinear" lineColor="4210752"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_omZNsjr8EeOGErlDG50Krg" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
+ <element xmi:type="ecore:EReference" href="workingsets.ecore#//InclusionPredicate/includedWorkingSets"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_omZNszr8EeOGErlDG50Krg" points="[0, -7, -22, 265]$[24, -234, 2, 38]"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_omkM0Tr8EeOGErlDG50Krg" id="(0.9835390946502057,0.62)"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_xB5aYDr8EeOGErlDG50Krg" type="3002" source="_KgoUADr8EeOGErlDG50Krg" target="_7JI-cANJEeOzDrIpOa7NnA">
+ <children xmi:type="notation:Node" xmi:id="_xB6BcDr8EeOGErlDG50Krg" type="4011">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_xB6BcTr8EeOGErlDG50Krg" x="5" y="32"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_xB6ogDr8EeOGErlDG50Krg" type="4012">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_xB6ogTr8EeOGErlDG50Krg" x="-4" y="-66"/>
+ </children>
+ <styles xmi:type="notation:ConnectorStyle" xmi:id="_xB5aYTr8EeOGErlDG50Krg" routing="Rectilinear" lineColor="4210752"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_xB5aYjr8EeOGErlDG50Krg" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
+ <element xmi:type="ecore:EReference" href="workingsets.ecore#//ExclusionPredicate/excludedWorkingSets"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_xB5aYzr8EeOGErlDG50Krg" points="[2, -16, -30, 339]$[33, -318, 1, 37]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_xB8dsDr8EeOGErlDG50Krg" id="(0.16049382716049382,0.3469387755102041)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_xB8dsTr8EeOGErlDG50Krg" id="(0.09465020576131687,0.63)"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_6QtTUDr8EeOGErlDG50Krg" type="3003" source="_KgoUADr8EeOGErlDG50Krg" target="_PXT3gAvHEeOoPqB4RyWmHw">
+ <styles xmi:type="notation:ConnectorStyle" xmi:id="_6QtTUTr8EeOGErlDG50Krg" routing="Rectilinear" lineColor="4210752"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_6QtTUjr8EeOGErlDG50Krg" fontName="Segoe UI"/>
+ <element xsi:nil="true"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6QtTUzr8EeOGErlDG50Krg" points="[1, 0, -60, 145]$[1, -55, -60, 90]$[56, -55, -5, 90]$[56, -110, -5, 35]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6QxkwDr8EeOGErlDG50Krg" id="(0.5925925925925926,0.02040816326530612)"/>
+ </edges>
+ <edges xmi:type="notation:Edge" xmi:id="_8MAiYDr8EeOGErlDG50Krg" type="3003" source="_fMT44Dr8EeOGErlDG50Krg" target="_PXT3gAvHEeOoPqB4RyWmHw">
+ <styles xmi:type="notation:ConnectorStyle" xmi:id="_8MAiYTr8EeOGErlDG50Krg" routing="Rectilinear" lineColor="4210752"/>
+ <styles xmi:type="notation:FontStyle" xmi:id="_8MBJcDr8EeOGErlDG50Krg" fontName="Segoe UI"/>
+ <element xsi:nil="true"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_8MBJcTr8EeOGErlDG50Krg" points="[-28, -23, 141, 124]$[-168, -133, 1, 14]"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8MCXkDr8EeOGErlDG50Krg" id="(0.3484848484848485,0.8055555555555556)"/>
+ </edges>
</notation:Diagram>
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.genmodel b/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.genmodel
index dbfd1f8d63..29803ee752 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.genmodel
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/model/workingsets.genmodel
@@ -10,15 +10,27 @@
operationReflection="true" importOrganizing="true" decoration="Live">
<foreignModel>workingsets.ecore</foreignModel>
<genPackages prefix="WorkingSets" basePackage="org.eclipse.emf.cdo.releng" disposableProviderFactory="true"
- multipleEditorPages="false" ecorePackage="workingsets.ecore#/">
+ multipleEditorPages="false" childCreationExtenders="true" ecorePackage="workingsets.ecore#/">
<genDataTypes ecoreDataType="workingsets.ecore#//Project"/>
<genClasses ecoreClass="workingsets.ecore#//WorkingSet">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute workingsets.ecore#//WorkingSet/name"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference workingsets.ecore#//WorkingSet/predicates"/>
<genFeatures property="None" createChild="false" ecoreFeature="ecore:EAttribute workingsets.ecore#//WorkingSet/id"/>
+ <genOperations ecoreOperation="workingsets.ecore#//WorkingSet/matches">
+ <genParameters ecoreParameter="workingsets.ecore#//WorkingSet/matches/project"/>
+ </genOperations>
</genClasses>
<genClasses ecoreClass="workingsets.ecore#//WorkingSetGroup">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference workingsets.ecore#//WorkingSetGroup/workingSets"/>
+ <genOperations ecoreOperation="workingsets.ecore#//WorkingSetGroup/getWorkingSet">
+ <genParameters ecoreParameter="workingsets.ecore#//WorkingSetGroup/getWorkingSet/name"/>
+ </genOperations>
+ </genClasses>
+ <genClasses ecoreClass="workingsets.ecore#//ExclusionPredicate">
+ <genFeatures createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference workingsets.ecore#//ExclusionPredicate/excludedWorkingSets"/>
+ </genClasses>
+ <genClasses ecoreClass="workingsets.ecore#//InclusionPredicate">
+ <genFeatures createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference workingsets.ecore#//InclusionPredicate/includedWorkingSets"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/ExclusionPredicate.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/ExclusionPredicate.java
new file mode 100644
index 0000000000..af31a2154c
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/ExclusionPredicate.java
@@ -0,0 +1,42 @@
+/**
+ */
+package org.eclipse.emf.cdo.releng.workingsets;
+
+import org.eclipse.emf.cdo.releng.predicates.Predicate;
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Exclusion Predicate</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate#getExcludedWorkingSets <em>Excluded Working Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage#getExclusionPredicate()
+ * @model
+ * @generated
+ */
+public interface ExclusionPredicate extends Predicate
+{
+ /**
+ * Returns the value of the '<em><b>Excluded Working Sets</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Excluded Working Sets</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Excluded Working Sets</em>' reference list.
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage#getExclusionPredicate_ExcludedWorkingSets()
+ * @model
+ * @generated
+ */
+ EList<WorkingSet> getExcludedWorkingSets();
+
+} // ExclusionPredicate
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/InclusionPredicate.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/InclusionPredicate.java
new file mode 100644
index 0000000000..f6adae833a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/InclusionPredicate.java
@@ -0,0 +1,42 @@
+/**
+ */
+package org.eclipse.emf.cdo.releng.workingsets;
+
+import org.eclipse.emf.cdo.releng.predicates.Predicate;
+import org.eclipse.emf.common.util.EList;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Inclusion Predicate</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate#getIncludedWorkingSets <em>Included Working Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage#getInclusionPredicate()
+ * @model
+ * @generated
+ */
+public interface InclusionPredicate extends Predicate
+{
+ /**
+ * Returns the value of the '<em><b>Included Working Sets</b></em>' reference list.
+ * The list contents are of type {@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Included Working Sets</em>' reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Included Working Sets</em>' reference list.
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage#getInclusionPredicate_IncludedWorkingSets()
+ * @model
+ * @generated
+ */
+ EList<WorkingSet> getIncludedWorkingSets();
+
+} // InclusionPredicate
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSet.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSet.java
index 9e2f16a94f..c9cfe9c508 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSet.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSet.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.releng.workingsets;
+import org.eclipse.core.resources.IProject;
import org.eclipse.emf.cdo.releng.predicates.Predicate;
import org.eclipse.emf.common.util.EList;
@@ -68,29 +69,37 @@ public interface WorkingSet extends EObject
String getId();
/**
- * Sets the value of the '{@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
+ * Sets the value of the '{@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet#getId <em>Id</em>}' attribute.
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
+ * @param value the new value of the '<em>Id</em>' attribute.
+ * @see #getId()
+ * @generated
+ */
void setId(String value);
/**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage#getWorkingSet_Name()
- * @model required="true"
- * @generated
- */
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model projectDataType="org.eclipse.emf.cdo.releng.workingsets.Project"
+ * @generated
+ */
+ boolean matches(IProject project);
+
+ /**
+ * Returns the value of the '<em><b>Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Name</em>' attribute.
+ * @see #setName(String)
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage#getWorkingSet_Name()
+ * @model required="true"
+ * @generated
+ */
String getName();
/**
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetGroup.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetGroup.java
index 715f2ce9ec..4dcecc57ae 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetGroup.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetGroup.java
@@ -47,4 +47,12 @@ public interface WorkingSetGroup extends EObject
*/
EList<WorkingSet> getWorkingSets();
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model
+ * @generated
+ */
+ WorkingSet getWorkingSet(String name);
+
} // WorkingSetGroup
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsFactory.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsFactory.java
index 7956d18d5f..8b09c661c5 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsFactory.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsFactory.java
@@ -49,9 +49,27 @@ public interface WorkingSetsFactory extends EFactory
WorkingSetGroup createWorkingSetGroup();
/**
- * Returns the package supported by this factory.
+ * Returns a new object of class '<em>Exclusion Predicate</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @return a new object of class '<em>Exclusion Predicate</em>'.
+ * @generated
+ */
+ ExclusionPredicate createExclusionPredicate();
+
+ /**
+ * Returns a new object of class '<em>Inclusion Predicate</em>'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return a new object of class '<em>Inclusion Predicate</em>'.
+ * @generated
+ */
+ InclusionPredicate createInclusionPredicate();
+
+ /**
+ * Returns the package supported by this factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsPackage.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsPackage.java
index 59d098ee3a..872f685821 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsPackage.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/WorkingSetsPackage.java
@@ -10,9 +10,11 @@
*/
package org.eclipse.emf.cdo.releng.workingsets;
+import org.eclipse.emf.cdo.releng.predicates.PredicatesPackage;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -104,22 +106,31 @@ public interface WorkingSetsPackage extends EPackage
int WORKING_SET__ID = 2;
/**
- * The number of structural features of the '<em>Working Set</em>' class.
- * <!-- begin-user-doc -->
+ * The number of structural features of the '<em>Working Set</em>' class.
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
- * @ordered
- */
+ * @generated
+ * @ordered
+ */
int WORKING_SET_FEATURE_COUNT = 3;
/**
- * The number of operations of the '<em>Working Set</em>' class.
+ * The operation id for the '<em>Matches</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int WORKING_SET_OPERATION_COUNT = 0;
+ int WORKING_SET___MATCHES__IPROJECT = 0;
+
+ /**
+ * The number of operations of the '<em>Working Set</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int WORKING_SET_OPERATION_COUNT = 1;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.releng.workingsets.impl.WorkingSetGroupImpl <em>Working Set Group</em>}' class.
@@ -150,23 +161,124 @@ public interface WorkingSetsPackage extends EPackage
int WORKING_SET_GROUP_FEATURE_COUNT = 1;
/**
+ * The operation id for the '<em>Get Working Set</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int WORKING_SET_GROUP___GET_WORKING_SET__STRING = 0;
+
+ /**
* The number of operations of the '<em>Working Set Group</em>' class.
* <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int WORKING_SET_GROUP_OPERATION_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.releng.workingsets.impl.ExclusionPredicateImpl <em>Exclusion Predicate</em>}' class.
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.ExclusionPredicateImpl
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.WorkingSetsPackageImpl#getExclusionPredicate()
+ * @generated
+ */
+ int EXCLUSION_PREDICATE = 2;
+
+ /**
+ * The feature id for the '<em><b>Excluded Working Sets</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
* @ordered
*/
- int WORKING_SET_GROUP_OPERATION_COUNT = 0;
+ int EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS = PredicatesPackage.PREDICATE_FEATURE_COUNT + 0;
/**
- * The meta object id for the '<em>Project</em>' data type.
+ * The number of structural features of the '<em>Exclusion Predicate</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EXCLUSION_PREDICATE_FEATURE_COUNT = PredicatesPackage.PREDICATE_FEATURE_COUNT + 1;
+
+ /**
+ * The operation id for the '<em>Matches</em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EXCLUSION_PREDICATE___MATCHES__IPROJECT = PredicatesPackage.PREDICATE___MATCHES__IPROJECT;
+
+ /**
+ * The number of operations of the '<em>Exclusion Predicate</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int EXCLUSION_PREDICATE_OPERATION_COUNT = PredicatesPackage.PREDICATE_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.releng.workingsets.impl.InclusionPredicateImpl <em>Inclusion Predicate</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.InclusionPredicateImpl
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.WorkingSetsPackageImpl#getInclusionPredicate()
+ * @generated
+ */
+ int INCLUSION_PREDICATE = 3;
+
+ /**
+ * The feature id for the '<em><b>Included Working Sets</b></em>' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INCLUSION_PREDICATE__INCLUDED_WORKING_SETS = PredicatesPackage.PREDICATE_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Inclusion Predicate</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INCLUSION_PREDICATE_FEATURE_COUNT = PredicatesPackage.PREDICATE_FEATURE_COUNT + 1;
+
+ /**
+ * The operation id for the '<em>Matches</em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INCLUSION_PREDICATE___MATCHES__IPROJECT = PredicatesPackage.PREDICATE___MATCHES__IPROJECT;
+
+ /**
+ * The number of operations of the '<em>Inclusion Predicate</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int INCLUSION_PREDICATE_OPERATION_COUNT = PredicatesPackage.PREDICATE_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '<em>Project</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @see org.eclipse.core.resources.IProject
* @see org.eclipse.emf.cdo.releng.workingsets.impl.WorkingSetsPackageImpl#getProject()
* @generated
*/
- int PROJECT = 2;
+ int PROJECT = 4;
/**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet <em>Working Set</em>}'.
@@ -201,14 +313,24 @@ public interface WorkingSetsPackage extends EPackage
EAttribute getWorkingSet_Id();
/**
- * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSet#getName()
- * @see #getWorkingSet()
- * @generated
- */
+ * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet#matches(org.eclipse.core.resources.IProject) <em>Matches</em>}' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the '<em>Matches</em>' operation.
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSet#matches(org.eclipse.core.resources.IProject)
+ * @generated
+ */
+ EOperation getWorkingSet__Matches__IProject();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.workingsets.WorkingSet#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSet#getName()
+ * @see #getWorkingSet()
+ * @generated
+ */
EAttribute getWorkingSet_Name();
/**
@@ -233,9 +355,61 @@ public interface WorkingSetsPackage extends EPackage
EReference getWorkingSetGroup_WorkingSets();
/**
- * Returns the meta object for data type '{@link org.eclipse.core.resources.IProject <em>Project</em>}'.
+ * Returns the meta object for the '{@link org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup#getWorkingSet(java.lang.String) <em>Get Working Set</em>}' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @return the meta object for the '<em>Get Working Set</em>' operation.
+ * @see org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup#getWorkingSet(java.lang.String)
+ * @generated
+ */
+ EOperation getWorkingSetGroup__GetWorkingSet__String();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate <em>Exclusion Predicate</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Exclusion Predicate</em>'.
+ * @see org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate
+ * @generated
+ */
+ EClass getExclusionPredicate();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate#getExcludedWorkingSets <em>Excluded Working Sets</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Excluded Working Sets</em>'.
+ * @see org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate#getExcludedWorkingSets()
+ * @see #getExclusionPredicate()
+ * @generated
+ */
+ EReference getExclusionPredicate_ExcludedWorkingSets();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate <em>Inclusion Predicate</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Inclusion Predicate</em>'.
+ * @see org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate
+ * @generated
+ */
+ EClass getInclusionPredicate();
+
+ /**
+ * Returns the meta object for the reference list '{@link org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate#getIncludedWorkingSets <em>Included Working Sets</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference list '<em>Included Working Sets</em>'.
+ * @see org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate#getIncludedWorkingSets()
+ * @see #getInclusionPredicate()
+ * @generated
+ */
+ EReference getInclusionPredicate_IncludedWorkingSets();
+
+ /**
+ * Returns the meta object for data type '{@link org.eclipse.core.resources.IProject <em>Project</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @return the meta object for data type '<em>Project</em>'.
* @see org.eclipse.core.resources.IProject
* @model instanceClass="org.eclipse.core.resources.IProject" serializeable="false"
@@ -294,11 +468,19 @@ public interface WorkingSetsPackage extends EPackage
EAttribute WORKING_SET__ID = eINSTANCE.getWorkingSet_Id();
/**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
+ * The meta object literal for the '<em><b>Matches</b></em>' operation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EOperation WORKING_SET___MATCHES__IPROJECT = eINSTANCE.getWorkingSet__Matches__IProject();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
EAttribute WORKING_SET__NAME = eINSTANCE.getWorkingSet_Name();
/**
@@ -320,9 +502,53 @@ public interface WorkingSetsPackage extends EPackage
EReference WORKING_SET_GROUP__WORKING_SETS = eINSTANCE.getWorkingSetGroup_WorkingSets();
/**
- * The meta object literal for the '<em>Project</em>' data type.
+ * The meta object literal for the '<em><b>Get Working Set</b></em>' operation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated
+ */
+ EOperation WORKING_SET_GROUP___GET_WORKING_SET__STRING = eINSTANCE.getWorkingSetGroup__GetWorkingSet__String();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.workingsets.impl.ExclusionPredicateImpl <em>Exclusion Predicate</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.ExclusionPredicateImpl
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.WorkingSetsPackageImpl#getExclusionPredicate()
+ * @generated
+ */
+ EClass EXCLUSION_PREDICATE = eINSTANCE.getExclusionPredicate();
+
+ /**
+ * The meta object literal for the '<em><b>Excluded Working Sets</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS = eINSTANCE.getExclusionPredicate_ExcludedWorkingSets();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.releng.workingsets.impl.InclusionPredicateImpl <em>Inclusion Predicate</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.InclusionPredicateImpl
+ * @see org.eclipse.emf.cdo.releng.workingsets.impl.WorkingSetsPackageImpl#getInclusionPredicate()
+ * @generated
+ */
+ EClass INCLUSION_PREDICATE = eINSTANCE.getInclusionPredicate();
+
+ /**
+ * The meta object literal for the '<em><b>Included Working Sets</b></em>' reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EReference INCLUSION_PREDICATE__INCLUDED_WORKING_SETS = eINSTANCE.getInclusionPredicate_IncludedWorkingSets();
+
+ /**
+ * The meta object literal for the '<em>Project</em>' data type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @see org.eclipse.core.resources.IProject
* @see org.eclipse.emf.cdo.releng.workingsets.impl.WorkingSetsPackageImpl#getProject()
* @generated
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/ExclusionPredicateImpl.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/ExclusionPredicateImpl.java
new file mode 100644
index 0000000000..908d4716f2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/ExclusionPredicateImpl.java
@@ -0,0 +1,181 @@
+/**
+ */
+package org.eclipse.emf.cdo.releng.workingsets.impl;
+
+import org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+
+import org.eclipse.core.resources.IProject;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Exclusion Predicate</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.releng.workingsets.impl.ExclusionPredicateImpl#getExcludedWorkingSets <em>Excluded Working Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class ExclusionPredicateImpl extends MinimalEObjectImpl.Container implements ExclusionPredicate
+{
+ /**
+ * The cached value of the '{@link #getExcludedWorkingSets() <em>Excluded Working Sets</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getExcludedWorkingSets()
+ * @generated
+ * @ordered
+ */
+ protected EList<WorkingSet> excludedWorkingSets;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ExclusionPredicateImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return WorkingSetsPackage.Literals.EXCLUSION_PREDICATE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<WorkingSet> getExcludedWorkingSets()
+ {
+ if (excludedWorkingSets == null)
+ {
+ excludedWorkingSets = new EObjectResolvingEList<WorkingSet>(WorkingSet.class, this,
+ WorkingSetsPackage.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS);
+ }
+ return excludedWorkingSets;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean matches(IProject project)
+ {
+ for (WorkingSet workingSet : getExcludedWorkingSets())
+ {
+ if (workingSet.matches(project))
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS:
+ return getExcludedWorkingSets();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS:
+ getExcludedWorkingSets().clear();
+ getExcludedWorkingSets().addAll((Collection<? extends WorkingSet>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS:
+ getExcludedWorkingSets().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS:
+ return excludedWorkingSets != null && !excludedWorkingSets.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException
+ {
+ switch (operationID)
+ {
+ case WorkingSetsPackage.EXCLUSION_PREDICATE___MATCHES__IPROJECT:
+ return matches((IProject)arguments.get(0));
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+} // ExclusionPredicateImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/InclusionPredicateImpl.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/InclusionPredicateImpl.java
new file mode 100644
index 0000000000..fddddc13fd
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/InclusionPredicateImpl.java
@@ -0,0 +1,181 @@
+/**
+ */
+package org.eclipse.emf.cdo.releng.workingsets.impl;
+
+import org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
+import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
+import org.eclipse.emf.ecore.util.EObjectResolvingEList;
+
+import org.eclipse.core.resources.IProject;
+
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collection;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Inclusion Predicate</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.releng.workingsets.impl.InclusionPredicateImpl#getIncludedWorkingSets <em>Included Working Sets</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class InclusionPredicateImpl extends MinimalEObjectImpl.Container implements InclusionPredicate
+{
+ /**
+ * The cached value of the '{@link #getIncludedWorkingSets() <em>Included Working Sets</em>}' reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIncludedWorkingSets()
+ * @generated
+ * @ordered
+ */
+ protected EList<WorkingSet> includedWorkingSets;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected InclusionPredicateImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return WorkingSetsPackage.Literals.INCLUSION_PREDICATE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EList<WorkingSet> getIncludedWorkingSets()
+ {
+ if (includedWorkingSets == null)
+ {
+ includedWorkingSets = new EObjectResolvingEList<WorkingSet>(WorkingSet.class, this,
+ WorkingSetsPackage.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS);
+ }
+ return includedWorkingSets;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean matches(IProject project)
+ {
+ for (WorkingSet workingSet : getIncludedWorkingSets())
+ {
+ if (workingSet.matches(project))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS:
+ return getIncludedWorkingSets();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS:
+ getIncludedWorkingSets().clear();
+ getIncludedWorkingSets().addAll((Collection<? extends WorkingSet>)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS:
+ getIncludedWorkingSets().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case WorkingSetsPackage.INCLUSION_PREDICATE__INCLUDED_WORKING_SETS:
+ return includedWorkingSets != null && !includedWorkingSets.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException
+ {
+ switch (operationID)
+ {
+ case WorkingSetsPackage.INCLUSION_PREDICATE___MATCHES__IPROJECT:
+ return matches((IProject)arguments.get(0));
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+} // InclusionPredicateImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetGroupImpl.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetGroupImpl.java
index 2558a5ffa6..c600d7a058 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetGroupImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetGroupImpl.java
@@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
+import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
/**
@@ -88,6 +89,24 @@ public class WorkingSetGroupImpl extends MinimalEObjectImpl.Container implements
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public WorkingSet getWorkingSet(String name)
+ {
+ for (WorkingSet workingSet : getWorkingSets())
+ {
+ if (name.equals(workingSet.getName()))
+ {
+ return workingSet;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
@Override
@@ -169,4 +188,20 @@ public class WorkingSetGroupImpl extends MinimalEObjectImpl.Container implements
return super.eIsSet(featureID);
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException
+ {
+ switch (operationID)
+ {
+ case WorkingSetsPackage.WORKING_SET_GROUP___GET_WORKING_SET__STRING:
+ return getWorkingSet((String)arguments.get(0));
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
} // WorkingSetGroupImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetImpl.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetImpl.java
index d53c96b12c..50746875ae 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetImpl.java
@@ -24,6 +24,9 @@ import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
+import org.eclipse.core.resources.IProject;
+
+import java.lang.reflect.InvocationTargetException;
import java.util.Collection;
/**
@@ -84,20 +87,20 @@ public class WorkingSetImpl extends MinimalEObjectImpl.Container implements Work
protected static final String ID_EDEFAULT = null;
/**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
+ * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
+ * @see #getId()
+ * @generated
+ * @ordered
+ */
protected String id = ID_EDEFAULT;
/**
- * <!-- begin-user-doc -->
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
- */
+ * @generated
+ */
protected WorkingSetImpl()
{
super();
@@ -140,10 +143,10 @@ public class WorkingSetImpl extends MinimalEObjectImpl.Container implements Work
}
/**
- * <!-- begin-user-doc -->
+ * <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated
- */
+ * @generated
+ */
public void setId(String newId)
{
String oldId = id;
@@ -153,10 +156,28 @@ public class WorkingSetImpl extends MinimalEObjectImpl.Container implements Work
}
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public boolean matches(IProject project)
+ {
+ for (Predicate predicate : getPredicates())
+ {
+ if (predicate.matches(project))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public String getName()
{
return name;
@@ -285,6 +306,22 @@ public class WorkingSetImpl extends MinimalEObjectImpl.Container implements Work
* @generated
*/
@Override
+ public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException
+ {
+ switch (operationID)
+ {
+ case WorkingSetsPackage.WORKING_SET___MATCHES__IPROJECT:
+ return matches((IProject)arguments.get(0));
+ }
+ return super.eInvoke(operationID, arguments);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
public String toString()
{
if (eIsProxy())
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsFactoryImpl.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsFactoryImpl.java
index 6411e08e84..fe07cc3b8f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsFactoryImpl.java
@@ -10,11 +10,11 @@
*/
package org.eclipse.emf.cdo.releng.workingsets.impl;
+import org.eclipse.emf.cdo.releng.workingsets.*;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsFactory;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
-
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EObject;
@@ -79,6 +79,10 @@ public class WorkingSetsFactoryImpl extends EFactoryImpl implements WorkingSetsF
return createWorkingSet();
case WorkingSetsPackage.WORKING_SET_GROUP:
return createWorkingSetGroup();
+ case WorkingSetsPackage.EXCLUSION_PREDICATE:
+ return createExclusionPredicate();
+ case WorkingSetsPackage.INCLUSION_PREDICATE:
+ return createInclusionPredicate();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -141,6 +145,28 @@ public class WorkingSetsFactoryImpl extends EFactoryImpl implements WorkingSetsF
* <!-- end-user-doc -->
* @generated
*/
+ public ExclusionPredicate createExclusionPredicate()
+ {
+ ExclusionPredicateImpl exclusionPredicate = new ExclusionPredicateImpl();
+ return exclusionPredicate;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public InclusionPredicate createInclusionPredicate()
+ {
+ InclusionPredicateImpl inclusionPredicate = new InclusionPredicateImpl();
+ return inclusionPredicate;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public WorkingSetsPackage getWorkingSetsPackage()
{
return (WorkingSetsPackage)getEPackage();
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsPackageImpl.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsPackageImpl.java
index 9edf3793cf..0e02caf4a5 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsPackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/impl/WorkingSetsPackageImpl.java
@@ -11,6 +11,8 @@
package org.eclipse.emf.cdo.releng.workingsets.impl;
import org.eclipse.emf.cdo.releng.predicates.PredicatesPackage;
+import org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate;
+import org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsFactory;
@@ -19,6 +21,7 @@ import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
@@ -52,6 +55,20 @@ public class WorkingSetsPackageImpl extends EPackageImpl implements WorkingSetsP
* <!-- end-user-doc -->
* @generated
*/
+ private EClass exclusionPredicateEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass inclusionPredicateEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EDataType projectEDataType = null;
/**
@@ -152,10 +169,20 @@ public class WorkingSetsPackageImpl extends EPackageImpl implements WorkingSetsP
}
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EOperation getWorkingSet__Matches__IProject()
+ {
+ return workingSetEClass.getEOperations().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EAttribute getWorkingSet_Name()
{
return (EAttribute)workingSetEClass.getEStructuralFeatures().get(0);
@@ -186,6 +213,56 @@ public class WorkingSetsPackageImpl extends EPackageImpl implements WorkingSetsP
* <!-- end-user-doc -->
* @generated
*/
+ public EOperation getWorkingSetGroup__GetWorkingSet__String()
+ {
+ return workingSetGroupEClass.getEOperations().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getExclusionPredicate()
+ {
+ return exclusionPredicateEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getExclusionPredicate_ExcludedWorkingSets()
+ {
+ return (EReference)exclusionPredicateEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EClass getInclusionPredicate()
+ {
+ return inclusionPredicateEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getInclusionPredicate_IncludedWorkingSets()
+ {
+ return (EReference)inclusionPredicateEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EDataType getProject()
{
return projectEDataType;
@@ -226,9 +303,17 @@ public class WorkingSetsPackageImpl extends EPackageImpl implements WorkingSetsP
createEAttribute(workingSetEClass, WORKING_SET__NAME);
createEReference(workingSetEClass, WORKING_SET__PREDICATES);
createEAttribute(workingSetEClass, WORKING_SET__ID);
+ createEOperation(workingSetEClass, WORKING_SET___MATCHES__IPROJECT);
workingSetGroupEClass = createEClass(WORKING_SET_GROUP);
createEReference(workingSetGroupEClass, WORKING_SET_GROUP__WORKING_SETS);
+ createEOperation(workingSetGroupEClass, WORKING_SET_GROUP___GET_WORKING_SET__STRING);
+
+ exclusionPredicateEClass = createEClass(EXCLUSION_PREDICATE);
+ createEReference(exclusionPredicateEClass, EXCLUSION_PREDICATE__EXCLUDED_WORKING_SETS);
+
+ inclusionPredicateEClass = createEClass(INCLUSION_PREDICATE);
+ createEReference(inclusionPredicateEClass, INCLUSION_PREDICATE__INCLUDED_WORKING_SETS);
// Create data types
projectEDataType = createEDataType(PROJECT);
@@ -268,6 +353,8 @@ public class WorkingSetsPackageImpl extends EPackageImpl implements WorkingSetsP
// Set bounds for type parameters
// Add supertypes to classes
+ exclusionPredicateEClass.getESuperTypes().add(thePredicatesPackage.getPredicate());
+ inclusionPredicateEClass.getESuperTypes().add(thePredicatesPackage.getPredicate());
// Initialize classes, features, and operations; add parameters
initEClass(workingSetEClass, WorkingSet.class, "WorkingSet", !IS_ABSTRACT, !IS_INTERFACE,
@@ -280,6 +367,10 @@ public class WorkingSetsPackageImpl extends EPackageImpl implements WorkingSetsP
initEAttribute(getWorkingSet_Id(), ecorePackage.getEString(), "id", null, 0, 1, WorkingSet.class, !IS_TRANSIENT,
!IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ EOperation op = initEOperation(getWorkingSet__Matches__IProject(), ecorePackage.getEBoolean(), "matches", 0, 1,
+ IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, this.getProject(), "project", 0, 1, IS_UNIQUE, IS_ORDERED);
+
initEClass(workingSetGroupEClass, WorkingSetGroup.class, "WorkingSetGroup", !IS_ABSTRACT, !IS_INTERFACE,
IS_GENERATED_INSTANCE_CLASS);
initEReference(getWorkingSetGroup_WorkingSets(), this.getWorkingSet(), null, "workingSets", null, 0, -1,
@@ -287,6 +378,22 @@ public class WorkingSetsPackageImpl extends EPackageImpl implements WorkingSetsP
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
getWorkingSetGroup_WorkingSets().getEKeys().add(this.getWorkingSet_Name());
+ op = initEOperation(getWorkingSetGroup__GetWorkingSet__String(), this.getWorkingSet(), "getWorkingSet", 0, 1,
+ IS_UNIQUE, IS_ORDERED);
+ addEParameter(op, ecorePackage.getEString(), "name", 0, 1, IS_UNIQUE, IS_ORDERED);
+
+ initEClass(exclusionPredicateEClass, ExclusionPredicate.class, "ExclusionPredicate", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getExclusionPredicate_ExcludedWorkingSets(), this.getWorkingSet(), null, "excludedWorkingSets",
+ null, 0, -1, ExclusionPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
+ IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(inclusionPredicateEClass, InclusionPredicate.class, "InclusionPredicate", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getInclusionPredicate_IncludedWorkingSets(), this.getWorkingSet(), null, "includedWorkingSets",
+ null, 0, -1, InclusionPredicate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
+ IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
// Initialize data types
initEDataType(projectEDataType, IProject.class, "Project", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsAdapterFactory.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsAdapterFactory.java
index f891c379a3..9032c76bc1 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsAdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsAdapterFactory.java
@@ -10,10 +10,11 @@
*/
package org.eclipse.emf.cdo.releng.workingsets.util;
+import org.eclipse.emf.cdo.releng.predicates.Predicate;
+import org.eclipse.emf.cdo.releng.workingsets.*;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
-
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
@@ -94,6 +95,24 @@ public class WorkingSetsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseExclusionPredicate(ExclusionPredicate object)
+ {
+ return createExclusionPredicateAdapter();
+ }
+
+ @Override
+ public Adapter caseInclusionPredicate(InclusionPredicate object)
+ {
+ return createInclusionPredicateAdapter();
+ }
+
+ @Override
+ public Adapter casePredicate(Predicate object)
+ {
+ return createPredicateAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object)
{
return createEObjectAdapter();
@@ -145,11 +164,56 @@ public class WorkingSetsAdapterFactory extends AdapterFactoryImpl
}
/**
- * Creates a new adapter for the default case.
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate <em>Exclusion Predicate</em>}'.
* <!-- begin-user-doc -->
- * This default implementation returns null.
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
+ * @see org.eclipse.emf.cdo.releng.workingsets.ExclusionPredicate
+ * @generated
+ */
+ public Adapter createExclusionPredicateAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate <em>Inclusion Predicate</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.releng.workingsets.InclusionPredicate
+ * @generated
+ */
+ public Adapter createInclusionPredicateAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.releng.predicates.Predicate <em>Predicate</em>}'.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
+ * @see org.eclipse.emf.cdo.releng.predicates.Predicate
+ * @generated
+ */
+ public Adapter createPredicateAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for the default case.
+ * <!-- begin-user-doc -->
+ * This default implementation returns null.
+ * <!-- end-user-doc -->
+ * @return the new adapter.
* @generated
*/
public Adapter createEObjectAdapter()
diff --git a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsSwitch.java b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsSwitch.java
index c0ace2837f..01f8f7c270 100644
--- a/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsSwitch.java
+++ b/plugins/org.eclipse.emf.cdo.releng.workingsets/src/org/eclipse/emf/cdo/releng/workingsets/util/WorkingSetsSwitch.java
@@ -10,10 +10,11 @@
*/
package org.eclipse.emf.cdo.releng.workingsets.util;
+import org.eclipse.emf.cdo.releng.predicates.Predicate;
+import org.eclipse.emf.cdo.releng.workingsets.*;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSet;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetGroup;
import org.eclipse.emf.cdo.releng.workingsets.WorkingSetsPackage;
-
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.util.Switch;
@@ -97,6 +98,26 @@ public class WorkingSetsSwitch<T> extends Switch<T>
result = defaultCase(theEObject);
return result;
}
+ case WorkingSetsPackage.EXCLUSION_PREDICATE:
+ {
+ ExclusionPredicate exclusionPredicate = (ExclusionPredicate)theEObject;
+ T result = caseExclusionPredicate(exclusionPredicate);
+ if (result == null)
+ result = casePredicate(exclusionPredicate);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
+ case WorkingSetsPackage.INCLUSION_PREDICATE:
+ {
+ InclusionPredicate inclusionPredicate = (InclusionPredicate)theEObject;
+ T result = caseInclusionPredicate(inclusionPredicate);
+ if (result == null)
+ result = casePredicate(inclusionPredicate);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -135,12 +156,60 @@ public class WorkingSetsSwitch<T> extends Switch<T>
}
/**
- * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * Returns the result of interpreting the object as an instance of '<em>Exclusion Predicate</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
- * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Exclusion Predicate</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseExclusionPredicate(ExclusionPredicate object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Inclusion Predicate</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Inclusion Predicate</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseInclusionPredicate(InclusionPredicate object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Predicate</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of '<em>Predicate</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T casePredicate(Predicate object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
+ * <!-- begin-user-doc -->
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch, but this is the last case anyway.
+ * <!-- end-user-doc -->
+ * @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated

Back to the top