Bug 514316
The graphical definition of the content of each tab in the "Run
Configurations..." dialog is now written in classes that are totally
independant on assumptions made on the parent (it can be anything which
matches a simple interface, and not only an
AbstractSewLaunchConfigurationTab
All the API has been rewritten and implemented on both the tabs and the
pages (on the previous commit it was only the field editors)
Change-Id: I7c9d5a9cb76b85e75734c90e77e524fe9ee8105f
Signed-off-by: Erwan Mahe <erwan.mahe@cea.fr>
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/LaunchConfigurationTabGroup.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/LaunchConfigurationTabGroup.java
index 6fc647a..51dc639 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/LaunchConfigurationTabGroup.java
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/LaunchConfigurationTabGroup.java
@@ -20,13 +20,13 @@
import org.eclipse.debug.ui.RefreshTab;
import org.eclipse.efm.core.workflow.Activator;
import org.eclipse.efm.core.workflow.ToolConstants;
-import org.eclipse.efm.runconfiguration.ui.CommonCriteriaTab;
-import org.eclipse.efm.runconfiguration.ui.DebugTab;
-import org.eclipse.efm.runconfiguration.ui.DeveloperTuningTab;
-import org.eclipse.efm.runconfiguration.ui.ExpertTab;
-import org.eclipse.efm.runconfiguration.ui.MainTab;
-import org.eclipse.efm.runconfiguration.ui.SymbexRuntimeTab;
-import org.eclipse.efm.runconfiguration.ui.TestGenerationTab;
+import org.eclipse.efm.runconfiguration.ui.tabs.CommonCriteriaTab;
+import org.eclipse.efm.runconfiguration.ui.tabs.DebugTab;
+import org.eclipse.efm.runconfiguration.ui.tabs.DeveloperTuningTab;
+import org.eclipse.efm.runconfiguration.ui.tabs.ExpertTab;
+import org.eclipse.efm.runconfiguration.ui.tabs.MainTab;
+import org.eclipse.efm.runconfiguration.ui.tabs.SymbexRuntimeTab;
+import org.eclipse.efm.runconfiguration.ui.tabs.TestGenerationTab;
import org.eclipse.jface.preference.IPreferenceStore;
public class LaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/AbstractSewLaunchConfigurationTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/AbstractSewLaunchConfigurationTab.java
deleted file mode 100644
index 8802b79..0000000
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/AbstractSewLaunchConfigurationTab.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
- * 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
-
-import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.efm.core.workflow.IWorkflowConfigurationConstants;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
-import org.eclipse.efm.ui.views.utils.LaunchConfigurationEditorCommunicationInterface;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-
-public abstract class AbstractSewLaunchConfigurationTab
- extends AbstractLaunchConfigurationTab
- implements IWorkflowConfigurationConstants, LaunchConfigurationEditorCommunicationInterface{
-
- protected LaunchConfigurationTabGroup fGroupTab;
-
- public LaunchConfigurationTabGroup getGroupTab() {
- return fGroupTab;
- }
-
- public MainTab getMainTab() {
- return fGroupTab.getMainTab();
- }
-
- /**
- * Constructor
- * @param groupTab
- */
- public AbstractSewLaunchConfigurationTab(LaunchConfigurationTabGroup groupTab) {
- super();
- this.fGroupTab = groupTab;
- }
-
- @Override
- public void setMessage(String message) {
- super.setMessage(message);
- }
-
- @Override
- public void setWarningMessage(String warningMessage) {
- super.setWarningMessage(warningMessage);
- }
-
- @Override
- public void setErrorMessage(String errorMessage) {
- super.setErrorMessage(errorMessage);
- }
-
-
- @Override
- public void updateLaunchConfigurationDialog() {
- super.updateLaunchConfigurationDialog();
- }
-
- @Override
- public void scheduleUpdateJob() {
- super.scheduleUpdateJob();
- }
-
- @Override
- protected Shell getShell() {
- return super.getShell();
- }
-
- @Override
- public void updateGUI() {
- updateLaunchConfigurationDialog();
- }
-
- /**
- * visibleAndExclude
- * @param aControl
- * @param visible
- */
- public void visibleAndExclude(Control aControl, boolean visible) {
- aControl.setVisible(visible);
-
- Object gd = aControl.getLayoutData();
- if (gd instanceof GridData) {
- ((GridData)gd).exclude = (! visible);
- }
- }
-
-}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertTab.java
deleted file mode 100644
index 6d34a7d..0000000
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertTab.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
- * 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
- *******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
-import org.eclipse.efm.ui.resources.HelpCoReferee;
-import org.eclipse.efm.ui.views.utils.SWTFactory;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-
-public class ExpertTab extends AbstractSewLaunchConfigurationTab {
-
- private String fTabName;
-
- private Group groupExplorationPage;
-
- // BEHAVIOR SELECTION : HIT OR JUMP
- ExpertBehaviorSelectionPage fBehaviorSelectionPage;
-
- // TRANSITION COVERAGE
- ExpertTransitionCoveragePage fTransitionCoveragePage;
-
- /**
- * Constructor
- * @param groupTab
- */
- public ExpertTab(LaunchConfigurationTabGroup groupTab) {
- super(groupTab);
- setHelpContextId(HelpCoReferee.efm_runconf_expert_tab);
-
- fTabName = "Expert";
-
- // BEHAVIOR SELECTION : HIT OR JUMP
- fBehaviorSelectionPage = new ExpertBehaviorSelectionPage(this);
-
- // TRANSITION COVERAGE
- fTransitionCoveragePage = new ExpertTransitionCoveragePage(this);
- }
-
-
- private Composite simpleComposite;
-
-
- @Override
- public void createControl(Composite parent) {
- simpleComposite = SWTFactory.createComposite(parent,
- parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0);
- setControl(simpleComposite);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- getControl(), getHelpContextId());
-
- // EXPLORATION PAGE
- createExplorationPage(simpleComposite);
-
- // BEHAVIOR SELECTION : HIT OR JUMP
- fBehaviorSelectionPage.createControl(simpleComposite);
-
- // TRANSITION COVERAGE
- fTransitionCoveragePage.createControl(simpleComposite);
- }
-
- private void setEnableGroupExplorationPage(ILaunchConfiguration configuration) {
- try {
- String fAnalysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
-
- String fModelAnalysis = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
-
- visibleAndExclude(groupExplorationPage,
- (fAnalysisProfile.equals(ANALYSIS_PROFILE_MODEL)
- && fModelAnalysis.equals(ANALYSIS_PROFILE_MODEL_EXPLORATION)
- ) || fAnalysisProfile.equals(ANALYSIS_PROFILE_TEST_OFFLINE) );
- }
- catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
-
- public void createExplorationPage(Composite parent) {
- groupExplorationPage = SWTFactory.createGroup(parent,
- "Exploration Page", 1, 2, GridData.FILL_HORIZONTAL);
-
- Composite comp = SWTFactory.createComposite(groupExplorationPage, 1, 1,
- GridData.FILL_HORIZONTAL);
-
- SWTFactory.createLabel(comp, "&No expert mode for Exploration "
- + "of Model Analysis and Test Verdict Computation !", 1);
- }
-
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- @Override
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
-
- // BEHAVIOR SELECTION : HIT OR JUMP
- if( ! fBehaviorSelectionPage.isValid(launchConfig) ) {
- return false;
- }
-
- // TRANSITION COVERAGE
- if( ! fTransitionCoveragePage.isValid(launchConfig) ) {
- return false;
- }
-
- return true;
- }
-
-
- @Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- // BEHAVIOR SELECTION : HIT OR JUMP
- fBehaviorSelectionPage.setDefaults(configuration);
-
- // TRANSITION COVERAGE
- fTransitionCoveragePage.setDefaults(configuration);
- }
-
-
- @Override
- public void initializeFrom(ILaunchConfiguration configuration) {
- setEnableGroupExplorationPage(configuration);
-
- // BEHAVIOR SELECTION : HIT OR JUMP
- fBehaviorSelectionPage.initializeFrom(configuration);
-
- // TRANSITION COVERAGE
- fTransitionCoveragePage.initializeFrom(configuration);
- }
-
- public void performApplyExploration(
- ILaunchConfigurationWorkingCopy configuration) {
- setEnableGroupExplorationPage(configuration);
- }
-
-
- @Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- performApplyExploration(configuration);
-
- // BEHAVIOR SELECTION : HIT OR JUMP
- fBehaviorSelectionPage.performApply(configuration);
-
- // TRANSITION COVERAGE
- fTransitionCoveragePage.performApply(configuration);
- }
-
- @Override
- public String getName() {
- return fTabName;
- }
-
- public void setTabName(String tabName) {
- this.fTabName = tabName;
- }
-
-
-}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/AbstractSewLaunchConfigurationTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/AbstractSewLaunchConfigurationTab.java
new file mode 100644
index 0000000..f1e57f1
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/AbstractSewLaunchConfigurationTab.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
+import org.eclipse.efm.core.workflow.Activator;
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.launchconfigurations.components.AbstractCompositeMaker;
+import org.eclipse.efm.ui.views.launchconfigurations.components.AbstractCompositeMaker.FieldValidationReturn;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+public abstract class AbstractSewLaunchConfigurationTab extends AbstractLaunchConfigurationTab implements ILaunchConfigurationGUIelement {
+
+ protected LaunchConfigurationTabGroup fGroupTab;
+ protected AbstractCompositeMaker contentCompositeManager;
+
+ /**
+ * Constructor
+ * @param groupTab
+ */
+ public AbstractSewLaunchConfigurationTab(LaunchConfigurationTabGroup groupTab) {
+ super();
+ this.fGroupTab = groupTab;
+ }
+
+ public LaunchConfigurationTabGroup getGroupTab() {
+ return fGroupTab;
+ }
+
+ public MainTab getMainTab() {
+ return fGroupTab.getMainTab();
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ Composite simpleComposite = contentCompositeManager.createControlMain(parent);
+ setControl(simpleComposite);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId());
+ }
+
+
+
+ @Override
+ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ contentCompositeManager.setDefaultFieldValues(configuration);
+ }
+
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ contentCompositeManager.initializeFieldValuesFrom(configuration);
+ }
+
+ @Override
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ contentCompositeManager.applyUpdatesOnFieldValuesFrom(configuration);
+ }
+
+ /**
+ * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
+ */
+ @Override
+ public boolean isValid(ILaunchConfiguration launchConfig) {
+ FieldValidationReturn fieldValidation = contentCompositeManager.areFieldsValid(launchConfig);
+ if (fieldValidation.areFieldsValid()) {
+ setMessage(fieldValidation.getReason());
+ } else {
+ setErrorMessage(fieldValidation.getReason());
+ }
+ return fieldValidation.areFieldsValid();
+ }
+
+
+ /**
+ * Returns the {@link IDialogSettings} for the given id
+ *
+ * @param id the id of the dialog settings to get
+ * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
+ * @since 3.6
+ */
+ public final IDialogSettings getDialogBoundsSettings(String id) {
+ IDialogSettings settings = Activator.getDefault().getDialogSettings();
+ IDialogSettings section = settings.getSection(id);
+ if(section == null) {
+ section = settings.addNewSection(id);
+ }
+ return section;
+ }
+
+ // ======================================================================================
+ // ILaunchConfigurationGUIelement interface methods
+ // ======================================================================================
+
+ @Override
+ public void updateGUI() {
+ updateLaunchConfigurationDialog();
+ }
+
+ @Override // to change visibility to public
+ public void setMessage(String message){
+ super.setMessage(message);
+ }
+
+ @Override // to change visibility to public
+ public void setWarningMessage(String warningmessage){
+ super.setWarningMessage(warningmessage);
+ }
+
+ @Override // to change visibility to public
+ public void setErrorMessage(String errormessage){
+ super.setErrorMessage(errormessage);
+ }
+
+ @Override // to change visibility to public
+ public void scheduleUpdateJob(){
+ super.scheduleUpdateJob();
+ }
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/CommonCriteriaTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/CommonCriteriaTab.java
new file mode 100644
index 0000000..8c054cb
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/CommonCriteriaTab.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2016 CEA LIST.
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import org.eclipse.efm.core.workflow.Activator;
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.launchconfigurations.components.CommonCriteriaCompositeMaker;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
+
+
+public class CommonCriteriaTab extends AbstractSewLaunchConfigurationTab {
+
+ public CommonCriteriaTab(LaunchConfigurationTabGroup groupTab) {
+ super(groupTab);
+ contentCompositeManager = new CommonCriteriaCompositeMaker(this);
+ setHelpContextId(HelpCoReferee.efm_runconf_commoncriteria_tab);
+ }
+
+ @Override
+ public String getName() {
+ return "Common Criteria";
+ }
+
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/DebugTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/DebugTab.java
new file mode 100644
index 0000000..94e9679
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/DebugTab.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import org.eclipse.efm.core.workflow.Activator;
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.launchconfigurations.components.DebugCompositeMaker;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
+
+
+public class DebugTab extends AbstractSewLaunchConfigurationTab {
+
+ public DebugTab(LaunchConfigurationTabGroup groupTab) {
+ super(groupTab);
+ contentCompositeManager = new DebugCompositeMaker(this);
+ setHelpContextId(HelpCoReferee.efm_runconf_debug_tab);
+ }
+
+ @Override
+ public String getName() {
+ return "Debug";
+ }
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/DeveloperTuningTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/DeveloperTuningTab.java
new file mode 100644
index 0000000..a1a01a0
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/DeveloperTuningTab.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import org.eclipse.efm.core.workflow.Activator;
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.launchconfigurations.components.DeveloperTuningCompositeMaker;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+
+public class DeveloperTuningTab extends AbstractSewLaunchConfigurationTab {
+
+ public DeveloperTuningTab(LaunchConfigurationTabGroup groupTab) {
+ super(groupTab);
+ contentCompositeManager = new DeveloperTuningCompositeMaker(this);
+ setHelpContextId(HelpCoReferee.efm_runconf_debug_tab);
+ }
+
+ @Override
+ public String getName() {
+ return "Developer";
+ }
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/ExpertTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/ExpertTab.java
new file mode 100644
index 0000000..611cf3f
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/ExpertTab.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
+import org.eclipse.efm.ui.views.launchconfigurations.components.ExpertCompositeMaker;
+
+public class ExpertTab extends AbstractSewLaunchConfigurationTab {
+
+ public ExpertTab(LaunchConfigurationTabGroup groupTab) {
+ super(groupTab);
+ contentCompositeManager = new ExpertCompositeMaker(this);
+ setHelpContextId(HelpCoReferee.efm_runconf_expert_tab);
+ }
+
+ @Override
+ public String getName() {
+ return "Expert";
+ }
+
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/MainTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/MainTab.java
new file mode 100644
index 0000000..536f780
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/MainTab.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.launchconfigurations.components.FirstCompositeMaker;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
+
+
+public class MainTab extends AbstractSewLaunchConfigurationTab {
+
+
+
+
+ /**
+ * Constructor
+ * @param groupTab
+ */
+ public MainTab(LaunchConfigurationTabGroup groupTab) {
+ super(groupTab);
+ contentCompositeManager = new FirstCompositeMaker(this);
+ setHelpContextId(HelpCoReferee.efm_runconf_main_tab);
+ }
+
+
+ @Override
+ public String getName() {
+ return "Main";
+ }
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/NonRegressionTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/NonRegressionTab.java
new file mode 100644
index 0000000..c31c886
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/NonRegressionTab.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.efm.core.workflow.Activator;
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
+import org.eclipse.efm.ui.views.utils.SWTFactory;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.window.Window;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.ContainerSelectionDialog;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.views.navigator.ResourceComparator;
+
+public class NonRegressionTab extends AbstractSewLaunchConfigurationTab {
+
+ public NonRegressionTab(LaunchConfigurationTabGroup groupTab) {
+ super(groupTab);
+
+ }
+
+ @Override
+ public String getName() {
+ return "Non Regression";
+ }
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/SymbexRuntimeTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/SymbexRuntimeTab.java
similarity index 99%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/SymbexRuntimeTab.java
rename to gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/SymbexRuntimeTab.java
index 4470ba7..865b1db 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/SymbexRuntimeTab.java
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/SymbexRuntimeTab.java
@@ -8,7 +8,7 @@
* Contributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr - Initial API and implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.runconfiguration.ui.tabs;
import java.io.File;
import java.util.ArrayList;
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/TestGenerationTab.java b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/TestGenerationTab.java
new file mode 100644
index 0000000..a64eb64
--- /dev/null
+++ b/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/tabs/TestGenerationTab.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+package org.eclipse.efm.runconfiguration.ui.tabs;
+
+import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.launchconfigurations.components.TestGenerationCompositeMaker;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
+
+public class TestGenerationTab extends AbstractSewLaunchConfigurationTab {
+
+ /**
+ * Constructor
+ * @param groupTab
+ */
+ public TestGenerationTab(LaunchConfigurationTabGroup groupTab) {
+ super(groupTab);
+ contentCompositeManager = new TestGenerationCompositeMaker(this);
+ setHelpContextId(HelpCoReferee.efm_runconf_testgeneration_tab);
+ }
+
+ @Override
+ public String getName() {
+ return "Test Generation";
+ }
+}
diff --git a/gui/org.eclipse.efm.ui.views/META-INF/MANIFEST.MF b/gui/org.eclipse.efm.ui.views/META-INF/MANIFEST.MF
index 8dd058a..3338500 100644
--- a/gui/org.eclipse.efm.ui.views/META-INF/MANIFEST.MF
+++ b/gui/org.eclipse.efm.ui.views/META-INF/MANIFEST.MF
@@ -13,8 +13,12 @@
org.eclipse.debug.core,
org.eclipse.debug.ui,
org.eclipse.efm.ui.resources,
+ org.eclipse.ui.dialogs,
org.eclipse.ui.forms.events,
- org.eclipse.ui.forms.widgets
+ org.eclipse.ui.forms.widgets,
+ org.eclipse.ui.model,
+ org.eclipse.ui.views.navigator
Export-Package: org.eclipse.efm.ui.views.editors,
org.eclipse.efm.ui.views.editors.impls,
+ org.eclipse.efm.ui.views.launchconfigurations.components,
org.eclipse.efm.ui.views.utils
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/FieldEditor.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/FieldEditor.java
index 55f9d91..c738be5 100644
--- a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/FieldEditor.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/FieldEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
* 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr - Initial API and implementation
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New Interfacing (ILaunchConfigurationEditorComposite)
*******************************************************************************/
package org.eclipse.efm.ui.views.editors;
@@ -14,7 +15,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.ui.views.utils.LaunchConfigurationEditorCommunicationInterface;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.IPropertyChangeListener;
@@ -75,7 +76,7 @@
/**
* The page containing this field editor
*/
- private LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt;
+ private ILaunchConfigurationEditorComposite fLaunchConfCommInt;
/**
@@ -91,7 +92,7 @@
* @param labelText the label text of the field editor
* @param parent the parent of the field editor's control
*/
- protected FieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ protected FieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent) {
this.fLaunchConfCommInt = fLaunchConfCommInt;
this.fStoreKey = storeKey;
@@ -141,7 +142,7 @@
*/
protected void clearErrorMessage() {
if (fLaunchConfCommInt != null) {
- fLaunchConfCommInt.setErrorMessage(null);
+ fLaunchConfCommInt.propagateErrorMessage(null);
}
}
@@ -150,7 +151,7 @@
*/
protected void clearMessage() {
if (fLaunchConfCommInt != null) {
- fLaunchConfCommInt.setMessage(null);
+ fLaunchConfCommInt.propagateMessage(null);
}
}
@@ -402,7 +403,7 @@
*
* @since 3.1
*/
- protected LaunchConfigurationEditorCommunicationInterface getLaunchConfCommInt(){
+ protected ILaunchConfigurationEditorComposite getLaunchConfCommInt(){
return fLaunchConfCommInt;
}
@@ -413,7 +414,7 @@
* @param name the name of the preference this field editor works on
* @param text the label text of the field editor
*/
- protected void init(LaunchConfigurationEditorCommunicationInterface launchConfigurationTab,
+ protected void init(ILaunchConfigurationEditorComposite launchConfigurationTab,
String storeKey, String labelText) {
Assert.isNotNull(launchConfigurationTab);
this.fLaunchConfCommInt = launchConfigurationTab;
@@ -548,7 +549,7 @@
*/
protected void showErrorMessage(String msg) {
if (fLaunchConfCommInt != null) {
- fLaunchConfCommInt.setErrorMessage(msg);
+ fLaunchConfCommInt.propagateErrorMessage(msg);
}
}
@@ -560,13 +561,13 @@
*/
protected void showMessage(String msg) {
if (fLaunchConfCommInt != null) {
- fLaunchConfCommInt.setMessage(msg);
+ fLaunchConfCommInt.propagateMessage(msg);
}
}
public void updateLaunchConfigurationDialog() {
if (fLaunchConfCommInt != null) {
- fLaunchConfCommInt.updateGUI();
+ fLaunchConfCommInt.propagateGUIupdate();
}
}
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/BooleanFieldEditor.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/BooleanFieldEditor.java
index c9680aa..90c00bf 100644
--- a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/BooleanFieldEditor.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/BooleanFieldEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
* 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
@@ -7,13 +7,14 @@
*
* Contributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr - Initial API and implementation
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New Interfacing (ILaunchConfigurationEditorComposite)
*******************************************************************************/
package org.eclipse.efm.ui.views.editors.impls;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.ui.views.utils.LaunchConfigurationEditorCommunicationInterface;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.editors.FieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@@ -79,7 +80,7 @@
* @see #DEFAULT
* @see #SEPARATE_LABEL
*/
- public BooleanFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public BooleanFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, int style, Composite parent, boolean defaultValue) {
this.fDefaultValue = defaultValue;
@@ -99,12 +100,12 @@
* @param parent
* the parent of the field editor's control
*/
- public BooleanFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public BooleanFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent, boolean defaultValue) {
this(fLaunchConfCommInt, storeKey, labelText, DEFAULT, parent, defaultValue);
}
- public BooleanFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public BooleanFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent) {
this(fLaunchConfCommInt, storeKey, labelText, DEFAULT, parent, false);
}
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/IntegerFieldEditor.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/IntegerFieldEditor.java
index 05c91b4..1471192 100644
--- a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/IntegerFieldEditor.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/IntegerFieldEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
* 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
@@ -7,13 +7,14 @@
*
* Contributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr - Initial API and implementation
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New Interfacing (ILaunchConfigurationEditorComposite)
*******************************************************************************/
package org.eclipse.efm.ui.views.editors.impls;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.ui.views.utils.LaunchConfigurationEditorCommunicationInterface;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
@@ -30,12 +31,12 @@
private static final int DEFAULT_TEXT_LIMIT = 10;
- public IntegerFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public IntegerFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent, int defaultValue) {
this(fLaunchConfCommInt, storeKey, labelText, parent, DEFAULT_TEXT_LIMIT, defaultValue);
}
- public IntegerFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public IntegerFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent, int textLimit, int defaultValue) {
super( Integer.toString(defaultValue) , true );
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/ListOfStringFieldEditor.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/ListOfStringFieldEditor.java
index 343d328..fce9d36 100644
--- a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/ListOfStringFieldEditor.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/ListOfStringFieldEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
* 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr - Initial API and implementation
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New Interfacing (ILaunchConfigurationEditorComposite)
*******************************************************************************/
package org.eclipse.efm.ui.views.editors.impls;
@@ -15,7 +16,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.ui.views.utils.LaunchConfigurationEditorCommunicationInterface;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.efm.ui.views.editors.FieldEditor;
@@ -24,7 +25,7 @@
private List< String > fValue;
private List< String > fDefaultValue;
- public ListOfStringFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public ListOfStringFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent, List< String > defaultValue) {
super(fLaunchConfCommInt, storeKey, labelText, parent);
this.fDefaultValue = defaultValue;
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/StringFieldEditor.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/StringFieldEditor.java
index 485d09b..f4fe8a1 100644
--- a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/StringFieldEditor.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/editors/impls/StringFieldEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
* 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr - Initial API and implementation
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New Interfacing (ILaunchConfigurationEditorComposite)
*******************************************************************************/
package org.eclipse.efm.ui.views.editors.impls;
@@ -14,7 +15,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.ui.views.utils.LaunchConfigurationEditorCommunicationInterface;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
@@ -175,7 +176,7 @@
* @param parent the parent of the field editor's control
* @since 2.0
*/
- public StringFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public StringFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, int width,
int strategy, Composite parent, String defaultValue, int textFieldStyle) {
this.fDefaultValue = defaultValue;
@@ -193,13 +194,13 @@
}
- public StringFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public StringFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent, String defaultValue) {
this(fLaunchConfCommInt, storeKey, labelText, UNLIMITED,
VALIDATE_ON_KEY_STROKE, parent, defaultValue, SWT.SINGLE);
}
- public StringFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public StringFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent, String defaultValue, int textFieldStyle) {
this(fLaunchConfCommInt, storeKey, labelText, UNLIMITED,
VALIDATE_ON_KEY_STROKE, parent, defaultValue, textFieldStyle);
@@ -215,7 +216,7 @@
* or <code>UNLIMITED</code> for no limit
* @param parent the parent of the field editor's control
*/
- public StringFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public StringFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, int width, Composite parent) {
this(fLaunchConfCommInt, storeKey, labelText, width,
VALIDATE_ON_KEY_STROKE, parent, "", SWT.SINGLE);
@@ -229,7 +230,7 @@
* @param labelText the label text of the field editor
* @param parent the parent of the field editor's control
*/
- public StringFieldEditor(LaunchConfigurationEditorCommunicationInterface fLaunchConfCommInt,
+ public StringFieldEditor(ILaunchConfigurationEditorComposite fLaunchConfCommInt,
String storeKey, String labelText, Composite parent) {
this(fLaunchConfCommInt, storeKey, labelText, UNLIMITED, parent);
}
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/AbstractCompositeMaker.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/AbstractCompositeMaker.java
new file mode 100644
index 0000000..74b19bd
--- /dev/null
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/AbstractCompositeMaker.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr
+ * - Initial API and Implementation
+ *******************************************************************************/
+
+package org.eclipse.efm.ui.views.launchconfigurations.components;
+
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.efm.core.workflow.IWorkflowConfigurationConstants;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public abstract class AbstractCompositeMaker implements ILaunchConfigurationEditorComposite, IWorkflowConfigurationConstants {
+
+ private ILaunchConfigurationGUIelement masterGUIelement;
+
+ public abstract void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration);
+
+ public abstract void initializeFieldValuesFrom(ILaunchConfiguration configuration);
+
+ public abstract void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration);
+
+ public AbstractCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ this.masterGUIelement = masterGUIelement;
+ }
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
+
+ public final class FieldValidationReturn {
+ private final boolean fieldValidation;
+ private final String reasonString;
+
+ public FieldValidationReturn(boolean fieldValidation, String reasonString) {
+ this.fieldValidation = fieldValidation;
+ this.reasonString = reasonString;
+ }
+
+ public boolean areFieldsValid() {
+ return fieldValidation;
+ }
+
+ public String getReason() {
+ return reasonString;
+ }
+ }
+
+ public abstract FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig);
+
+ public abstract Composite createControlMain(Composite parent);
+
+ @Override
+ public void propagateMessage(String message) {
+ if (masterGUIelement != null) {
+ masterGUIelement.setMessage(message);
+ }
+ }
+
+ @Override
+ public void propagateWarningMessage(String warningmessage) {
+ if (masterGUIelement != null) {
+ masterGUIelement.setWarningMessage(warningmessage);
+ }
+ }
+
+ @Override
+ public void propagateErrorMessage(String errormessage) {
+ if (masterGUIelement != null) {
+ masterGUIelement.setErrorMessage(errormessage);
+ }
+
+ }
+
+ @Override
+ public void propagateGUIupdate() {
+ if (masterGUIelement != null) {
+ masterGUIelement.updateGUI();
+ }
+ }
+
+ @Override
+ public void propagateVisibility(Control aControl, boolean visible) {
+ aControl.setVisible(visible);
+
+ Object gd = aControl.getLayoutData();
+ if (gd instanceof GridData) {
+ ((GridData)gd).exclude = (! visible);
+ }
+ }
+
+ @Override
+ public void propagateUpdateJobScheduling() {
+ if (masterGUIelement != null) {
+ masterGUIelement.scheduleUpdateJob();
+ }
+ }
+
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/CommonCriteriaTab.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/CommonCriteriaCompositeMaker.java
similarity index 75%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/CommonCriteriaTab.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/CommonCriteriaCompositeMaker.java
index 1d90afe..bc97e83 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/CommonCriteriaTab.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/CommonCriteriaCompositeMaker.java
@@ -1,25 +1,26 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
+ *
* 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+
+package org.eclipse.efm.ui.views.launchconfigurations.components;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.core.workflow.Activator;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.core.workflow.common.GraphExplorationStrategyKind;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.IntegerFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
import org.eclipse.efm.ui.views.utils.SWTFactory;
-import org.eclipse.efm.core.workflow.common.GraphExplorationStrategyKind;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
@@ -28,67 +29,62 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.efm.ui.resources.HelpCoReferee;
+public class CommonCriteriaCompositeMaker extends AbstractCompositeMaker {
-public class CommonCriteriaTab extends AbstractSewLaunchConfigurationTab {
-
- public CommonCriteriaTab(LaunchConfigurationTabGroup groupTab) {
- super(groupTab);
- setHelpContextId(HelpCoReferee.efm_runconf_commoncriteria_tab);
- }
-
-// public static final String ATTR_BEHAVIOR_ANALYSIS_TRANSITION_NAME =
-// Activator.PLUGIN_ID + ".ATTR_BEHAVIOR_ANALYSIS_TRANSITION_NAME"; //$NON-NLS-1$
+ // public static final String ATTR_BEHAVIOR_ANALYSIS_TRANSITION_NAME =
+ // Activator.PLUGIN_ID + ".ATTR_BEHAVIOR_ANALYSIS_TRANSITION_NAME"; //$NON-NLS-1$
private IntegerFieldEditor fNodeIntegerField;
private IntegerFieldEditor fWidthIntegerField;
private IntegerFieldEditor fHeightIntegerField;
private IntegerFieldEditor fStepsIntegerField;
private IntegerFieldEditor fTimeoutIntegerField;
-// private StringFieldEditor fTransitionNameStringField;
+ //private StringFieldEditor fTransitionNameStringField;
private BooleanFieldEditor fInclusionCriterionBooleanField;
-
+
private Button fBFSButton = null;
private Button fDFSButton = null;
private Button fRFSButton = null;
-
+
private GraphExplorationStrategyKind fAnalyzeStrategy =
- GraphExplorationStrategyKind.BREADTH_FIRST_SEARCH;
-
+ GraphExplorationStrategyKind.BREADTH_FIRST_SEARCH;
+
private Group groupAnalyzeStrategy;
-// private Group groupBehaviorCharacterization;
+ //private Group groupBehaviorCharacterization;
private Group groupInclusionCriterion;
+ public CommonCriteriaCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ super(masterGUIelement);
+ }
+
- private class TabListener extends SelectionAdapter implements ModifyListener {
-
+ private final class TabListener extends SelectionAdapter implements ModifyListener {
+
/* (non-Javadoc)
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
@Override
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
Object source= e.getSource();
-// if (source == fViewer.getTable() || source == fViewer) {
-// setParametersButtonsEnableState();
-// } else if (source == fParametersAddButton) {
-// handleParametersAddButtonSelected();
-// } else if (source == fParametersEditButton) {
-// handleParametersEditButtonSelected();
-// } else if (source == fParametersRemoveButton) {
-// handleParametersRemoveButtonSelected();
-// }
-
+ // if (source == fViewer.getTable() || source == fViewer) {
+ // setParametersButtonsEnableState();
+ // } else if (source == fParametersAddButton) {
+ // handleParametersAddButtonSelected();
+ // } else if (source == fParametersEditButton) {
+ // handleParametersEditButtonSelected();
+ // } else if (source == fParametersRemoveButton) {
+ // handleParametersRemoveButtonSelected();
+ // }
+
// Use case Analysis
if (source == fBFSButton) {
handleBFSButtonSelected();
@@ -105,58 +101,49 @@
private TabListener fListener= new TabListener();
- /**
- * Returns the {@link IDialogSettings} for the given id
- *
- * @param id the id of the dialog settings to get
- * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
- * @since 3.6
- */
- IDialogSettings getDialogBoundsSettings(String id) {
- IDialogSettings settings = Activator.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(id);
- if (section == null) {
- section = settings.addNewSection(id);
- }
- return section;
- }
+ // ======================================================================================
+ // Buttons handling
+ // ======================================================================================
public void handleBFSButtonSelected() {
if( fBFSButton.getSelection() ) {
fAnalyzeStrategy = GraphExplorationStrategyKind.BREADTH_FIRST_SEARCH;
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
public void handleDFSButtonSelected() {
if( fDFSButton.getSelection() ) {
fAnalyzeStrategy = GraphExplorationStrategyKind.DEPTH_FIRST_SEARCH;
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
public void handleRFSButtonSelected() {
if( fRFSButton.getSelection() ) {
fAnalyzeStrategy = GraphExplorationStrategyKind.RANDOM_FIRST_SEARCH;
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
-
+
+ // ======================================================================================
+ // Graphical Components Creation Methods
+ // ======================================================================================
+
@Override
- public void createControl(Composite parent) {
+ public Composite createControlMain(Composite parent) {
Composite simpleComposite = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0);
- setControl(simpleComposite);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId());
createControlNodesHeightWidth(simpleComposite);
createControlEvaluationLimits(simpleComposite);
createAnalyzeStrategy(simpleComposite);
createControlInclusionCriterion(simpleComposite);
// createBehaviorCharacterization(simpleComposite);
+
+ return simpleComposite;
}
-
-
- public void createControlNodesHeightWidth(Composite parent) {
+
+ private void createControlNodesHeightWidth(Composite parent) {
Group group = SWTFactory.createGroup(parent, "Graph size limits", 5, 2, GridData.FILL_HORIZONTAL);
Composite comp = SWTFactory.createComposite(group, 1, 1, GridData.FILL_HORIZONTAL);
@@ -177,7 +164,7 @@
"Maximal height (-1 <=> no-limit) of the symbolic execution tree");
}
- public void createControlEvaluationLimits(Composite parent) {
+ private void createControlEvaluationLimits(Composite parent) {
Group group = SWTFactory.createGroup(parent,
"Evaluation limits", 5, 2, GridData.FILL_HORIZONTAL);
@@ -197,7 +184,7 @@
+ "(-1 <=> no-limit) of the symbolic execution");
}
- public void createControlInclusionCriterion(Composite parent) {
+ private void createControlInclusionCriterion(Composite parent) {
groupInclusionCriterion = SWTFactory.createGroup(parent,
"Inclusion Criterion", 5, 2, GridData.FILL_HORIZONTAL);
@@ -244,48 +231,14 @@
// "&Transition Name List:", comp,
// "Select a transition name list");
// }
-
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
+
+
+ // ======================================================================================
+ // Fields Values Management
+ // ======================================================================================
+
@Override
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
-
- if( ! fNodeIntegerField.isValid() ) {
- setErrorMessage("Node is not a valid integer");
- return false;
- }
- if( ! fWidthIntegerField.isValid() ) {
- setErrorMessage("Width is not a valid integer");
- return false;
- }
- if( ! fHeightIntegerField.isValid() ) {
- setErrorMessage("Height is not a valid integer");
- return false;
- }
- if( ! fStepsIntegerField.isValid() ) {
- setErrorMessage("Evaluation Steps is not a valid integer");
- return false;
- }
-
- if( ! fTimeoutIntegerField.isValid() ) {
- setErrorMessage("Timeout is not a valid integer");
- return false;
- }
-
-// if( ! fTransitionNameStringField.isValid() ) {
-// setErrorMessage("Transition Name is not a valid string");
-// return false;
-// }
-
- return true;
- }
-
-
- @Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ public void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration) {
// fNodeIntegerField.setDefaults(configuration);
configuration.setAttribute(
ATTR_SPECIFICATION_STOP_CRITERIA_NODE, -1);
@@ -302,7 +255,7 @@
String fModelAnalysis;
try {
fModelAnalysis = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
+ ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
if ( fModelAnalysis.equals(
ANALYSIS_PROFILE_MODEL_COVERAGE_TRANSITION) )
@@ -330,10 +283,9 @@
configuration.setAttribute(
ATTR_SPECIFICATION_ANALYZE_STRATEGY, "BFS");
}
-
-
+
@Override
- public void initializeFrom(ILaunchConfiguration configuration) {
+ public void initializeFieldValuesFrom(ILaunchConfiguration configuration) {
fNodeIntegerField.initializeFrom(configuration);
fWidthIntegerField.initializeFrom(configuration);
fHeightIntegerField.initializeFrom(configuration);
@@ -377,10 +329,10 @@
String fAnalysisProfile;
try {
fModelAnalysis = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
+ ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
fAnalysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
if ( fModelAnalysis.equals(ANALYSIS_PROFILE_MODEL_COVERAGE_TRANSITION)
|| fModelAnalysis.equals(ANALYSIS_PROFILE_MODEL_COVERAGE_BEHAVIOR)
@@ -390,8 +342,8 @@
// fRFSButton.setEnabled(false);
// groupAnalyzeStrategy.setVisible(false);
- visibleAndExclude(groupAnalyzeStrategy,false);
- visibleAndExclude(groupInclusionCriterion,false);
+ propagateVisibility(groupAnalyzeStrategy,false);
+ propagateVisibility(groupInclusionCriterion,false);
fBFSButton.setSelection(false);
fDFSButton.setSelection(false);
@@ -402,8 +354,8 @@
// fDFSButton.setEnabled(true);
// fRFSButton.setEnabled(true);
groupAnalyzeStrategy.setVisible(true);
- visibleAndExclude(groupAnalyzeStrategy,true);
- visibleAndExclude(groupInclusionCriterion,true);
+ propagateVisibility(groupAnalyzeStrategy,true);
+ propagateVisibility(groupInclusionCriterion,true);
switch( fAnalyzeStrategy ) {
case BREADTH_FIRST_SEARCH:
@@ -456,11 +408,10 @@
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
-// }
-
+// }
@Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ public void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration) {
fNodeIntegerField.performApply(configuration);
fWidthIntegerField.performApply(configuration);
fHeightIntegerField.performApply(configuration);
@@ -475,10 +426,31 @@
ATTR_SPECIFICATION_ANALYZE_STRATEGY,
fAnalyzeStrategy.getLiteral());
}
-
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
+
@Override
- public String getName() {
- return "Common Criteria";
+ public FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig) {
+ if( ! fNodeIntegerField.isValid() ) {
+ return new FieldValidationReturn(false, "Node is not a valid integer");
+ }
+ if( ! fWidthIntegerField.isValid() ) {
+ return new FieldValidationReturn(false, "Width is not a valid integer");
+ }
+ if( ! fHeightIntegerField.isValid() ) {
+ return new FieldValidationReturn(false, "Height is not a valid integer");
+ }
+ if( ! fStepsIntegerField.isValid() ) {
+ return new FieldValidationReturn(false, "Evaluation Steps is not a valid integer");
+ }
+ if( ! fTimeoutIntegerField.isValid() ) {
+ return new FieldValidationReturn(false, "Timeout is not a valid integer");
+ }
+// if( ! fTransitionNameStringField.isValid() ) {
+// return new FieldValidationReturn(false, "Transition Name is not a valid string");
+// }
+ return new FieldValidationReturn(true, null);
}
-
}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/DebugTab.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/DebugCompositeMaker.java
similarity index 68%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/DebugTab.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/DebugCompositeMaker.java
index 508a701..d131cdf 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/DebugTab.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/DebugCompositeMaker.java
@@ -1,27 +1,29 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
+ *
* 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+
+package org.eclipse.efm.ui.views.launchconfigurations.components;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.efm.core.workflow.AbstractLaunchDelegate;
import org.eclipse.efm.core.workflow.Activator;
import org.eclipse.efm.core.workflow.ToolConstants;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
-import org.eclipse.efm.runconfiguration.LaunchDelegate;
+import org.eclipse.efm.core.workflow.common.ConsoleVerbosityKind;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
import org.eclipse.efm.ui.views.utils.SWTFactory;
-import org.eclipse.efm.core.workflow.common.ConsoleVerbosityKind;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -32,12 +34,8 @@
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-import org.eclipse.efm.ui.resources.HelpCoReferee;
-
-public class DebugTab extends AbstractSewLaunchConfigurationTab {
+public class DebugCompositeMaker extends AbstractCompositeMaker {
// Console Log
private static final String[] CONSOLE_LEVEL_COMBO_ITEMS = new String[] {
@@ -47,61 +45,55 @@
ConsoleVerbosityKind.MAXIMUM.getLiteral()
};
-// Arrays.stream(ConsoleVerbosityKind.values()).map(
-// ConsoleVerbosityKind::getLiteral).toArray(String[]::new);
-
+// Arrays.stream(ConsoleVerbosityKind.values()).map(
+// ConsoleVerbosityKind::getLiteral).toArray(String[]::new);
private Combo fConsoleLevelCombo = null;
private ConsoleVerbosityKind fConsoleLevel = ConsoleVerbosityKind.MINIMUM;
// First Symbex Workflow Page
private BooleanFieldEditor fFirstParsedModelTextualEnabledBooleanField;
-// private StringFieldEditor fFirstparsedModelTextualFileNameStringField;
+// private StringFieldEditor fFirstparsedModelTextualFileNameStringField;
private BooleanFieldEditor fFirstParsedModelGraphizEnabledBooleanField;
-// private StringFieldEditor fFirstParsedModelGraphizFileNameStringField;
+// private StringFieldEditor fFirstParsedModelGraphizFileNameStringField;
private BooleanFieldEditor fFirstCompiledModelTextualEnabledBooleanField;
-// private StringFieldEditor fFirstCompiledModelTextualFileNameStringField;
+// private StringFieldEditor fFirstCompiledModelTextualFileNameStringField;
private boolean fEnabledSymbexDeveloperMode;
private BooleanFieldEditor fFirstSymbexOutputTextualEnabledBooleanField;
-// private StringFieldEditor fFirstSymbexOutputTextualFileNameStringField;
+// private StringFieldEditor fFirstSymbexOutputTextualFileNameStringField;
private BooleanFieldEditor fFirstSymbexOutputGraphizEnabledBooleanField;
-// private StringFieldEditor fFirstSymbexOutputGraphizFileNameStringField;
+// private StringFieldEditor fFirstSymbexOutputGraphizFileNameStringField;
private StringFieldEditor fFirstSymbexOutputGraphizTraceStringField;
private StringFieldEditor fFirstSymbexOutputGraphizFormatStringField;
private Composite fCompositeFirstSymbexOutputGraphiz;
// Second Symbex Workflow Page
-// private BooleanFieldEditor fSecondParsedModelGraphizEnabledBooleanField;
-//// private StringFieldEditor fSecondParsedModelGraphizFileNameStringField;
+// private BooleanFieldEditor fSecondParsedModelGraphizEnabledBooleanField;
+//// private StringFieldEditor fSecondParsedModelGraphizFileNameStringField;
//
-// private BooleanFieldEditor fSecondParsedModelTextualEnabledBooleanField;
-//// private StringFieldEditor fSecondparsedModelTextualFileNameStringField;
+// private BooleanFieldEditor fSecondParsedModelTextualEnabledBooleanField;
+//// private StringFieldEditor fSecondparsedModelTextualFileNameStringField;
//
-// private BooleanFieldEditor fSecondCompiledModelTextualEnabledBooleanField;
-//// private StringFieldEditor fSecondCompiledModelTextualFileNameStringField;
+// private BooleanFieldEditor fSecondCompiledModelTextualEnabledBooleanField;
+//// private StringFieldEditor fSecondCompiledModelTextualFileNameStringField;
private BooleanFieldEditor fSecondSymbexOutputTextualEnabledBooleanField;
-// private StringFieldEditor fSecondSymbexOutputTextualFileNameStringField;
+// private StringFieldEditor fSecondSymbexOutputTextualFileNameStringField;
private BooleanFieldEditor fSecondSymbexOutputGraphizEnabledBooleanField;
-// private StringFieldEditor fSecondSymbexOutputGraphizFileNameStringField;
+// private StringFieldEditor fSecondSymbexOutputGraphizFileNameStringField;
private StringFieldEditor fSecondSymbexOutputGraphizTraceStringField;
private StringFieldEditor fSecondSymbexOutputGraphizFormatStringField;
private Composite fCompositeSecondSymbexOutputGraphiz;
-
-
- public DebugTab(LaunchConfigurationTabGroup groupTab) {
- super(groupTab);
-
- setHelpContextId(HelpCoReferee.efm_runconf_debug_tab);
-
- if( LaunchDelegate.ENABLED_SYMBEX_DEVELOPER_MODE_OPTION ) {
+ public DebugCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ super(masterGUIelement);
+ if( AbstractLaunchDelegate.ENABLED_SYMBEX_DEVELOPER_MODE_OPTION ) {
IPreferenceStore prefs =
Activator.getDefault().getPreferenceStore();
@@ -112,21 +104,60 @@
fEnabledSymbexDeveloperMode = false;
}
}
+
+ // ======================================================================================
+ // Miscellaneous handling
+ // ======================================================================================
+
+ private class TabListener extends SelectionAdapter implements ModifyListener {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ propagateGUIupdate();
+ }
- @Override
- public void createControl(Composite parent) {
- Composite simpleComposite = SWTFactory.createComposite(parent,
- parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL, 0, 0);
- setControl(simpleComposite);
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ final Object source= e.getSource();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- getControl(), getHelpContextId());
-
- createDebugTracePage(simpleComposite);
+ if (source == fConsoleLevelCombo) {
+ handleConsoleLevelSelectionChange();
+ }
+ }
}
- public void createDebugTracePage(Composite parent) {
+ private TabListener fListener= new TabListener();
+
+ private void handleConsoleLevelSelectionChange() {
+ fConsoleLevel = ConsoleVerbosityKind.get( fConsoleLevelCombo.getText() );
+ if( fConsoleLevel == null ) {
+ fConsoleLevel = ConsoleVerbosityKind.MINIMUM;
+ }
+
+ propagateGUIupdate();
+ }
+
+ // ======================================================================================
+ // Graphical Components Creation Methods
+ // ======================================================================================
+
+ @Override
+ public Composite createControlMain(Composite parent) {
+ Composite simpleComposite = SWTFactory.createComposite(parent,
+ parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL, 0, 0);
+
+ createDebugTracePage(simpleComposite);
+
+ return simpleComposite;
+ }
+
+ private void createDebugTracePage(Composite parent) {
Group group = SWTFactory.createGroup(parent,
"Debug Trace", 1, 1, GridData.FILL_HORIZONTAL);
@@ -228,7 +259,7 @@
private void setEnableFirstExecutionPage(boolean checked) {
fCompositeFirstSymbexOutputGraphiz.setVisible(checked);
- visibleAndExclude(fCompositeFirstSymbexOutputGraphiz, checked);
+ propagateVisibility(fCompositeFirstSymbexOutputGraphiz, checked);
}
@@ -237,35 +268,35 @@
"Second Stage Symbex Workflow Page",
1, 1, GridData.FILL_HORIZONTAL);
-// createSecondInputModelGraphicComponent(group);
+// createSecondInputModelGraphicComponent(group);
createSecondSymbexOutputComponent(group);
}
-// private void createSecondInputModelGraphicComponent(Composite parent) {
-// Group group = SWTFactory.createGroup(parent,
-// "Input Model Generated Traces",
-// 1, 1, GridData.FILL_HORIZONTAL);
+// private void createSecondInputModelGraphicComponent(Composite parent) {
+// Group group = SWTFactory.createGroup(parent,
+// "Input Model Generated Traces",
+// 1, 1, GridData.FILL_HORIZONTAL);
//
-// Composite comp = SWTFactory.createComposite(
-// group, 1, 1, GridData.FILL_HORIZONTAL);
+// Composite comp = SWTFactory.createComposite(
+// group, 1, 1, GridData.FILL_HORIZONTAL);
//
-// fSecondParsedModelTextualEnabledBooleanField = new BooleanFieldEditor(
-// this, ATTR_ENABLED_SECOND_PARSED_MODEL_TEXTUAL_GENERATION,
-// "&Parsed Model as Textual Representation", comp, false);
+// fSecondParsedModelTextualEnabledBooleanField = new BooleanFieldEditor(
+// this, ATTR_ENABLED_SECOND_PARSED_MODEL_TEXTUAL_GENERATION,
+// "&Parsed Model as Textual Representation", comp, false);
//
-// fSecondParsedModelGraphizEnabledBooleanField = new BooleanFieldEditor(
-// this, ATTR_ENABLED_SECOND_PARSED_MODEL_GRAPHVIZ_GENERATION,
-// "&Parsed Model as <Graphiz> Representation", comp, false);
+// fSecondParsedModelGraphizEnabledBooleanField = new BooleanFieldEditor(
+// this, ATTR_ENABLED_SECOND_PARSED_MODEL_GRAPHVIZ_GENERATION,
+// "&Parsed Model as <Graphiz> Representation", comp, false);
//
-// if( fEnabledSymbexDeveloperMode ) {
-// fSecondCompiledModelTextualEnabledBooleanField =
-// new BooleanFieldEditor(this,
-// ATTR_ENABLED_SECOND_COMPILED_MODEL_TEXTUAL_GENERATION,
-// "&Compiled Model as Textual Representation", comp, false);
+// if( fEnabledSymbexDeveloperMode ) {
+// fSecondCompiledModelTextualEnabledBooleanField =
+// new BooleanFieldEditor(this,
+// ATTR_ENABLED_SECOND_COMPILED_MODEL_TEXTUAL_GENERATION,
+// "&Compiled Model as Textual Representation", comp, false);
+// }
// }
-// }
private void createSecondSymbexOutputComponent(Composite parent) {
Group group = SWTFactory.createGroup(parent,
@@ -309,81 +340,21 @@
private void setEnableSecondExecutionPage(boolean checked) {
fCompositeSecondSymbexOutputGraphiz.setVisible(checked);
- visibleAndExclude(fCompositeSecondSymbexOutputGraphiz, checked);
+ propagateVisibility(fCompositeSecondSymbexOutputGraphiz, checked);
}
-
- /**
- * Returns the {@link IDialogSettings} for the given id
- *
- * @param id the id of the dialog settings to get
- * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
- * @since 3.6
- */
- IDialogSettings getDialogBoundsSettings(String id) {
- IDialogSettings settings = Activator.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(id);
- if (section == null) {
- section = settings.addNewSection(id);
- }
- return section;
- }
-
- private class TabListener extends SelectionAdapter implements ModifyListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- final Object source= e.getSource();
-
- if (source == fConsoleLevelCombo) {
- handleConsoleLevelSelectionChange();
- }
- }
- }
-
- private void handleConsoleLevelSelectionChange() {
- fConsoleLevel = ConsoleVerbosityKind.get( fConsoleLevelCombo.getText() );
- if( fConsoleLevel == null ) {
- fConsoleLevel = ConsoleVerbosityKind.MINIMUM;
- }
-
- updateLaunchConfigurationDialog();
- }
-
-
- private TabListener fListener= new TabListener();
-
-
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- @Override
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
-
- return true;
- }
+ // ======================================================================================
+ // Fields Values Management
+ // ======================================================================================
@Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ public void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
ATTR_CONSOLE_LOG_VERBOSE_LEVEL, "MINIMUM");
// First Symbex Workflow Page
-// fFirstParsedModelTextualEnabledBooleanField.setDefaults(configuration);
+// fFirstParsedModelTextualEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_FIRST_PARSED_MODEL_TEXTUAL_GENERATION, false);
@@ -391,7 +362,7 @@
ATTR_FIRST_PARSED_MODEL_TEXTUAL_FILENAME,
"model_parsed.xlia");
-// fFirstParsedModelGraphizEnabledBooleanField.setDefaults(configuration);
+// fFirstParsedModelGraphizEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_FIRST_PARSED_MODEL_GRAPHVIZ_GENERATION, false);
@@ -400,7 +371,7 @@
"model_parsed_graph.gv");
if( fEnabledSymbexDeveloperMode ) {
-// fFirstCompiledModelTextualEnabledBooleanField.setDefaults(configuration);
+// fFirstCompiledModelTextualEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_FIRST_COMPILED_MODEL_TEXTUAL_GENERATION, false);
@@ -409,7 +380,7 @@
"phase1_compiled_model.fexe");
}
-// fFirstSymbexOutputTextualEnabledBooleanField.setDefaults(configuration);
+// fFirstSymbexOutputTextualEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_FIRST_SYMBEX_OUTPUT_TEXTUAL_GENERATION, false);
@@ -417,7 +388,7 @@
ATTR_FIRST_SYMBEX_OUTPUT_TEXTUAL_FILENAME,
DEFAULT_FIRST_SYMBEX_OUTPUT_TEXTUAL_FILENAME);
-// fFirstSymbexOutputGraphizEnabledBooleanField.setDefaults(configuration);
+// fFirstSymbexOutputGraphizEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_FIRST_SYMBEX_OUTPUT_GRAPHVIZ_GENERATION, false);
@@ -425,35 +396,35 @@
ATTR_FIRST_SYMBEX_OUTPUT_GRAPHVIZ_FILENAME,
DEFAULT_FIRST_SYMBEX_OUTPUT_GRAPHVIZ_FILENAME);
-// fFirstSymbexOutputGraphizTraceStringField.setDefaults(configuration);
+// fFirstSymbexOutputGraphizTraceStringField.setDefaults(configuration);
configuration.setAttribute(
ATTR_FIRST_SYMBEX_OUTPUT_GRAPHVIZ_TRACE_SPEC,
DEFAULT_FIRST_SYMBEX_OUTPUT_GRAPHVIZ_TRACE_SPEC);
-// fFirstSymbexOutputGraphizFormatStringField.setDefaults(configuration);
+// fFirstSymbexOutputGraphizFormatStringField.setDefaults(configuration);
configuration.setAttribute(
ATTR_FIRST_SYMBEX_OUTPUT_GRAPHVIZ_FORMAT_SPEC,
DEFAULT_SYMBEX_OUTPUT_GRAPHVIZ_FORMAT_SPEC);
// Second Symbex Workflow Page
-// fSecondParsedModelTextualEnabledBooleanField.setDefaults(configuration);
-// configuration.setAttribute(
-// ATTR_ENABLED_SECOND_PARSED_MODEL_TEXTUAL_GENERATION, false);
+// fSecondParsedModelTextualEnabledBooleanField.setDefaults(configuration);
+// configuration.setAttribute(
+// ATTR_ENABLED_SECOND_PARSED_MODEL_TEXTUAL_GENERATION, false);
configuration.setAttribute(
ATTR_SECOND_PARSED_MODEL_TEXTUAL_FILENAME,
"phase2_parsed_model.xlia");
-// fSecondParsedModelGraphizEnabledBooleanField.setDefaults(configuration);
-// configuration.setAttribute(
-// ATTR_ENABLED_SECOND_PARSED_MODEL_GRAPHVIZ_GENERATION, false);
+// fSecondParsedModelGraphizEnabledBooleanField.setDefaults(configuration);
+// configuration.setAttribute(
+// ATTR_ENABLED_SECOND_PARSED_MODEL_GRAPHVIZ_GENERATION, false);
configuration.setAttribute(
ATTR_SECOND_PARSED_MODEL_GRAPHVIZ_FILENAME,
"phase2_parsed_model.gv");
if( fEnabledSymbexDeveloperMode ) {
-// fSecondCompiledModelTextualEnabledBooleanField.setDefaults(configuration);
+// fSecondCompiledModelTextualEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_SECOND_COMPILED_MODEL_TEXTUAL_GENERATION, false);
@@ -462,7 +433,7 @@
"phase2_compiled_model.fexe");
}
-// fSecondSymbexOutputTextualEnabledBooleanField.setDefaults(configuration);
+// fSecondSymbexOutputTextualEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_SECOND_SYMBEX_OUTPUT_TEXTUAL_GENERATION, false);
@@ -470,7 +441,7 @@
ATTR_SECOND_SYMBEX_OUTPUT_TEXTUAL_FILENAME,
DEFAULT_SECOND_SYMBEX_OUTPUT_TEXTUAL_FILENAME);
-// fSecondSymbexOutputGraphizEnabledBooleanField.setDefaults(configuration);
+// fSecondSymbexOutputGraphizEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
ATTR_ENABLED_SECOND_SYMBEX_OUTPUT_GRAPHVIZ_GENERATION, false);
@@ -478,19 +449,19 @@
ATTR_SECOND_SYMBEX_OUTPUT_GRAPHVIZ_FILENAME,
DEFAULT_SECOND_SYMBEX_OUTPUT_GRAPHVIZ_FILENAME);
-// fSecondSymbexOutputGraphizTraceStringField.setDefaults(configuration);
+// fSecondSymbexOutputGraphizTraceStringField.setDefaults(configuration);
configuration.setAttribute(
ATTR_SECOND_SYMBEX_OUTPUT_GRAPHVIZ_TRACE_SPEC,
DEFAULT_SECOND_SYMBEX_OUTPUT_GRAPHVIZ_TRACE_SPEC);
-// fSecondSymbexOutputGraphizFormatStringField.setDefaults(configuration);
+// fSecondSymbexOutputGraphizFormatStringField.setDefaults(configuration);
configuration.setAttribute(
ATTR_SECOND_SYMBEX_OUTPUT_GRAPHVIZ_FORMAT_SPEC,
DEFAULT_SYMBEX_OUTPUT_GRAPHVIZ_FORMAT_SPEC);
}
@Override
- public void initializeFrom(ILaunchConfiguration configuration) {
+ public void initializeFieldValuesFrom(ILaunchConfiguration configuration) {
try {
fConsoleLevel = ConsoleVerbosityKind.get(
configuration.getAttribute(ATTR_CONSOLE_LOG_VERBOSE_LEVEL,
@@ -520,11 +491,11 @@
fFirstSymbexOutputGraphizFormatStringField.initializeFrom(configuration);
-// fSecondParsedModelTextualEnabledBooleanField.initializeFrom(configuration);
-// fSecondParsedModelGraphizEnabledBooleanField.initializeFrom(configuration);
-// if( fEnabledSymbexDeveloperMode ) {
-// fSecondCompiledModelTextualEnabledBooleanField.initializeFrom(configuration);
-// }
+// fSecondParsedModelTextualEnabledBooleanField.initializeFrom(configuration);
+// fSecondParsedModelGraphizEnabledBooleanField.initializeFrom(configuration);
+// if( fEnabledSymbexDeveloperMode ) {
+// fSecondCompiledModelTextualEnabledBooleanField.initializeFrom(configuration);
+// }
fSecondSymbexOutputTextualEnabledBooleanField.initializeFrom(configuration);
fSecondSymbexOutputGraphizEnabledBooleanField.initializeFrom(configuration);
@@ -562,7 +533,7 @@
@Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ public void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
ATTR_CONSOLE_LOG_VERBOSE_LEVEL, fConsoleLevel.getLiteral());
@@ -579,28 +550,35 @@
fFirstSymbexOutputGraphizFormatStringField.performApply(configuration);
-// fSecondParsedModelTextualEnabledBooleanField.performApply(configuration);
-// fSecondParsedModelGraphizEnabledBooleanField.performApply(configuration);
-// if( fEnabledSymbexDeveloperMode ) {
-// fSecondCompiledModelTextualEnabledBooleanField.performApply(configuration);
-// }
+// fSecondParsedModelTextualEnabledBooleanField.performApply(configuration);
+// fSecondParsedModelGraphizEnabledBooleanField.performApply(configuration);
+// if( fEnabledSymbexDeveloperMode ) {
+// fSecondCompiledModelTextualEnabledBooleanField.performApply(configuration);
+// }
- fSecondSymbexOutputTextualEnabledBooleanField.performApply(configuration);
- fSecondSymbexOutputGraphizEnabledBooleanField.performApply(configuration);
- fSecondSymbexOutputGraphizTraceStringField.performApply(configuration);
+ fSecondSymbexOutputTextualEnabledBooleanField.performApply(configuration);
+ fSecondSymbexOutputGraphizEnabledBooleanField.performApply(configuration);
+ fSecondSymbexOutputGraphizTraceStringField.performApply(configuration);
- fSecondSymbexOutputGraphizFormatStringField.performApply(configuration);
+ fSecondSymbexOutputGraphizFormatStringField.performApply(configuration);
- setEnableFirstExecutionPage(
- fFirstSymbexOutputGraphizEnabledBooleanField.getBooleanValue() );
+ setEnableFirstExecutionPage(
+ fFirstSymbexOutputGraphizEnabledBooleanField.getBooleanValue() );
- setEnableSecondExecutionPage(
- fSecondSymbexOutputGraphizEnabledBooleanField.getBooleanValue() );
- }
+ setEnableSecondExecutionPage(
+ fSecondSymbexOutputGraphizEnabledBooleanField.getBooleanValue() );
+ }
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
+
@Override
- public String getName() {
- return "Debug";
- }
+ public FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig) {
+ return new FieldValidationReturn(true, null);
+ }
+
}
+
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/DeveloperTuningTab.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/DeveloperTuningCompositeMaker.java
similarity index 91%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/DeveloperTuningTab.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/DeveloperTuningCompositeMaker.java
index 3a86a38..427bc8c 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/DeveloperTuningTab.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/DeveloperTuningCompositeMaker.java
@@ -1,26 +1,26 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
+ *
* 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+
+package org.eclipse.efm.ui.views.launchconfigurations.components;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.core.workflow.Activator;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.core.workflow.common.DebuglevelKind;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
import org.eclipse.efm.ui.views.utils.SWTFactory;
-import org.eclipse.efm.core.workflow.common.DebuglevelKind;
-import org.eclipse.efm.ui.resources.HelpCoReferee;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -31,11 +31,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
-public class DeveloperTuningTab extends AbstractSewLaunchConfigurationTab {
-
+public class DeveloperTuningCompositeMaker extends AbstractCompositeMaker {
private static final String[] TRACE_LEVEL_COMBO_ITEMS = new String[] {
DebuglevelKind.ZERO.getLiteral(),
@@ -129,25 +126,64 @@
private BooleanFieldEditor fNothingEnabledBooleanField;
private BooleanFieldEditor fGodModeEnabledBooleanField;
+ public DeveloperTuningCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ super(masterGUIelement);
+ }
+
+
+ // ======================================================================================
+ // Miscellaneous Handling
+ // ======================================================================================
+
+ private class TabListener extends SelectionAdapter implements ModifyListener {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
+ public void modifyText(ModifyEvent e) {
+ propagateGUIupdate();
+ }
- public DeveloperTuningTab(LaunchConfigurationTabGroup groupTab) {
- super(groupTab);
- setHelpContextId(HelpCoReferee.efm_runconf_debug_tab);
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ final Object source= e.getSource();
+
+ if (source == fDebugTraceLevelCombo) {
+ handleDebugTraceLevelSelectionChange();
+ }
+ }
+ }
+
+ private TabListener fListener= new TabListener();
+
+ private void handleDebugTraceLevelSelectionChange() {
+ fDebugTraceLevel = DebuglevelKind.get( fDebugTraceLevelCombo.getText() );
+ if( fDebugTraceLevel == null ) {
+ fDebugTraceLevel = DebuglevelKind.ZERO;
+ }
+
+ propagateVisibility(fGroupDebugTraceOptions,
+ (fDebugTraceLevel != DebuglevelKind.ZERO));
+
+ propagateGUIupdate();
}
- Composite simpleComposite;
-
+ // ======================================================================================
+ // Graphical Components Creation Methods
+ // ======================================================================================
+
@Override
- public void createControl(Composite parent) {
- simpleComposite = SWTFactory.createComposite(parent,
+ public Composite createControlMain(Composite parent) {
+ Composite simpleComposite = SWTFactory.createComposite(parent,
parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL, 0, 0);
- setControl(simpleComposite);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- getControl(), getHelpContextId());
createDeveloperTuningOptionsComponent(simpleComposite);
+
+ return simpleComposite;
}
private void createDeveloperTuningOptionsComponent(Composite parent) {
@@ -173,64 +209,10 @@
&& (fDebugTraceLevel != DebuglevelKind.ZERO)
&& (! fGodModeEnabledBooleanField.getBooleanValue());
- visibleAndExclude(fGroupDebugTraceOptions, enabled);
+ propagateVisibility(fGroupDebugTraceOptions, enabled);
}
- /**
- * Returns the {@link IDialogSettings} for the given id
- *
- * @param id the id of the dialog settings to get
- * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
- * @since 3.6
- */
- IDialogSettings getDialogBoundsSettings(String id) {
- IDialogSettings settings = Activator.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(id);
- if (section == null) {
- section = settings.addNewSection(id);
- }
- return section;
- }
-
- private class TabListener extends SelectionAdapter implements ModifyListener {
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- @Override
- public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- @Override
- public void widgetSelected(SelectionEvent e) {
- final Object source= e.getSource();
-
- if (source == fDebugTraceLevelCombo) {
- handleDebugTraceLevelSelectionChange();
- }
- }
- }
-
-
- private void handleDebugTraceLevelSelectionChange() {
- fDebugTraceLevel = DebuglevelKind.get( fDebugTraceLevelCombo.getText() );
- if( fDebugTraceLevel == null ) {
- fDebugTraceLevel = DebuglevelKind.ZERO;
- }
-
- visibleAndExclude(fGroupDebugTraceOptions,
- (fDebugTraceLevel != DebuglevelKind.ZERO));
-
- updateLaunchConfigurationDialog();
- }
-
- private TabListener fListener= new TabListener();
-
private void createDeveloperModeComponent(Composite parent) {
Composite comp = SWTFactory.createComposite(
@@ -457,20 +439,14 @@
fGodModeEnabledBooleanField = new BooleanFieldEditor(this,
ATTR_ENABLED_TRACE_GOD_MODE, "GOD_MODE", comp, false);
}
-
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- @Override
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
-
- return true;
- }
+
+ // ======================================================================================
+ // Fields Values Management
+ // ======================================================================================
+
@Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ public void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration) {
// fDeveloperModeEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(ATTR_ENABLED_DEVELOPER_TUNING, false);
@@ -630,7 +606,7 @@
}
@Override
- public void initializeFrom(ILaunchConfiguration configuration) {
+ public void initializeFieldValuesFrom(ILaunchConfiguration configuration) {
fDeveloperModeEnabledBooleanField.initializeFrom(configuration);
fLogFileNameStringField.initializeFrom(configuration);
fDebugTraceFileNameStringField.initializeFrom(configuration);
@@ -749,9 +725,8 @@
}
}
-
@Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ public void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration) {
fDeveloperModeEnabledBooleanField.performApply(configuration);
setEnableDeveloperTuningOptionsPage(configuration,
@@ -828,10 +803,14 @@
fNothingEnabledBooleanField.performApply(configuration);
fGodModeEnabledBooleanField.performApply(configuration);
}
-
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
@Override
- public String getName() {
- return "Developer";
+ public FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig) {
+ return new FieldValidationReturn(true, null);
}
+
}
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/ExpertCompositeMaker.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/ExpertCompositeMaker.java
new file mode 100644
index 0000000..cf7e264
--- /dev/null
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/ExpertCompositeMaker.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ *
+ * 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:
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
+ *******************************************************************************/
+
+package org.eclipse.efm.ui.views.launchconfigurations.components;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
+import org.eclipse.efm.ui.views.launchconfigurations.components.AbstractCompositeMaker.FieldValidationReturn;
+import org.eclipse.efm.ui.views.launchconfigurations.components.pages.ExpertBehaviorSelectionPage;
+import org.eclipse.efm.ui.views.launchconfigurations.components.pages.ExpertTransitionCoveragePage;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
+import org.eclipse.efm.ui.views.utils.SWTFactory;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.PlatformUI;
+
+public class ExpertCompositeMaker extends AbstractCompositeMaker {
+
+ private Group groupExplorationPage;
+
+ // BEHAVIOR SELECTION : HIT OR JUMP
+ ExpertBehaviorSelectionPage fBehaviorSelectionPage;
+
+ // TRANSITION COVERAGE
+ ExpertTransitionCoveragePage fTransitionCoveragePage;
+
+ public ExpertCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ super(masterGUIelement);
+ // BEHAVIOR SELECTION : HIT OR JUMP
+ fBehaviorSelectionPage = new ExpertBehaviorSelectionPage(this);
+
+ // TRANSITION COVERAGE
+ fTransitionCoveragePage = new ExpertTransitionCoveragePage(this);
+ }
+
+
+
+ // ======================================================================================
+ // Graphical Components Creation Methods
+ // ======================================================================================
+
+ @Override
+ public Composite createControlMain(Composite parent) {
+ Composite simpleComposite = SWTFactory.createComposite(parent,
+ parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0);
+
+ // EXPLORATION PAGE
+ createExplorationPage(simpleComposite);
+
+ // BEHAVIOR SELECTION : HIT OR JUMP
+ fBehaviorSelectionPage.createControl(simpleComposite);
+
+ // TRANSITION COVERAGE
+ fTransitionCoveragePage.createControl(simpleComposite);
+
+ return simpleComposite;
+ }
+
+ private void setEnableGroupExplorationPage(ILaunchConfiguration configuration) {
+ try {
+ String fAnalysisProfile = configuration.getAttribute(
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+
+ String fModelAnalysis = configuration.getAttribute(
+ ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
+
+ propagateVisibility(groupExplorationPage,
+ (fAnalysisProfile.equals(ANALYSIS_PROFILE_MODEL)
+ && fModelAnalysis.equals(ANALYSIS_PROFILE_MODEL_EXPLORATION)
+ ) || fAnalysisProfile.equals(ANALYSIS_PROFILE_TEST_OFFLINE) );
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void createExplorationPage(Composite parent) {
+ groupExplorationPage = SWTFactory.createGroup(parent,
+ "Exploration Page", 1, 2, GridData.FILL_HORIZONTAL);
+
+ Composite comp = SWTFactory.createComposite(groupExplorationPage, 1, 1,
+ GridData.FILL_HORIZONTAL);
+
+ SWTFactory.createLabel(comp, "&No expert mode for Exploration "
+ + "of Model Analysis and Test Verdict Computation !", 1);
+ }
+
+ // ======================================================================================
+ // Fields Values Management
+ // ======================================================================================
+
+ @Override
+ public void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration) {
+ // BEHAVIOR SELECTION : HIT OR JUMP
+ fBehaviorSelectionPage.setDefaults(configuration);
+
+ // TRANSITION COVERAGE
+ fTransitionCoveragePage.setDefaults(configuration);
+ }
+
+
+ @Override
+ public void initializeFieldValuesFrom(ILaunchConfiguration configuration) {
+ setEnableGroupExplorationPage(configuration);
+
+ // BEHAVIOR SELECTION : HIT OR JUMP
+ fBehaviorSelectionPage.initializeFrom(configuration);
+
+ // TRANSITION COVERAGE
+ fTransitionCoveragePage.initializeFrom(configuration);
+ }
+
+ public void performApplyExploration(
+ ILaunchConfigurationWorkingCopy configuration) {
+ setEnableGroupExplorationPage(configuration);
+ }
+
+
+ @Override
+ public void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration) {
+ performApplyExploration(configuration);
+
+ // BEHAVIOR SELECTION : HIT OR JUMP
+ fBehaviorSelectionPage.performApply(configuration);
+
+ // TRANSITION COVERAGE
+ fTransitionCoveragePage.performApply(configuration);
+ }
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
+
+ @Override
+ public FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig) {
+ // BEHAVIOR SELECTION : HIT OR JUMP
+ if( ! fBehaviorSelectionPage.isValid(launchConfig) ) {
+ return new FieldValidationReturn(false, null);
+ }
+ // TRANSITION COVERAGE
+ if( ! fTransitionCoveragePage.isValid(launchConfig) ) {
+ return new FieldValidationReturn(false, null);
+ }
+ return new FieldValidationReturn(true, null);
+ }
+
+}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTab.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/FirstCompositeMaker.java
similarity index 86%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTab.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/FirstCompositeMaker.java
index 8f15f00..4af2900 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTab.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/FirstCompositeMaker.java
@@ -1,14 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
+ *
* 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components;
import java.io.File;
@@ -20,15 +22,18 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.efm.core.workflow.AbstractLaunchDelegate;
import org.eclipse.efm.core.workflow.Activator;
import org.eclipse.efm.core.workflow.ToolConstants;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
-import org.eclipse.efm.runconfiguration.LaunchDelegate;
-import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
-import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.efm.ui.resources.HelpCoReferee;
+import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.launchconfigurations.components.AbstractCompositeMaker.FieldValidationReturn;
+import org.eclipse.efm.ui.views.launchconfigurations.components.pages.MainTabBehaviorSelectionPage;
+import org.eclipse.efm.ui.views.launchconfigurations.components.pages.MainTabTestOfflinePage;
+import org.eclipse.efm.ui.views.launchconfigurations.components.pages.MainTabTransitionCoveragePage;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
+import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
@@ -45,13 +50,12 @@
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceComparator;
-public class MainTab extends AbstractSewLaunchConfigurationTab {
+public class FirstCompositeMaker extends AbstractCompositeMaker {
private static final String[] MODEL_COMBO_ITEMS = new String[] {
ANALYSIS_PROFILE_MODEL_EXPLORATION ,
@@ -116,17 +120,11 @@
private Button fTestOfflineButton = null;
MainTabTestOfflinePage fTestOfflinePage;
+
-
- /**
- * Constructor
- * @param groupTab
- */
- public MainTab(LaunchConfigurationTabGroup groupTab) {
- super(groupTab);
- setHelpContextId(HelpCoReferee.efm_runconf_main_tab);
-
- if( LaunchDelegate.ENABLED_SYMBEX_DEVELOPER_MODE_OPTION ) {
+ public FirstCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ super(masterGUIelement);
+ if( AbstractLaunchDelegate.ENABLED_SYMBEX_DEVELOPER_MODE_OPTION ) {
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
@@ -137,7 +135,7 @@
fEnabledSymbexDeveloperMode = false;
}
- if( LaunchDelegate.ENABLED_SYMBEX_INCUBATION_MODE_OPTION ) {
+ if( AbstractLaunchDelegate.ENABLED_SYMBEX_INCUBATION_MODE_OPTION ) {
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
@@ -159,8 +157,7 @@
fTestOfflinePage = new MainTabTestOfflinePage(this);
}
}
-
-
+
private class TabListener extends SelectionAdapter implements ModifyListener {
/* (non-Javadoc)
@@ -168,7 +165,7 @@
*/
@Override
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
/* (non-Javadoc)
@@ -191,8 +188,11 @@
}
private TabListener fListener = new TabListener();
-
-
+
+ // ======================================================================================
+ // Miscellaneous handling
+ // ======================================================================================
+
public void handleModelButtonSelected() {
if( fModelButton.getSelection() ) {
fAnalysisProfile = ANALYSIS_PROFILE_MODEL;
@@ -225,7 +225,7 @@
fBehaviorSelectionPage.setVisible(false);
}
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
public void handleTestOfflineButtonSelected() {
@@ -240,16 +240,16 @@
enableAnalysisTestOfflineTrace(true);
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
private void handleModelSelectionChange() {
fModelAnalysis = fModelCombo.getText();
- ExpertTab expertTab = getGroupTab().getExpertTab();
- if( expertTab != null ) {
- expertTab.setTabName("Expert <" + fModelAnalysis + ">");
- }
+// ExpertTab expertTab = getGroupTab().getExpertTab();
+// if( expertTab != null ) {
+// expertTab.setTabName("Expert <" + fModelAnalysis + ">");
+// }
if( fModelAnalysis.equals(
ANALYSIS_PROFILE_MODEL_COVERAGE_BEHAVIOR) )
@@ -270,54 +270,61 @@
fBehaviorSelectionPage.setVisible(false);
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
-
-
+
+ private void handleModelFileChange() {
+ if( (fAnalysisProfile == ANALYSIS_PROFILE_MODEL)
+ && fModelAnalysis.equals(ANALYSIS_PROFILE_MODEL_COVERAGE_TRANSITION) )
+ {
+ fTransitionCoveragePage.handleModelFilePathChanged(
+ fModelPathText.getText());
+ }
+ }
+
/**
* Modify listener that simply updates the owning launch configuration dialog.
*/
private ModifyListener fBasicModifyListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent evt) {
- scheduleUpdateJob();
+ propagateUpdateJobScheduling();
handleModelFileChange();
}
};
-
+
/**
- * Returns the {@link IDialogSettings} for the given id
- *
- * @param id the id of the dialog settings to get
- * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
- * @since 3.6
+ * Enable Model / Trace Use Case Analysis radio button has been selected
*/
- IDialogSettings getDialogBoundsSettings(String id) {
- IDialogSettings settings = Activator.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(id);
- if(section == null) {
- section = settings.addNewSection(id);
- }
- return section;
+ private void enableAnalysisModel(boolean bEnabled) {
+ fModelButton.setSelection(bEnabled);
+
+ fModelCombo.setEnabled(bEnabled);
}
+ // TEST OFFLINE // INCUBATION MODE
+ private void enableAnalysisTestOfflineTrace(boolean bEnabled) {
+ fTestOfflineButton.setSelection(bEnabled);
+
+ fTestOfflinePage.setVisible(bEnabled);
+ }
+
+ // ======================================================================================
+ // Graphical Components Creation Methods
+ // ======================================================================================
+
+
@Override
- public void createControl(Composite parent) {
-
+ public Composite createControlMain(Composite parent) {
Composite simpleComposite = SWTFactory.createComposite(parent,
parent.getFont(), 1, 1, GridData.FILL_BOTH, 0, 0);
- setControl(simpleComposite);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- getControl(), getHelpContextId());
-
createModelFileSelectionComponent(simpleComposite);
-
createWorkspaceComponent(simpleComposite);
-
createAnalyseProfileComponent(simpleComposite);
+
+ return simpleComposite;
}
@@ -341,13 +348,13 @@
});
fModelPathText.addModifyListener(fBasicModifyListener);
- fModelWorkspaceBrowse = createPushButton(comp, "&Workspace...", null);
+ fModelWorkspaceBrowse = SWTFactory.createPushButton(comp, "&Workspace...", null);
fModelWorkspaceBrowse.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog =
new ElementTreeSelectionDialog(
- getShell(),
+ parent.getShell(),
new WorkbenchLabelProvider(),
new WorkbenchContentProvider() );
dialog.setTitle("Select a Diversity Specification:");
@@ -355,9 +362,9 @@
dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
dialog.setComparator(
new ResourceComparator(ResourceComparator.NAME));
- dialog.setDialogBoundsSettings(
- getDialogBoundsSettings(WORKSPACE_SELECTION_DIALOG),
- Dialog.DIALOG_PERSISTSIZE);
+// dialog.setDialogBoundsSettings(
+// getDialogBoundsSettings(WORKSPACE_SELECTION_DIALOG),
+// Dialog.DIALOG_PERSISTSIZE);
if(dialog.open() == Window.OK) {
IResource resource = (IResource) dialog.getFirstResult();
if(resource != null) {
@@ -554,107 +561,16 @@
}
- private void handleModelFileChange() {
- if( (fAnalysisProfile == ANALYSIS_PROFILE_MODEL)
- && fModelAnalysis.equals(ANALYSIS_PROFILE_MODEL_COVERAGE_TRANSITION) )
- {
- fTransitionCoveragePage.handleModelFilePathChanged(
- fModelPathText.getText());
- }
- }
- /**
- * Enable Model / Trace Use Case Analysis radio button has been selected
- */
- private void enableAnalysisModel(boolean bEnabled) {
- fModelButton.setSelection(bEnabled);
-
- fModelCombo.setEnabled(bEnabled);
- }
-
- // TEST OFFLINE // INCUBATION MODE
- private void enableAnalysisTestOfflineTrace(boolean bEnabled) {
- fTestOfflineButton.setSelection(bEnabled);
-
- fTestOfflinePage.setVisible(bEnabled);
- }
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- @Override
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
- setWarningMessage(null);
-
- String filePath = fModelPathText.getText();
- if( (filePath == null) || filePath.isEmpty() ) {
- setErrorMessage("The resource model file path is empty (or null)");
- }
- else {
- File aFile = new File(filePath);
- if( ! aFile.exists() ) {
- setErrorMessage("The resource model file \"" +
- filePath + "\" does not exist.");
- }
- else if( ! aFile.isFile() ) {
- setErrorMessage("The resource model \"" +
- filePath + "\" is not a file.");
- }
- }
-
- switch( fAnalysisProfile ) {
- case ANALYSIS_PROFILE_MODEL: {
- switch( fModelAnalysis )
- {
- case ANALYSIS_PROFILE_MODEL_COVERAGE_BEHAVIOR:
- {
- // BEHAVIOR SELECTION ANALYSIS
- if( ! fBehaviorSelectionPage.isValid(launchConfig) )
- {
- return false;
- }
-
- break;
- }
- case ANALYSIS_PROFILE_MODEL_COVERAGE_TRANSITION:
- {
- // TRANSITION COVERAGE ANALYSIS
- if( ! fTransitionCoveragePage.isValid(launchConfig) )
- {
- return false;
- }
-
- break;
- }
-
- default:
- break;
- }
- break;
- }
- case ANALYSIS_PROFILE_TEST_OFFLINE:
- {
- // TEST OFFLINE // INCUBATION MODE
- if( fEnabledSymbexIncubationMode ) {
- if( ! fTestOfflinePage.isValid(launchConfig) )
- {
- return false;
- }
- }
-
- break;
- }
- default:
- break;
- }
-
- return true;
- }
+
+
+ // ======================================================================================
+ // Fields Values Management
+ // ======================================================================================
@Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ public void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
ATTR_SPECIFICATION_PROJECT_NAME, "<project-name>");
@@ -709,7 +625,7 @@
@Override
- public void initializeFrom(ILaunchConfiguration configuration) {
+ public void initializeFieldValuesFrom(ILaunchConfiguration configuration) {
try {
fProjectName = configuration.getAttribute(
ATTR_SPECIFICATION_PROJECT_NAME, "");
@@ -882,12 +798,12 @@
}
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
@Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ public void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
ATTR_SPECIFICATION_PROJECT_NAME, fProjectName);
@@ -920,9 +836,79 @@
fTestOfflinePage.performApply(configuration);
}
}
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
+
@Override
- public String getName() {
- return "Main";
- }
+ public FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig) {
+ String messageToSend = null;
+
+ String filePath = fModelPathText.getText();
+ if( (filePath == null) || filePath.isEmpty() ) {
+ messageToSend = "The resource model file path is empty (or null)";
+ }
+ else {
+ File aFile = new File(filePath);
+ if( ! aFile.exists() ) {
+ messageToSend="The resource model file \"" +
+ filePath + "\" does not exist.";
+ }
+ else if( ! aFile.isFile() ) {
+ messageToSend = "The resource model \"" +
+ filePath + "\" is not a file.";
+ }
+ }
+
+ switch( fAnalysisProfile ) {
+ case ANALYSIS_PROFILE_MODEL: {
+ switch( fModelAnalysis )
+ {
+ case ANALYSIS_PROFILE_MODEL_COVERAGE_BEHAVIOR:
+ {
+ // BEHAVIOR SELECTION ANALYSIS
+ if( ! fBehaviorSelectionPage.isValid(launchConfig) )
+ {
+ return new FieldValidationReturn(false, messageToSend);
+ }
+
+ break;
+ }
+ case ANALYSIS_PROFILE_MODEL_COVERAGE_TRANSITION:
+ {
+ // TRANSITION COVERAGE ANALYSIS
+ if( ! fTransitionCoveragePage.isValid(launchConfig) )
+ {
+ return new FieldValidationReturn(false, messageToSend);
+ }
+
+ break;
+ }
+
+ default:
+ break;
+ }
+ break;
+ }
+ case ANALYSIS_PROFILE_TEST_OFFLINE:
+ {
+ // TEST OFFLINE // INCUBATION MODE
+ if( fEnabledSymbexIncubationMode ) {
+ if( ! fTestOfflinePage.isValid(launchConfig) )
+ {
+ return new FieldValidationReturn(false, messageToSend);
+ }
+ }
+
+ break;
+ }
+ default:
+ break;
+ }
+
+ return new FieldValidationReturn(true, messageToSend);
+ }
+
}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/NonRegressionTab.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/NonRegressionCompositeMaker.java
similarity index 87%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/NonRegressionTab.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/NonRegressionCompositeMaker.java
index be05d71..d0ca6ff 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/NonRegressionTab.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/NonRegressionCompositeMaker.java
@@ -1,14 +1,17 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
+ *
* 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+
+package org.eclipse.efm.ui.views.launchconfigurations.components;
import java.io.BufferedReader;
import java.io.FileInputStream;
@@ -25,11 +28,11 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.core.workflow.Activator;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
+import org.eclipse.efm.ui.views.launchconfigurations.components.AbstractCompositeMaker.FieldValidationReturn;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleAdapter;
@@ -50,17 +53,12 @@
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
import org.eclipse.ui.views.navigator.ResourceComparator;
-public class NonRegressionTab extends AbstractSewLaunchConfigurationTab {
-
- public NonRegressionTab(LaunchConfigurationTabGroup groupTab) {
- super(groupTab);
- }
+public class NonRegressionCompositeMaker extends AbstractCompositeMaker {
public static final String ATTR_ENABLED_NON_REGRESSION =
Activator.PLUGIN_ID + ".ATTR_ENABLED_NON_REGRESSION"; //$NON-NLS-1$
@@ -107,7 +105,10 @@
private List< String > transitionsToBeSelected;
private List< String > selectedTransitions;
-
+ public NonRegressionCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ super(masterGUIelement);
+ }
+
private class TabListener extends SelectionAdapter implements ModifyListener {
/* (non-Javadoc)
@@ -115,7 +116,7 @@
*/
@Override
public void modifyText(ModifyEvent e) {
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
/* (non-Javadoc)
@@ -136,6 +137,10 @@
private TabListener fListener = new TabListener();
+ // ======================================================================================
+ // Miscellaneous handling
+ // ======================================================================================
+
public void handleSelectedTransition() {
boolean refresh = false;
@@ -156,23 +161,23 @@
updateTransitionTable2();
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
public void handleAllTransitionButtonSelected() {
if( fAllNonRegressionCaseButton.getSelection() ) {
fNonRegressionCaseButton = "All";
- visibleAndExclude(compNonRegressionCaseCoverage,false);
+ propagateVisibility(compNonRegressionCaseCoverage,false);
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
public void handleDetailedTransitionSelected() {
if( fDetailsNonRegressionCaseButton.getSelection() ) {
fNonRegressionCaseButton = "Details";
- visibleAndExclude(compNonRegressionCaseCoverage,true);
+ propagateVisibility(compNonRegressionCaseCoverage,true);
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
/**
@@ -181,43 +186,24 @@
private ModifyListener fBasicModifyListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent evt) {
- scheduleUpdateJob();
+ propagateUpdateJobScheduling();
}
- };
-
- /**
- * Returns the {@link IDialogSettings} for the given id
- *
- * @param id the id of the dialog settings to get
- * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
- * @since 3.6
- */
- IDialogSettings getDialogBoundsSettings(String id) {
- IDialogSettings settings = Activator.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(id);
- if(section == null) {
- section = settings.addNewSection(id);
- }
- return section;
- }
-
-
+ };
+
+
+ // ======================================================================================
+ // Graphical Components Creation Methods
+ // ======================================================================================
+
@Override
- public void createControl(Composite parent) {
-
+ public Composite createControlMain(Composite parent) {
Composite simpleComposite = SWTFactory.createComposite(parent,
parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL, 0, 0);
-
- setControl(simpleComposite);
-
- PlatformUI.getWorkbench().getHelpSystem()
- .setHelp(getControl(), getHelpContextId());
-
createNonRegressionSelectionComponent(simpleComposite);
-
createModelFileSelectionComponent(simpleComposite);
-
createAnalyseProfileComponent(simpleComposite);
+
+ return simpleComposite;
}
@@ -256,12 +242,12 @@
ld.marginHeight = 1;
ld.marginWidth = 0;
- fModelWorkspaceBrowse = createPushButton(bcomp, "&Workspace...", null);
+ fModelWorkspaceBrowse = SWTFactory.createPushButton(bcomp, "&Workspace...", null);
fModelWorkspaceBrowse.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog =
- new ElementTreeSelectionDialog(getShell(),
+ new ElementTreeSelectionDialog(parent.getShell(),
new WorkbenchLabelProvider(),
new WorkbenchContentProvider());
dialog.setTitle("Select a &Diversity Specification:");
@@ -269,9 +255,9 @@
dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
dialog.setComparator(
new ResourceComparator(ResourceComparator.NAME));
- dialog.setDialogBoundsSettings(
- getDialogBoundsSettings(WORKSPACE_SELECTION_DIALOG),
- Dialog.DIALOG_PERSISTSIZE);
+// dialog.setDialogBoundsSettings(
+// getDialogBoundsSettings(WORKSPACE_SELECTION_DIALOG),
+// Dialog.DIALOG_PERSISTSIZE);
if(dialog.open() == Window.OK) {
IResource resource = (IResource) dialog.getFirstResult();
@@ -480,13 +466,13 @@
selectedTransitions.sort(null);
updateTransitionTable2();
}
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
// TODO Auto-generated method stub
- updateLaunchConfigurationDialog();
+ propagateGUIupdate();
}
});
}
@@ -620,23 +606,14 @@
}
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
- @Override
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
- if( fNonRegressionCaseButton.equals("Details") &&
- ( selectedTransitions.size() == 0 ) ) {
- setErrorMessage("You must select at least one transition");
- return false;
- }
- return true;
- }
+ // ======================================================================================
+ // Fields Values Management
+ // ======================================================================================
+
@Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ public void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
ATTR_SPECIFICATION_PROJECT_NAME, "<project location>");
@@ -651,7 +628,7 @@
}
@Override
- public void initializeFrom(ILaunchConfiguration configuration) {
+ public void initializeFieldValuesFrom(ILaunchConfiguration configuration) {
try {
fNonRegressionBooleanField.initializeFrom(configuration);
@@ -688,12 +665,12 @@
case "All":
fAllNonRegressionCaseButton.setSelection(true);
fDetailsNonRegressionCaseButton.setSelection(false);
- visibleAndExclude(compNonRegressionCaseCoverage,false);
+ propagateVisibility(compNonRegressionCaseCoverage,false);
break;
case "Details":
fAllNonRegressionCaseButton.setSelection(false);
fDetailsNonRegressionCaseButton.setSelection(true);
- visibleAndExclude(compNonRegressionCaseCoverage,true);
+ propagateVisibility(compNonRegressionCaseCoverage,true);
break;
default:
// Error !!!
@@ -702,7 +679,7 @@
}
@Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ public void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration) {
fNonRegressionBooleanField.performApply(configuration);
configuration.setAttribute(
@@ -721,9 +698,17 @@
configuration.setAttribute(
ATTR_SELECTED_TRANSITIONS, selectedTransitions);
}
-
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
+
@Override
- public String getName() {
- return "Non Regression";
+ public FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig) {
+ if( fNonRegressionCaseButton.equals("Details") &&
+ ( selectedTransitions.size() == 0 ) ) {
+ return new FieldValidationReturn(false, "You must select at least one transition");
+ }
+ return new FieldValidationReturn(true, null);
}
}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationTab.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/TestGenerationCompositeMaker.java
similarity index 69%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationTab.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/TestGenerationCompositeMaker.java
index f5a2b53..e232118 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationTab.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/TestGenerationCompositeMaker.java
@@ -1,32 +1,37 @@
/*******************************************************************************
- * Copyright (c) 2016 CEA LIST.
+ * Copyright (c) 2017 CEA LIST.
+ *
* 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:
- * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
+ * Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial Implementation (tab-based, inserted in Run Configurations dialog)
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - New API (free-composite-based, no type assumptions on parent)
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+
+package org.eclipse.efm.ui.views.launchconfigurations.components;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.efm.runconfiguration.LaunchConfigurationTabGroup;
+import org.eclipse.efm.ui.views.launchconfigurations.components.pages.TestGenerationTTCNTracePage;
+import org.eclipse.efm.ui.views.launchconfigurations.components.AbstractCompositeMaker.FieldValidationReturn;
+import org.eclipse.efm.ui.views.launchconfigurations.components.pages.TestGenerationBasicTracePage;
+import org.eclipse.efm.ui.resources.HelpCoReferee;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.IntegerFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationGUIelement;
import org.eclipse.efm.ui.views.utils.SWTFactory;
-import org.eclipse.efm.ui.resources.HelpCoReferee;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.ui.PlatformUI;
-public class TestGenerationTab extends AbstractSewLaunchConfigurationTab {
-
+public class TestGenerationCompositeMaker extends AbstractCompositeMaker {
private Group groupExtensionObjective;
private BooleanFieldEditor fTraceExtensionEnabledBooleanField;
@@ -39,35 +44,29 @@
// TTCN TRACE GENERATION
private TestGenerationTTCNTracePage fTTCNTracePage;
- /**
- * Constructor
- * @param groupTab
- */
- public TestGenerationTab(LaunchConfigurationTabGroup groupTab) {
- super(groupTab);
- setHelpContextId(HelpCoReferee.efm_runconf_testgeneration_tab);
-
+ public TestGenerationCompositeMaker(ILaunchConfigurationGUIelement masterGUIelement) {
+ super(masterGUIelement);
fBasicTracePage = new TestGenerationBasicTracePage(this);
fTTCNTracePage = new TestGenerationTTCNTracePage(this);
}
- Composite simpleComposite;
+ // ======================================================================================
+ // Graphical Components Creation Methods
+ // ======================================================================================
@Override
- public void createControl(Composite parent) {
- simpleComposite = SWTFactory.createComposite(parent,
+ public Composite createControlMain(Composite parent) {
+ Composite simpleComposite = SWTFactory.createComposite(parent,
parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL, 0, 0);
- setControl(simpleComposite);
-
- PlatformUI.getWorkbench().getHelpSystem()
- .setHelp(getControl(), getHelpContextId());
createExtensionFormatPage(simpleComposite);
fBasicTracePage.createControl(simpleComposite);
fTTCNTracePage.createControl(simpleComposite);
+
+ return simpleComposite;
}
public void createExtensionFormatPage(Composite parent) {
@@ -125,49 +124,26 @@
try {
fAnalysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
localEnable = fTraceExtensionEnabledBooleanField.getBooleanValue() &&
(! fAnalysisProfile.equals(ANALYSIS_PROFILE_TEST_OFFLINE ) );
fTraceExtensionEvaluationStepsLimitIntegerField.setEnabled(localEnable);
- visibleAndExclude(groupExtensionObjective, localEnable);
+ propagateVisibility(groupExtensionObjective, localEnable);
}
catch (CoreException e) {
e.printStackTrace();
}
}
-
-
- /**
- * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(ILaunchConfiguration)
- */
+
+ // ======================================================================================
+ // Fields Values Management
+ // ======================================================================================
+
@Override
- public boolean isValid(ILaunchConfiguration launchConfig) {
- setErrorMessage(null);
-
- if( ! fTraceExtensionEvaluationStepsLimitIntegerField.isValid() ) {
- setErrorMessage("Evaluation Steps is not a valid integer");
- return false;
- }
-
- if( ! fBasicTracePage.isValid(launchConfig) )
- {
- return false;
- }
-
- if( ! fTTCNTracePage.isValid(launchConfig) )
- {
- return false;
- }
-
-
- return true;
- }
-
- @Override
- public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
+ public void setDefaultFieldValues(ILaunchConfigurationWorkingCopy configuration) {
// fTraceExtensionEnabledBooleanField.setDefaults(configuration);
configuration.setAttribute(
@@ -190,11 +166,11 @@
}
@Override
- public void initializeFrom(ILaunchConfiguration configuration) {
+ public void initializeFieldValuesFrom(ILaunchConfiguration configuration) {
String analysisProfile;
try {
analysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
}
catch (CoreException e) {
e.printStackTrace();
@@ -222,7 +198,7 @@
@Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration)
+ public void applyUpdatesOnFieldValuesFrom(ILaunchConfigurationWorkingCopy configuration)
{
fTraceExtensionEnabledBooleanField.performApply(configuration);
@@ -235,9 +211,28 @@
fTTCNTracePage.performApply(configuration);
}
-
+
+ // ======================================================================================
+ // Fields Validation
+ // ======================================================================================
+
@Override
- public String getName() {
- return "Test Generation";
+ public FieldValidationReturn areFieldsValid(ILaunchConfiguration launchConfig) {
+ if( ! fTraceExtensionEvaluationStepsLimitIntegerField.isValid() ) {
+ return new FieldValidationReturn(false, "Evaluation Steps is not a valid integer");
+ }
+
+ if( ! fBasicTracePage.isValid(launchConfig) )
+ {
+ return new FieldValidationReturn(false, null);
+ }
+
+ if( ! fTTCNTracePage.isValid(launchConfig) )
+ {
+ return new FieldValidationReturn(false, null);
+ }
+ return new FieldValidationReturn(true, null);
}
+
+
}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/AbstractTabComponentPage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/AbstractTabComponentPage.java
similarity index 77%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/AbstractTabComponentPage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/AbstractTabComponentPage.java
index 8edd390..493c223 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/AbstractTabComponentPage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/AbstractTabComponentPage.java
@@ -10,17 +10,18 @@
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.core.workflow.IWorkflowConfigurationConstants;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.swt.widgets.Composite;
public abstract class AbstractTabComponentPage
implements IWorkflowConfigurationConstants {
- protected AbstractSewLaunchConfigurationTab fParentTab;
+ protected ILaunchConfigurationEditorComposite fParentTab;
protected Composite fCompositeParent;
@@ -31,7 +32,7 @@
* Constructor
* @param parentTab
*/
- public AbstractTabComponentPage(AbstractSewLaunchConfigurationTab parentTab) {
+ public AbstractTabComponentPage(ILaunchConfigurationEditorComposite parentTab) {
fParentTab = parentTab;
fCompositeParent = null;
@@ -43,7 +44,7 @@
public void setVisible(boolean visible) {
if( fCompositeControl != null ) {
- fParentTab.visibleAndExclude(fCompositeControl, visible);
+ fParentTab.propagateVisibility(fCompositeControl, visible);
}
}
@@ -64,11 +65,11 @@
abstract public boolean isValid(ILaunchConfiguration launchConfig);
protected void setWarningMessage(String warningMessage) {
- fParentTab.setWarningMessage(warningMessage);
+ fParentTab.propagateWarningMessage(warningMessage);
}
protected void setErrorMessage(String errorMessage) {
- fParentTab.setErrorMessage(errorMessage);
+ fParentTab.propagateErrorMessage(errorMessage);
}
}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertBehaviorSelectionPage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/ExpertBehaviorSelectionPage.java
similarity index 97%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertBehaviorSelectionPage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/ExpertBehaviorSelectionPage.java
index 50a11af..b17712b 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertBehaviorSelectionPage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/ExpertBehaviorSelectionPage.java
@@ -10,13 +10,14 @@
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.IntegerFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -53,7 +54,7 @@
* @param parentTab
*/
public ExpertBehaviorSelectionPage(
- AbstractSewLaunchConfigurationTab parentTab) {
+ ILaunchConfigurationEditorComposite parentTab) {
super(parentTab);
}
@@ -194,9 +195,9 @@
String fModelAnalysis;
try {
fAnalysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
fModelAnalysis = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
+ ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
setVisible(fAnalysisProfile.equals(ANALYSIS_PROFILE_MODEL)
&& fModelAnalysis.equals(
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertTransitionCoveragePage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/ExpertTransitionCoveragePage.java
similarity index 97%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertTransitionCoveragePage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/ExpertTransitionCoveragePage.java
index 2e38019..858fae0 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/ExpertTransitionCoveragePage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/ExpertTransitionCoveragePage.java
@@ -10,13 +10,14 @@
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.IntegerFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -99,7 +100,7 @@
* @param parentTab
*/
public ExpertTransitionCoveragePage(
- AbstractSewLaunchConfigurationTab parentTab) {
+ ILaunchConfigurationEditorComposite parentTab) {
super(parentTab);
}
@@ -111,7 +112,7 @@
*/
@Override
public void modifyText(ModifyEvent e) {
- fParentTab.updateLaunchConfigurationDialog();
+ fParentTab.propagateGUIupdate();
}
/* (non-Javadoc)
@@ -136,17 +137,17 @@
private void handleScopeSelectionChange() {
fTCScope = fTCScopeCombo.getText();
- fParentTab.updateLaunchConfigurationDialog();
+ fParentTab.propagateGUIupdate();
}
private void handleHeuristicStartSelectionChange() {
fTCHeuristicStart = fTCHeuristicStartCombo.getText();
- fParentTab.updateLaunchConfigurationDialog();
+ fParentTab.propagateGUIupdate();
}
private void handleDirectiveTraceHeuristicSelectionChange() {
fTCDirectiveTraceHeuristic = fTCDirectiveTraceHeuristicCombo.getText();
- fParentTab.updateLaunchConfigurationDialog();
+ fParentTab.propagateGUIupdate();
}
@@ -365,9 +366,9 @@
String fModelAnalysis;
try {
fAnalysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
fModelAnalysis = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
+ ATTR_SPECIFICATION_MODEL_ANALYSIS, "");
setVisible(fAnalysisProfile.equals(ANALYSIS_PROFILE_MODEL)
&& fModelAnalysis.equals(
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabBehaviorSelectionPage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabBehaviorSelectionPage.java
similarity index 94%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabBehaviorSelectionPage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabBehaviorSelectionPage.java
index 39b23ff..87faae3 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabBehaviorSelectionPage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabBehaviorSelectionPage.java
@@ -10,11 +10,12 @@
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -30,7 +31,7 @@
* @param parentTab
*/
public MainTabBehaviorSelectionPage(
- AbstractSewLaunchConfigurationTab parentTab) {
+ ILaunchConfigurationEditorComposite parentTab) {
super(parentTab);
}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabTestOfflinePage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabTestOfflinePage.java
similarity index 95%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabTestOfflinePage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabTestOfflinePage.java
index 7e7431a..cdaf9f3 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabTestOfflinePage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabTestOfflinePage.java
@@ -8,7 +8,7 @@
* Contributors:
* Alain Faivre (CEA LIST) alain.faivre@cea.fr - Initial API and implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import java.io.File;
@@ -18,8 +18,10 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.core.workflow.Activator;
+//import org.eclipse.efm.runconfiguration.ui.tabs.MainTab;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
@@ -61,24 +63,23 @@
private Group fGroupControllable;
private StringFieldEditor fControllableStringField;
-
-
+
/**
* Constructor
* @param parentTab
*/
- public MainTabTestOfflinePage(MainTab parentTab) {
- super( parentTab );
+ public MainTabTestOfflinePage(
+ ILaunchConfigurationEditorComposite parentTab) {
+ super(parentTab);
}
-
/**
* Modify listener that simply updates the owning launch configuration dialog.
*/
private ModifyListener fBasicModifyListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent evt) {
- fParentTab.scheduleUpdateJob();
+ fParentTab.propagateUpdateJobScheduling();
}
};
@@ -130,7 +131,7 @@
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog =
new ElementTreeSelectionDialog(
- fParentTab.getShell(),
+ parent.getShell(),
new WorkbenchLabelProvider(),
new WorkbenchContentProvider() );
dialog.setTitle("Select a Resource:");
@@ -176,7 +177,7 @@
public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog =
new ElementTreeSelectionDialog(
- fParentTab.getShell(),
+ parent.getShell(),
new WorkbenchLabelProvider(),
new WorkbenchContentProvider());
dialog.setTitle("Select a Resource:");
@@ -243,8 +244,8 @@
boolean enabled =
fEnabledTraceConfigurationBooleanField.getBooleanValue();
- fParentTab.visibleAndExclude(fGroupObservable, enabled);
- fParentTab.visibleAndExclude(fGroupControllable, enabled);
+ fParentTab.propagateVisibility(fGroupObservable, enabled);
+ fParentTab.propagateVisibility(fGroupControllable, enabled);
}
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabTransitionCoveragePage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabTransitionCoveragePage.java
similarity index 95%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabTransitionCoveragePage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabTransitionCoveragePage.java
index 83c0e53..d25267f 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/MainTabTransitionCoveragePage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/MainTabTransitionCoveragePage.java
@@ -10,7 +10,7 @@
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import java.io.BufferedReader;
import java.io.File;
@@ -24,6 +24,7 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
@@ -60,7 +61,7 @@
* @param parentTab
*/
public MainTabTransitionCoveragePage(
- AbstractSewLaunchConfigurationTab parentTab) {
+ ILaunchConfigurationEditorComposite parentTab) {
super(parentTab);
fModelFilePath = null;
@@ -219,12 +220,12 @@
}
}
- fParentTab.updateLaunchConfigurationDialog();
+ fParentTab.propagateGUIupdate();
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
- fParentTab.updateLaunchConfigurationDialog();
+ fParentTab.propagateGUIupdate();
}
});
@@ -254,7 +255,7 @@
fSelectedTransitionsTable.remove(index);
- fParentTab.updateLaunchConfigurationDialog();
+ fParentTab.propagateGUIupdate();
break;
}
@@ -267,15 +268,15 @@
@Override
public void setVisible(boolean visible) {
- fParentTab.visibleAndExclude(fCompositeControl,visible);
+ fParentTab.propagateVisibility(fCompositeControl,visible);
if( visible ) {
if( fEnabledDetailedSelectionBooleanField.getBooleanValue() )
{
- fParentTab.visibleAndExclude(fCompDetailedSelection, true);
+ fParentTab.propagateVisibility(fCompDetailedSelection, true);
}
else {
- fParentTab.visibleAndExclude(fCompDetailedSelection, false);
+ fParentTab.propagateVisibility(fCompDetailedSelection, false);
}
}
}
@@ -461,7 +462,7 @@
fEnabledDetailedSelectionBooleanField.initializeFrom(configuration);
- fParentTab.visibleAndExclude(fCompDetailedSelection,
+ fParentTab.propagateVisibility(fCompDetailedSelection,
fEnabledDetailedSelectionBooleanField.getBooleanValue());
try {
@@ -487,7 +488,7 @@
{
fEnabledDetailedSelectionBooleanField.performApply(configuration);
- fParentTab.visibleAndExclude(fCompDetailedSelection,
+ fParentTab.propagateVisibility(fCompDetailedSelection,
fEnabledDetailedSelectionBooleanField.getBooleanValue());
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationBasicTracePage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/TestGenerationBasicTracePage.java
similarity index 96%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationBasicTracePage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/TestGenerationBasicTracePage.java
index 4440cd8..8d1d978 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationBasicTracePage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/TestGenerationBasicTracePage.java
@@ -10,13 +10,14 @@
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -57,7 +58,7 @@
* @param parentTab
*/
public TestGenerationBasicTracePage(
- AbstractSewLaunchConfigurationTab parentTab) {
+ ILaunchConfigurationEditorComposite parentTab) {
super(parentTab);
}
@@ -261,13 +262,13 @@
try {
fAnalysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
localEnable = fBasicTraceEnabledGenerationBooleanField.getBooleanValue()
&& (! fAnalysisProfile.equals(ANALYSIS_PROFILE_TEST_OFFLINE ) );
- fParentTab.visibleAndExclude(groupBasicConfiguration,localEnable);
- fParentTab.visibleAndExclude(groupBasicObservable,localEnable);
+ fParentTab.propagateVisibility(groupBasicConfiguration,localEnable);
+ fParentTab.propagateVisibility(groupBasicObservable,localEnable);
}
catch (CoreException e) {
// TODO Auto-generated catch block
@@ -350,7 +351,7 @@
String analysisProfile;
try {
analysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
}
catch (CoreException e) {
e.printStackTrace();
diff --git a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationTTCNTracePage.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/TestGenerationTTCNTracePage.java
similarity index 97%
rename from gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationTTCNTracePage.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/TestGenerationTTCNTracePage.java
index e321fd7..668e139 100644
--- a/gui/org.eclipse.efm.runconfiguration/src/org/eclipse/efm/runconfiguration/ui/TestGenerationTTCNTracePage.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/launchconfigurations/components/pages/TestGenerationTTCNTracePage.java
@@ -10,13 +10,14 @@
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr
* - Initial API and Implementation
*******************************************************************************/
-package org.eclipse.efm.runconfiguration.ui;
+package org.eclipse.efm.ui.views.launchconfigurations.components.pages;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.efm.ui.views.editors.impls.BooleanFieldEditor;
import org.eclipse.efm.ui.views.editors.impls.StringFieldEditor;
+import org.eclipse.efm.ui.views.utils.ILaunchConfigurationEditorComposite;
import org.eclipse.efm.ui.views.utils.SWTFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -55,7 +56,7 @@
* @param parentTab
*/
public TestGenerationTTCNTracePage(
- AbstractSewLaunchConfigurationTab parentTab) {
+ ILaunchConfigurationEditorComposite parentTab) {
super(parentTab);
}
@@ -315,7 +316,7 @@
String fAnalysisProfile;
try {
fAnalysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
} catch (CoreException e) {
e.printStackTrace();
@@ -328,13 +329,13 @@
fTTCNEnabledAdaptationModuleBooleanField.setEnabled(enabledGeneration);
- fParentTab.visibleAndExclude(groupTTCNConfiguration, enabledGeneration);
+ fParentTab.propagateVisibility(groupTTCNConfiguration, enabledGeneration);
boolean enabledAdaptation =
fTTCNEnabledAdaptationModuleBooleanField.getBooleanValue();
- fParentTab.visibleAndExclude(groupTTCNModule,
+ fParentTab.propagateVisibility(groupTTCNModule,
enabledGeneration && enabledAdaptation);
}
@@ -434,7 +435,7 @@
String analysisProfile;
try {
analysisProfile = configuration.getAttribute(
- MainTab.ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
+ ATTR_SPECIFICATION_ANALYSIS_PROFILE, "");
}
catch (CoreException e) {
e.printStackTrace();
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/ILaunchConfigurationEditorComposite.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/ILaunchConfigurationEditorComposite.java
new file mode 100644
index 0000000..9a47391
--- /dev/null
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/ILaunchConfigurationEditorComposite.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2017 CEA LIST.
+ * 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:
+ * Erwan Mahe (CEA LIST) erwan.mahe@cea.fr - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.efm.ui.views.utils;
+
+import org.eclipse.swt.widgets.Control;
+
+public interface ILaunchConfigurationEditorComposite {
+
+ public void propagateMessage(String message);
+
+ public void propagateWarningMessage(String warningmessage);
+
+ public void propagateErrorMessage(String errormessage);
+
+ public void propagateGUIupdate();
+
+ public void propagateVisibility(Control smp, boolean isVisible);
+
+ public void propagateUpdateJobScheduling();
+}
diff --git a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/LaunchConfigurationEditorCommunicationInterface.java b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/ILaunchConfigurationGUIelement.java
similarity index 82%
rename from gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/LaunchConfigurationEditorCommunicationInterface.java
rename to gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/ILaunchConfigurationGUIelement.java
index c859cac..2f1546c 100644
--- a/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/LaunchConfigurationEditorCommunicationInterface.java
+++ b/gui/org.eclipse.efm.ui.views/src/org/eclipse/efm/ui/views/utils/ILaunchConfigurationGUIelement.java
@@ -11,11 +11,16 @@
package org.eclipse.efm.ui.views.utils;
-public interface LaunchConfigurationEditorCommunicationInterface {
-
- public void setErrorMessage(String errormessage);
+public interface ILaunchConfigurationGUIelement {
public void setMessage(String message);
+
+ public void setWarningMessage(String warningmessage);
+
+ public void setErrorMessage(String errormessage);
public void updateGUI();
+
+ public void scheduleUpdateJob();
+
}