From 28d6d2d5ed601d7615c20387739b283e212657ef Mon Sep 17 00:00:00 2001 From: miettinen Date: Wed, 15 Jan 2014 13:47:28 +0000 Subject: [PATCH] AdjustableTab to Sysdyn to allow reorganizing the configuration tab (refs #4655). git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@28638 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../sysdyn/ui/properties/AdjustableTab.java | 98 +++++++++ .../ui/properties/ConfigurationTab.java | 200 +++++++++++------- .../sysdyn/ui/properties/EquationTab.java | 50 +---- 3 files changed, 228 insertions(+), 120 deletions(-) create mode 100644 org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/AdjustableTab.java diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/AdjustableTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/AdjustableTab.java new file mode 100644 index 00000000..b0ad402b --- /dev/null +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/AdjustableTab.java @@ -0,0 +1,98 @@ +/******************************************************************************* + * Copyright (c) 2007, 2014 Association for Decentralized Information Management in + * Industry THTH ry. + * 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 + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.sysdyn.ui.properties; + +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.ControlListener; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IWorkbenchSite; +import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; +import org.simantics.db.management.ISessionContext; +import org.simantics.selectionview.StandardProperties; + +/** + * Tab adjusting the layout depending on its dimensions. + * @author Tuomas Miettinen + * + */ +public abstract class AdjustableTab extends LabelPropertyTabContributor { + + private Composite spp; + private ControlListener controlListener; + private static final int WIDE_SCREEN_WIDTH = 1100; + + @Override + public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport _support) { + // Get size of the available area. + spp = body; + do { + spp = spp.getParent(); + } while (!(spp instanceof StandardProperties)); + + // Add listener to change the layout when the composite resizes. + spp.addControlListener(controlListener = new ControlListener(){ + + @Override + public void controlMoved(ControlEvent e) {} + + @Override + public void controlResized(ControlEvent e) { + createLayout(); + } + }); + + // Create the controls and their initial layout. + createAndAddControls(body, site, context, _support); + createLayout(); + } + + /** + * Create controls and add them to the tab. + * @param body the composite where the controls are added. + * @param site + * @param context + * @param _support + */ + protected abstract void createAndAddControls(Composite body, IWorkbenchSite site, + ISessionContext context, WidgetSupport _support); + + /** + * Create layout for controls. + */ + protected void createLayout() { + Point size = spp.getSize(); + if (size.x > size.y) { + createControlLayoutHorizontal((size.x > WIDE_SCREEN_WIDTH)); + } else { + createControlLayoutVertical(); + } + } + + /** + * Create vertical layout for controls. + */ + protected abstract void createControlLayoutVertical(); + + /** + * Create horizontal layout for controls. + * @param wideScreen true iff the control is wider than WIDE_SCREEN_WIDTH + */ + protected abstract void createControlLayoutHorizontal(boolean wideScreen); + + @Override + public void dispose() { + if(controlListener != null && spp != null) + spp.removeControlListener(controlListener); + } + +} diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java index 477c6086..51952932 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/ConfigurationTab.java @@ -54,8 +54,15 @@ import org.simantics.sysdyn.ui.properties.widgets.factories.ModelNameInputValida * @author Teemu Lempinen * */ -public class ConfigurationTab extends LabelPropertyTabContributor { +public class ConfigurationTab extends AdjustableTab { + ScrolledComposite sc; + Composite composite; + Label nameLabel, startTimeLabel, stopTimeLabel, stepLengthLabel, + outputIntervalLabel, methodLabel, toleranceLabel, variableFilterLabel; + TrackedText name, startTime, stopTime, stepLength, outputInterval, tolerance, variableFilter; + TrackedCombo method, timeUnit; + Button validateUnits; /** * Modifier for modifying model labels * @author Teemu Lempinen @@ -76,68 +83,58 @@ public class ConfigurationTab extends LabelPropertyTabContributor { } - - @Override - public void createControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport support) { - ScrolledComposite sc = new ScrolledComposite(body, SWT.H_SCROLL | SWT.V_SCROLL); - GridDataFactory.fillDefaults().grab(true, true).applyTo(sc); - GridLayoutFactory.fillDefaults().applyTo(sc); + @Override + protected void createAndAddControls(Composite body, IWorkbenchSite site, + ISessionContext context, WidgetSupport support) { + sc = new ScrolledComposite(body, SWT.H_SCROLL | SWT.V_SCROLL); + composite = new Composite(sc, SWT.NONE); + sc.setContent(composite); - Composite composite = new Composite(sc, SWT.NONE); - GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); - GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(composite); - - Label label = new Label(composite, SWT.NONE); - label.setText("Name"); + nameLabel = new Label(composite, SWT.NONE); + nameLabel.setText("Name"); - TrackedText name = new TrackedText(composite, support, SWT.BORDER); + name = new TrackedText(composite, support, SWT.BORDER); name.setTextFactory(new StringPropertyFactory(Layer0.URIs.HasLabel)); name.addModifyListener(new ModelLabelModifier(context, Layer0.URIs.HasLabel)); name.setInputValidator(new ModelNameInputValidator(support)); - GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(name.getWidget()); - - label = new Label(composite, SWT.NONE); - label.setText("Start time"); + startTimeLabel = new Label(composite, SWT.NONE); + startTimeLabel.setText("Start time"); - TrackedText startTime = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); + startTime = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); startTime.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SysdynModel_startTime)); startTime.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SysdynModel_startTime)); startTime.setInputValidator(new DoubleValidator()); - GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(startTime.getWidget()); - label = new Label(composite, SWT.NONE); - label.setText("Stop time"); + stopTimeLabel = new Label(composite, SWT.NONE); + stopTimeLabel.setText("Stop time"); - TrackedText stopTime = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); + stopTime = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); stopTime.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SysdynModel_stopTime)); stopTime.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SysdynModel_stopTime)); stopTime.setInputValidator(new DoubleValidator()); - GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(stopTime.getWidget()); - label = new Label(composite, SWT.NONE); - label.setText("Step length\n(empty = default)"); + stepLengthLabel = new Label(composite, SWT.NONE); + stepLengthLabel.setText("Step length\n(empty = default)"); - TrackedText stepLength = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); + stepLength = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); stepLength.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SysdynModel_simulationStepLength)); stepLength.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SysdynModel_simulationStepLength)); stepLength.setInputValidator(new DoubleValidator()); - GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(stepLength.getWidget()); - - label = new Label(composite, SWT.NONE); - label.setText("Output interval\n(empty = all steps)"); - TrackedText outputInterval = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); + outputIntervalLabel = new Label(composite, SWT.NONE); + outputIntervalLabel.setText("Output interval\n(empty = all steps)"); + outputIntervalLabel.setAlignment(SWT.RIGHT); + + outputInterval = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); outputInterval.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SysdynModel_outputInterval)); outputInterval.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SysdynModel_outputInterval)); outputInterval.setInputValidator(new DoubleValidator()); - GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(outputInterval.getWidget()); - - - label = new Label(composite, SWT.NONE); - label.setText("Method"); + + methodLabel = new Label(composite, SWT.NONE); + methodLabel.setText("Method"); - TrackedCombo method = new TrackedCombo(composite, support, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); + method = new TrackedCombo(composite, support, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); method.setItemFactory(new ReadFactoryImpl>() { @Override @@ -172,35 +169,7 @@ public class ConfigurationTab extends LabelPropertyTabContributor { } }); - label = new Label(composite, SWT.NONE); - label.setText("Tolerance"); - - TrackedText tolerance = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); - tolerance.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SysdynModel_tolerance)); - tolerance.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SysdynModel_tolerance)); - tolerance.setInputValidator(new DoubleValidator()); - GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(tolerance.getWidget()); - - label = new Label(composite, SWT.NONE); - label.setText("Variable filter"); - label.setToolTipText("Variable filter as regular expression.\n" + - "To include variables Auxiliary1, Auxiliary2 and Auxiliary3: \n" + - "Auxiliary[1-3]\n" + - "or\n" + - "Auxiliary1|Auxiliary2|Auxiliary3"); - - TrackedText variableFilter = new TrackedText(composite, support, SWT.BORDER); - variableFilter.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.SysdynModel_variableFilter, "")); - variableFilter.addModifyListener(new StringPropertyModifier(context, SysdynResource.URIs.SysdynModel_variableFilter)); - GridDataFactory.fillDefaults().hint(200, SWT.DEFAULT).applyTo(variableFilter.getWidget()); - variableFilter.getWidget().setToolTipText("Variable filter as regular expression.\n" + - "To include variables Auxiliary1, Auxiliary2 and Auxiliary3: \n" + - "Auxiliary[1-3]\n" + - "or\n" + - "Auxiliary1|Auxiliary2|Auxiliary3"); - - - Button validateUnits = new Button(composite, support, SWT.CHECK); + validateUnits = new Button(composite, support, SWT.CHECK); validateUnits.setText("Validate units"); validateUnits.setSelectionFactory(new ReadFactoryImpl() { @@ -235,8 +204,7 @@ public class ConfigurationTab extends LabelPropertyTabContributor { }); - - TrackedCombo timeUnit = new TrackedCombo(composite, support, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); + timeUnit = new TrackedCombo(composite, support, SWT.DROP_DOWN | SWT.BORDER | SWT.READ_ONLY); timeUnit.setItemFactory(new ReadFactoryImpl>() { @Override @@ -270,15 +238,96 @@ public class ConfigurationTab extends LabelPropertyTabContributor { graph.claimLiteral(input, SysdynResource.getInstance(graph).SysdynModel_timeUnit, text); } }); - - // Scrolled composite settings - sc.setContent(composite); - sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + toleranceLabel = new Label(composite, SWT.NONE); + toleranceLabel.setText("Tolerance"); + + tolerance = new TrackedText(composite, support, SWT.BORDER | SWT.RIGHT); + tolerance.setTextFactory(new DoublePropertyFactory(SysdynResource.URIs.SysdynModel_tolerance)); + tolerance.addModifyListener(new DoublePropertyModifier(context, SysdynResource.URIs.SysdynModel_tolerance)); + tolerance.setInputValidator(new DoubleValidator()); + + variableFilterLabel = new Label(composite, SWT.NONE); + variableFilterLabel.setText("Variable filter"); + variableFilterLabel.setToolTipText("Variable filter as regular expression.\n" + + "To include variables Auxiliary1, Auxiliary2 and Auxiliary3: \n" + + "Auxiliary[1-3]\n" + + "or\n" + + "Auxiliary1|Auxiliary2|Auxiliary3"); + + variableFilter = new TrackedText(composite, support, SWT.BORDER); + variableFilter.setTextFactory(new StringPropertyFactory(SysdynResource.URIs.SysdynModel_variableFilter, "")); + variableFilter.addModifyListener(new StringPropertyModifier(context, SysdynResource.URIs.SysdynModel_variableFilter)); + variableFilter.getWidget().setToolTipText("Variable filter as regular expression.\n" + + "To include variables Auxiliary1, Auxiliary2 and Auxiliary3: \n" + + "Auxiliary[1-3]\n" + + "or\n" + + "Auxiliary1|Auxiliary2|Auxiliary3"); + sc.setExpandHorizontal(true); sc.setExpandVertical(true); - } + } + @Override + protected void createControlLayoutVertical() { + GridDataFactory.fillDefaults().grab(true, true).applyTo(sc); + GridLayoutFactory.fillDefaults().applyTo(sc); + + GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); + GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(composite); + + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(nameLabel); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(name.getWidget()); + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(startTimeLabel); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(startTime.getWidget()); + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(stopTimeLabel); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(stopTime.getWidget()); + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(stepLengthLabel); + stepLengthLabel.setAlignment(SWT.LEFT); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(stepLength.getWidget()); + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(outputIntervalLabel); + outputIntervalLabel.setAlignment(SWT.LEFT); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(outputInterval.getWidget()); + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(methodLabel); + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(validateUnits.getWidget()); + GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(toleranceLabel); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(tolerance.getWidget()); + GridDataFactory.fillDefaults().span(2, 1).align(SWT.BEGINNING, SWT.CENTER).applyTo(variableFilterLabel); + GridDataFactory.fillDefaults().span(2, 1).grab(true, false).hint(100, SWT.DEFAULT).applyTo(variableFilter.getWidget()); + + sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + } + + @Override + protected void createControlLayoutHorizontal(boolean wideScreen) { + GridDataFactory.fillDefaults().grab(true, true).applyTo(sc); + GridLayoutFactory.fillDefaults().applyTo(sc); + + GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); + GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(wideScreen ? 12 : 6).applyTo(composite); + + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(nameLabel); + GridDataFactory.fillDefaults().grab(true, false).span(wideScreen ? 11 : 5, 1).hint(200, SWT.DEFAULT).applyTo(name.getWidget()); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(startTimeLabel); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(startTime.getWidget()); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(stopTimeLabel); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(stopTime.getWidget()); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(stepLengthLabel); + stepLengthLabel.setAlignment(SWT.RIGHT); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(stepLength.getWidget()); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(outputIntervalLabel); + outputIntervalLabel.setAlignment(SWT.RIGHT); + GridDataFactory.fillDefaults().grab(true, false).hint(50, SWT.DEFAULT).applyTo(outputInterval.getWidget()); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(methodLabel); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(validateUnits.getWidget()); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(toleranceLabel); + GridDataFactory.fillDefaults().grab(true, false).span(wideScreen ? 1 : 1, 1).hint(60, SWT.DEFAULT).applyTo(tolerance.getWidget()); + GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(variableFilterLabel); + GridDataFactory.fillDefaults().grab(true, false).span(wideScreen ? 9 : 3, 1).hint(200, SWT.DEFAULT).applyTo(variableFilter.getWidget()); + + sc.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + } + private class DoubleValidator implements IInputValidator { @Override @@ -294,5 +343,6 @@ public class ConfigurationTab extends LabelPropertyTabContributor { } return null; } - } + } + } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java index 7bbfe7df..901d6ecc 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/properties/EquationTab.java @@ -10,7 +10,6 @@ * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ package org.simantics.sysdyn.ui.properties; -import org.simantics.selectionview.StandardProperties; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -24,8 +23,6 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.custom.VerifyKeyListener; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.MouseEvent; @@ -89,7 +86,7 @@ import org.simantics.utils.ui.AdaptionUtils; * @author Tuomas Miettinen * */ -public class EquationTab extends LabelPropertyTabContributor implements Widget { +public class EquationTab extends AdjustableTab implements Widget { private TrackedCombo expressionTypeCombo, unitCombo, arrayEquationCombo; private ShortcutTabWidget shortcutTabWidget; @@ -101,8 +98,6 @@ public class EquationTab extends LabelPropertyTabContributor implements Widget { private ExpressionComposite expressionComposite; private final WidgetSupportImpl expressionSupport = new WidgetSupportImpl(); private Composite composite; - private Composite spp; - private ControlListener controlListener; private Composite nameComposite; private Composite TypeAndUnit; private Label typeLabel; @@ -114,43 +109,10 @@ public class EquationTab extends LabelPropertyTabContributor implements Widget { _support.register(this); setSupport(); this.site = site; - - // Get size of the available area. - spp = body; - do { - spp = spp.getParent(); - } while (!(spp instanceof StandardProperties)); - - // Add listener to change the layout when the composite resizes. - spp.addControlListener(controlListener = new ControlListener(){ - - @Override - public void controlMoved(ControlEvent e) {} - - @Override - public void controlResized(ControlEvent e) { - createLayout(); - } - }); - - // Create the controls and their initial layout. - createAndAddControls(body, site, context, _support); - createLayout(); - } - - /** - * Create layout for controls. - */ - private void createLayout() { - Point size = spp.getSize(); - if (size.x > size.y) { - createControlLayoutHorizontal((size.x > 1100)); - } else { - createControlLayoutVertical(); - } + super.createControls(body, site, context, _support); } - private void createControlLayoutHorizontal(boolean wideScreen) { + protected void createControlLayoutHorizontal(boolean wideScreen) { GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); GridLayoutFactory.fillDefaults().margins(3, 3).numColumns(2).applyTo(composite); @@ -174,7 +136,7 @@ public class EquationTab extends LabelPropertyTabContributor implements Widget { GridDataFactory.fillDefaults().span(wideScreen ? 4 : 3, 1).grab(true, true).applyTo(expressionComposite); } - private void createControlLayoutVertical() { + protected void createControlLayoutVertical() { GridDataFactory.fillDefaults().grab(true, true).applyTo(composite); GridLayoutFactory.fillDefaults().margins(3, 3).applyTo(composite); @@ -198,7 +160,7 @@ public class EquationTab extends LabelPropertyTabContributor implements Widget { GridDataFactory.fillDefaults().span(3, 1).grab(true, true).hint(SWT.DEFAULT, 300).applyTo(shortcutTabWidget.getWidget()); } - private void createAndAddControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport _support) { + protected void createAndAddControls(Composite body, IWorkbenchSite site, ISessionContext context, WidgetSupport _support) { // Composite for the whole tab Composite composite = new Composite(body, SWT.NONE); this.composite = composite; @@ -766,8 +728,6 @@ public class EquationTab extends LabelPropertyTabContributor implements Widget { } if(focusLostListener != null && site != null) site.getPage().removePartListener(focusLostListener); - if(controlListener != null && spp != null) - spp.removeControlListener(controlListener); super.dispose(); if(expressionComposite != null && !expressionComposite.isDisposed()) expressionComposite.dispose(); -- 2.47.1