mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Terminal: Extended ISettingsPage interface to allow page container to listen to changes on the settings page. Added AbstractSettingsPage implementation.
This commit is contained in:
parent
06073156ab
commit
4271f62a21
43 changed files with 251 additions and 73 deletions
|
@ -13,7 +13,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal"
|
||||
label="%featureName"
|
||||
version="3.2.1.qualifier"
|
||||
version="3.2.2.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal</artifactId>
|
||||
<version>3.2.1-SNAPSHOT</version>
|
||||
<version>3.2.2.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.core.sdk"
|
||||
label="%featureName"
|
||||
version="3.3.1.qualifier"
|
||||
version="3.3.2.qualifier"
|
||||
provider-name="%providerName"
|
||||
image="eclipse_update_120.jpg">
|
||||
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.core.sdk</artifactId>
|
||||
<version>3.3.1-SNAPSHOT</version>
|
||||
<version>3.3.2.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.local"
|
||||
label="%featureName"
|
||||
version="0.2.100.qualifier"
|
||||
version="0.2.200.qualifier"
|
||||
provider-name="%providerName"
|
||||
image="eclipse_update_120.jpg">
|
||||
|
||||
|
@ -41,8 +41,8 @@
|
|||
<import plugin="org.eclipse.debug.core"/>
|
||||
<import plugin="org.eclipse.debug.ui"/>
|
||||
<import plugin="org.eclipse.jface"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.0" match="equivalent"/>
|
||||
<import plugin="org.eclipse.tm.terminal.view" version="2.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
|
||||
<import plugin="org.eclipse.tm.terminal.view" version="2.4.1" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.ui.externaltools"/>
|
||||
</requires>
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.local</artifactId>
|
||||
<version>0.2.100-SNAPSHOT</version>
|
||||
<version>0.2.200.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.local.sdk"
|
||||
label="%featureName"
|
||||
version="0.3.0.qualifier"
|
||||
version="0.3.1.qualifier"
|
||||
provider-name="%providerName"
|
||||
image="eclipse_update_120.jpg">
|
||||
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.local.sdk</artifactId>
|
||||
<version>0.3.0-SNAPSHOT</version>
|
||||
<version>0.3.1.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.sdk</artifactId>
|
||||
<version>3.3.2-SNAPSHOT</version>
|
||||
<version>3.3.2.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.serial"
|
||||
label="%featureName"
|
||||
version="2.1.100.qualifier"
|
||||
version="2.1.200.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<requires>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.0" match="equivalent"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.serial</artifactId>
|
||||
<version>2.1.100-SNAPSHOT</version>
|
||||
<version>2.1.200.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.ssh"
|
||||
label="%featureName"
|
||||
version="2.1.100.qualifier"
|
||||
version="2.1.200.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<requires>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.0" match="equivalent"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
|
||||
<import plugin="org.eclipse.jsch.core" version="1.0.0" match="compatible"/>
|
||||
<import plugin="com.jcraft.jsch" version="0.1.31" match="compatible"/>
|
||||
</requires>
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.ssh</artifactId>
|
||||
<version>2.1.100-SNAPSHOT</version>
|
||||
<version>2.1.200.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.telnet"
|
||||
label="%featureName"
|
||||
version="2.1.100.qualifier"
|
||||
version="2.1.200.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<requires>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.0" match="equivalent"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.telnet</artifactId>
|
||||
<version>2.1.100-SNAPSHOT</version>
|
||||
<version>2.1.200.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.test"
|
||||
label="%featureName"
|
||||
version="2.1.0.qualifier"
|
||||
version="2.1.1.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<requires>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.0" match="equivalent"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
|
||||
<import plugin="org.junit" version="3.8.1" match="compatible"/>
|
||||
<import plugin="org.apache.ant"/>
|
||||
</requires>
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.test</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>2.1.1.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<feature
|
||||
id="org.eclipse.tm.terminal.view"
|
||||
label="%featureName"
|
||||
version="2.4.0.qualifier"
|
||||
version="2.4.1.qualifier"
|
||||
provider-name="%providerName">
|
||||
|
||||
<description>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<requires>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.0" match="equivalent"/>
|
||||
<import plugin="org.eclipse.tm.terminal" version="3.2.2" match="equivalent"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm.features</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.view</artifactId>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<version>2.4.1.qualifier</version>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
</project>
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.local;singleton:=true
|
||||
Bundle-Version: 0.2.100.qualifier
|
||||
Bundle-Version: 0.2.200.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.local.LocalTerminalActivator
|
||||
Bundle-Localization: plugin
|
||||
Bundle-Vendor: %providerName
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.local</artifactId>
|
||||
<version>0.2.100-SNAPSHOT</version>
|
||||
<version>0.2.200.qualifier</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -38,6 +38,7 @@ import org.eclipse.swt.widgets.Table;
|
|||
import org.eclipse.swt.widgets.Widget;
|
||||
import org.eclipse.tm.internal.terminal.local.launch.LocalTerminalLaunchUtilities;
|
||||
import org.eclipse.tm.internal.terminal.local.ui.DependentHeightComposite;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
|
@ -51,8 +52,8 @@ import org.eclipse.ui.PlatformUI;
|
|||
* @author Mirko Raner
|
||||
* @version $Revision: 1.3 $
|
||||
*/
|
||||
public class LocalTerminalSettingsPage
|
||||
implements ISettingsPage, ISelectionChangedListener, SelectionListener {
|
||||
public class LocalTerminalSettingsPage extends AbstractSettingsPage
|
||||
implements ISelectionChangedListener, SelectionListener {
|
||||
|
||||
private ILocalTerminalSettings settings;
|
||||
private TableViewer viewer;
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.serial;singleton:=true
|
||||
Bundle-Version: 2.1.100.qualifier
|
||||
Bundle-Version: 2.1.200.qualifier
|
||||
Bundle-Localization: plugin
|
||||
Import-Package: gnu.io;resolution:=optional
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.serial</artifactId>
|
||||
<version>2.1.100-SNAPSHOT</version>
|
||||
<version>2.1.200.qualifier</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -21,15 +21,19 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
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.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
|
||||
|
||||
public class SerialSettingsPage implements ISettingsPage {
|
||||
public class SerialSettingsPage extends AbstractSettingsPage {
|
||||
private Combo fSerialPortCombo;
|
||||
private Combo fBaudRateCombo;
|
||||
private Combo fDataBitsCombo;
|
||||
|
@ -137,6 +141,11 @@ public class SerialSettingsPage implements ISettingsPage {
|
|||
new Label(composite, SWT.RIGHT).setText(SerialMessages.TIMEOUT + ":"); //$NON-NLS-1$
|
||||
fTimeout = new Text(composite, SWT.BORDER);
|
||||
fTimeout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
fTimeout.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(fTimeout);
|
||||
}
|
||||
});
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
|
@ -148,8 +157,20 @@ public class SerialSettingsPage implements ISettingsPage {
|
|||
int flags=SWT.DROP_DOWN;
|
||||
if(readonly)
|
||||
flags|=SWT.READ_ONLY;
|
||||
Combo combo = new Combo(composite, flags);
|
||||
final Combo combo = new Combo(composite, flags);
|
||||
combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
if (!readonly) {
|
||||
combo.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(combo);
|
||||
}
|
||||
});
|
||||
}
|
||||
combo.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
fireListeners(combo);
|
||||
}
|
||||
});
|
||||
return combo;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.ssh;singleton:=true
|
||||
Bundle-Version: 2.1.100.qualifier
|
||||
Bundle-Version: 2.1.200.qualifier
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.ssh</artifactId>
|
||||
<version>2.1.100-SNAPSHOT</version>
|
||||
<version>2.1.200.qualifier</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -14,14 +14,16 @@
|
|||
package org.eclipse.tm.internal.terminal.ssh;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
|
||||
|
||||
public class SshSettingsPage implements ISettingsPage {
|
||||
public class SshSettingsPage extends AbstractSettingsPage {
|
||||
private Text fHostText;
|
||||
private Text fUser;
|
||||
private Text fTimeout;
|
||||
|
@ -107,8 +109,13 @@ public class SshSettingsPage implements ISettingsPage {
|
|||
|
||||
// Add control
|
||||
gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
Text text= new Text(composite, SWT.BORDER | textOptions);
|
||||
final Text text= new Text(composite, SWT.BORDER | textOptions);
|
||||
text.setLayoutData(gridData);
|
||||
text.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(text);
|
||||
}
|
||||
});
|
||||
return text;
|
||||
}
|
||||
private Text createTextField(Composite composite, String labelTxt) {
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.telnet;singleton:=true
|
||||
Bundle-Version: 2.1.100.qualifier
|
||||
Bundle-Version: 2.1.200.qualifier
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.telnet</artifactId>
|
||||
<version>2.1.100-SNAPSHOT</version>
|
||||
<version>2.1.200.qualifier</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -22,15 +22,19 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
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.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
|
||||
|
||||
public class TelnetSettingsPage implements ISettingsPage {
|
||||
public class TelnetSettingsPage extends AbstractSettingsPage {
|
||||
private Text fHostText;
|
||||
private Combo fNetworkPortCombo;
|
||||
private Text fTimeout;
|
||||
|
@ -123,6 +127,11 @@ public class TelnetSettingsPage implements ISettingsPage {
|
|||
gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
fHostText = new Text(composite, SWT.BORDER);
|
||||
fHostText.setLayoutData(gridData);
|
||||
fHostText.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(fHostText);
|
||||
}
|
||||
});
|
||||
|
||||
// Add label
|
||||
ctlLabel = new Label(composite, SWT.RIGHT);
|
||||
|
@ -131,8 +140,17 @@ public class TelnetSettingsPage implements ISettingsPage {
|
|||
// Add control
|
||||
gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
fNetworkPortCombo = new Combo(composite, SWT.DROP_DOWN);
|
||||
|
||||
fNetworkPortCombo.setLayoutData(gridData);
|
||||
fNetworkPortCombo.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(fNetworkPortCombo);
|
||||
}
|
||||
});
|
||||
fNetworkPortCombo.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
fireListeners(fNetworkPortCombo);
|
||||
}
|
||||
});
|
||||
|
||||
List table = getNetworkPortMap().getNameTable();
|
||||
Collections.sort(table);
|
||||
|
@ -141,6 +159,11 @@ public class TelnetSettingsPage implements ISettingsPage {
|
|||
new Label(composite, SWT.RIGHT).setText(TelnetMessages.TIMEOUT + ":"); //$NON-NLS-1$
|
||||
fTimeout = new Text(composite, SWT.BORDER);
|
||||
fTimeout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
fTimeout.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(fTimeout);
|
||||
}
|
||||
});
|
||||
|
||||
loadSettings();
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.test;singleton:=true
|
||||
Bundle-Version: 2.2.0.qualifier
|
||||
Bundle-Version: 2.2.1.qualifier
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.junit,
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.test</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1.qualifier</version>
|
||||
<packaging>eclipse-test-plugin</packaging>
|
||||
<build>
|
||||
<plugins>
|
||||
|
|
|
@ -124,6 +124,10 @@ public class TerminalConnectorFactoryTest extends TestCase {
|
|||
}
|
||||
public boolean validateSettings() {
|
||||
return false;
|
||||
}
|
||||
public void addListener(Listener listener) {
|
||||
}
|
||||
public void removeListener(Listener listener) {
|
||||
}};
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,12 @@ public class TerminalConnectorTest extends TestCase {
|
|||
}
|
||||
public boolean validateSettings() {
|
||||
return false;
|
||||
}
|
||||
public void addListener(Listener listener) {
|
||||
}
|
||||
public void removeListener(Listener listener) {
|
||||
}};
|
||||
|
||||
}
|
||||
|
||||
public void save(ISettingsStore store) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 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:
|
||||
* 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:
|
||||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.speedtest;
|
||||
|
@ -16,9 +16,9 @@ import org.eclipse.swt.layout.GridLayout;
|
|||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage;
|
||||
import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
|
||||
|
||||
public class SpeedTestSettingsPage implements ISettingsPage {
|
||||
public class SpeedTestSettingsPage extends AbstractSettingsPage {
|
||||
final SpeedTestSettings fSettings;
|
||||
Text fInputFile;
|
||||
Text fBufferSize;
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal.view;singleton:=true
|
||||
Bundle-Version: 2.4.0.qualifier
|
||||
Bundle-Version: 2.4.1.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.view.TerminalViewPlugin
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal.view</artifactId>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<version>2.4.1.qualifier</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.dialogs.IDialogSettings;
|
||||
|
@ -121,6 +122,8 @@ class TerminalSettingsDlg extends Dialog {
|
|||
public void loadSettings() {}
|
||||
public void saveSettings() {}
|
||||
public boolean validateSettings() {return false;}
|
||||
public void addListener(Listener listener) {}
|
||||
public void removeListener(Listener listener) {}
|
||||
};
|
||||
} else {
|
||||
fPages[i]=fConnectors[i].makeSettingsPage();
|
||||
|
@ -259,11 +262,11 @@ class TerminalSettingsDlg extends Dialog {
|
|||
fTerminalTitleText = new Text(wndGroup, SWT.BORDER);
|
||||
fTerminalTitleText.setText(fTerminalTitle);
|
||||
fTerminalTitleText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
|
||||
|
||||
Label encodingLabel=new Label(wndGroup,SWT.NONE);
|
||||
encodingLabel.setText(ViewMessages.ENCODING);
|
||||
encodingLabel.setLayoutData(new GridData(GridData.BEGINNING));
|
||||
|
||||
|
||||
fEncodingCombo = new Combo(wndGroup, SWT.DROP_DOWN);
|
||||
fEncodingCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
}
|
||||
|
@ -294,7 +297,7 @@ class TerminalSettingsDlg extends Dialog {
|
|||
fPageBook=new PageBook(group,SWT.NONE);
|
||||
fPageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
}
|
||||
|
||||
|
||||
private void setupListeners() {
|
||||
if(fCtlConnTypeCombo==null)
|
||||
return;
|
||||
|
@ -356,10 +359,10 @@ class TerminalSettingsDlg extends Dialog {
|
|||
//TODO when moving to J2SE-1.5, restore the simpler way getting the default encoding
|
||||
//String hostEncoding =Charset.defaultCharset().displayName();
|
||||
String hostEncoding = new java.io.InputStreamReader(new java.io.ByteArrayInputStream(new byte[0])).getEncoding();
|
||||
if (!encodings.contains(hostEncoding))
|
||||
if (!encodings.contains(hostEncoding))
|
||||
encodings.add(hostEncoding);
|
||||
populateEncodingsCombo(encodings);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
private void populateEncodingsCombo(List encodings) {
|
||||
|
@ -394,7 +397,7 @@ class TerminalSettingsDlg extends Dialog {
|
|||
mb.open();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
private void setCombo(Combo combo,String value) {
|
||||
if(value==null)
|
||||
return;
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.tm.terminal; singleton:=true
|
||||
Bundle-Version: 3.2.1.qualifier
|
||||
Bundle-Version: 3.2.2.qualifier
|
||||
Bundle-Activator: org.eclipse.tm.internal.terminal.control.impl.TerminalPlugin
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
</parent>
|
||||
<groupId>org.eclipse.tm</groupId>
|
||||
<artifactId>org.eclipse.tm.terminal</artifactId>
|
||||
<version>3.2.1-SNAPSHOT</version>
|
||||
<version>3.2.2.qualifier</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
/*******************************************************************************
|
||||
* 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.tm.internal.terminal.provisional.api;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.jface.dialogs.IMessageProvider;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
/**
|
||||
* Abstract settings page providing a common implementation of the listener handling.
|
||||
*/
|
||||
public abstract class AbstractSettingsPage implements ISettingsPage, IMessageProvider {
|
||||
// A message associated with the control.
|
||||
private String message = null;
|
||||
|
||||
// The message type of the associated message.
|
||||
private int messageType = IMessageProvider.NONE;
|
||||
|
||||
// Reference to the listener
|
||||
private final ListenerList listeners = new ListenerList();
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#addListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener)
|
||||
*/
|
||||
public void addListener(Listener listener) {
|
||||
Assert.isNotNull(listener);
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage#removeListener(org.eclipse.tm.internal.terminal.provisional.api.ISettingsPage.Listener)
|
||||
*/
|
||||
public void removeListener(Listener listener) {
|
||||
Assert.isNotNull(listener);
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire the listeners for the given control.
|
||||
*
|
||||
* @param control The control or <code>null</code>.
|
||||
*/
|
||||
public void fireListeners(Control control) {
|
||||
Object[] list = listeners.getListeners();
|
||||
for (int i = 0; i < list.length; i++) {
|
||||
Object l = list[i];
|
||||
if (!(l instanceof Listener)) continue;
|
||||
((Listener)l).onSettingsPageChanged(control);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.dialogs.IMessageProvider#getMessage()
|
||||
*/
|
||||
public final String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.dialogs.IMessageProvider#getMessageType()
|
||||
*/
|
||||
public final int getMessageType() {
|
||||
return messageType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the message and the message type.
|
||||
*
|
||||
* @param message The message or <code>null</code>.
|
||||
* @param messageType The type of the message (NONE, INFORMATION, WARNING, ERROR).
|
||||
*/
|
||||
public final void setMessage(String message, int messageType) {
|
||||
this.message = message;
|
||||
this.messageType = messageType;
|
||||
}
|
||||
}
|
|
@ -1,17 +1,18 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2011 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:
|
||||
* 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:
|
||||
* Michael Scharf (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.internal.terminal.provisional.api;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
/**
|
||||
* @author Michael Scharf
|
||||
|
@ -27,6 +28,18 @@ import org.eclipse.swt.widgets.Composite;
|
|||
* </p>
|
||||
*/
|
||||
public interface ISettingsPage {
|
||||
|
||||
public interface Listener {
|
||||
|
||||
/**
|
||||
* Invoked by settings page controls to signal that the settings page
|
||||
* changed and page container may update their state.
|
||||
*
|
||||
* @param control The control which triggered the event or <code>null</code>
|
||||
*/
|
||||
public void onSettingsPageChanged(Control control);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a page to be shown in a dialog or wizard to setup the connection.
|
||||
* @param parent
|
||||
|
@ -44,8 +57,25 @@ public interface ISettingsPage {
|
|||
void saveSettings();
|
||||
|
||||
/**
|
||||
* @return true if the
|
||||
* @return true if the
|
||||
*/
|
||||
boolean validateSettings();
|
||||
|
||||
|
||||
/**
|
||||
* Adds the given listener.
|
||||
* <p>
|
||||
* Has not effect if the same listener is already registered.
|
||||
*
|
||||
* @param listener The listener. Must not be <code>null</code>.
|
||||
*/
|
||||
public void addListener(Listener listener);
|
||||
|
||||
/**
|
||||
* Removes the given listener.
|
||||
* <p>
|
||||
* Has no effect if the same listener was not registered.
|
||||
*
|
||||
* @param listener The listener. Must not be <code>null</code>.
|
||||
*/
|
||||
public void removeListener(Listener listener);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue