Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortle2010-04-21 21:21:25 +0000
committertle2010-04-21 21:21:25 +0000
commit98aa244301a6f888712a79b153895e168b10781f (patch)
treed308291a85598dbea8b7d19d075bf0347b24625c /jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink
parent6d68098da6656d9e4e1f16539c7ebfc1819e2a7b (diff)
downloadwebtools.dali-98aa244301a6f888712a79b153895e168b10781f.tar.gz
webtools.dali-98aa244301a6f888712a79b153895e168b10781f.tar.xz
webtools.dali-98aa244301a6f888712a79b153895e168b10781f.zip
306860 - EclipseLink Persistence.xml Logging missing Connection checkbox
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink')
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java9
4 files changed, 124 insertions, 12 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java
index 4c252103bf..90a37382a8 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java
@@ -315,6 +315,8 @@ public class EclipseLinkUiMessages {
public static String PersistenceXmlLoggingTab_sessionLabelDefault;
public static String PersistenceXmlLoggingTab_exceptionsLabel;
public static String PersistenceXmlLoggingTab_exceptionsLabelDefault;
+ public static String PersistenceXmlLoggingTab_connectionLabel;
+ public static String PersistenceXmlLoggingTab_connectionLabelDefault;
public static String PersistenceXmlLoggingTab_loggersLabel;
public static String PersistenceXmlLoggingTab_loggingFileLabel;
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java
index b3c0a58f56..e25109913e 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java
@@ -45,17 +45,8 @@ public class EclipseLinkLoggingComposite<T extends Logging>
// LoggingLevel:
new LoggingLevelComposite(this, composite);
- // Timestamp:
- new TimestampComposite(this, composite);
-
- // Thread:
- new ThreadComposite(this, composite);
-
- // Session:
- new SessionComposite(this, composite);
-
- // Exceptions:
- new ExceptionsComposite(this, composite);
+ // Boolean properties group
+ this.logPropertiesComposite(composite);
// LoggingFile:
new LoggingFileLocationComposite(this, composite);
@@ -65,6 +56,21 @@ public class EclipseLinkLoggingComposite<T extends Logging>
return;
}
+
+ protected void logPropertiesComposite(Composite parent) {
+
+ // Timestamp:
+ new TimestampComposite(this, parent);
+
+ // Thread:
+ new ThreadComposite(this, parent);
+
+ // Session:
+ new SessionComposite(this, parent);
+
+ // Exceptions:
+ new ExceptionsComposite(this, parent);
+ }
private void updateGridData(Composite container) {
GridData gridData = new GridData();
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java
new file mode 100644
index 0000000000..7466682715
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+* 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.eclipselink.ui.internal.v2_0.persistence.logging;
+
+import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
+import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
+import org.eclipse.jpt.ui.internal.widgets.Pane;
+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;
+
+/**
+ * ConnectionComposite
+ */
+public class ConnectionComposite extends Pane<Logging2_0>
+{
+ /**
+ * Creates a new <code>ConnectionComposite</code>.
+ *
+ * @param parentController
+ * The parent container of this one
+ * @param parent
+ * The parent container
+ */
+ public ConnectionComposite(
+ Pane<? extends Logging2_0> parentComposite,
+ Composite parent) {
+
+ super(parentComposite, parent);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+
+ this.addTriStateCheckBoxWithDefault(
+ container,
+ EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabel,
+ this.buildConnectionHolder(),
+ this.buildConnectionStringHolder(),
+ null
+// EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_CONNECTION // TODO
+ );
+ }
+
+ private WritablePropertyValueModel<Boolean> buildConnectionHolder() {
+ return new PropertyAspectAdapter<Logging2_0, Boolean>(getSubjectHolder(), Logging2_0.CONNECTION_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.getConnection();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setConnection(value);
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildConnectionStringHolder() {
+ return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultConnectionHolder()) {
+ @Override
+ protected String transform(Boolean value) {
+ if (value != null) {
+ String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
+ return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabelDefault, defaultStringValue);
+ }
+ return EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabel;
+ }
+ };
+ }
+
+ private PropertyValueModel<Boolean> buildDefaultConnectionHolder() {
+ return new PropertyAspectAdapter<Logging2_0, Boolean>(
+ getSubjectHolder(),
+ Logging2_0.CONNECTION_PROPERTY)
+ {
+ @Override
+ protected Boolean buildValue_() {
+ if (this.subject.getConnection() != null) {
+ return null;
+ }
+ return this.subject.getDefaultConnection();
+ }
+ };
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java
index 8f3292734e..19f21b0d16 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java
@@ -44,5 +44,12 @@ public class EclipseLinkLogging2_0Composite extends EclipseLinkLoggingComposite<
protected void addCategoryLoggingLevelComposite(Composite parent) {
new EclipseLinkCategoryLoggingLevelComposite(this, parent);
}
-
+
+ @Override
+ protected void logPropertiesComposite(Composite parent) {
+ super.logPropertiesComposite(parent);
+
+ // Connection:
+ new ConnectionComposite(this, parent);
+ }
}

Back to the top