diff options
Diffstat (limited to 'plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.bridge.ui/src/org/eclipse/papyrus/gmf/internal/bridge/transform/ModelDiagnosticPage.java')
-rw-r--r-- | plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.bridge.ui/src/org/eclipse/papyrus/gmf/internal/bridge/transform/ModelDiagnosticPage.java | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.bridge.ui/src/org/eclipse/papyrus/gmf/internal/bridge/transform/ModelDiagnosticPage.java b/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.bridge.ui/src/org/eclipse/papyrus/gmf/internal/bridge/transform/ModelDiagnosticPage.java deleted file mode 100644 index 9789e4e0051..00000000000 --- a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.bridge.ui/src/org/eclipse/papyrus/gmf/internal/bridge/transform/ModelDiagnosticPage.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2020 Borland Software Corporation, CEA LIST, Artal - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Alexander Fedorov (Borland) - initial API and implementation - * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174 - *****************************************************************************/ -package org.eclipse.papyrus.gmf.internal.bridge.transform; - -import org.eclipse.emf.common.ui.DiagnosticComposite; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; - - -abstract class ModelDiagnosticPage extends WizardPage { - - private DiagnosticComposite myDiagnosticComposite; - private Button myIgnoreButton; - - - ModelDiagnosticPage(String pageName) { - super(pageName); - } - - void applyValidation() { - boolean ignore = myIgnoreButton.getSelection(); - setIgnoreOption(ignore); - setPageComplete(ignore); - } - - public void createControl(Composite parent) { - Composite plate = new Composite(parent, SWT.NONE); - { - GridLayout layout = new GridLayout(); - plate.setLayout(layout); - - GridData data = new GridData(); - data.verticalAlignment = GridData.FILL; - data.horizontalAlignment = GridData.FILL; - data.grabExcessHorizontalSpace = true; - plate.setLayoutData(data); - } - createDiagnosticComposite(plate); - createIgnoreButton(plate); - setControl(plate); - - } - - private void createDiagnosticComposite(Composite parent) { - myDiagnosticComposite = new DiagnosticComposite(parent, SWT.NONE); - myDiagnosticComposite.initialize(null); - myDiagnosticComposite.setShowRootDiagnostic(true); - myDiagnosticComposite.setSeverityMask(Diagnostic.ERROR); - GridData data = new GridData(SWT.FILL, SWT.FILL, true, true); - myDiagnosticComposite.setLayoutData(data); - } - - private void createIgnoreButton(Composite parent) { - myIgnoreButton = new Button(parent, SWT.CHECK); - myIgnoreButton.setText(Messages.MapModelDiagnosticPage_btn_ignore_text); - setButtonLayoutData(myIgnoreButton); - myIgnoreButton.addSelectionListener(new SelectionAdapter(){ - - @Override - public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) { - applyValidation(); - } - - }); - } - - protected abstract boolean getIgnoreOption(); - - protected ITransformToGenModelOperation getOperation() { - TransformToGenModelWizard wizard = (TransformToGenModelWizard) getWizard(); - return wizard.getTransformOperation(); - } - - protected abstract Diagnostic getValidationResult(); - - private void initControls() { - Diagnostic diagnostic = getValidationResult(); - myDiagnosticComposite.setDiagnostic(diagnostic); - boolean ignore = getIgnoreOption(); - myIgnoreButton.setSelection(ignore); - setPageComplete(ignore); - } - - protected abstract void setIgnoreOption(boolean ignore); - - @Override - public void setVisible(boolean visible) { - if (visible) { - initControls(); - } - super.setVisible(visible); - } - -} |