Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 76694 invoked from network); 12 Dec 2005 17:15:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Dec 2005 17:15:19 -0000 Received: (qmail 54784 invoked by uid 500); 12 Dec 2005 17:15:17 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 54759 invoked by uid 500); 12 Dec 2005 17:15:17 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 54745 invoked by uid 99); 12 Dec 2005 17:15:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2005 09:15:16 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 12 Dec 2005 09:15:15 -0800 Received: (qmail 76508 invoked by uid 65534); 12 Dec 2005 17:14:54 -0000 Message-ID: <20051212171453.76495.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r356288 - in /geronimo/devtools/trunk/modules/eclipse-plugin/plugins: org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ Date: Mon, 12 Dec 2005 17:14:47 -0000 To: scm@geronimo.apache.org From: sppatel@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sppatel Date: Mon Dec 12 09:14:40 2005 New Revision: 356288 URL: http://svn.apache.org/viewcvs?rev=356288&view=rev Log: more migration to emf.edit Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceEnvRefTypeItemProvider.java Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java Added: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceEnvRefTypeItemProvider.java URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceEnvRefTypeItemProvider.java?rev=356288&view=auto ============================================================================== --- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceEnvRefTypeItemProvider.java (added) +++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.deployment.model.edit/src/org/apache/geronimo/xml/ns/naming/provider/ResourceEnvRefTypeItemProvider.java Mon Dec 12 09:14:40 2005 @@ -0,0 +1,439 @@ +/** + * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.geronimo.xml.ns.naming.provider; + + +import java.util.Collection; +import java.util.List; + +import org.apache.geronimo.deployment.model.edit.GeronimoEMFEditPlugin; +import org.apache.geronimo.xml.ns.naming.NamingPackage; +import org.apache.geronimo.xml.ns.naming.ResourceEnvRefType; +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.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITableItemLabelProvider; +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; + +/** + * This is the item provider adapter for a {@link org.apache.geronimo.xml.ns.naming.ResourceEnvRefType} object. + * + * + * @generated NOT + */ +public class ResourceEnvRefTypeItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource , + ITableItemLabelProvider +{ + /** + * + * + * @generated + */ + public static final String copyright = ""; + + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ResourceEnvRefTypeItemProvider(AdapterFactory adapterFactory) + { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + public List getPropertyDescriptors(Object object) + { + if (itemPropertyDescriptors == null) + { + super.getPropertyDescriptors(object); + + addRefNamePropertyDescriptor(object); + addDomainPropertyDescriptor(object); + addServerPropertyDescriptor(object); + addApplicationPropertyDescriptor(object); + addModulePropertyDescriptor(object); + addTypePropertyDescriptor(object); + addNamePropertyDescriptor(object); + addMessageDestinationLinkPropertyDescriptor(object); + addAdminObjectModulePropertyDescriptor(object); + addAdminObjectLinkPropertyDescriptor(object); + addTargetNamePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Ref Name feature. + * + * + * @generated + */ + protected void addRefNamePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_refName_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_refName_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_RefName(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Domain feature. + * + * + * @generated + */ + protected void addDomainPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_domain_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_domain_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_Domain(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Server feature. + * + * + * @generated + */ + protected void addServerPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_server_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_server_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_Server(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Application feature. + * + * + * @generated + */ + protected void addApplicationPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_application_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_application_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_Application(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Module feature. + * + * + * @generated + */ + protected void addModulePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_module_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_module_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_Module(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Type feature. + * + * + * @generated + */ + protected void addTypePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_type_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_type_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_Type(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_name_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_Name(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Message Destination Link feature. + * + * + * @generated + */ + protected void addMessageDestinationLinkPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_messageDestinationLink_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_messageDestinationLink_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_MessageDestinationLink(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Admin Object Module feature. + * + * + * @generated + */ + protected void addAdminObjectModulePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_adminObjectModule_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_adminObjectModule_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_AdminObjectModule(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Admin Object Link feature. + * + * + * @generated + */ + protected void addAdminObjectLinkPropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_adminObjectLink_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_adminObjectLink_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_AdminObjectLink(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Target Name feature. + * + * + * @generated + */ + protected void addTargetNamePropertyDescriptor(Object object) + { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ResourceEnvRefType_targetName_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ResourceEnvRefType_targetName_feature", "_UI_ResourceEnvRefType_type"), + NamingPackage.eINSTANCE.getResourceEnvRefType_TargetName(), + true, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns ResourceEnvRefType.gif. + * + * + * @generated + */ + public Object getImage(Object object) + { + return getResourceLocator().getImage("full/obj16/ResourceEnvRefType"); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + public String getText(Object object) + { + String label = ((ResourceEnvRefType)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_ResourceEnvRefType_type") : + getString("_UI_ResourceEnvRefType_type") + " " + label; + } + + /** + * 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}. + * + * + * @generated + */ + public void notifyChanged(Notification notification) + { + updateChildren(notification); + + switch (notification.getFeatureID(ResourceEnvRefType.class)) + { + case NamingPackage.RESOURCE_ENV_REF_TYPE__REF_NAME: + case NamingPackage.RESOURCE_ENV_REF_TYPE__DOMAIN: + case NamingPackage.RESOURCE_ENV_REF_TYPE__SERVER: + case NamingPackage.RESOURCE_ENV_REF_TYPE__APPLICATION: + case NamingPackage.RESOURCE_ENV_REF_TYPE__MODULE: + case NamingPackage.RESOURCE_ENV_REF_TYPE__TYPE: + case NamingPackage.RESOURCE_ENV_REF_TYPE__NAME: + case NamingPackage.RESOURCE_ENV_REF_TYPE__MESSAGE_DESTINATION_LINK: + case NamingPackage.RESOURCE_ENV_REF_TYPE__ADMIN_OBJECT_MODULE: + case NamingPackage.RESOURCE_ENV_REF_TYPE__ADMIN_OBJECT_LINK: + case NamingPackage.RESOURCE_ENV_REF_TYPE__TARGET_NAME: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds to the collection of {@link org.eclipse.emf.edit.command.CommandParameter}s + * describing all of the children that can be created under this object. + * + * + * @generated + */ + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) + { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + public ResourceLocator getResourceLocator() + { + return GeronimoEMFEditPlugin.INSTANCE; + } + + /** + * This does the same thing as ITableLabelProvider.getColumnText. + */ + public String getColumnText(Object object, int columnIndex) { + ResourceEnvRefType o = (ResourceEnvRefType) object; + switch(columnIndex) { + case 0: + if(o.eIsSet(NamingPackage.eINSTANCE.getResourceEnvRefType_RefName())) { + return o.getRefName(); + } + break; + case 1: + if(o.eIsSet(NamingPackage.eINSTANCE.getResourceEnvRefType_MessageDestinationLink())) { + return o.getMessageDestinationLink(); + } + break; + } + return ""; + } + + /** + * This does the same thing as ITableLabelProvider.getColumnImage. + */ + public Object getColumnImage(Object object, int columnIndex) { + if (columnIndex == 0) { + return getResourceLocator().getImage("full/obj16/ResourceEnvRefType"); + } + return null; + } + +} Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java?rev=356288&r1=356287&r2=356288&view=diff ============================================================================== --- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java (original) +++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceEnvRefSection.java Mon Dec 12 09:14:40 2005 @@ -15,14 +15,17 @@ */ package org.apache.geronimo.ui.sections; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.geronimo.ui.internal.GeronimoUIPlugin; import org.apache.geronimo.ui.internal.Messages; import org.apache.geronimo.ui.wizards.ResourceEnvRefWizard; +import org.apache.geronimo.xml.ns.j2ee.web.provider.WebItemProviderAdapterFactory; import org.apache.geronimo.xml.ns.naming.NamingFactory; import org.apache.geronimo.xml.ns.naming.NamingPackage; +import org.apache.geronimo.xml.ns.naming.provider.NamingItemProviderAdapterFactory; import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EFactory; @@ -41,7 +44,8 @@ FormToolkit toolkit, int style, EReference resourceEnvRefERef) { super(plan, parent, toolkit, style); this.resourceEnvRefERef = resourceEnvRefERef; - create(); + //create(); + createNew(); } /* @@ -120,7 +124,10 @@ } public List getFactories() { - return Collections.EMPTY_LIST; + List factories = new ArrayList(); + factories.add(new WebItemProviderAdapterFactory()); + factories.add(new NamingItemProviderAdapterFactory()); + return factories; } public EClass getTableEntryObjectType() { Modified: geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java URL: http://svn.apache.org/viewcvs/geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java?rev=356288&r1=356287&r2=356288&view=diff ============================================================================== --- geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java (original) +++ geronimo/devtools/trunk/modules/eclipse-plugin/plugins/org.apache.geronimo.ui/src/org/apache/geronimo/ui/sections/ResourceRefSection.java Mon Dec 12 09:14:40 2005 @@ -57,47 +57,7 @@ this.factory = factory; createNew(); //super.createClient(); - } - - /*public void createClient() { - - getSection().setText(getTitle()); - getSection().setDescription(getDescription()); - getSection().setLayoutData(getSectionLayoutData()); - Composite composite = createTableComposite(getSection()); - getSection().setClient(composite); - createTable(composite); - - List factories = new ArrayList(); - factories.add(new WebItemProviderAdapterFactory()); - factories.add(new NamingItemProviderAdapterFactory()); - - ComposedAdapterFactory a = new ComposedAdapterFactory(factories); - - tableViewer = new TableViewer(table); - tableViewer.setContentProvider(new AdapterFactoryContentProvider( - a)); - tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(a)); - tableViewer.setInput(plan); - - tableViewer.addFilter(new ViewerFilter() { - public boolean select(Viewer viewer, Object parentElement, - Object element) { - return NamingPackage.eINSTANCE.getResourceRefType().isInstance( - element); - } - }); - - if (getTableColumnNames().length > 0) { - tableViewer.setColumnProperties(getTableColumnNames()); - } - - Composite buttonComp = createButtonComposite(composite); - createAddButton(toolkit, buttonComp); - createRemoveButton(toolkit, buttonComp); - createEditButton(toolkit, buttonComp); - - }*/ + } /* * (non-Javadoc)