Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2012-10-30 09:39:47 +0000
committerUwe Stieber2012-10-30 09:39:47 +0000
commit337267a01783ea1e6c0e600f57657d17a34352a3 (patch)
treeb75d623508e4deaeac476ff15ff95149d881970d
parentddd6d20872a8ec1705c2e40d8da67c54d153084a (diff)
downloadorg.eclipse.tcf-337267a01783ea1e6c0e600f57657d17a34352a3.tar.gz
org.eclipse.tcf-337267a01783ea1e6c0e600f57657d17a34352a3.tar.xz
org.eclipse.tcf-337267a01783ea1e6c0e600f57657d17a34352a3.zip
Target Explorer: Bug 392240 - [TERMINALS] performance: Opening a new terminal is very slow due to RXTX even if not choosing Serial
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java44
2 files changed, 38 insertions, 8 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java
index c92351f63..f61106b7e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.controls/src/org/eclipse/tcf/te/ui/controls/BaseWizardConfigurationPanelControl.java
@@ -92,6 +92,8 @@ public class BaseWizardConfigurationPanelControl extends BaseDialogPageControl {
Assert.isNotNull(parent);
Assert.isNotNull(toolkit);
+ setFormToolkit(toolkit);
+
if (isPanelIsGroup()) {
panel = new Group(parent, SWT.NONE);
if (getGroupLabel() != null) ((Group)panel).setText(getGroupLabel());
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
index 79e52abe2..74a9cd029 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals/src/org/eclipse/tcf/te/ui/terminals/internal/dialogs/LaunchTerminalSettingsDialog.java
@@ -66,7 +66,7 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog {
private FormToolkit toolkit = null;
// Map the label added to the combobox to the corresponding launcher delegate.
- private final Map<String, ILauncherDelegate> label2delegate = new HashMap<String, ILauncherDelegate>();
+ /* default */ final Map<String, ILauncherDelegate> label2delegate = new HashMap<String, ILauncherDelegate>();
// The data object containing the currently selected settings
private IPropertiesContainer data = null;
@@ -94,6 +94,32 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog {
public String getGroupLabel() {
return Messages.LaunchTerminalSettingsDialog_group_label;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseWizardConfigurationPanelControl#showConfigurationPanel(java.lang.String)
+ */
+ @Override
+ public void showConfigurationPanel(String key) {
+ // Check if we have to create the panel first
+ IWizardConfigurationPanel configPanel = getConfigurationPanel(key);
+ if (configPanel == null) {
+ // Get the corresponding delegate
+ ILauncherDelegate delegate = label2delegate.get(key);
+ Assert.isNotNull(delegate);
+ // Get the wizard configuration panel instance
+ configPanel = delegate.getPanel(this);
+ if (configPanel == null) configPanel = new EmptySettingsPanel(this);
+ // Push the selection to the configuration panel
+ Assert.isTrue(configPanel instanceof IConfigurationPanel);
+ ((IConfigurationPanel)configPanel).setSelection(getSelection());
+ // Add it
+ addConfigurationPanel(key, configPanel);
+ // Create the panel controls
+ configPanel.setupPanel(getPanel(), getFormToolkit());
+ }
+
+ super.showConfigurationPanel(key);
+ }
}
/**
@@ -255,13 +281,15 @@ public class LaunchTerminalSettingsDialog extends CustomTrayDialog {
// Create the settings panel control
settings = new SettingsPanelControl(null);
- // Create and add the panels
- for (String terminalLabel : terminals.getItems()) {
- // Get the corresponding delegate
- ILauncherDelegate delegate = label2delegate.get(terminalLabel);
- Assert.isNotNull(delegate);
- // Get the wizard configuration panel instance
- IConfigurationPanel configPanel = delegate.getPanel(settings);
+ // Create, initialize and add the first visible panel. All
+ // other panels are created on demand only.
+ String terminalLabel = SWTControlUtil.getItem(terminals, 0);
+ if (terminalLabel != null) {
+ // Get the corresponding delegate
+ ILauncherDelegate delegate = label2delegate.get(terminalLabel);
+ Assert.isNotNull(delegate);
+ // Get the wizard configuration panel instance
+ IConfigurationPanel configPanel = delegate.getPanel(settings);
if (configPanel == null) configPanel = new EmptySettingsPanel(settings);
// Push the selection to the configuration panel
Assert.isNotNull(configPanel);

Back to the top