Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2012-02-28 15:43:56 +0000
committernhauge2012-02-28 15:43:56 +0000
commitf5db5af04de6b77fdd37ad18d748a5b2d5540643 (patch)
tree8c3d6faf51f3b84ce7ef6c7279cea61cb685b41a
parent07edb9c97aae64ca45a9b3d884bb8b173d62d0f5 (diff)
downloadwebtools.dali-f5db5af04de6b77fdd37ad18d748a5b2d5540643.tar.gz
webtools.dali-f5db5af04de6b77fdd37ad18d748a5b2d5540643.tar.xz
webtools.dali-f5db5af04de6b77fdd37ad18d748a5b2d5540643.zip
368393 - fix enablement of converter Add button. Patch from Nan.
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java25
1 files changed, 19 insertions, 6 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
index d60d58aa88..c3b5787506 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
@@ -15,6 +15,7 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
+import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
@@ -45,7 +46,8 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.PageBook;
/**
- * This pane shows the list of named queries and named native queries.
+ * This pane shows the list of custom converters, object type converters,
+ * struct converters, and type converters.
* <p>
* Here the layout of this pane:
* <pre>
@@ -98,6 +100,7 @@ public class EclipseLinkConvertersComposite extends Pane<EclipseLinkConverterCon
// List pane
this.listPane = addListPane(container);
+ this.installPaneEnabler();
// Property pane
PageBook pageBook = new PageBook(container, SWT.NULL);
@@ -143,7 +146,7 @@ public class EclipseLinkConvertersComposite extends Pane<EclipseLinkConverterCon
buildDisplayableConvertersListHolder(),
this.selectedConverterHolder,
buildConvertersListLabelProvider(),
- null//JpaHelpContextIds.MAPPING_NAMED_QUERIES
+ null
);
}
@@ -365,9 +368,19 @@ public class EclipseLinkConvertersComposite extends Pane<EclipseLinkConverterCon
};
}
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- this.listPane.enableWidgets(enabled);
+ private void installPaneEnabler() {
+ new PaneEnabler(
+ this.buildPaneEnablerHolder(),
+ this.listPane
+ );
+ }
+
+ private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
+ return new TransformationPropertyValueModel<EclipseLinkConverterContainer, Boolean>(getSubjectHolder()) {
+ @Override
+ protected Boolean transform(EclipseLinkConverterContainer value) {
+ return (value != null);
+ }
+ };
}
} \ No newline at end of file

Back to the top