diff options
author | pfullbright | 2011-02-08 23:13:17 +0000 |
---|---|---|
committer | pfullbright | 2011-02-08 23:13:17 +0000 |
commit | f84a6f5610cfc2b3752d1a0caffadb4d2f801a70 (patch) | |
tree | e1523306a68d8ad6253f1de9a4be93ab5db9a725 /jaxb/plugins/org.eclipse.jpt.jaxb.ui/src | |
parent | e0f30ce76b361218e802413484f66435bbdd5ba0 (diff) | |
download | webtools.dali-f84a6f5610cfc2b3752d1a0caffadb4d2f801a70.tar.gz webtools.dali-f84a6f5610cfc2b3752d1a0caffadb4d2f801a70.tar.xz webtools.dali-f84a6f5610cfc2b3752d1a0caffadb4d2f801a70.zip |
changed facet config to use data model only; added jre and user library validators
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.ui/src')
11 files changed, 18 insertions, 462 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java index dbae27a4fa..23526b7272 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetInstallPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. + * Copyright (c) 2010, 2011 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html @@ -9,7 +9,7 @@ *******************************************************************************/ package org.eclipse.jpt.jaxb.ui.internal.wizards.facet; -import org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model.JaxbFacetInstallDataModelProperties; +import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallDataModelProperties; public class JaxbFacetInstallPage extends JaxbFacetPage diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java index 99d5dcdb17..861dae7f92 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. + * Copyright (c) 2010, 2011 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html @@ -12,10 +12,10 @@ package org.eclipse.jpt.jaxb.ui.internal.wizards.facet; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetDataModelProperties; import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin; import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiIcons; import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages; -import org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model.JaxbFacetDataModelProperties; import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate; import org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi; import org.eclipse.swt.SWT; @@ -125,6 +125,18 @@ public abstract class JaxbFacetPage } } + @Override + public void transferStateToConfig() { + // This method is called when "finish" is being performed. + // We remove "this" as a listener so that it will stop responding to data model changes. + // "This" listens only for validation purposes, and we are done with validation at this + // point. Furthermore, any validation at this point runs into the danger of deadlocking + // the wizard. + this.model.removeListener(this); + this.synchHelper.dispose(); + super.transferStateToConfig(); + } + protected final IWorkbenchHelpSystem getHelpSystem() { return PlatformUI.getWorkbench().getHelpSystem(); } diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java index 4f11932622..26e1e43b0a 100644 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java +++ b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/JaxbFacetVersionChangePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. + * Copyright (c) 2010, 2011 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html @@ -9,7 +9,7 @@ *******************************************************************************/ package org.eclipse.jpt.jaxb.ui.internal.wizards.facet; -import org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model.JaxbFacetVersionChangeDataModelProperties; +import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeDataModelProperties; public class JaxbFacetVersionChangePage extends JaxbFacetPage diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetDataModelProperties.java deleted file mode 100644 index 61957b2f39..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetDataModelProperties.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - -import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties; - -public interface JaxbFacetDataModelProperties - extends IDataModelProperties { - - static final String PREFIX_ - = JaxbFacetDataModelProperties.class.getSimpleName() + "."; //$NON-NLS-1$ - - public static final String JAXB_FACET_INSTALL_CONFIG - = PREFIX_ + "JAVA_FACET_INSTALL_CONFIG"; //$NON-NLS-1$ - - public static final String PLATFORM - = PREFIX_ + "PLATFORM"; //$NON-NLS-1$ - - public static final String LIBRARY_INSTALL_DELEGATE - = PREFIX_ + "LIBRARY_INSTALL_DELEGATE"; //$NON-NLS-1$ -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetDataModelProvider.java deleted file mode 100644 index 40e6799791..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetDataModelProvider.java +++ /dev/null @@ -1,261 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.Comparator; -import java.util.Set; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.jpt.common.utility.internal.ArrayTools; -import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; -import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable; -import org.eclipse.jpt.jaxb.core.JaxbFacet; -import org.eclipse.jpt.jaxb.core.JptJaxbCorePlugin; -import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetConfig; -import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription; -import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener; -import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate; -import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider; -import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; -import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy; -import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion; -import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent; -import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener; - - -public abstract class JaxbFacetDataModelProvider - extends FacetInstallDataModelProvider - implements JaxbFacetDataModelProperties { - - protected static final DataModelPropertyDescriptor[] EMPTY_DMPD_ARRAY = new DataModelPropertyDescriptor[0]; - - - protected static final Comparator<DataModelPropertyDescriptor> DMPD_COMPARATOR = - new Comparator<DataModelPropertyDescriptor>() { - public int compare(DataModelPropertyDescriptor dmpd1, DataModelPropertyDescriptor dmpd2) { - return dmpd1.getPropertyDescription().compareTo(dmpd2.getPropertyDescription()); - } - }; - - - private JaxbFacetConfig config; - - private PropertyChangeListener configListener; - - private IPropertyChangeListener libraryInstallDelegateListener; - - - protected JaxbFacetDataModelProvider(JaxbFacetConfig config) { - super(); - this.config = config; - this.configListener = buildConfigListener(); - this.config.addPropertyChangeListener(this.configListener); - this.libraryInstallDelegateListener = buildLibraryInstallDelegateListener(); - } - - - protected PropertyChangeListener buildConfigListener() { - return new PropertyChangeListener() { - public void propertyChange(PropertyChangeEvent evt) { - if (evt.getPropertyName().equals(JaxbFacetConfig.FACETED_PROJECT_WORKING_COPY_PROPERTY)) { - - } - else if (evt.getPropertyName().equals(JaxbFacetConfig.PROJECT_FACET_VERSION_PROPERTY)) { - if (! isPropertySet(PLATFORM)) { - JaxbFacetDataModelProvider.this.config.setPlatform(getDefaultPlatform()); - } - } - else if (evt.getPropertyName().equals(JaxbFacetConfig.LIBRARY_INSTALL_DELEGATE_PROPERTY)) { - LibraryInstallDelegate oldLid = (LibraryInstallDelegate) evt.getOldValue(); - if (oldLid != null) { - oldLid.removeListener(JaxbFacetDataModelProvider.this.libraryInstallDelegateListener); - } - LibraryInstallDelegate newLid = (LibraryInstallDelegate) evt.getNewValue(); - if (newLid != null) { - newLid.addListener(JaxbFacetDataModelProvider.this.libraryInstallDelegateListener); - } - setLibraryInstallDelegate(newLid); - } - } - }; - } - - protected IPropertyChangeListener buildLibraryInstallDelegateListener() { - return new IPropertyChangeListener() { - public void propertyChanged(String property, Object oldValue, Object newValue ) { - JaxbFacetDataModelProvider.this.getDataModel().notifyPropertyChange( - LIBRARY_INSTALL_DELEGATE, IDataModel.VALUE_CHG); - } - }; - } - - @Override - public Set getPropertyNames() { - Set names = super.getPropertyNames(); - names.add(JAXB_FACET_INSTALL_CONFIG); - names.add(PLATFORM); - names.add(LIBRARY_INSTALL_DELEGATE); - return names; - } - - @Override - public void init() { - super.init(); - getDataModel().setProperty(JAXB_FACET_INSTALL_CONFIG, this.config); - - if (this.config.getPlatform() != null) { - getDataModel().setProperty(PLATFORM, this.config.getPlatform()); - } - else { - this.config.setPlatform(getDefaultPlatform()); - } - - if (this.config.getLibraryInstallDelegate() != null) { - getDataModel().setProperty(LIBRARY_INSTALL_DELEGATE, this.config.getLibraryInstallDelegate()); - this.config.getLibraryInstallDelegate().addListener(this.libraryInstallDelegateListener); - } - } - - @Override - public Object getDefaultProperty(String propertyName) { - if (propertyName.equals(FACET_ID)) { - return JaxbFacet.ID; - } - else if (propertyName.equals(PLATFORM)) { - return getDefaultPlatform(); - } - else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) { - // means that library install delegate has not been initialized - LibraryInstallDelegate lid = this.config.getLibraryInstallDelegate(); - setLibraryInstallDelegate(lid); - return lid; - } - - return super.getDefaultProperty(propertyName); - } - - protected JaxbPlatformDescription getDefaultPlatform() { - return JptJaxbCorePlugin.getDefaultPlatform(getProjectFacetVersion()); - } - - @Override - public boolean propertySet(String propertyName, Object propertyValue) { - boolean ok = super.propertySet(propertyName, propertyValue); - - if (propertyName.equals(FACET_VERSION)) { - this.model.notifyPropertyChange(PLATFORM, IDataModel.DEFAULT_CHG); - } - else if (propertyName.equals(FACETED_PROJECT_WORKING_COPY)) { - getFacetedProjectWorkingCopy().addListener( - new IFacetedProjectListener() { - public void handleEvent(IFacetedProjectEvent event) { - LibraryInstallDelegate lid = getLibraryInstallDelegate(); - if (lid != null) { - // may be null while model is being built up - // ... or in tests - lid.refresh(); - } - } - }, - IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED); - } - else if (propertyName.equals(JAXB_FACET_INSTALL_CONFIG)) { - return false; - } - else if (propertyName.equals(PLATFORM)) { - this.config.setPlatform((JaxbPlatformDescription) propertyValue); - } - else if (propertyName.equals(LIBRARY_INSTALL_DELEGATE)) { - this.config.setLibraryInstallDelegate((LibraryInstallDelegate) propertyValue); - } - - return ok; - } - - @Override - public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) { - if (propertyName.equals(PLATFORM)) { - return this.buildValidPlatformDescriptors(); - } - - return super.getValidPropertyDescriptors(propertyName); - } - - protected DataModelPropertyDescriptor[] buildValidPlatformDescriptors() { - Iterable<JaxbPlatformDescription> validPlatformDescriptions = buildValidPlatformDescriptions(); - Iterable<DataModelPropertyDescriptor> validPlatformDescriptors = - new TransformationIterable<JaxbPlatformDescription, DataModelPropertyDescriptor>(validPlatformDescriptions) { - @Override - protected DataModelPropertyDescriptor transform(JaxbPlatformDescription description) { - return buildPlatformDescriptor(description); - } - }; - return ArrayTools.sort(ArrayTools.array(validPlatformDescriptors, EMPTY_DMPD_ARRAY), DMPD_COMPARATOR); - } - - protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() { - return new FilteringIterable<JaxbPlatformDescription>( - JptJaxbCorePlugin.getJaxbPlatformManager().getJaxbPlatforms()) { - @Override - protected boolean accept(JaxbPlatformDescription o) { - return o.supportsJaxbFacetVersion(getProjectFacetVersion()); - } - }; - } - - @Override - public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) { - if (propertyName.equals(PLATFORM)) { - return buildPlatformDescriptor(getPlatform()); - } - - return super.getPropertyDescriptor(propertyName); - } - - protected DataModelPropertyDescriptor buildPlatformDescriptor(JaxbPlatformDescription desc) { - return new DataModelPropertyDescriptor(desc, desc.getLabel()); - } - - @Override - public IStatus validate(String propertyName) { - return this.config.validate(); - } - - protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() { - return (IFacetedProjectWorkingCopy) this.config.getFacetedProjectWorkingCopy(); - } - - protected IProjectFacetVersion getProjectFacetVersion() { - return (IProjectFacetVersion) this.config.getProjectFacetVersion(); - } - - protected JaxbPlatformDescription getPlatform() { - return (JaxbPlatformDescription) getProperty(PLATFORM); - } - - protected LibraryInstallDelegate getLibraryInstallDelegate() { - return (LibraryInstallDelegate) getProperty(LIBRARY_INSTALL_DELEGATE); - } - - protected void setLibraryInstallDelegate(LibraryInstallDelegate lid) { - getDataModel().setProperty(LIBRARY_INSTALL_DELEGATE, lid); - } - - @Override - public void dispose() { - super.dispose(); - this.config.removePropertyChangeListener(this.configListener); - if (this.config.getLibraryInstallDelegate() != null) { - this.config.getLibraryInstallDelegate().removeListener(this.libraryInstallDelegateListener); - } - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallConfigToDataModelAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallConfigToDataModelAdapterFactory.java deleted file mode 100644 index de0df6270e..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallConfigToDataModelAdapterFactory.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallConfig; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - -public class JaxbFacetInstallConfigToDataModelAdapterFactory - implements IAdapterFactory { - - private static final Class<?>[] ADAPTER_LIST = new Class[] { IDataModel.class }; - - public Class<?>[] getAdapterList() { - return ADAPTER_LIST; - } - - public Object getAdapter(Object adaptableObj, Class adapterType) { - if (adapterType == IDataModel.class) { - JaxbFacetInstallDataModelProvider provider - = new JaxbFacetInstallDataModelProvider((JaxbFacetInstallConfig) adaptableObj); - return DataModelFactory.createDataModel( provider ); - } - - return null; - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallDataModelProperties.java deleted file mode 100644 index 98ae9b5765..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallDataModelProperties.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - - -public interface JaxbFacetInstallDataModelProperties - extends JaxbFacetDataModelProperties { - -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallDataModelProvider.java deleted file mode 100644 index 750f80f586..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetInstallDataModelProvider.java +++ /dev/null @@ -1,25 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - -import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetInstallConfig; - -public class JaxbFacetInstallDataModelProvider - extends JaxbFacetDataModelProvider - implements JaxbFacetInstallDataModelProperties { - - public JaxbFacetInstallDataModelProvider() { - this(new JaxbFacetInstallConfig()); - } - - public JaxbFacetInstallDataModelProvider(JaxbFacetInstallConfig config) { - super(config); - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeConfigToDataModelAdapterFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeConfigToDataModelAdapterFactory.java deleted file mode 100644 index dc74680868..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeConfigToDataModelAdapterFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeConfig; -import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory; -import org.eclipse.wst.common.frameworks.datamodel.IDataModel; - - -public class JaxbFacetVersionChangeConfigToDataModelAdapterFactory - implements IAdapterFactory { - - private static final Class<?>[] ADAPTER_LIST = new Class[] { IDataModel.class }; - - public Class<?>[] getAdapterList() { - return ADAPTER_LIST; - } - - public Object getAdapter(Object adaptableObj, Class adapterType) { - if (adapterType == IDataModel.class) { - JaxbFacetVersionChangeDataModelProvider provider - = new JaxbFacetVersionChangeDataModelProvider((JaxbFacetVersionChangeConfig) adaptableObj); - return DataModelFactory.createDataModel( provider ); - } - - return null; - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeDataModelProperties.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeDataModelProperties.java deleted file mode 100644 index 60e7749baa..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeDataModelProperties.java +++ /dev/null @@ -1,16 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - - -public interface JaxbFacetVersionChangeDataModelProperties - extends JaxbFacetDataModelProperties { - -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeDataModelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeDataModelProvider.java deleted file mode 100644 index 393fb8ca46..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/facet/model/JaxbFacetVersionChangeDataModelProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.ui.internal.wizards.facet.model; - -import org.eclipse.jpt.common.utility.internal.CollectionTools; -import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; -import org.eclipse.jpt.jaxb.core.internal.facet.JaxbFacetVersionChangeConfig; -import org.eclipse.jpt.jaxb.core.platform.JaxbPlatformDescription; - -public class JaxbFacetVersionChangeDataModelProvider - extends JaxbFacetDataModelProvider - implements JaxbFacetVersionChangeDataModelProperties { - - public JaxbFacetVersionChangeDataModelProvider() { - this(new JaxbFacetVersionChangeConfig()); - } - - public JaxbFacetVersionChangeDataModelProvider(JaxbFacetVersionChangeConfig config) { - super(config); - } - - - @Override - protected Iterable<JaxbPlatformDescription> buildValidPlatformDescriptions() { - // add existing platform to list of choices - Iterable<JaxbPlatformDescription> validPlatformDescs = super.buildValidPlatformDescriptions(); - if (! CollectionTools.contains(validPlatformDescs, getPlatform())) { - validPlatformDescs = new CompositeIterable(getPlatform(), validPlatformDescs); - } - return validPlatformDescs; - } -} |