Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortle2008-12-23 19:40:54 +0000
committertle2008-12-23 19:40:54 +0000
commitd558aac29b15ba14c711d01e8d6c04a0baafb941 (patch)
tree90a40e9969cb853e1e434bd088733ae8d390eb83 /jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence
parent3cbfc2a5fa8ac98f7d2f695a6bdfda9452adf80c (diff)
downloadwebtools.dali-d558aac29b15ba14c711d01e8d6c04a0baafb941.tar.gz
webtools.dali-d558aac29b15ba14c711d01e8d6c04a0baafb941.tar.xz
webtools.dali-d558aac29b15ba14c711d01e8d6c04a0baafb941.zip
228213 - EclipseLink persistence.xml - other properties not supported
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence')
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ClassLoaderComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java96
6 files changed, 395 insertions, 3 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java
index 3852009073..225909b3a7 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java
@@ -28,16 +28,16 @@ public class EclipseLinkCachingComposite extends FormPane<Caching>
@Override
protected void initializeLayout(Composite container) {
- container = addSection(
+ container = this.addSection(
container,
EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionTitle,
EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionDescription
);
// Default pane
- int groupBoxMargin = getGroupBoxMargin();
+ int groupBoxMargin = this.getGroupBoxMargin();
- Composite defaultPane = addSubPane(
+ Composite defaultPane = this.addSubPane(
container,
0, groupBoxMargin, 0, groupBoxMargin
);
@@ -53,5 +53,8 @@ public class EclipseLinkCachingComposite extends FormPane<Caching>
// EntitiesList
new EntityListComposite(this, container);
+
+ // Flush Clear Cache
+ new FlushClearCacheComposite(this, container);
}
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java
new file mode 100644
index 0000000000..c2a1ddeb72
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.eclipselink.ui.internal.persistence.caching;
+
+import java.util.Collection;
+
+import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Caching;
+import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.FlushClearCache;
+import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
+import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
+import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * FlushClearCacheComposite
+ */
+public class FlushClearCacheComposite extends FormPane<Caching>
+{
+ /**
+ * Creates a new <code>FlushClearCacheComposite</code>.
+ *
+ * @param parentController
+ * The parent container of this one
+ * @param parent
+ * The parent container
+ */
+ public FlushClearCacheComposite(
+ FormPane<? extends Caching> parentComposite,
+ Composite parent) {
+
+ super(parentComposite, parent);
+ }
+
+ private EnumFormComboViewer<Caching, FlushClearCache> addFlushClearCacheCombo(Composite container) {
+ return new EnumFormComboViewer<Caching, FlushClearCache>(this, container) {
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(Caching.FLUSH_CLEAR_CACHE_PROPERTY);
+ }
+
+ @Override
+ protected FlushClearCache[] getChoices() {
+ return FlushClearCache.values();
+ }
+
+ @Override
+ protected boolean sortChoices() {
+ return false;
+ }
+
+ @Override
+ protected FlushClearCache getDefaultValue() {
+ return this.getSubject().getDefaultFlushClearCache();
+ }
+
+ @Override
+ protected String displayString(FlushClearCache value) {
+ return this.buildDisplayString(EclipseLinkUiMessages.class, FlushClearCacheComposite.this, value);
+ }
+
+ @Override
+ protected FlushClearCache getValue() {
+ return this.getSubject().getFlushClearCache();
+ }
+
+ @Override
+ protected void setValue(FlushClearCache value) {
+ this.getSubject().setFlushClearCache(value);
+ }
+ };
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ this.addLabeledComposite(
+ container,
+ EclipseLinkUiMessages.PersistenceXmlCachingTab_FlushClearCacheLabel,
+ this.addFlushClearCacheCombo(container),
+ null // TODO IJpaHelpContextIds.
+ );
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ClassLoaderComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ClassLoaderComposite.java
new file mode 100644
index 0000000000..6d03022be6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ClassLoaderComposite.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+* Copyright (c) 2008 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.eclipselink.ui.internal.persistence.customization;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Customization;
+import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
+import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
+import org.eclipse.jpt.ui.internal.widgets.Pane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * ClassLoaderComposite
+ */
+public class ClassLoaderComposite extends Pane<Customization>
+{
+ /**
+ * Creates a new <code>ClassLoaderComposite</code>.
+ *
+ * @param parentPane The parent pane of this one
+ * @param parent The parent container
+ */
+ public ClassLoaderComposite(Pane<? extends Customization> parentPane,
+ Composite parent) {
+
+ super(parentPane, parent);
+ }
+
+ private ClassChooserPane<Customization> initializeClassChooser(Composite container) {
+
+ return new ClassChooserPane<Customization>(this, container) {
+
+ @Override
+ protected WritablePropertyValueModel<String> buildTextHolder() {
+ return new PropertyAspectAdapter<Customization, String>(
+ this.getSubjectHolder(), Customization.CLASSLOADER_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getClassLoader();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setClassLoader(value);
+ }
+ };
+ }
+
+ @Override
+ protected String getClassName() {
+ return this.getSubject().getClassLoader();
+ }
+
+ @Override
+ protected String getLabelText() {
+ return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_classLoaderLabel;
+ }
+
+ @Override
+ protected JpaProject getJpaProject() {
+ return getSubject().getJpaProject();
+ }
+
+ @Override
+ protected void promptType() {
+ IType type = chooseType();
+
+ if (type != null) {
+ String className = type.getFullyQualifiedName('.');
+ this.getSubject().setClassLoader(className);
+ }
+ }
+ };
+ }
+
+ /*
+ * (non-Javadoc)
+ */
+ @Override
+ protected void initializeLayout(Composite container) {
+ this.initializeClassChooser(container);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java
index 0f4ea53aa3..49a9fd3232 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java
@@ -68,11 +68,20 @@ public class EclipseLinkCustomizationComposite extends FormPane<Customization>
// Throw Exceptions
new ThrowExceptionsComposite(this, defaultPane);
+ // Exception Handler
+ new ExceptionHandlerComposite(this, defaultPane);
+
// Session Customizer
new SessionCustomizersComposite(this, defaultPane);
// EntitiesList
new EntityListComposite(this, composite);
+
+ // Validation Only
+ new ValidationOnlyComposite(this, composite);
+
+ // Class Loader
+ new ClassLoaderComposite(this, composite);
// Profiler:
new ProfilerComposite(this, composite);
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java
new file mode 100644
index 0000000000..6fd3242a46
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+* Copyright (c) 2008 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.eclipselink.ui.internal.persistence.customization;
+
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jpt.core.JpaProject;
+import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Customization;
+import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
+import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
+import org.eclipse.jpt.ui.internal.widgets.Pane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * ExceptionHandlerComposite
+ */
+public class ExceptionHandlerComposite extends Pane<Customization>
+{
+ /**
+ * Creates a new <code>ExceptionHandlerComposite</code>.
+ *
+ * @param parentPane The parent pane of this one
+ * @param parent The parent container
+ */
+ public ExceptionHandlerComposite(Pane<? extends Customization> parentPane,
+ Composite parent) {
+
+ super(parentPane, parent);
+ }
+
+ private ClassChooserPane<Customization> initializeClassChooser(Composite container) {
+
+ return new ClassChooserPane<Customization>(this, container) {
+
+ @Override
+ protected WritablePropertyValueModel<String> buildTextHolder() {
+ return new PropertyAspectAdapter<Customization, String>(
+ this.getSubjectHolder(), Customization.EXCEPTION_HANDLER_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getExceptionHandler();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setExceptionHandler(value);
+ }
+ };
+ }
+
+ @Override
+ protected String getClassName() {
+ return this.getSubject().getExceptionHandler();
+ }
+
+ @Override
+ protected String getLabelText() {
+ return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_exceptionHandlerLabel;
+ }
+
+ @Override
+ protected JpaProject getJpaProject() {
+ return getSubject().getJpaProject();
+ }
+
+ @Override
+ protected void promptType() {
+ IType type = chooseType();
+
+ if (type != null) {
+ String className = type.getFullyQualifiedName('.');
+ this.getSubject().setExceptionHandler(className);
+ }
+ }
+ };
+ }
+
+ /*
+ * (non-Javadoc)
+ */
+ @Override
+ protected void initializeLayout(Composite container) {
+ this.initializeClassChooser(container);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java
new file mode 100644
index 0000000000..7af56bc4d4
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.eclipselink.ui.internal.persistence.customization;
+
+import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Customization;
+import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
+import org.eclipse.jpt.ui.internal.widgets.FormPane;
+import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * ValidationOnlyComposite
+ */
+public class ValidationOnlyComposite extends FormPane<Customization>
+{
+ /**
+ * Creates a new <code>ValidationOnlyComposite</code>.
+ *
+ * @param parentController
+ * The parent container of this one
+ * @param parent
+ * The parent container
+ */
+ public ValidationOnlyComposite(
+ FormPane<? extends Customization> parentComposite,
+ Composite parent) {
+
+ super(parentComposite, parent);
+ }
+
+ private WritablePropertyValueModel<Boolean> buildValidationOnlyHolder() {
+ return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.VALIDATION_ONLY_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return subject.getValidationOnly();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ subject.setValidationOnly(value);
+ }
+
+ @Override
+ protected void subjectChanged() {
+ Object oldValue = this.getValue();
+ super.subjectChanged();
+ Object newValue = this.getValue();
+
+ // Make sure the default value is appended to the text
+ if (oldValue == newValue && newValue == null) {
+ this.fireAspectChange(Boolean.TRUE, newValue);
+ }
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildValidationOnlyStringHolder() {
+ return new TransformationPropertyValueModel<Boolean, String>(buildValidationOnlyHolder()) {
+ @Override
+ protected String transform(Boolean value) {
+ if ((getSubject() != null) && (value == null)) {
+ Boolean defaultValue = getSubject().getDefaultValidationOnly();
+ if (defaultValue != null) {
+ String defaultStringValue = defaultValue ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
+ return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabelDefault, defaultStringValue);
+ }
+ }
+ return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabel;
+ }
+ };
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+
+ this.addTriStateCheckBoxWithDefault(
+ container,
+ EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabel,
+ this.buildValidationOnlyHolder(),
+ this.buildValidationOnlyStringHolder(),
+ null
+// EclipseLinkHelpContextIds.
+ );
+ }
+}

Back to the top