summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-03 01:55:52 (EDT)
committerEike Stepper2007-07-03 01:55:52 (EDT)
commit90975c87583195bfd4ea1027b8a029d49fccf015 (patch)
treed257066e634d425c5b76907abd6a1b388c451d54
parenta5fe345cc14b6ec20ba8322c5480b2ea84236793 (diff)
downloadcdo-90975c87583195bfd4ea1027b8a029d49fccf015.zip
cdo-90975c87583195bfd4ea1027b8a029d49fccf015.tar.gz
cdo-90975c87583195bfd4ea1027b8a029d49fccf015.tar.bz2
task 1: Develop 0.8.0
-rw-r--r--plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java103
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/model/resource.genmodel14
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/Connector.java19
4 files changed, 36 insertions, 111 deletions
diff --git a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java
index 3147cf3..473847f 100644
--- a/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.edit/src/org/eclipse/emf/cdo/eresource/provider/CDOResourceItemProvider.java
@@ -14,7 +14,6 @@ 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.EStructuralFeature;
-import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -63,34 +62,16 @@ public class CDOResourceItemProvider extends ItemProviderAdapter implements IEdi
{
super.getPropertyDescriptors(object);
- addResourceSetPropertyDescriptor(object);
addURIPropertyDescriptor(object);
addModifiedPropertyDescriptor(object);
addLoadedPropertyDescriptor(object);
addTrackingModificationPropertyDescriptor(object);
- addErrorsPropertyDescriptor(object);
- addWarningsPropertyDescriptor(object);
addPathPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
/**
- * This adds a property descriptor for the Resource Set feature. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addResourceSetPropertyDescriptor(Object object)
- {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
- .getRootAdapterFactory(), getResourceLocator(), getString("_UI_CDOResource_resourceSet_feature"), getString(
- "_UI_PropertyDescriptor_description", "_UI_CDOResource_resourceSet_feature", "_UI_CDOResource_type"),
- EresourcePackage.Literals.CDO_RESOURCE__RESOURCE_SET, true, false, false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
- }
-
- /**
* This adds a property descriptor for the URI feature. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
@@ -101,7 +82,7 @@ public class CDOResourceItemProvider extends ItemProviderAdapter implements IEdi
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
.getRootAdapterFactory(), getResourceLocator(), getString("_UI_CDOResource_uRI_feature"), getString(
"_UI_PropertyDescriptor_description", "_UI_CDOResource_uRI_feature", "_UI_CDOResource_type"),
- EresourcePackage.Literals.CDO_RESOURCE__URI, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ EresourcePackage.Literals.CDO_RESOURCE__URI, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null, null));
}
@@ -116,7 +97,7 @@ public class CDOResourceItemProvider extends ItemProviderAdapter implements IEdi
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
.getRootAdapterFactory(), getResourceLocator(), getString("_UI_CDOResource_modified_feature"), getString(
"_UI_PropertyDescriptor_description", "_UI_CDOResource_modified_feature", "_UI_CDOResource_type"),
- EresourcePackage.Literals.CDO_RESOURCE__MODIFIED, true, false, false,
+ EresourcePackage.Literals.CDO_RESOURCE__MODIFIED, false, false, false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}
@@ -131,8 +112,8 @@ public class CDOResourceItemProvider extends ItemProviderAdapter implements IEdi
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
.getRootAdapterFactory(), getResourceLocator(), getString("_UI_CDOResource_loaded_feature"), getString(
"_UI_PropertyDescriptor_description", "_UI_CDOResource_loaded_feature", "_UI_CDOResource_type"),
- EresourcePackage.Literals.CDO_RESOURCE__LOADED, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
- null, null));
+ EresourcePackage.Literals.CDO_RESOURCE__LOADED, false, false, false,
+ ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null));
}
/**
@@ -151,36 +132,6 @@ public class CDOResourceItemProvider extends ItemProviderAdapter implements IEdi
}
/**
- * This adds a property descriptor for the Errors feature. <!-- begin-user-doc
- * --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addErrorsPropertyDescriptor(Object object)
- {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
- .getRootAdapterFactory(), getResourceLocator(), getString("_UI_CDOResource_errors_feature"), getString(
- "_UI_PropertyDescriptor_description", "_UI_CDOResource_errors_feature", "_UI_CDOResource_type"),
- EresourcePackage.Literals.CDO_RESOURCE__ERRORS, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null, null));
- }
-
- /**
- * This adds a property descriptor for the Warnings feature. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addWarningsPropertyDescriptor(Object object)
- {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
- .getRootAdapterFactory(), getResourceLocator(), getString("_UI_CDOResource_warnings_feature"), getString(
- "_UI_PropertyDescriptor_description", "_UI_CDOResource_warnings_feature", "_UI_CDOResource_type"),
- EresourcePackage.Literals.CDO_RESOURCE__WARNINGS, true, false, false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
- }
-
- /**
* This adds a property descriptor for the Path feature. <!-- begin-user-doc
* --> <!-- end-user-doc -->
*
@@ -191,7 +142,7 @@ public class CDOResourceItemProvider extends ItemProviderAdapter implements IEdi
itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory)adapterFactory)
.getRootAdapterFactory(), getResourceLocator(), getString("_UI_CDOResource_path_feature"), getString(
"_UI_PropertyDescriptor_description", "_UI_CDOResource_path_feature", "_UI_CDOResource_type"),
- EresourcePackage.Literals.CDO_RESOURCE__PATH, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ EresourcePackage.Literals.CDO_RESOURCE__PATH, false, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null, null));
}
@@ -292,54 +243,12 @@ public class CDOResourceItemProvider extends ItemProviderAdapter implements IEdi
* describing the children that can be created under this object. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object)
{
super.collectNewChildDescriptors(newChildDescriptors, object);
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEObject()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEAttribute()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEAnnotation()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEClass()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEDataType()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEEnum()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEEnumLiteral()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEFactory()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEOperation()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEPackage()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEParameter()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEReference()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createEGenericType()));
-
- newChildDescriptors.add(createChildParameter(EresourcePackage.Literals.CDO_RESOURCE__CONTENTS,
- EcoreFactory.eINSTANCE.createETypeParameter()));
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
index b8dc9e5..cb40e5d 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java
@@ -10,6 +10,7 @@ import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.internal.ui.bundle.CDOUI;
import org.eclipse.emf.cdo.util.CDOUtil;
+import org.eclipse.net4j.ui.actions.LongRunningAction;
import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.emf.common.command.BasicCommandStack;
@@ -1601,10 +1602,18 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv
* the context menus with contributions from the Edit menu. <!--
* begin-user-doc --> <!-- end-user-doc -->
*
- * @generated
+ * @generated NOT
*/
public void menuAboutToShow(IMenuManager menuManager)
{
+ menuManager.add(new LongRunningAction(getEditorSite().getPage(), "New Root", "Create and add a new root object")
+ {
+ @Override
+ protected void doRun(IWorkbenchPage page, IProgressMonitor monitor) throws Exception
+ {
+ }
+ });
+
((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
}
diff --git a/plugins/org.eclipse.emf.cdo/model/resource.genmodel b/plugins/org.eclipse.emf.cdo/model/resource.genmodel
index cde1312..40e3d1b 100644
--- a/plugins/org.eclipse.emf.cdo/model/resource.genmodel
+++ b/plugins/org.eclipse.emf.cdo/model/resource.genmodel
@@ -15,15 +15,15 @@
<genDataTypes ecoreDataType="eresource.ecore#//URI"/>
<genDataTypes ecoreDataType="eresource.ecore#//Diagnostic"/>
<genClasses ecoreClass="eresource.ecore#//CDOResource">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/resourceSet"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/uRI"/>
+ <genFeatures property="None" createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/resourceSet"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/uRI"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eresource.ecore#//CDOResource/contents"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/modified"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/loaded"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/modified"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/loaded"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/trackingModification"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/errors"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/warnings"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/path"/>
+ <genFeatures property="None" createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/errors"/>
+ <genFeatures property="None" createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/warnings"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute eresource.ecore#//CDOResource/path"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/Connector.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/Connector.java
index 957ef65..f5c03b2 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/Connector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/Connector.java
@@ -391,7 +391,10 @@ public abstract class Connector extends Lifecycle implements IConnector
{
try
{
- return channels.get(channelIndex);
+ synchronized (channels)
+ {
+ return channels.get(channelIndex);
+ }
}
catch (IndexOutOfBoundsException ex)
{
@@ -544,16 +547,20 @@ public abstract class Connector extends Lifecycle implements IConnector
protected void doDeactivate() throws Exception
{
setState(ConnectorState.DISCONNECTED);
- for (short i = 0; i < channels.size(); i++)
+ synchronized (channels)
{
- Channel channel = channels.get(i);
- if (channel != null)
+ for (short i = 0; i < channels.size(); i++)
{
- LifecycleUtil.deactivate(channel);
+ Channel channel = channels.get(i);
+ if (channel != null)
+ {
+ LifecycleUtil.deactivate(channel);
+ }
}
+
+ channels.clear();
}
- channels.clear();
super.doDeactivate();
}