Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingUiDefinition.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingUiDefinition.java69
1 files changed, 69 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingUiDefinition.java
new file mode 100644
index 0000000000..58fb733c8f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingUiDefinition.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2012 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.jpa.ui.internal.details;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.ui.WidgetFactory;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.jpa.core.MappingKeys;
+import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
+import org.eclipse.jpt.jpa.core.context.JpaContextNode;
+import org.eclipse.jpt.jpa.ui.JptJpaUiImages;
+import org.eclipse.jpt.jpa.ui.details.JpaComposite;
+import org.eclipse.jpt.jpa.ui.details.JpaUiFactory;
+import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
+import org.eclipse.swt.widgets.Composite;
+
+public class EmbeddedIdMappingUiDefinition
+ extends AbstractMappingUiDefinition
+{
+ // singleton
+ private static final EmbeddedIdMappingUiDefinition INSTANCE =
+ new EmbeddedIdMappingUiDefinition();
+
+
+ /**
+ * Return the singleton.
+ */
+ public static MappingUiDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Ensure single instance.
+ */
+ private EmbeddedIdMappingUiDefinition() {
+ super();
+ }
+
+ public String getKey() {
+ return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
+ }
+
+ public String getLabel() {
+ return JptUiDetailsMessages.EmbeddedIdMappingUiProvider_label;
+ }
+
+ public String getLinkLabel() {
+ return JptUiDetailsMessages.EmbeddedIdMappingUiProvider_linkLabel;
+ }
+
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ return JptJpaUiImages.EMBEDDED_ID;
+ }
+
+ @SuppressWarnings("unchecked")
+ public JpaComposite buildMappingComposite(JpaUiFactory factory, PropertyValueModel<? extends JpaContextNode> mappingModel, PropertyValueModel<Boolean> enabledModel, Composite parentComposite, WidgetFactory widgetFactory, ResourceManager resourceManager) {
+ return factory.createEmbeddedIdMappingComposite((PropertyValueModel<EmbeddedIdMapping>) mappingModel, enabledModel, parentComposite, widgetFactory, resourceManager);
+ }
+}

Back to the top