Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Plouhinec2022-10-11 13:29:00 +0000
committerGlenn Plouhinec2022-10-14 10:41:10 +0000
commit0af9096ee2333fed41d229b013069e7fcb72376d (patch)
treee042688b1dd5ef66de6e9c6ef9ab601d93ed73d4
parent04bd241acb7a65e864d13acf8f39754b859bd4b0 (diff)
downloadorg.eclipse.eef-master.tar.gz
org.eclipse.eef-master.tar.xz
org.eclipse.eef-master.zip
[580892] Allow the override of EEFExtEObjectCreationPageHEADmaster
Bug: 580892 Change-Id: I01aeff260ed18ff94a34f43950c0f422edc20f2c Signed-off-by: Glenn Plouhinec <glenn.plouhinec@obeo.fr>
-rw-r--r--plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtEObjectCreationPage.java30
1 files changed, 20 insertions, 10 deletions
diff --git a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtEObjectCreationPage.java b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtEObjectCreationPage.java
index 201d93cb6..080fffd49 100644
--- a/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtEObjectCreationPage.java
+++ b/plugins/org.eclipse.eef.ide.ui.ext.widgets.reference/src/org/eclipse/eef/ide/ui/ext/widgets/reference/internal/EEFExtEObjectCreationPage.java
@@ -148,16 +148,26 @@ public class EEFExtEObjectCreationPage extends WizardPage {
this.composedAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
this.composedAdapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ this.createReferenceContentPage(control);
+ this.determinePageCompletion();
+ }
+
+ /**
+ * Create the content of the wizard page depending on the containment attribute of the reference.
+ *
+ * @param parent
+ * the parent composite
+ */
+ protected void createReferenceContentPage(Composite parent) {
if (this.eReference.isContainment()) {
- this.createEObjectEClassComboViewer(control);
+ this.createEObjectEClassComboViewer(parent);
this.initializeContainmentInput(this.target, this.eReference);
} else {
- this.createContainerTreeViewer(control);
- this.createContainmentFeatureComboViewer(control);
- this.createEObjectEClassComboViewer(control);
+ this.createContainerTreeViewer(parent);
+ this.createContainmentFeatureComboViewer(parent);
+ this.createEObjectEClassComboViewer(parent);
this.initializeNonContainmentInput();
}
- this.determinePageCompletion();
}
/**
@@ -168,7 +178,7 @@ public class EEFExtEObjectCreationPage extends WizardPage {
* @param eContainementReference
* The containment EReference to consider
*/
- private void initializeContainmentInput(EObject eObject, EReference eContainementReference) {
+ protected void initializeContainmentInput(EObject eObject, EReference eContainementReference) {
List<Object> values = new ArrayList<>();
Adapter adapter = this.composedAdapterFactory.adapt(eObject, IEditingDomainItemProvider.class);
if (adapter instanceof IEditingDomainItemProvider) {
@@ -303,7 +313,7 @@ public class EEFExtEObjectCreationPage extends WizardPage {
* @param parent
* The parent composite
*/
- private void createContainmentFeatureComboViewer(Composite parent) {
+ protected void createContainmentFeatureComboViewer(Composite parent) {
Label label = new Label(parent, SWT.NONE);
label.setText(Messages.ReferenceCreationWizardPage_eContainerToUseLabel);
label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
@@ -342,7 +352,7 @@ public class EEFExtEObjectCreationPage extends WizardPage {
* @param parent
* The parent composite
*/
- private void createEObjectEClassComboViewer(Composite parent) {
+ protected void createEObjectEClassComboViewer(Composite parent) {
Label label = new Label(parent, SWT.NONE);
label.setText(Messages.ReferenceCreationWizardPage_eClassToCreateLabel);
label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
@@ -375,7 +385,7 @@ public class EEFExtEObjectCreationPage extends WizardPage {
/**
* Determines if the page is complete or not.
*/
- private void determinePageCompletion() {
+ protected void determinePageCompletion() {
this.setMessage(null);
boolean isPageComplete = false;
@@ -404,7 +414,7 @@ public class EEFExtEObjectCreationPage extends WizardPage {
* The error message
* @return <code>true</code> if the wizard is currently complete and the viewer too, <code>false</code> otherwise
*/
- private boolean isCompleteViewer(boolean isCurrentlyComplete, StructuredViewer viewer, String errorMessage) {
+ protected boolean isCompleteViewer(boolean isCurrentlyComplete, StructuredViewer viewer, String errorMessage) {
boolean isComplete = isCurrentlyComplete;
if (isCurrentlyComplete) {
boolean isViewerComplete = this.getEObject(viewer) != null;

Back to the top