diff options
Diffstat (limited to 'jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink')
10 files changed, 0 insertions, 381 deletions
diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java deleted file mode 100644 index 39e81583dd..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/Activator.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.eclipse.jpt.jaxb.eclipselink.ui; - -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; - -public class Activator implements BundleActivator { - - private static BundleContext context; - - static BundleContext getContext() { - return context; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext bundleContext) throws Exception { - Activator.context = bundleContext; - } - - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext bundleContext) throws Exception { - Activator.context = null; - } - -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java deleted file mode 100644 index 23b5d76ee8..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/JptJaxbEclipseLinkUiPlugin.java +++ /dev/null @@ -1,105 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * The activator class controls the plug-in life cycle - * - * Provisional API: This interface is part of an interim API that is still - * under development and expected to change significantly before reaching - * stability. It is available at this early stage to solicit feedback from - * pioneering adopters on the understanding that any code that uses this API - * will almost certainly be broken (repeatedly) as the API evolves. - */ -@SuppressWarnings("nls") -public class JptJaxbEclipseLinkUiPlugin - extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.eclipselink.ui"; - - - // ********** singleton ********** - - private static JptJaxbEclipseLinkUiPlugin INSTANCE; - - /** - * Returns the singleton Plugin - */ - public static JptJaxbEclipseLinkUiPlugin instance() { - return INSTANCE; - } - - - // ********** error logging ********** - - public static void log(IStatus status) { - INSTANCE.getLog().log(status); - } - - public static void log(String msg) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, null)); - } - - public static void log(Throwable throwable) { - log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, throwable.getLocalizedMessage(), throwable)); - } - - - // ********** Image API ********** - - /** - * This gets a .gif from the icons folder. - */ - public static ImageDescriptor getImageDescriptor(String key) { - if (! key.startsWith("icons/")) { - key = "icons/" + key; - } - if (! key.endsWith(".gif")) { - key = key + ".gif"; - } - return imageDescriptorFromPlugin(PLUGIN_ID, key); - } - - /** - * This returns an image for a .gif from the icons folder - */ - //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin, - //which means until the workspace is closed. This is better than before where we constantly - //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers - //on our views so that closing the JPA perspective would mean our icons are disposed. - public static Image getImage(String key) { - ImageRegistry imageRegistry = instance().getImageRegistry(); - Image image = imageRegistry.get(key); - if (image == null) { - imageRegistry.put(key, getImageDescriptor(key)); - image = imageRegistry.get(key); - } - return image; - } - - - // ********** constructors ********** - - public JptJaxbEclipseLinkUiPlugin() { - super(); - if (INSTANCE != null) { - throw new IllegalStateException(); - } - INSTANCE = this; - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java deleted file mode 100644 index 91fa343855..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbMappingImageHelper.java +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal; - -import org.eclipse.jpt.jaxb.eclipselink.core.ELJaxbMappingKeys; -import org.eclipse.jpt.jaxb.eclipselink.ui.JptJaxbEclipseLinkUiPlugin; -import org.eclipse.jpt.jaxb.ui.internal.JaxbMappingImageHelper; -import org.eclipse.swt.graphics.Image; - - -public class ELJaxbMappingImageHelper { - - public static Image imageForAttributeMapping(String mappingKey) { - String iconKey = iconKeyForAttributeMapping(mappingKey); - return (iconKey == null) ? - JaxbMappingImageHelper.imageForAttributeMapping(mappingKey) - : JptJaxbEclipseLinkUiPlugin.getImage(iconKey); - } - - public static String iconKeyForAttributeMapping(String mappingKey) { - if (ELJaxbMappingKeys.XML_INVERSE_REFERENCE_ATTRIBUTE_MAPPING_KEY == mappingKey) { - return JptJaxbEclipseLinkUiIcons.XML_INVERSE_REFERENCE; - } - else if (ELJaxbMappingKeys.XML_TRANSFORMATION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) { - return JptJaxbEclipseLinkUiIcons.XML_TRANSFORMATION; - } - - return null; - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java deleted file mode 100644 index 547c390161..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorItemLabelProviderFactory.java +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal; - -import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider; -import org.eclipse.jpt.common.ui.jface.ItemLabelProvider; -import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; -import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorItemLabelProviderFactory; - - -public class ELJaxbNavigatorItemLabelProviderFactory - extends GenericJaxb_2_1_NavigatorItemLabelProviderFactory { - - private static ELJaxbNavigatorItemLabelProviderFactory INSTANCE = new ELJaxbNavigatorItemLabelProviderFactory(); - - - public static GenericJaxb_2_1_NavigatorItemLabelProviderFactory instance() { - return INSTANCE; - } - - - private ELJaxbNavigatorItemLabelProviderFactory() { - super(); - } - - - @Override - public ItemLabelProvider buildItemLabelProvider( - Object item, - DelegatingContentAndLabelProvider contentAndLabelProvider) { - - if (item instanceof JaxbPersistentAttribute) { - return new ELJaxbPersistentAttributeItemLabelProvider((JaxbPersistentAttribute) item, contentAndLabelProvider); - } - - return super.buildItemLabelProvider(item, contentAndLabelProvider); - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java deleted file mode 100644 index e8a1573b48..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbNavigatorUi.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal; - -import org.eclipse.jpt.common.ui.jface.ItemLabelProviderFactory; -import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorUi; - - -public class ELJaxbNavigatorUi - extends GenericJaxb_2_1_NavigatorUi { - - private static ELJaxbNavigatorUi INSTANCE = new ELJaxbNavigatorUi(); - - - public static ELJaxbNavigatorUi instance() { - return INSTANCE; - } - - - private ELJaxbNavigatorUi() { - super(); - } - - - @Override - public ItemLabelProviderFactory getItemLabelProviderFactory() { - return ELJaxbNavigatorItemLabelProviderFactory.instance(); - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java deleted file mode 100644 index 00999326b7..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/ELJaxbPersistentAttributeItemLabelProvider.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal; - -import org.eclipse.jpt.common.ui.jface.DelegatingContentAndLabelProvider; -import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter; -import org.eclipse.jpt.common.utility.model.value.PropertyValueModel; -import org.eclipse.jpt.jaxb.core.context.JaxbPersistentAttribute; -import org.eclipse.jpt.jaxb.ui.internal.jaxb21.JaxbPersistentAttributeItemLabelProvider; -import org.eclipse.swt.graphics.Image; - - -public class ELJaxbPersistentAttributeItemLabelProvider - extends JaxbPersistentAttributeItemLabelProvider { - - public ELJaxbPersistentAttributeItemLabelProvider( - JaxbPersistentAttribute attribute, DelegatingContentAndLabelProvider labelProvider) { - super(attribute, labelProvider); - } - - - @Override - protected PropertyValueModel<Image> buildImageModel() { - - return new PropertyAspectAdapter<JaxbPersistentAttribute, Image>( - new String[] {JaxbPersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY, JaxbPersistentAttribute.MAPPING_PROPERTY}, - getModel()) { - - @Override - protected Image buildValue_() { - return ELJaxbMappingImageHelper.imageForAttributeMapping(this.subject.getMappingKey()); - } - }; - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java deleted file mode 100644 index 148333842e..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/JptJaxbEclipseLinkUiIcons.java +++ /dev/null @@ -1,17 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal; - - -public class JptJaxbEclipseLinkUiIcons { - - public static final String XML_INVERSE_REFERENCE = "full/obj16/xml-inverse-reference"; - public static final String XML_TRANSFORMATION = "full/obj16/xml-transformation"; -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java deleted file mode 100644 index cdaa30c23f..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_1/ELJaxb_2_1_PlatformUi.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_1; - -import org.eclipse.jpt.jaxb.ui.internal.jaxb21.GenericJaxb_2_1_NavigatorUi; -import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi; -import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi; - - -public class ELJaxb_2_1_PlatformUi - implements JaxbPlatformUi { - - public JaxbNavigatorUi getNavigatorUi() { - return GenericJaxb_2_1_NavigatorUi.instance(); - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java deleted file mode 100644 index 2737982fd4..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_2/ELJaxb_2_2_PlatformUi.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_2; - -import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbNavigatorUi; -import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi; -import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi; - - -public class ELJaxb_2_2_PlatformUi - implements JaxbPlatformUi { - - public JaxbNavigatorUi getNavigatorUi() { - return ELJaxbNavigatorUi.instance(); - } -} diff --git a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java b/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java deleted file mode 100644 index dbc9c4f31e..0000000000 --- a/jaxb/plugins/org.eclipse.jpt.jaxb.eclipselink.ui/src/org/eclipse/jpt/jaxb/eclipselink/ui/internal/v2_3/ELJaxb_2_3_PlatformUi.java +++ /dev/null @@ -1,23 +0,0 @@ -/******************************************************************************* - * Copyright (c) 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 - * - * Contributors: - * Oracle - initial API and implementation - *******************************************************************************/ -package org.eclipse.jpt.jaxb.eclipselink.ui.internal.v2_3; - -import org.eclipse.jpt.jaxb.eclipselink.ui.internal.ELJaxbNavigatorUi; -import org.eclipse.jpt.jaxb.ui.navigator.JaxbNavigatorUi; -import org.eclipse.jpt.jaxb.ui.platform.JaxbPlatformUi; - - -public class ELJaxb_2_3_PlatformUi - implements JaxbPlatformUi { - - public JaxbNavigatorUi getNavigatorUi() { - return ELJaxbNavigatorUi.instance(); - } -} |