Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-07-11 06:50:55 +0000
committerTobias Schwarz2013-07-11 06:53:28 +0000
commit17e08a7ea05b275d17179d25508d3082c43d7eb2 (patch)
tree166b7556b43c4909556cef9563f50b602dd59a22 /target_explorer
parent8f48d3c6f1d1d1b4d67afb9bd3eb8bc61c0b66f0 (diff)
downloadorg.eclipse.tcf-17e08a7ea05b275d17179d25508d3082c43d7eb2.tar.gz
org.eclipse.tcf-17e08a7ea05b275d17179d25508d3082c43d7eb2.tar.xz
org.eclipse.tcf-17e08a7ea05b275d17179d25508d3082c43d7eb2.zip
Target Explorer: rework sections
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java111
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/MainTabContextSelectorSection.java100
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java17
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/ContextSelectorSection.java)65
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java (renamed from target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/TargetSelectorSection.java)9
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/sections/AbstractContextSelectorSection.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java25
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/data/IUpdatable.java32
16 files changed, 254 insertions, 158 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
index a0d5fbefd..bf48ee0d7 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/internal/PropertyTester.java
@@ -58,6 +58,7 @@ public class PropertyTester extends org.eclipse.core.expressions.PropertyTester
for (IService service : services) {
if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(receiver, operation)) {
stepperService = (IStepperService)service;
+ break;
}
}
if (stepperService != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
index 41e638cb0..c79df3a69 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/AbstractLaunchContextMainTab.java
@@ -13,17 +13,24 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.te.launch.core.bindings.LaunchConfigTypeBindingsManager;
+import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
+import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
import org.eclipse.tcf.te.launch.core.selection.RemoteSelectionContext;
+import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
import org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorTab;
+import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.ui.controls.ContextSelectorSectionControl;
+import org.eclipse.tcf.te.tcf.ui.sections.AbstractContextSelectorSection;
import org.eclipse.tcf.te.ui.views.controls.AbstractContextSelectorControl;
import org.eclipse.ui.forms.IManagedForm;
@@ -90,6 +97,97 @@ public abstract class AbstractLaunchContextMainTab extends AbstractContextSelect
}
}
+ protected class MainTabContextSelectorSection extends AbstractContextSelectorSection implements ILaunchConfigurationTabFormPart {
+
+ /**
+ * Constructor.
+ * @param form The managed form.
+ * @param parent The parent composite.
+ */
+ public MainTabContextSelectorSection(IManagedForm form, Composite parent) {
+ super(form, parent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.launch.ui.launchcontext.MainTabContextSelectorSection#doCreateContextSelector()
+ */
+ @Override
+ protected AbstractContextSelectorControl doCreateContextSelector() {
+ AbstractContextSelectorControl control = new MainTabContextSelectorControl(this, null);
+ doConfigureContextSelectorControl(control);
+ return control;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.ui.sections.AbstractContextSelectorSection#getContextListDataKey()
+ */
+ @Override
+ protected String getContextListDataKey() {
+ return ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public void initializeFrom(ILaunchConfiguration configuration) {
+ Assert.isNotNull(configuration);
+
+ if (selector != null) {
+ IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(configuration);
+ if (contexts != null && contexts.length > 0) {
+ // Loop the contexts and create a list of nodes
+ List<IModelNode> nodes = new ArrayList<IModelNode>();
+ for (IModelNode node : contexts) {
+ if (node != null && !nodes.contains(node)) {
+ nodes.add(node);
+ }
+ }
+ if (!nodes.isEmpty()) {
+ selector.setCheckedModelContexts(nodes.toArray(new IModelNode[nodes.size()]));
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
+ */
+ @Override
+ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
+ Assert.isNotNull(configuration);
+
+ if (selector != null) {
+ IModelNode[] nodes = selector.getCheckedModelContexts();
+
+ // Write the selected contexts to the launch configuration
+ if (nodes != null && nodes.length > 0) {
+ LaunchContextsPersistenceDelegate.setLaunchContexts(configuration, nodes);
+ } else {
+ LaunchContextsPersistenceDelegate.setLaunchContexts(configuration, null);
+ }
+ } else {
+ LaunchContextsPersistenceDelegate.setLaunchContexts(configuration, null);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#isValid(org.eclipse.debug.core.ILaunchConfiguration)
+ */
+ @Override
+ public boolean isValid(ILaunchConfiguration configuration) {
+ return isValid();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.tcf.ui.sections.AbstractContextSelectorSection#dataChanged()
+ */
+ @Override
+ public void dataChanged() {
+ getManagedForm().dirtyStateChanged();
+ }
+ }
+
/* (non-Javadoc)
* @see org.eclipse.tcf.te.launch.ui.tabs.AbstractFormsLaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
@@ -111,18 +209,7 @@ public abstract class AbstractLaunchContextMainTab extends AbstractContextSelect
*/
@Override
protected MainTabContextSelectorSection doCreateContextSelectorSection(IManagedForm form, Composite panel) {
- return new MainTabContextSelectorSection(form, panel) {
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.launch.ui.launchcontext.MainTabContextSelectorSection#doCreateContextSelector()
- */
- @Override
- protected AbstractContextSelectorControl doCreateContextSelector() {
- AbstractContextSelectorControl control = new MainTabContextSelectorControl(this, null);
- doConfigureContextSelectorControl(control);
- return control;
- }
- };
+ return new MainTabContextSelectorSection(form, panel);
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/MainTabContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/MainTabContextSelectorSection.java
deleted file mode 100644
index 7f3dd792f..000000000
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/launchcontext/MainTabContextSelectorSection.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems, Inc. and others. 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:
- * Wind River Systems - initial API and implementation
- *******************************************************************************/
-package org.eclipse.tcf.te.tcf.launch.ui.launchcontext;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchContextLaunchAttributes;
-import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
-import org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart;
-import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
-import org.eclipse.tcf.te.tcf.ui.sections.ContextSelectorSection;
-import org.eclipse.ui.forms.IManagedForm;
-
-/**
- * Locator model context selector section implementation.
- */
-public class MainTabContextSelectorSection extends ContextSelectorSection implements ILaunchConfigurationTabFormPart {
-
- /**
- * Constructor.
- * @param form The managed form.
- * @param parent The parent composite.
- */
- public MainTabContextSelectorSection(IManagedForm form, Composite parent) {
- super(form, parent);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.ui.sections.ContextSelectorSection#getContextListDataKey()
- */
- @Override
- protected String getContextListDataKey() {
- return ILaunchContextLaunchAttributes.ATTR_LAUNCH_CONTEXTS;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public void initializeFrom(ILaunchConfiguration configuration) {
- Assert.isNotNull(configuration);
-
- if (selector != null) {
- IModelNode[] contexts = LaunchContextsPersistenceDelegate.getLaunchContexts(configuration);
- if (contexts != null && contexts.length > 0) {
- // Loop the contexts and create a list of nodes
- List<IModelNode> nodes = new ArrayList<IModelNode>();
- for (IModelNode node : contexts) {
- if (node != null && !nodes.contains(node)) {
- nodes.add(node);
- }
- }
- if (!nodes.isEmpty()) {
- selector.setCheckedModelContexts(nodes.toArray(new IModelNode[nodes.size()]));
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
- */
- @Override
- public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- Assert.isNotNull(configuration);
-
- if (selector != null) {
- IModelNode[] nodes = selector.getCheckedModelContexts();
-
- // Write the selected contexts to the launch configuration
- if (nodes != null && nodes.length > 0) {
- LaunchContextsPersistenceDelegate.setLaunchContexts(configuration, nodes);
- } else {
- LaunchContextsPersistenceDelegate.setLaunchContexts(configuration, null);
- }
- } else {
- LaunchContextsPersistenceDelegate.setLaunchContexts(configuration, null);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.interfaces.ILaunchConfigurationTabFormPart#isValid(org.eclipse.debug.core.ILaunchConfiguration)
- */
- @Override
- public boolean isValid(ILaunchConfiguration configuration) {
- return isValid();
- }
-}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
index 4521dac4d..d5be38c17 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
@@ -131,6 +131,7 @@ public class UIPlugin extends AbstractUIPlugin {
for (IService service : services) {
if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(peerModel, IStepperServiceOperations.DISCONNECT)) {
stepperService = (IStepperService)service;
+ break;
}
}
if (stepperService != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java
index 86ac93640..bec8576aa 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/ContextSelectorSectionControl.java
@@ -25,7 +25,7 @@ import org.eclipse.tcf.te.ui.views.sections.AbstractContextSelectorSection;
*/
public class ContextSelectorSectionControl extends AbstractContextSelectorControl {
- private final AbstractContextSelectorSection section;
+ protected final AbstractContextSelectorSection section;
/**
* Constructor.
@@ -41,22 +41,21 @@ public class ContextSelectorSectionControl extends AbstractContextSelectorContro
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#onCheckStateChanged(java.lang.Object, boolean)
+ * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#getInitialViewerInput()
*/
@Override
- protected void onCheckStateChanged(Object element, boolean checked) {
- super.onCheckStateChanged(element, checked);
- section.getManagedForm().dirtyStateChanged();
+ protected Object getInitialViewerInput() {
+ return Model.getModel();
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#getInitialViewerInput()
+ * @see org.eclipse.tcf.te.ui.views.controls.AbstractContextSelectorControl#onCheckStateChanged(java.lang.Object, boolean)
*/
@Override
- protected Object getInitialViewerInput() {
- return Model.getModel();
+ protected void onCheckStateChanged(Object element, boolean checked) {
+ super.onCheckStateChanged(element, checked);
+ section.dataChanged();
}
-
/* (non-Javadoc)
* @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorControl#doConfigureTreeContentAndLabelProvider(org.eclipse.jface.viewers.TreeViewer)
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java
index 2c8e4af41..40867de03 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/controls/SimulatorTypeSelectionControl.java
@@ -24,7 +24,7 @@ import org.eclipse.tcf.te.runtime.services.interfaces.IService;
import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService;
import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.ui.sections.TargetSelectorSection;
+import org.eclipse.tcf.te.tcf.ui.sections.SimulatorTypeSelectionSection;
import org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl;
import org.eclipse.tcf.te.ui.interfaces.services.ISimulatorServiceUIDelegate;
import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
@@ -39,14 +39,14 @@ public class SimulatorTypeSelectionControl extends BaseEditBrowseTextControl {
private final Map<String, String> id2name = new HashMap<String, String>();
private final Map<String, String> id2config = new HashMap<String, String>();
- private final TargetSelectorSection parentSection;
+ private final SimulatorTypeSelectionSection parentSection;
/**
* Constructor.
*
* @param parentSection The parent section.
*/
- public SimulatorTypeSelectionControl(TargetSelectorSection parentSection) {
+ public SimulatorTypeSelectionControl(SimulatorTypeSelectionSection parentSection) {
super(null);
Assert.isNotNull(parentSection);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java
index d31f046fa..30256a7ee 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/AbstractConfigurationEditorPage.java
@@ -26,7 +26,7 @@ import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelRefreshService;
import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
-import org.eclipse.tcf.te.tcf.ui.sections.TargetSelectorSection;
+import org.eclipse.tcf.te.tcf.ui.sections.SimulatorTypeSelectionSection;
import org.eclipse.tcf.te.ui.views.ViewsUtil;
import org.eclipse.tcf.te.ui.views.editor.pages.AbstractCustomFormToolkitEditorPage;
import org.eclipse.ui.IEditorInput;
@@ -39,7 +39,7 @@ import org.eclipse.ui.forms.widgets.TableWrapData;
public abstract class AbstractConfigurationEditorPage extends AbstractCustomFormToolkitEditorPage {
// Section to select real or simulator
- /* default */ TargetSelectorSection targetSelectorSection = null;
+ /* default */ SimulatorTypeSelectionSection simulatorTypeSelectionSection = null;
/* (non-Javadoc)
* @see org.eclipse.tcf.te.ui.views.editor.pages.AbstractEditorPage#setInput(org.eclipse.ui.IEditorInput)
@@ -83,14 +83,14 @@ public abstract class AbstractConfigurationEditorPage extends AbstractCustomForm
protected void addTargetSelectorSection(IManagedForm form, Composite parent) {
ISimulatorService service = ServiceManager.getInstance().getService(getEditorInputNode(), ISimulatorService.class);
if (service != null) {
- targetSelectorSection = doCreateTargetSelectorSection(form, parent);
- targetSelectorSection.getSection().setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP));
- getManagedForm().addPart(targetSelectorSection);
+ simulatorTypeSelectionSection = doCreateTargetSelectorSection(form, parent);
+ simulatorTypeSelectionSection.getSection().setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP));
+ getManagedForm().addPart(simulatorTypeSelectionSection);
}
}
- protected TargetSelectorSection getTargetSelectorSection() {
- return targetSelectorSection;
+ protected SimulatorTypeSelectionSection getTargetSelectorSection() {
+ return simulatorTypeSelectionSection;
}
/**
@@ -99,8 +99,8 @@ public abstract class AbstractConfigurationEditorPage extends AbstractCustomForm
* @param parent The parent composite.
* @return The target selector section.
*/
- protected TargetSelectorSection doCreateTargetSelectorSection (IManagedForm form, Composite parent) {
- return new TargetSelectorSection(getManagedForm(), parent);
+ protected SimulatorTypeSelectionSection doCreateTargetSelectorSection (IManagedForm form, Composite parent) {
+ return new SimulatorTypeSelectionSection(getManagedForm(), parent);
}
/* (non-Javadoc)
@@ -108,7 +108,7 @@ public abstract class AbstractConfigurationEditorPage extends AbstractCustomForm
*/
@Override
public void dispose() {
- if (targetSelectorSection != null) { targetSelectorSection.dispose(); targetSelectorSection = null; }
+ if (simulatorTypeSelectionSection != null) { simulatorTypeSelectionSection.dispose(); simulatorTypeSelectionSection = null; }
super.dispose();
}
@@ -119,8 +119,8 @@ public abstract class AbstractConfigurationEditorPage extends AbstractCustomForm
public void setActive(boolean active) {
super.setActive(active);
- if (targetSelectorSection != null) {
- targetSelectorSection.setActive(active);
+ if (simulatorTypeSelectionSection != null) {
+ simulatorTypeSelectionSection.setActive(active);
}
}
@@ -131,9 +131,9 @@ public abstract class AbstractConfigurationEditorPage extends AbstractCustomForm
protected ValidationResult doValidate() {
ValidationResult result = super.doValidate();
- if (targetSelectorSection != null) {
- targetSelectorSection.isValid();
- result.setResult(targetSelectorSection);
+ if (simulatorTypeSelectionSection != null) {
+ simulatorTypeSelectionSection.isValid();
+ result.setResult(simulatorTypeSelectionSection);
}
return result;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/ContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
index 0a34a497a..09876be77 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/ContextSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/AbstractContextSelectorSection.java
@@ -12,29 +12,31 @@ package org.eclipse.tcf.te.tcf.ui.sections;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.model.interfaces.IModelNode;
import org.eclipse.tcf.te.runtime.persistence.PersistenceManager;
import org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate;
+import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
-import org.eclipse.tcf.te.tcf.ui.controls.ContextSelectorSectionControl;
-import org.eclipse.tcf.te.ui.views.controls.AbstractContextSelectorControl;
-import org.eclipse.tcf.te.ui.views.sections.AbstractContextSelectorSection;
import org.eclipse.ui.forms.IManagedForm;
/**
* Locator model context selector section implementation.
*/
-public abstract class ContextSelectorSection extends AbstractContextSelectorSection {
+public abstract class AbstractContextSelectorSection extends org.eclipse.tcf.te.ui.views.sections.AbstractContextSelectorSection {
+
+ // Reference to a copy of the original data
+ private IPropertiesContainer odc = null;
/**
* Constructor.
* @param form The managed form.
* @param parent The parent composite.
*/
- public ContextSelectorSection(IManagedForm form, Composite parent) {
+ public AbstractContextSelectorSection(IManagedForm form, Composite parent) {
super(form, parent);
}
@@ -44,19 +46,10 @@ public abstract class ContextSelectorSection extends AbstractContextSelectorSect
* @param parent The parent composite.
* @param style
*/
- public ContextSelectorSection(IManagedForm form, Composite parent, int style) {
+ public AbstractContextSelectorSection(IManagedForm form, Composite parent, int style) {
super(form, parent, style);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.tcf.te.launch.ui.tabs.launchcontext.AbstractContextSelectorSection#doCreateContextSelector()
- */
- @Override
- protected AbstractContextSelectorControl doCreateContextSelector() {
- return new ContextSelectorSectionControl(this, null);
- }
-
public static final String encode(IModelNode[] contexts) {
try {
if (contexts != null && contexts.length > 0) {
@@ -95,12 +88,26 @@ public abstract class ContextSelectorSection extends AbstractContextSelectorSect
*/
@Override
public void setupData(IPropertiesContainer data) {
+ Assert.isNotNull(data);
+
+ // store original data
+ odc = new PropertiesContainer();
+ odc.setProperties(data.getProperties());
+
+ setIsUpdating(true);
+
String encoded = data.getStringProperty(getContextListDataKey());
IModelNode[] list = decode(encoded);
selector.setCheckedModelContexts(list);
if (selector != null && selector.getViewer() != null) {
selector.getViewer().refresh();
}
+
+ // Mark the control update as completed now
+ setIsUpdating(false);
+
+ // Re-evaluate the dirty state
+ dataChanged();
}
/* (non-Javadoc)
@@ -110,4 +117,32 @@ public abstract class ContextSelectorSection extends AbstractContextSelectorSect
public void extractData(IPropertiesContainer data) {
data.setProperty(getContextListDataKey(), encode(selector.getCheckedModelContexts()));
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.views.sections.AbstractContextSelectorSection#dataChanged()
+ */
+ @Override
+ public void dataChanged() {
+ // dataChanged is not evaluated while the controls are updated or no data was set
+ if (odc == null || isUpdating()) {
+ return;
+ }
+
+ boolean isDirty = false;
+
+ if (selector != null) {
+ String newValue = encode(selector.getCheckedModelContexts());
+ if ("".equals(newValue)) { //$NON-NLS-1$
+ String oldValue = odc.getStringProperty(getContextListDataKey());
+ isDirty |= oldValue != null && !"".equals(oldValue.trim()); //$NON-NLS-1$
+ }
+ else {
+ isDirty |= !odc.isProperty(getContextListDataKey(), newValue);
+ }
+ }
+
+ // If dirty, mark the form part dirty.
+ // Otherwise call refresh() to reset the dirty (and stale) flag
+ markDirty(isDirty);
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/TargetSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java
index 5286dfc92..bc9229bb0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/TargetSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java
@@ -46,7 +46,7 @@ import org.eclipse.ui.forms.widgets.Section;
/**
* Simulator section implementation.
*/
-public class TargetSelectorSection extends AbstractSection implements IDataExchangeNode {
+public class SimulatorTypeSelectionSection extends AbstractSection implements IDataExchangeNode {
// The section sub controls
/* default */ Button real;
/* default */ SimulatorTypeSelectionControl type;
@@ -67,7 +67,7 @@ public class TargetSelectorSection extends AbstractSection implements IDataExcha
* @param form The parent managed form. Must not be <code>null</code>.
* @param parent The parent composite. Must not be <code>null</code>.
*/
- public TargetSelectorSection(IManagedForm form, Composite parent) {
+ public SimulatorTypeSelectionSection(IManagedForm form, Composite parent) {
super(form, parent, SWT.NONE);
createClient(getSection(), form.getToolkit());
}
@@ -79,7 +79,7 @@ public class TargetSelectorSection extends AbstractSection implements IDataExcha
* @param parent The parent composite. Must not be <code>null</code>.
* @param style The section style.
*/
- public TargetSelectorSection(IManagedForm form, Composite parent, int style) {
+ public SimulatorTypeSelectionSection(IManagedForm form, Composite parent, int style) {
super(form, parent, style);
createClient(getSection(), form.getToolkit());
}
@@ -101,6 +101,9 @@ public class TargetSelectorSection extends AbstractSection implements IDataExcha
super.dispose();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.forms.parts.AbstractSection#getValidatingContainer()
+ */
@Override
public IValidatingContainer getValidatingContainer() {
Object container = getManagedForm().getContainer();
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
index ea8a1c17a..9836198e2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/AbstractConfigWizard.java
@@ -79,6 +79,7 @@ public abstract class AbstractConfigWizard extends NewTargetWizard {
for (IService service : services) {
if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(peerModel, IStepperServiceOperations.CONNECT)) {
stepperService = (IStepperService)service;
+ break;
}
}
if (stepperService != null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/sections/AbstractContextSelectorSection.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/sections/AbstractContextSelectorSection.java
index 891f883c0..7c93a6e47 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/sections/AbstractContextSelectorSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.views/src/org/eclipse/tcf/te/ui/views/sections/AbstractContextSelectorSection.java
@@ -167,4 +167,9 @@ public abstract class AbstractContextSelectorSection extends AbstractSection imp
return valid;
}
+
+ /**
+ * Called to signal that the data associated has been changed.
+ */
+ public abstract void dataChanged();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java
index ff851eae7..94ef5d13b 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/activator/UIPlugin.java
@@ -124,6 +124,9 @@ public class UIPlugin extends AbstractUIPlugin {
url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_ELCL + "collapseall.gif"); //$NON-NLS-1$
registry.put(ImageConsts.VIEWER_COLLAPSE_ALL, ImageDescriptor.createFromURL(url));
+ url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_ELCL + "connect.gif"); //$NON-NLS-1$
+ registry.put(ImageConsts.ACTION_CONNECT, ImageDescriptor.createFromURL(url));
+
url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "gold_ovr.gif"); //$NON-NLS-1$
registry.put(ImageConsts.GOLD_OVR, ImageDescriptor.createFromURL(url));
url = UIPlugin.getDefault().getBundle().getEntry(ImageConsts.IMAGE_DIR_ROOT + ImageConsts.IMAGE_DIR_OVR + "green_ovr.gif"); //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java
index 35e07c34a..ba842fa1f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/dialogs/AbstractSectionDialog.java
@@ -28,6 +28,7 @@ import org.eclipse.tcf.te.ui.forms.CustomFormToolkit;
import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
import org.eclipse.tcf.te.ui.forms.parts.AbstractSection;
import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode;
+import org.eclipse.tcf.te.ui.interfaces.data.IUpdatable;
import org.eclipse.tcf.te.ui.jface.dialogs.CustomTitleAreaDialog;
import org.eclipse.tcf.te.ui.jface.interfaces.IValidatingContainer;
import org.eclipse.ui.forms.IManagedForm;
@@ -118,6 +119,7 @@ public abstract class AbstractSectionDialog extends CustomTitleAreaDialog implem
IManagedForm form = new ManagedForm(toolkit, scrolledForm) {
@Override
public void dirtyStateChanged() {
+ updateSections();
validate();
}
@Override
@@ -214,6 +216,26 @@ public abstract class AbstractSectionDialog extends CustomTitleAreaDialog implem
}
}
+ public void updateSections() {
+ IPropertiesContainer workingData = new PropertiesContainer();
+ if (sections != null) {
+ // get working data
+ for (AbstractSection section : sections) {
+ if (section instanceof IDataExchangeNode) {
+ ((IDataExchangeNode)section).extractData(workingData);
+ }
+ }
+
+ // update sections
+ for (AbstractSection section : sections) {
+ if (section instanceof IUpdatable) {
+ ((IUpdatable)section).updateData(workingData);
+ }
+ }
+ }
+
+ }
+
/* (non-Javadoc)
* @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode#extractData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer)
*/
@@ -228,10 +250,11 @@ public abstract class AbstractSectionDialog extends CustomTitleAreaDialog implem
*/
@Override
protected void okPressed() {
- // Extract the properties from the logging section
+ // Extract the properties
if (data == null) {
data = new PropertiesContainer();
}
+ data.clearProperties();
if (sections != null) {
for (AbstractSection section : sections) {
if (section instanceof IDataExchangeNode) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java
index dae892fde..ee905df54 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/handler/StepperCommandHandler.java
@@ -88,6 +88,7 @@ public class StepperCommandHandler extends AbstractHandler implements IExecutabl
for (IService service : services) {
if (service instanceof IStepperService && ((IStepperService)service).isHandledOperation(context, operation)) {
stepperService = (IStepperService)service;
+ break;
}
}
return stepperService;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java
index a3950f820..9d442fefa 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/ImageConsts.java
@@ -117,4 +117,9 @@ public interface ImageConsts {
* The key to access the target object busy state overlay image.
*/
public static final String BUSY_OVR = "BusyOverlay"; //$NON-NLS-1$
+
+ /**
+ * The key to access the connect action image.
+ */
+ public static final String ACTION_CONNECT = "ActionConnect"; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/data/IUpdatable.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/data/IUpdatable.java
new file mode 100644
index 000000000..cc346c597
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/data/IUpdatable.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.tcf.te.ui.interfaces.data;
+
+import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
+
+/**
+ * Public interface for wizard or dialog pages, panel, controls or other UI elements
+ * exchanging data via a shared data object.
+ */
+public interface IUpdatable {
+
+ /**
+ * Update the data from the given properties container which contains the current
+ * working data.
+ * <p>
+ * This method may called multiple times during the lifetime of the node and the given
+ * properties container might be even <code>null</code>.
+ *
+ * @param data
+ */
+ public void updateData(IPropertiesContainer data);
+
+}

Back to the top