Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-10-17 11:13:51 -0400
committerUwe Stieber2013-10-17 11:13:51 -0400
commit6c317ca6b1160e77bda85aed5a22c68e1ff2ae7d (patch)
treeb5574379de1d05c0b4a277284425c8f98b29dad8 /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf
parent00f7c65d9fa10c845b5ca8a48e734f04514191e4 (diff)
downloadorg.eclipse.tcf-6c317ca6b1160e77bda85aed5a22c68e1ff2ae7d.tar.gz
org.eclipse.tcf-6c317ca6b1160e77bda85aed5a22c68e1ff2ae7d.tar.xz
org.eclipse.tcf-6c317ca6b1160e77bda85aed5a22c68e1ff2ae7d.zip
Target Explorer: Fix transport section transport type combo not disabled if only one valid transport type exist
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java29
1 files changed, 12 insertions, 17 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java
index c79084b7e..47972e8da 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TransportSection.java
@@ -139,12 +139,12 @@ public class TransportSection extends AbstractSection implements IDataExchangeNo
@Override
public String[] getTransportTypes() {
List<String> types = new ArrayList<String>();
- for (String type : super.getTransportTypes()) {
- if (isTransportTypeSupported(type)) {
- types.add(type);
- }
- }
- return types.toArray(new String[types.size()]);
+ for (String type : super.getTransportTypes()) {
+ if (isTransportTypeSupported(type)) {
+ types.add(type);
+ }
+ }
+ return types.toArray(new String[types.size()]);
}
};
transportTypeControl.setFormToolkit(toolkit);
@@ -165,7 +165,7 @@ public class TransportSection extends AbstractSection implements IDataExchangeNo
}
@Override
protected boolean hasHistory() {
- return true;
+ return true;
}
};
transportTypePanelControl.addConfigurationPanel(ITransportTypes.TRANSPORT_TYPE_TCP, tcpTransportPanel);
@@ -205,8 +205,7 @@ public class TransportSection extends AbstractSection implements IDataExchangeNo
transportTypePanelControl.getPanel().setLayoutData(layoutData);
toolkit.adapt(transportTypePanelControl.getPanel());
- transportTypePanelControl.showConfigurationPanel(transportTypeControl
- .getSelectedTransportType());
+ transportTypePanelControl.showConfigurationPanel(transportTypeControl.getSelectedTransportType());
// Adjust the control enablement
updateEnablement();
@@ -236,10 +235,8 @@ public class TransportSection extends AbstractSection implements IDataExchangeNo
// unsaved data, than fill in the data from the selected node
if (active) {
// Leave everything unchanged if the page is in dirty state
- if (getManagedForm().getContainer() instanceof AbstractEditorPage && !((AbstractEditorPage) getManagedForm()
- .getContainer()).isDirty()) {
- Object node = ((AbstractEditorPage) getManagedForm().getContainer())
- .getEditorInputNode();
+ if (getManagedForm().getContainer() instanceof AbstractEditorPage && !((AbstractEditorPage) getManagedForm().getContainer()).isDirty()) {
+ Object node = ((AbstractEditorPage) getManagedForm().getContainer()).getEditorInputNode();
if (node instanceof IPeerModel) {
setupData((IPeerModel) node);
}
@@ -627,11 +624,9 @@ public class TransportSection extends AbstractSection implements IDataExchangeNo
// The transport type control is enabled for static peers
if (transportTypeControl != null) {
boolean enabled = !isReadOnly() && (input == null || (isStatic.get() && !isRemote.get()));
- SWTControlUtil.setEnabled(transportTypeControl.getEditFieldControl(), enabled);
+ SWTControlUtil.setEnabled(transportTypeControl.getEditFieldControl(), enabled && SWTControlUtil.getItemCount(transportTypeControl.getEditFieldControl()) > 1);
if (transportTypePanelControl != null) {
- IWizardConfigurationPanel panel = transportTypePanelControl
- .getConfigurationPanel(transportTypeControl
- .getSelectedTransportType());
+ IWizardConfigurationPanel panel = transportTypePanelControl.getConfigurationPanel(transportTypeControl.getSelectedTransportType());
if (panel != null) {
panel.setEnabled(enabled);
}

Back to the top