Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2012-03-15 02:32:36 +0000
committerkmoore2012-03-15 02:32:36 +0000
commitce76d9e7cda329e98f4600b76ff930171f261160 (patch)
treea3fc08f9a8526930c07275683e9fa8401035e291 /common/plugins
parent438f54ba6ee6c87f104e9909f627924a393d7a6a (diff)
downloadwebtools.dali-ce76d9e7cda329e98f4600b76ff930171f261160.tar.gz
webtools.dali-ce76d9e7cda329e98f4600b76ff930171f261160.tar.xz
webtools.dali-ce76d9e7cda329e98f4600b76ff930171f261160.zip
Bug 370497 - [EclipseLink] JPA Details add attribute-type class chooser widgets
Diffstat (limited to 'common/plugins')
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java21
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java21
-rw-r--r--common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java2
3 files changed, 39 insertions, 5 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java
index a652562257..2a46bf1f4c 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ChooserPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
+ * Copyright (c) 2008, 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.
@@ -64,6 +64,21 @@ public abstract class ChooserPane<T extends Model> extends Pane<T>
super(parentPane, subjectHolder, parent);
}
+ /**
+ * Creates a new <code>ChooserPane</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param subjectHolder The holder of this pane's subject
+ * @param parent The parent container
+ */
+ public ChooserPane(Pane<?> parentPane,
+ PropertyValueModel<? extends T> subjectHolder,
+ Composite parent,
+ PropertyValueModel<Boolean> enabledModel) {
+
+ super(parentPane, subjectHolder, parent, enabledModel);
+ }
+
@Override
protected void initializeLayout(Composite container) {
@@ -157,11 +172,11 @@ public abstract class ChooserPane<T extends Model> extends Pane<T>
super.enableWidgets(enabled);
if (!this.mainControl.isDisposed()) {
- this.mainControl.setEnabled(enabled);
+ this.mainControl.setEnabled(getCombinedEnablement());
}
if (!this.rightControl.isDisposed()) {
- this.rightControl.setEnabled(enabled);
+ this.rightControl.setEnabled(getCombinedEnablement());
}
}
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java
index 2c6a1e650f..be2c54218a 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/ClassChooserPane.java
@@ -99,12 +99,27 @@ public abstract class ClassChooserPane<T extends Model> extends ChooserPane<T>
super(parentPane, subjectHolder, parent);
}
+ /**
+ * Creates a new <code>ClassChooserPane</code>.
+ *
+ * @param parentPane The parent container of this one
+ * @param subjectHolder The holder of this pane's subject
+ * @param parent The parent container
+ */
+ public ClassChooserPane(Pane<?> parentPane,
+ PropertyValueModel<? extends T> subjectHolder,
+ Composite parent,
+ PropertyValueModel<Boolean> enabledModel) {
+
+ super(parentPane, subjectHolder, parent, enabledModel);
+ }
+
@Override
protected void initialize() {
super.initialize();
// TODO bug 156185 - when this is fixed there should be api for this
- this.javaTypeCompletionProcessor = new JavaTypeCompletionProcessor(false, false);
+ this.javaTypeCompletionProcessor = buildJavaTypeCompletionProcessor();
this.subjectChangeListener = this.buildSubjectChangeListener();
this.getSubjectHolder().addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
@@ -112,6 +127,10 @@ public abstract class ClassChooserPane<T extends Model> extends ChooserPane<T>
this.classChooserSubjectChanged(getSubject());
}
+ protected JavaTypeCompletionProcessor buildJavaTypeCompletionProcessor() {
+ return new JavaTypeCompletionProcessor(false, false);
+ }
+
private PropertyChangeListener buildSubjectChangeListener() {
return new SWTPropertyChangeListenerWrapper(this.buildSubjectChangeListener_());
}
diff --git a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
index 643371e6d8..6a4019e029 100644
--- a/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
+++ b/common/plugins/org.eclipse.jpt.common.ui/src/org/eclipse/jpt/common/ui/internal/widgets/Pane.java
@@ -3299,7 +3299,7 @@ public abstract class Pane<T extends Model>
return (this.combinedEnabledModel != null) ? this.combinedEnabledModel : this.baseEnabledModel;
}
- private boolean getCombinedEnablement() {
+ protected boolean getCombinedEnablement() {
Boolean enabled = getCombinedEnabledModel().getValue();
return (enabled == null) ? true : enabled.booleanValue();
}

Back to the top