Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-04-02 15:59:08 +0000
committerkmoore2010-04-02 15:59:08 +0000
commit9a8bf35a71d249c3a3edbedf11d2a89d78753f79 (patch)
tree11f839b73117e46c9b32b76bc80790c90cc5fb6e
parent3fefdb0f2a4d6cc4c70b3b6c11ed18d73fc53c85 (diff)
downloadwebtools.dali-9a8bf35a71d249c3a3edbedf11d2a89d78753f79.tar.gz
webtools.dali-9a8bf35a71d249c3a3edbedf11d2a89d78753f79.tar.xz
webtools.dali-9a8bf35a71d249c3a3edbedf11d2a89d78753f79.zip
306390 - maps id radio button is no longer a separate radio button group, had to make the parent composite the same as the ID and None radio buttons
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java80
1 files changed, 36 insertions, 44 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java
index 895ae16e3b..92a7db6c3a 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java
@@ -20,7 +20,9 @@ import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
public class DerivedIdentity2_0Pane
@@ -40,6 +42,7 @@ public class DerivedIdentity2_0Pane
Composite composite = addCollapsibleSection(
container,
JptUiDetailsMessages2_0.DerivedIdentity_title);
+ ((GridLayout) composite.getLayout()).numColumns = 2;
addNullDerivedIdentityPane(composite);
addIdDerivedIdentityPane(composite);
@@ -47,11 +50,12 @@ public class DerivedIdentity2_0Pane
}
protected void addNullDerivedIdentityPane(Composite parent) {
- addRadioButton(
+ Button button = addRadioButton(
parent,
JptUiDetailsMessages2_0.DerivedIdentity_nullDerivedIdentity,
buildUsesNullDerivedIdentityStrategyHolder(),
null);
+ ((GridData) button.getLayoutData()).horizontalSpan = 2;
}
protected WritablePropertyValueModel<Boolean> buildUsesNullDerivedIdentityStrategyHolder() {
@@ -74,11 +78,12 @@ public class DerivedIdentity2_0Pane
}
protected void addIdDerivedIdentityPane(Composite parent) {
- addRadioButton(
+ Button button = addRadioButton(
parent,
JptUiDetailsMessages2_0.DerivedIdentity_idDerivedIdentity,
buildUsesIdDerivedIdentityStrategyHolder(),
null);
+ ((GridData) button.getLayoutData()).horizontalSpan = 2;
}
protected WritablePropertyValueModel<Boolean> buildUsesIdDerivedIdentityStrategyHolder() {
@@ -101,7 +106,32 @@ public class DerivedIdentity2_0Pane
}
protected void addMapsIdDerivedIdentityPane(Composite parent) {
- addPaneForAlignment(buildMapsIdValueComboPane(parent));
+ addRadioButton(
+ parent,
+ JptUiDetailsMessages2_0.DerivedIdentity_mapsIdDerivedIdentity,
+ buildUsesMapsIdDerivedIdentityStrategyHolder(),
+ null);
+
+ buildMapsIdValueComboPane(parent);
+ }
+
+ protected WritablePropertyValueModel<Boolean> buildUsesMapsIdDerivedIdentityStrategyHolder() {
+ return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>(
+ getSubjectHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) {
+
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.usesMapsIdDerivedIdentityStrategy();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ // radio button - should only have true values here
+ if (value) {
+ this.subject.setMapsIdDerivedIdentityStrategy();
+ }
+ }
+ };
}
protected ComboPane buildMapsIdValueComboPane(Composite parent) {
@@ -132,52 +162,14 @@ public class DerivedIdentity2_0Pane
@Override
protected void initializeLayout(Composite container) {
- container = addContainer(container);
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- WritablePropertyValueModel<Boolean> usesMapsIdHolder =
- buildUsesMapsIdDerivedIdentityStrategyHolder();
-
- addRadioButton(
- container,
- JptUiDetailsMessages2_0.DerivedIdentity_mapsIdDerivedIdentity,
- usesMapsIdHolder,
- null);
-
super.initializeLayout(container);
-
+ WritablePropertyValueModel<Boolean> usesMapsIdHolder =
+ buildUsesMapsIdDerivedIdentityStrategyHolder();
+
this.comboBox.setEnabled(false);
SWTTools.controlEnabledState(usesMapsIdHolder, this.comboBox);
}
- protected WritablePropertyValueModel<Boolean> buildUsesMapsIdDerivedIdentityStrategyHolder() {
- return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>(
- buildDerivedIdentityHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return this.subject.usesMapsIdDerivedIdentityStrategy();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- // radio button - should only have true values here
- if (value) {
- this.subject.setMapsIdDerivedIdentityStrategy();
- }
- }
- };
- }
-
- protected PropertyValueModel<DerivedIdentity2_0> buildDerivedIdentityHolder() {
- return new PropertyAspectAdapter<MapsIdDerivedIdentityStrategy2_0, DerivedIdentity2_0>(getSubjectHolder()) {
- @Override
- protected DerivedIdentity2_0 buildValue_() {
- return this.subject.getDerivedIdentity();
- }
- };
- }
-
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);

Back to the top