diff options
Diffstat (limited to 'plugins/org.eclipse.jst.j2ee/applicationedit/org')
21 files changed, 0 insertions, 3273 deletions
diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/common/CreateChildCommand.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/common/CreateChildCommand.java deleted file mode 100644 index a1f94fd2b..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/common/CreateChildCommand.java +++ /dev/null @@ -1,131 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.common; - - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandWrapper; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.CommandActionDelegate; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.domain.EditingDomain; - - -/** - * This is used to generate a command that will add a new child of appropriate type to an object. - * The implementation specifies an owner, a feature, and a helper to which the implementation is - * delegated, - */ -public class CreateChildCommand extends CommandWrapper implements CommandActionDelegate { - - /** - * This is the helper interface to which child creation is delegated. - */ - public static interface Helper { - /** - * This implements the default command behavior - */ - public Object createChild(Object object); - - /** - * This returns the default label - */ - public String getCreateChildText(Object object); - - /** - * This returns the default help text - */ - public String getCreateChildToolTipText(Object object); - - /** - * This returns the default image - */ - public Object getCreateChildImage(Object object); - } - - /** - * This is the editing doman in which this command operates. - */ - protected EditingDomain domain; - /** - * This is the owner to which children will be added. - */ - protected EObject owner; - /** - * This is the feature of the owner to which children will be added. - */ - protected EReference feature; - /** - * This is the helper object to which child creation is delegated. - */ - protected CreateChildCommand.Helper helper; - - /** - * This creates an instances that will add something to the owner's feature based on the - * delegate helper. - */ - public CreateChildCommand(EditingDomain domain, EObject owner, EReference feature, CreateChildCommand.Helper helper) { - super(); - - this.domain = domain; - this.owner = owner; - this.feature = feature; - this.helper = helper; - } - - /** - * This returns a command that creates a new child of some appropriate type. - */ - public static Command create(EditingDomain domain, Object object) { - return domain.createCommand(CreateChildCommand.class, new CommandParameter(object)); - } - - /** - * This creates the add command that will implement this action and specifies the collection by - * delegating to {@link CreateChildCommand.Helper#getCreateChildImage}. - */ - protected Command createCommand() { - if (feature == null) { - return AddCommand.create(domain, owner, null, helper.createChild(owner)); - } - return new AddCommand(domain, owner, feature, helper.createChild(owner)); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildToolTipText}. - */ - public String getDescription() { - return helper.getCreateChildToolTipText(owner); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildImage}. - */ - public Object getImage() { - return helper.getCreateChildImage(owner); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildText}. - */ - public String getText() { - return helper.getCreateChildText(owner); - } - - /** - * This delegates to {@link CreateChildCommand.Helper#getCreateChildToolTipText}. - */ - public String getToolTipText() { - return helper.getCreateChildToolTipText(owner); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProvider.java deleted file mode 100644 index b6f515c3e..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProvider.java +++ /dev/null @@ -1,214 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -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.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -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.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.application.Application; -import org.eclipse.jst.j2ee.application.ApplicationFactory; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.internal.provider.CompatibilityDescriptionGroupItemProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Application}object. - */ -public class ApplicationItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public ApplicationItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: check that this is what you want. - Module child = org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getApplicationFactory().createModule(); - - // TODO: initialize child here... - - return child; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - ApplicationPackage pkg = ApplicationPackage.eINSTANCE; - Collection result = new ArrayList(); - result.add(pkg.getApplication_SecurityRoles()); - result.add(pkg.getApplication_Modules()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage(refObject.eClass().getName() + "CreateModule"); //$NON-NLS-1$ - } - - /** - * This returns the label for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Module_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_child_of_type_Module_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This returns Application.gif. - */ - public Object getImage(Object object) { - String key = null; - if (((Application) object).eResource() == null) - return J2EEPlugin.getPlugin().getImage("earFile_obj"); //$NON-NLS-1$ - switch (((Application) object).getVersionID()) { - case J2EEVersionConstants.J2EE_1_2_ID : - key = "12_ear_obj"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_3_ID : - key = "13_ear_obj"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_4_ID : - default : - key = "14_ear_obj"; //$NON-NLS-1$ - break; - } - return J2EEPlugin.getPlugin().getImage(key); - } - - /** - * This returns the parent of the Application. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This adds a property descriptor for the Version feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Application_version_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Application_version_feature", "_UI_Application_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getApplication_Version(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - public String getText(Object object) { - - String displayName = ((Application) object).getDisplayName(); - return displayName == null ? ApplicationProvidersResourceHandler.getString("<<No_display_name>>_ERROR_") : displayName; //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Application.class)) { - case ApplicationPackage.APPLICATION__VERSION : - case ApplicationPackage.APPLICATION__SECURITY_ROLES : - case ApplicationPackage.APPLICATION__MODULES : { - fireNotifyChanged(notification); - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_SecurityRoles(), CommonFactory.eINSTANCE.createSecurityRole())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createWebModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createJavaClientModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createEjbModule())); - - newChildDescriptors.add(createChildParameter(ApplicationPackage.eINSTANCE.getApplication_Modules(), ApplicationFactory.eINSTANCE.createConnectorModule())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapter.java deleted file mode 100644 index 173415d7f..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapter.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; - - - -/** - * This extended item provider supports the following commands: - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. The - * commands are implemented uniformly on all our item adapters using this common base class. - */ -public class ApplicationItemProviderAdapter extends ItemProviderAdapter { - /** - * This creates and instance from an adapter factory and a domain notifier. - */ - protected ApplicationItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This implements the default behavior for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - return null; - } - - /** - * This returns the default image for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage("CreateChild"); //$NON-NLS-1$ - } - - /** - * This returns the default label for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the default help text for - * {@link org.eclipse.jst.j2ee.internal.internal.application.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_new_child_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapterFactory.java deleted file mode 100644 index c1000c63d..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationItemProviderAdapterFactory.java +++ /dev/null @@ -1,267 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -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.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.Disposable; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -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.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.internal.util.ApplicationAdapterFactory; - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewers.Viewer}s. The adapters generated by this factory convert EMF - * adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters - * also support property sheets, see {@link org.eclipse.ui.views.properties}. Note that most of the - * adapters are shared among multiple instances. - */ -public class ApplicationItemProviderAdapterFactory extends ApplicationAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - /** - * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.Application}instances. - */ - protected ApplicationItemProvider applicationItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.Module}instances. - */ - protected ModuleItemProvider moduleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.WebModule}instances. - */ - protected WebModuleItemProvider webModuleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}instances. - */ - protected JavaClientModuleItemProvider javaClientModuleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}instances. - */ - protected ConnectorModuleItemProvider connectorModuleItemProvider; - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.application.EjbModule}instances. - */ - protected EjbModuleItemProvider ejbModuleItemProvider; - protected Disposable disposable = new Disposable(); - - /** - * This constructs an instance. - */ - public ApplicationItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - public Adapter adapt(Notifier target, Object adapterKey) { - return super.adapt(target, this); - } - - public Object adapt(Object object, Object type) { - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - public Adapter adaptNew(Notifier target, Object adapterType) { - Adapter adapter = super.adaptNew(target, adapterType); - disposable.add(adapter); - return adapter; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Application}. - */ - public Adapter createApplicationAdapter() { - if (applicationItemProvider == null) { - applicationItemProvider = new ApplicationItemProvider(this); - } - - return applicationItemProvider; - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.EjbModule}. - */ - public Adapter createEjbModuleAdapter() { - if (ejbModuleItemProvider == null) { - ejbModuleItemProvider = new EjbModuleItemProvider(this); - } - - return ejbModuleItemProvider; - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}. - */ - public Adapter createJavaClientModuleAdapter() { - if (javaClientModuleItemProvider == null) { - javaClientModuleItemProvider = new JavaClientModuleItemProvider(this); - } - - return javaClientModuleItemProvider; - } - - /** - * This creates an adapter for a connector. - * - * @return Adapter - */ - public Adapter createConnectorModuleAdapter() { - if (connectorModuleItemProvider == null) { - connectorModuleItemProvider = new ConnectorModuleItemProvider(this); - }// if - - return connectorModuleItemProvider; - }// createConnectorModuleAdapter - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Module}. - */ - public Adapter createModuleAdapter() { - if (moduleItemProvider == null) { - moduleItemProvider = new ModuleItemProvider(this); - } - - return moduleItemProvider; - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.WebModule}. - */ - public Adapter createWebModuleAdapter() { - if (webModuleItemProvider == null) { - webModuleItemProvider = new WebModuleItemProvider(this); - } - - return webModuleItemProvider; - } - - public void dispose() { - disposable.dispose(); - } - - /** - * This calls {@link INotifyChangedListener#fireNotifyChanged fireNotifyChanged}for each viewer - * in {@link #notifyChangedListeners}. - */ - /* - * public void fireNotifyChanged(Object object, int eventType, Object feature, Object oldValue, - * Object newValue, int index) { for (Iterator i = notifyChangedListeners.iterator(); - * i.hasNext(); ) { INotifyChangedListener notifyChangedListener = - * (INotifyChangedListener)i.next(); notifyChangedListener.notifyChanged(new - * ENotificationImpl((InternalEObject)object, eventType,(EStructuralFeature) feature, oldValue, - * newValue, index)); } - * - * if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(object, eventType, - * feature, oldValue, newValue, index); } } - */ - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationProvidersResourceHandler.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationProvidersResourceHandler.java deleted file mode 100644 index 2bee27955..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ApplicationProvidersResourceHandler.java +++ /dev/null @@ -1,93 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - - -import java.net.URL; -import java.text.MessageFormat; -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -import org.eclipse.emf.common.util.ResourceLocator; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -public class ApplicationProvidersResourceHandler { - - private static ResourceBundle fgResourceBundle; - public static ResourceLocator RESOURCE_LOCATOR = new ResourceLocator() { - public URL getBaseURL() { - return null; - } - - public Object getImage(String arg0) { - return J2EEPlugin.getPlugin().getImage(arg0); - } - - public String getString(String arg0) { - return ApplicationProvidersResourceHandler.getString(arg0); - } - - public String getString(String arg0, Object[] arg1) { - return ApplicationProvidersResourceHandler.getString(arg0, arg1); - } - public String getString(String key, boolean translate) { - // TODO For now... translate not supported - return getString(key); - } - - public String getString(String key, Object[] substitutions, boolean translate) { - // TODO For now... translate not supported - return getString(key,substitutions); - } - }; - - /** - * Returns the resource bundle used by all classes in this Project - */ - public static ResourceBundle getResourceBundle() { - try { - return ResourceBundle.getBundle("applicationproviders");//$NON-NLS-1$ - } catch (MissingResourceException e) { - // does nothing - this method will return null and - // getString(String, String) will return the key - // it was called with - } - return null; - } - - public static String getString(String key) { - if (fgResourceBundle == null) { - fgResourceBundle = getResourceBundle(); - } - - if (fgResourceBundle != null) { - try { - return fgResourceBundle.getString(key); - } catch (MissingResourceException e) { - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - } - return "!" + key + "!";//$NON-NLS-2$//$NON-NLS-1$ - } - - public static String getString(String key, Object[] args) { - - try { - return MessageFormat.format(getString(key), args); - } catch (IllegalArgumentException e) { - return getString(key); - } - - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ConnectorModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ConnectorModuleItemProvider.java deleted file mode 100644 index ee08848bc..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ConnectorModuleItemProvider.java +++ /dev/null @@ -1,126 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -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.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.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.ConnectorModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adapter for a Connector modules in ears. - */ -public class ConnectorModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - - /** - * This constructs an instance from a factory and a notifier. - * - * @param AdapterFactory - * adapterFactory - Current adapter - */ - public ConnectorModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - }// ConnectorModuleItemProvider - - /** - * This returns resource image - * - * @param Object - * object - resource - * @return Object - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("full/obj16/connector_module"); //$NON-NLS-1$ - }// getImage - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((ConnectorModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_ConnectorModule_type") : //$NON-NLS-1$ - getString("_UI_ConnectorModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the ConnectorModule. - * - * @param Object - * object - resource - * @return Object - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - }// getParent - - /** - * This returns the property descriptors for the adapted class. - * - * @param Object - * object - resource - * @return List - */ - public List getPropertyDescriptors(Object object) { - - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - }// if - - return itemPropertyDescriptors; - }// getPropertyDescriptors - -}// ConnectorModuleItemProvider diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/EjbModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/EjbModuleItemProvider.java deleted file mode 100644 index 1dcc01e11..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/EjbModuleItemProvider.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -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.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.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.EjbModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.EjbModule}object. - */ -public class EjbModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public EjbModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns EjbModule.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("module_ejb_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((EjbModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_EjbModule_type") : //$NON-NLS-1$ - getString("_UI_EjbModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the EjbModule. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/JavaClientModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/JavaClientModuleItemProvider.java deleted file mode 100644 index 9e14a7f18..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/JavaClientModuleItemProvider.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -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.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.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.application.JavaClientModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.JavaClientModule}object. - */ -public class JavaClientModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public JavaClientModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns JavaClientModule.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("module_clientapp_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((JavaClientModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_JavaClientModule_type") : //$NON-NLS-1$ - getString("_UI_JavaClientModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the JavaClientModule. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ModuleItemProvider.java deleted file mode 100644 index c00f59193..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/ModuleItemProvider.java +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -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.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.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.Module; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.Module}object. - */ -public class ModuleItemProvider extends ApplicationItemProviderAdapter implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public ModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns Module.gif. - */ - public Object getImage(Object object) { - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage("Module"); //$NON-NLS-1$ - } - - /** - * This returns the parent of the Module. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ApplicationPackage pkg = ApplicationPackage.eINSTANCE; - - // This is for the uri feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Uri_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_uri_property_UI_"), //$NON-NLS-1$ - pkg.getModule_Uri())); - - // This is for the altDD feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("AltDD_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_altDD_property_UI_"), //$NON-NLS-1$ - pkg.getModule_AltDD(), false)); - - // This is for the application feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Application_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_application_property_UI_"), //$NON-NLS-1$ - pkg.getModule_Application(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Uri feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUriPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Module_uri_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Module_uri_feature", "_UI_Module_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getModule_Uri(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Alt DD feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addAltDDPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_Module_altDD_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Module_altDD_feature", "_UI_Module_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getModule_AltDD(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - public String getText(Object object) { - return getURIIfPossible((Module) object); - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(Module.class)) { - case ApplicationPackage.MODULE__URI : - case ApplicationPackage.MODULE__ALT_DD : { - fireNotifyChanged(notification); - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - public static String getURIIfPossible(Module m) { - return m.getUri() == null ? ApplicationProvidersResourceHandler.getString("<<URI_not_set>>_ERROR_") : m.getUri(); //$NON-NLS-1$ - } - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ApplicationPackage pkg = ApplicationPackage.eINSTANCE;; if - * (feature == pkg.getModule_Uri() || feature == pkg.getModule_AltDD() || feature == - * pkg.getModule_Application()) { fireNotifyChanged(notifier, eventType, feature, oldValue, - * newValue, index); // ModuleExtension does not update automatically. // The following code is - * to explicitly notify ApplicationExtension if (feature == pkg.getModule_Uri() || feature == - * pkg.getModule_AltDD() ) { ApplicationExtension applicationExtension = - * ApplicationExtensionsHelper.getApplicationExtension(((Module)notifier).getApplication()); if - * (applicationExtension == null) return; EObject newFeature = - * ApplicationextPackage.eINSTANCE.getApplicationExtension_ModuleExtensions(); Object - * moduleExtension = applicationExtension.getModuleExtension((Module)notifier); Notification - * notification = new NotificationImpl(applicationExtension, Notification.SET, newFeature, - * moduleExtension, moduleExtension); applicationExtension.eNotify(notification); } // code ends - * return; } super.notifyChanged(notifier, eventType, feature, oldValue, newValue, index); } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/WebModuleItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/WebModuleItemProvider.java deleted file mode 100644 index 7b185b653..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/application/provider/WebModuleItemProvider.java +++ /dev/null @@ -1,138 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.application.provider; - - -import java.util.Collection; -import java.util.List; - -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.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.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.application.ApplicationPackage; -import org.eclipse.jst.j2ee.application.WebModule; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.application.WebModule}object. - */ -public class WebModuleItemProvider extends ModuleItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public WebModuleItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns WebModule.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("module_web_obj"); //$NON-NLS-1$ - } - - /** - * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc - * --> - * - * @generated - */ - public String getText(Object object) { - String label = ((WebModule) object).getUri(); - return label == null || label.length() == 0 ? getString("_UI_WebModule_type") : //$NON-NLS-1$ - getString("_UI_WebModule_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(WebModule.class)) { - case ApplicationPackage.WEB_MODULE__CONTEXT_ROOT : { - fireNotifyChanged(notification); - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - - /** - * This returns the parent of the WebModule. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ApplicationPackage pkg = ApplicationPackage.eINSTANCE; - - // This is for the contextRoot feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("ContextRoot_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_contextRoot_property_UI_"), //$NON-NLS-1$ - pkg.getWebModule_ContextRoot(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Context Root feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addContextRootPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_WebModule_contextRoot_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_WebModule_contextRoot_feature", "_UI_WebModule_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ApplicationPackage.eINSTANCE.getWebModule_ContextRoot(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ApplicationClientItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ApplicationClientItemProvider.java deleted file mode 100644 index 3fb8b9d26..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ApplicationClientItemProvider.java +++ /dev/null @@ -1,275 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.Path; -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.EReference; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -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.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jem.util.emf.workbench.ProjectUtilities; -import org.eclipse.jst.j2ee.client.ApplicationClient; -import org.eclipse.jst.j2ee.client.ClientPackage; -import org.eclipse.jst.j2ee.common.CommonFactory; -import org.eclipse.jst.j2ee.common.internal.provider.CompatibilityDescriptionGroupItemProvider; -import org.eclipse.jst.j2ee.internal.J2EEVersionConstants; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; -import org.eclipse.jst.j2ee.internal.webservices.WSDLServiceExtManager; -import org.eclipse.jst.j2ee.internal.webservices.WSDLServiceHelper; -import org.eclipse.jst.j2ee.webservice.wsclient.Webservice_clientFactory; - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.client.ApplicationClient}object. - */ -public class ApplicationClientItemProvider extends CompatibilityDescriptionGroupItemProvider implements IEditingDomainItemProvider, IItemLabelProvider, IItemPropertySource, IStructuredItemContentProvider, ITreeItemContentProvider { - /** - * This constructs an instance from a factory and a notifier. - */ - public ApplicationClientItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates a new child for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - // TODO: create some child object. - return null; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - ClientPackage pkg = ClientPackage.eINSTANCE; - Collection result = new ArrayList(); - result.add(pkg.getApplicationClient_EjbReferences()); - result.add(pkg.getApplicationClient_ResourceRefs()); - result.add(pkg.getApplicationClient_ResourceEnvRefs()); - result.add(pkg.getApplicationClient_EnvironmentProps()); - result.add(pkg.getApplicationClient_MessageDestinationRefs()); - result.add(pkg.getApplicationClient_ServiceRefs()); - return result; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // Check the type of the specified child object and return the proper feature to use for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the image for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - EObject refObject = (EObject) object; - return J2EEPlugin.getPlugin().getImage(refObject.eClass().getName() + "Create#CHILD_CLASS_NAME#"); //$NON-NLS-1$ - } - - /** - * This returns the label for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the help text for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_child_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This returns ApplicationClient.gif. - */ - public Object getImage(Object object) { - String key = null; - if (((ApplicationClient) object).eResource() == null) - return J2EEPlugin.getPlugin().getImage("applclientJAR_obj"); //$NON-NLS-1$ - switch (((ApplicationClient) object).getVersionID()) { - case J2EEVersionConstants.J2EE_1_2_ID : - key = "appclient_12"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_3_ID : - key = "appclient_13"; //$NON-NLS-1$ - break; - case J2EEVersionConstants.J2EE_1_4_ID : - default : - key = "appclient_14"; //$NON-NLS-1$ - break; - } - return J2EEPlugin.getPlugin().getImage(key); - } - - /** - * This returns the parent of the ApplicationClient. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This adds a property descriptor for the Version feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addVersionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ApplicationClient_version_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ApplicationClient_version_feature", "_UI_ApplicationClient_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ClientPackage.eINSTANCE.getApplicationClient_Version(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Callback Handler feature. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void addCallbackHandlerPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ApplicationClient_callbackHandler_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ApplicationClient_callbackHandler_feature", "_UI_ApplicationClient_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ClientPackage.eINSTANCE.getApplicationClient_CallbackHandler(), true)); - } - - public String getText(Object object) { - - /* - * String displayName = ((ApplicationClient) object).getDisplayName(); return displayName == - * null ? "" ApplicationProvidersResourceHandler.getString(" < <No_display_name>>_ERROR_") : - * displayName; //$NON-NLS-1$ - */ - ApplicationClient appclient = ((ApplicationClient) object); - if (appclient.getDisplayName() == null) { - try { - IProject project = ProjectUtilities.getProject(appclient); - return project.getDescription().getName(); - } catch (Exception e) { - //Ignore - } - - Resource resource = appclient.eResource(); - if (resource != null) { - return new Path(resource.getURI().toString()).removeFileExtension().lastSegment(); - } - return ""; //$NON-NLS-1$ - } - return appclient.getDisplayName(); - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ApplicationClient.class)) { - case ClientPackage.APPLICATION_CLIENT__VERSION : - case ClientPackage.APPLICATION_CLIENT__RESOURCE_REFS : - case ClientPackage.APPLICATION_CLIENT__ENVIRONMENT_PROPS : - case ClientPackage.APPLICATION_CLIENT__EJB_REFERENCES : - case ClientPackage.APPLICATION_CLIENT__RESOURCE_ENV_REFS : - case ClientPackage.APPLICATION_CLIENT__SERVICE_REFS : - case ClientPackage.APPLICATION_CLIENT__MESSAGE_DESTINATION_REFS : - case ClientPackage.APPLICATION_CLIENT__MESSAGE_DESTINATIONS : { - fireNotifyChanged(notification); - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_ResourceRefs(), CommonFactory.eINSTANCE.createResourceRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_EnvironmentProps(), CommonFactory.eINSTANCE.createEnvEntry())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_EjbReferences(), CommonFactory.eINSTANCE.createEjbRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_EjbReferences(), CommonFactory.eINSTANCE.createEJBLocalRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_ResourceEnvRefs(), CommonFactory.eINSTANCE.createResourceEnvRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_ServiceRefs(), Webservice_clientFactory.eINSTANCE.createServiceRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_MessageDestinationRefs(), CommonFactory.eINSTANCE.createMessageDestinationRef())); - - newChildDescriptors.add(createChildParameter(ClientPackage.eINSTANCE.getApplicationClient_MessageDestinations(), CommonFactory.eINSTANCE.createMessageDestination())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return J2EEPlugin.getDefault(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object) - */ - public Collection getChildren(Object object) { - ApplicationClient client = (ApplicationClient) object; - Collection myChildren = super.getChildren(object); - myChildren.addAll(client.getMessageDestinations()); - if (client.getVersionID() <= J2EEVersionConstants.J2EE_1_3_ID) { - WSDLServiceHelper serviceHelper = WSDLServiceExtManager.getServiceHelper(); - myChildren.addAll(serviceHelper.get13ServiceRefs(client)); - } - return myChildren; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapter.java deleted file mode 100644 index 4253a6b5a..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapter.java +++ /dev/null @@ -1,80 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -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.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.application.common.CreateChildCommand; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; - - - -/** - * This extended item provider supports the following commands: - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. The commands - * are implemented uniformly on all our item adapters using this common base class. - */ -public class ClientItemProviderAdapter extends ItemProviderAdapter implements org.eclipse.jst.j2ee.internal.application.common.CreateChildCommand.Helper { - /** - * This creates and instance from an adapter factory and a domain notifier. - */ - protected ClientItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This implements the default behavior for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object createChild(Object object) { - return null; - } - - /** - * This creates the supported commands. - */ - public Command createCommand(Object object, EditingDomain editingDomain, Class commandClass, CommandParameter commandParameter) { - if (commandClass == CreateChildCommand.class) { - return new CreateChildCommand(editingDomain, (EObject) object, null, this); - } - return super.createCommand(object, editingDomain, commandClass, commandParameter); - } - - /** - * This returns the default image for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public Object getCreateChildImage(Object object) { - return org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin.getPlugin().getImage("CreateChild"); //$NON-NLS-1$ - } - - /** - * This returns the default label for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildText(Object object) { - return ApplicationProvidersResourceHandler.getString("Create_Child_UI_"); //$NON-NLS-1$ - } - - /** - * This returns the default help text for - * {@link org.eclipse.jst.j2ee.internal.internal.client.command.CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object object) { - EObject refObject = (EObject) object; - return ApplicationProvidersResourceHandler.getString("Create_a_new_child_for_the_selected_UI_") + refObject.eClass().getName() + "."; //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapterFactory.java deleted file mode 100644 index 5a5b15955..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ClientItemProviderAdapterFactory.java +++ /dev/null @@ -1,180 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - -import java.util.ArrayList; -import java.util.Collection; - -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.ecore.EObject; -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.Disposable; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -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.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.client.internal.util.ClientAdapterFactory; - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewers.Viewer}s. The adapters generated by this factory convert EMF - * adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters - * also support property sheets, see {@link org.eclipse.ui.views.properties}. Note that most of the - * adapters are shared among multiple instances. - */ -public class ClientItemProviderAdapterFactory extends ClientAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - /** - * This is used to implement {@link #IChangeNotifier}. - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.client.ApplicationClient}instances. - */ - protected ApplicationClientItemProvider applicationClientItemProvider; - protected Disposable disposable = new Disposable(); - - /** - * This constructs an instance. - */ - public ClientItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - public Adapter adapt(Notifier target, Object adapterKey) { - return super.adapt(target, this); - } - - public Object adapt(Object object, Object type) { - // This is a kludge to deal with enumerators, which crash the doSwitch. - // - if (object instanceof EObject && ((EObject) object).eClass() == null) { - return null; - } - - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - public Adapter adaptNew(Notifier target, Object adapterType) { - Adapter adapter = super.adaptNew(target, adapterType); - disposable.add(adapter); - return adapter; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.client.ApplicationClient}. - */ - public Adapter createApplicationClientAdapter() { - if (applicationClientItemProvider == null) { - applicationClientItemProvider = new ApplicationClientItemProvider(this); - } - - return applicationClientItemProvider; - } - - public void dispose() { - disposable.dispose(); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. - */ - /* - * public void fireNotifyChanged(Object object, int eventType, Object feature, Object oldValue, - * Object newValue, int index) { changeNotifier.fireNotifyChanged(object, eventType, feature, - * oldValue, newValue, index); - * - * if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(object, eventType, - * feature, oldValue, newValue, index); } } - */ - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/EARProjectMapItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/EARProjectMapItemProvider.java deleted file mode 100644 index 1edbb7d92..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/EARProjectMapItemProvider.java +++ /dev/null @@ -1,166 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -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.EReference; -import org.eclipse.emf.edit.command.AddCommand; -import org.eclipse.emf.edit.command.RemoveCommand; -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.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.EARProjectMap; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.EARProjectMap} - * object. - */ -public class EARProjectMapItemProvider extends ModulemapItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** Added to generated code */ - protected boolean includeModules = false; - - /** - * This constructs an instance from a factory and a notifier. - */ - public EARProjectMapItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - public EARProjectMapItemProvider(AdapterFactory adapterFactory, boolean includeModules) { - this(adapterFactory); - this.includeModules = includeModules; - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - } - return itemPropertyDescriptors; - } - - /** - * This specifies how to implement {@link #getChildren}and {@link AddCommand}and - * {@link RemoveCommand}support in {@link #createCommand}. - */ - public Collection getChildrenReferences(Object object) { - if (childrenReferences == null) { - super.getChildrenReferences(object); - if (includeModules) - childrenReferences.add(ModulemapPackage.eINSTANCE.getEARProjectMap_Mappings()); - childrenReferences.add(ModulemapPackage.eINSTANCE.getEARProjectMap_UtilityJARMappings()); - } - return childrenReferences; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected EReference getChildReference(Object object, Object child) { - // TODO: Check the type of the specified child object and return the proper feature to use - // for - // adding (see {@link AddCommand}) it as a child. - - return super.getChildReference(object, child); - } - - - /** - * This returns the parent of the EARProjectMap. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns EARProjectMap.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("EARProjectMap"); //$NON-NLS-1$ - } - - public String getText(Object object) { - return ApplicationProvidersResourceHandler.getString("EARProjectMap_UI_"); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(EARProjectMap.class)) { - case ModulemapPackage.EAR_PROJECT_MAP__MAPPINGS : - case ModulemapPackage.EAR_PROJECT_MAP__UTILITY_JAR_MAPPINGS : { - fireNotifyChanged(notification); - return; - } - } - super.notifyChanged(notification); - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ModulemapPackage pkg = ModulemapPackage.eINSTANCE;; if - * (!includeModules && feature == pkg.getEARProjectMap_Mappings()) return; - * - * if (feature == pkg.getEARProjectMap_Mappings() || feature == - * pkg.getEARProjectMap_UtilityJARMappings()) { fireNotifyChanged(notifier, eventType, feature, - * oldValue, newValue, index); return; } super.notifyChanged(notifier, eventType, feature, - * oldValue, newValue, index); } - */ - - /** - * This adds to the collection of {@linkcom.ibm.etools.emf.edit.command.CommandParameter}s - * describing all of the children that can be created under this object. - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - - if (includeModules) - newChildDescriptors.add(createChildParameter(modulemapPackage.getEARProjectMap_Mappings(), modulemapPackage.getModuleMapping())); - newChildDescriptors.add(createChildParameter(modulemapPackage.getEARProjectMap_UtilityJARMappings(), modulemapPackage.getUtilityJARMapping())); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/FacetedProjectPropertyTester.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/FacetedProjectPropertyTester.java deleted file mode 100644 index 09474d081..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/FacetedProjectPropertyTester.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.eclipse.jst.j2ee.internal.provider; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework; - -public class FacetedProjectPropertyTester extends PropertyTester - -{ - public boolean test( final Object receiver, - final String property, - final Object[] args, - final Object value ) - { - try - { - if( ! ( receiver instanceof J2EEItemProvider ) ) - { - return false; - } - - IResource resource = ((J2EEItemProvider) receiver).getAssociatedFile(); - final IProject pj = resource.getProject(); - - if( pj == null ) - { - return false; - } - - final String val = (String) value; - final int colon = val.indexOf( ':' ); - - final String fid; - final String vexpr; - - if( colon == -1 || colon == val.length() - 1 ) - { - fid = val; - vexpr = null; - } - else - { - fid = val.substring( 0, colon ); - vexpr = val.substring( colon + 1 ); - } - - return FacetedProjectFramework.hasProjectFacet( pj, fid, vexpr ); - } - catch( CoreException e ) - { - // - } - - return false; - } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/J2EEItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/J2EEItemProvider.java deleted file mode 100644 index d7b71f178..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/J2EEItemProvider.java +++ /dev/null @@ -1,250 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - -import java.util.Collection; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Platform; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ItemProvider; - -public class J2EEItemProvider extends ItemProvider implements IAdaptable { - - protected static final Class IRESOURCE_CLASS = IResource.class; - protected static final Class IFILE_CLASS = IFile.class; - - - /** - * Constructor for J2EEItemProvider. - */ - public J2EEItemProvider() { - super(); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param children - */ - public J2EEItemProvider(Collection children) { - super(children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - */ - public J2EEItemProvider(String text) { - super(text); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param children - */ - public J2EEItemProvider(String text, Collection children) { - super(text, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - */ - public J2EEItemProvider(String text, Object image) { - super(text, image); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - * @param children - */ - public J2EEItemProvider(String text, Object image, Collection children) { - super(text, image, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - * @param parent - */ - public J2EEItemProvider(String text, Object image, Object parent) { - super(text, image, parent); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param text - * @param image - * @param parent - * @param children - */ - public J2EEItemProvider(String text, Object image, Object parent, Collection children) { - super(text, image, parent, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - */ - public J2EEItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text) { - super(adapterFactory, text); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image) { - super(adapterFactory, text, image); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - * @param parent - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent) { - super(adapterFactory, text, image, parent); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, Collection children) { - super(adapterFactory, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Collection children) { - super(adapterFactory, text, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image, Collection children) { - super(adapterFactory, text, image, children); - } - - /** - * Constructor for J2EEItemProvider. - * - * @param adapterFactory - * @param text - * @param image - * @param parent - * @param children - */ - public J2EEItemProvider(AdapterFactory adapterFactory, String text, Object image, Object parent, Collection children) { - super(adapterFactory, text, image, parent, children); - } - - protected boolean notificationOn = true; - - protected void disableNotification() { - notificationOn = false; - } - - protected void enableNotification() { - notificationOn = true; - } - - - public void fireNotifyChanged(Notification notification) { - if (notificationOn) - super.fireNotifyChanged(notification); - } - - public Collection getChildren(Object object) { - if (children.isEmpty()) { - try { - disableNotification(); - initializeChildren(); - } finally { - enableNotification(); - } - } - return children; - } - - protected void initializeChildren() { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - if (adapter == IRESOURCE_CLASS || adapter == IFILE_CLASS) - return null; //return getAssociatedFile(); - return Platform.getAdapterManager().getAdapter(this, adapter); - } - - public IFile getAssociatedFile() { - return null; - } - - /** - * @return - */ -// private IProject getProjectFromParent() { -// return ProjectUtilities.getProject(getParent()); -// } - -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModuleMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModuleMappingItemProvider.java deleted file mode 100644 index d7c6f84b0..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModuleMappingItemProvider.java +++ /dev/null @@ -1,166 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -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.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.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModuleMapping; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.ModuleMapping} - * object. - */ -public class ModuleMappingItemProvider extends ModulemapItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public ModuleMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ModulemapPackage pkg = ModulemapPackage.eINSTANCE; - ; - - // This is for the projectName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Project_Name_1"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_project_name_property_of_the_module_mapping_UI_"), //$NON-NLS-1$ - pkg.getModuleMapping_ProjectName(), true, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - // This is for the module feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Module_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_module_of_the_module_mapping_UI_"), //$NON-NLS-1$ - pkg.getModuleMapping_Module(), false)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Project Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addProjectNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ModuleMapping_projectName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ModuleMapping_projectName_feature", "_UI_ModuleMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getModuleMapping_ProjectName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Module feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addModulePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_ModuleMapping_module_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_ModuleMapping_module_feature", "_UI_ModuleMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getModuleMapping_Module(), true)); - } - - - /** - * This returns the parent of the ModuleMapping. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns ModuleMapping.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("ModuleMapping"); //$NON-NLS-1$ - } - - public String getText(Object object) { - ModuleMapping moduleMapping = ((ModuleMapping) object); - return ApplicationProvidersResourceHandler.getString("ModuleMapping_UI_") + moduleMapping.getProjectName(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(ModuleMapping.class)) { - case ModulemapPackage.MODULE_MAPPING__PROJECT_NAME : - case ModulemapPackage.MODULE_MAPPING__MODULE : { - fireNotifyChanged(notification); - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ModulemapPackage pkg = ModulemapPackage.eINSTANCE;; if ( - * feature == pkg.getModuleMapping_ProjectName() || feature == pkg.getModuleMapping_Module() ) { - * fireNotifyChanged(notifier, eventType, feature, oldValue, newValue, index); return; } - * super.notifyChanged(notifier, eventType, feature, oldValue, newValue, index); } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapEditPlugin.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapEditPlugin.java deleted file mode 100644 index ebf6adf34..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapEditPlugin.java +++ /dev/null @@ -1,125 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2004 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - -import java.net.MalformedURLException; -import java.net.URL; -import java.text.MessageFormat; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapFactory; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; - - - -/** - * @deprecated Leaving this in for now, to minimize breakage to all the providers; should delete - * when we regen all providers for mof5 - * - * This is the central singleton for the modulemap plugin. - */ -public class ModulemapEditPlugin extends Plugin { - /** - * Keep track of the singleton. - */ - protected static ModulemapEditPlugin plugin; - - /** - * Keep track of the modulemap package. - */ - protected ModulemapPackage modulemapPackage; - - /** - * Create the instance. - */ - public ModulemapEditPlugin(IPluginDescriptor descriptor) { - super(descriptor); - - // Remember the static instance. - // - plugin = this; - } - - /** - * Get the one modulemap package. - */ - public ModulemapPackage getModulemapPackage() { - return modulemapPackage; - } - - /** - * Get the one modulemap factory. - */ - public ModulemapFactory getModulemapFactory() { - return (ModulemapFactory) modulemapPackage.getEFactoryInstance(); - } - - /** - * Do initialization stuff here. - */ - public void startup() throws CoreException { - super.startup(); - modulemapPackage = org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapFactoryImpl.getPackage(); - } - - /** - * Get the singleton instance. - */ - public static ModulemapEditPlugin getPlugin() { - return plugin; - } - - /** - * Get a .gif from the icons folder. - */ - public Object getImage(String key) { - try { - return new URL(getDescriptor().getInstallURL(), "icons/" + key + ".gif"); //$NON-NLS-1$ //$NON-NLS-2$ - } catch (MalformedURLException exception) { - System.out.println(ApplicationProvidersResourceHandler.getString("Failed_to_load_image_for_ERROR_") + key + "'"); //$NON-NLS-1$ //$NON-NLS-2$ - exception.printStackTrace(); - } - - return null; - } - - /** - * Get a translated string from the resource bundle. - */ - public String getString(String key) { - return getDescriptor().getResourceBundle().getString(key); - } - - /** - * Get a translated string from the resource bundle, with an object substitution. - */ - public String getString(String key, Object s1) { - return MessageFormat.format(getString(key), new Object[]{s1}); - } - - /** - * Get a translated string from the resource bundle, with two object substitutions. - */ - public String getString(String key, Object s1, Object s2) { - return MessageFormat.format(getString(key), new Object[]{s1, s2}); - } - - /** - * Get a translated string from the resource bundle, with three object substitutions. - */ - public String getString(String key, Object s1, Object s2, Object s3) { - return MessageFormat.format(getString(key), new Object[]{s1, s2, s3}); - } -}
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapter.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapter.java deleted file mode 100644 index 49bc8c44b..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapter.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - - -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.edit.command.CommandParameter; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapFactory; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This extended item provider supports the following commands: - * <ul> - * <li>{@link CreateChildCommand} - * </ul> - * <p> - * The commands are implemented uniformly on all our item adapters using this common base class. - */ -public class ModulemapItemProviderAdapter extends ItemProviderAdapter { - /** - * This is the package for the modulemap model. - */ - protected static final ModulemapPackage modulemapPackage = (ModulemapPackage) EPackage.Registry.INSTANCE.getEPackage(ModulemapPackage.eNS_URI); - /** - * This is the factory for the modulemap model. - */ - protected static final ModulemapFactory modulemapFactory = modulemapPackage.getModulemapFactory(); - - /** - * This creates an instance from an adapter factory and a domain notifier. - */ - protected ModulemapItemProviderAdapter(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This creates the supported commands. - */ - public Command createCommand(Object object, EditingDomain editingDomain, Class commandClass, CommandParameter commandParameter) { - return super.createCommand(object, editingDomain, commandClass, commandParameter); - } - - /** - * This is a convenience method for creating <code>CommandParameter</code> s for a given - * parent feature and child type (MOF meta-object). - */ - protected CommandParameter createChildParameter(EReference feature, EObject childType) { - return new CommandParameter(null, feature, modulemapFactory.create(childType.eClass())); - } - - /** - * This returns the default owner object for {@link CreateChildCommand}. - */ - public Object getCreateChildOwner(Object parent) { - return parent; - } - - /** - * This returns the default result collection for {@link CreateChildCommand}. - */ - public Collection getCreateChildResult(Object child) { - Collection result = new ArrayList(1); - result.add(child); - return result; - } - - /** - * This returns the default label for {@link CreateChildCommand}. - */ - public String getCreateChildText(Object parent, Object feature, Object child) { - return J2EEPlugin.getPlugin().getString("_UI_CreateChild_text"); //$NON-NLS-1$ - } - - /** - * This returns the default description for {@link CreateChildCommand}. - */ - public String getCreateChildDescription(Object parent, Object feature, Object child) { - return J2EEPlugin.getPlugin().getString("_UI_CreateChild_description"); //$NON-NLS-1$ - } - - /** - * This returns the default help text for {@link CreateChildCommand}. - */ - public String getCreateChildToolTipText(Object parent, Object feature, Object child) { - return J2EEPlugin.getPlugin().getString("_UI_CreateChild_tooltip"); //$NON-NLS-1$ - } - - /** - * This returns the default image for {@link CreateChildCommand}. - */ - public Object getCreateChildImage(Object parent, Object feature, Object child) { - Object image = null; - - if (parent instanceof EObject && child instanceof EObject) { - String name = ((EObject) parent).eClass().getName() + "Create" + ((EObject) child).eClass().getName(); //$NON-NLS-1$ - image = J2EEPlugin.getPlugin().getImage(name); - } - return image; - } - - /** - * This looks up the name of the type of the specified object. - */ - protected String getTypeText(Object object) { - String typeKey = object instanceof EObject ? ((EObject) object).eClass().getName() : "Unknown"; //$NON-NLS-1$ - return J2EEPlugin.getPlugin().getString("_UI_" + typeKey + "_type"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /** - * This looks up the name of the specified feature. - */ - protected String getFeatureText(Object feature) { - String featureKey = feature instanceof EReference ? ((EReference) feature).getName() : "Unknown"; //$NON-NLS-1$ - return J2EEPlugin.getPlugin().getString("_UI_" + featureKey + "_feature"); //$NON-NLS-1$ //$NON-NLS-2$ - } -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapterFactory.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapterFactory.java deleted file mode 100644 index bc415ac53..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/ModulemapItemProviderAdapterFactory.java +++ /dev/null @@ -1,215 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - - -import java.util.ArrayList; -import java.util.Collection; - -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.ecore.EObject; -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.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITableItemLabelProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapAdapterFactory; - - - -/** - * This is the factory that is used to provide the interfaces needed to support - * {@link org.eclipse.jface.viewers.Viewer}s. The adapters generated by this factory convert EMF - * adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. The adapters - * also support property sheets, see {@link org.eclipse.ui.views.properties}. Note that most of the - * adapters are shared among multiple instances. - */ -public class ModulemapItemProviderAdapterFactory extends ModulemapAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier { - /** - * This keeps track of the root adapter factory that delegates to this adapter factory. - */ - protected ComposedAdapterFactory parentAdapterFactory; - - /** - * This is used to implement {@link #com.ibm.etools.emf.edit.provider.IChangeNotifier}. - */ - protected IChangeNotifier changeNotifier = new ChangeNotifier(); - - /** - * This keeps track of all the supported types checked by - * {@link #isFactoryForType isFactoryForType}. - */ - protected Collection supportedTypes = new ArrayList(); - - /** - * This constructs an instance. - */ - public ModulemapItemProviderAdapterFactory() { - supportedTypes.add(IStructuredItemContentProvider.class); - supportedTypes.add(ITreeItemContentProvider.class); - supportedTypes.add(IItemPropertySource.class); - supportedTypes.add(IEditingDomainItemProvider.class); - supportedTypes.add(IItemLabelProvider.class); - supportedTypes.add(ITableItemLabelProvider.class); - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.ModuleMapping} - * instances. - */ - protected ModuleMappingItemProvider moduleMappingItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.ModuleMapping}. - */ - public Adapter createModuleMappingAdapter() { - if (moduleMappingItemProvider == null) { - moduleMappingItemProvider = new ModuleMappingItemProvider(this); - } - - return moduleMappingItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.EARProjectMap} - * instances. - */ - protected EARProjectMapItemProvider earProjectMapItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.EARProjectMap}. - */ - public Adapter createEARProjectMapAdapter() { - if (earProjectMapItemProvider == null) { - earProjectMapItemProvider = new EARProjectMapItemProvider(this); - } - - return earProjectMapItemProvider; - } - - /** - * This keeps track of the one adapter used for all - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.UtilityJARMapping} - * instances. - */ - protected UtilityJARMappingItemProvider utilityJARMappingItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.UtilityJARMapping}. - */ - public Adapter createUtilityJARMappingAdapter() { - if (utilityJARMappingItemProvider == null) { - utilityJARMappingItemProvider = new UtilityJARMappingItemProvider(this); - } - - return utilityJARMappingItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - */ - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - */ - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { - this.parentAdapterFactory = parentAdapterFactory; - } - - public boolean isFactoryForType(Object type) { - return super.isFactoryForType(type) || supportedTypes.contains(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - */ - public Adapter adapt(Notifier notifier, Object type) { - return super.adapt(notifier, this); - } - - public Object adapt(Object object, Object type) { - // This is a kludge to deal with enumerators, which crash the doSwitch. - // - if (object instanceof EObject && ((EObject) object).eClass() == null) { - return null; - } - - if (isFactoryForType(type)) { - Object adapter = super.adapt(object, type); - if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { - return adapter; - } - } - - return null; - } - - /** - * This adds a listener. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * @generated - */ - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void fireNotifyChanged(Notification notification) { - changeNotifier.fireNotifyChanged(notification); - - if (parentAdapterFactory != null) { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - /** - * This delegates to {@link #changeNotifier}and to {@link #parentAdapterFactory}. - */ - /* - * public void fireNotifyChanged(Object object, int eventType, Object feature, Object oldValue, - * Object newValue, int index) { changeNotifier.fireNotifyChanged(object, eventType, feature, - * oldValue, newValue, index); - * - * if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(object, eventType, - * feature, oldValue, newValue, index); } } - */ -} diff --git a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/UtilityJARMappingItemProvider.java b/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/UtilityJARMappingItemProvider.java deleted file mode 100644 index 6cf3c105f..000000000 --- a/plugins/org.eclipse.jst.j2ee/applicationedit/org/eclipse/jst/j2ee/internal/provider/UtilityJARMappingItemProvider.java +++ /dev/null @@ -1,191 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jst.j2ee.internal.provider; - - - -import java.util.Collection; -import java.util.List; - -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.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.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.jst.j2ee.internal.application.provider.ApplicationProvidersResourceHandler; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.ModulemapPackage; -import org.eclipse.jst.j2ee.internal.earcreation.modulemap.UtilityJARMapping; -import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; - - - -/** - * This is the item provider adpater for a - * {@link org.eclipse.jst.j2ee.internal.internal.internal.earcreation.modulemap.UtilityJARMapping} - * object. - */ -public class UtilityJARMappingItemProvider extends ModulemapItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - */ - public UtilityJARMappingItemProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * This returns the property descriptors for the adapted class. - */ - public List getPropertyDescriptors(Object object) { - if (itemPropertyDescriptors == null) { - super.getPropertyDescriptors(object); - - ModulemapPackage pkg = ModulemapPackage.eINSTANCE; - ; - - // This is for the projectName feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Project_Name_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_project_name_property_of_the_utility_jar_mapping_UI_"), //$NON-NLS-1$ - pkg.getUtilityJARMapping_ProjectName(), false, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - // This is for the uri feature. - // - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), ApplicationProvidersResourceHandler.getString("Uri_UI_"), //$NON-NLS-1$ - ApplicationProvidersResourceHandler.getString("The_uri_property_of_the_utility_jar_mapping_UI_"), //$NON-NLS-1$ - pkg.getUtilityJARMapping_Uri(), true, ItemPropertyDescriptor.TEXT_VALUE_IMAGE)); - - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Project Name feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addProjectNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_UtilityJARMapping_projectName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_UtilityJARMapping_projectName_feature", "_UI_UtilityJARMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getUtilityJARMapping_ProjectName(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - /** - * This adds a property descriptor for the Uri feature. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - protected void addUriPropertyDescriptor(Object object) { - itemPropertyDescriptors.add(new ItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getString("_UI_UtilityJARMapping_uri_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_UtilityJARMapping_uri_feature", "_UI_UtilityJARMapping_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ModulemapPackage.eINSTANCE.getUtilityJARMapping_Uri(), true, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); - } - - - /** - * This returns the parent of the UtilityJARMapping. - */ - public Object getParent(Object object) { - return ((EObject) object).eContainer(); - } - - /** - * This returns UtilityJARMapping.gif. - */ - public Object getImage(Object object) { - return J2EEPlugin.getPlugin().getImage("icons/full/obj16/prjutiljar_obj"); //$NON-NLS-1$ - } - - // /** - // * @param object - // * @return - // */ - // private boolean isEJBClientJAR(Object object) { - // UtilityJARMapping map = (UtilityJARMapping) object; - // IProject project = ProjectUtilities.getProject(map); - // if (project == null) - // return false; - // - // EARNatureRuntime runtime = EARNatureRuntime.getRuntime(project); - // if (runtime == null) - // return false; - // - // EAREditModel model = null; - // try { - // model = runtime.getEarEditModelForRead(this); - // return model.isEjbClientJarMapping(map); - // } finally { - // if (model != null) - // model.releaseAccess(this); - // } - // } - - public String getText(Object object) { - UtilityJARMapping map = ((UtilityJARMapping) object); - return map == null ? "<??>" : map.getUri(); //$NON-NLS-1$ - } - - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public void notifyChanged(Notification notification) { - switch (notification.getFeatureID(UtilityJARMapping.class)) { - case ModulemapPackage.UTILITY_JAR_MAPPING__PROJECT_NAME : - case ModulemapPackage.UTILITY_JAR_MAPPING__URI : { - fireNotifyChanged(notification); - 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. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @generated - */ - protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { - super.collectNewChildDescriptors(newChildDescriptors, object); - } - - /** - * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - public ResourceLocator getResourceLocator() { - return ApplicationProvidersResourceHandler.RESOURCE_LOCATOR; - } - /** - * This handles notification by calling {@link #fireNotifyChanged fireNotifyChanged}. - */ - /* - * public void notifyChanged(Notifier notifier, int eventType, EObject feature, Object oldValue, - * Object newValue, int index) { ModulemapPackage pkg = ModulemapPackage.eINSTANCE;; if ( - * feature == pkg.getUtilityJARMapping_ProjectName() || feature == - * pkg.getUtilityJARMapping_Uri() ) { fireNotifyChanged(notifier, eventType, feature, oldValue, - * newValue, index); return; } super.notifyChanged(notifier, eventType, feature, oldValue, - * newValue, index); } - */ -} |