mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Cleanup: Fix some warnings
This commit is contained in:
parent
5ef6efe70a
commit
ca86c90468
15 changed files with 108 additions and 84 deletions
|
@ -38,7 +38,6 @@ import org.eclipse.tm.internal.terminal.provisional.api.Logger;
|
|||
import org.eclipse.tm.internal.terminal.provisional.api.TerminalState;
|
||||
import org.eclipse.tm.terminal.connector.serial.nls.Messages;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public class SerialConnectWorker extends Thread {
|
||||
/* default */ final ITerminalControl fControl;
|
||||
private final SerialConnector fConn;
|
||||
|
|
|
@ -38,7 +38,6 @@ import org.eclipse.tm.internal.terminal.provisional.api.provider.TerminalConnect
|
|||
import org.eclipse.tm.terminal.connector.serial.activator.UIPlugin;
|
||||
import org.eclipse.tm.terminal.connector.serial.nls.Messages;
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public class SerialConnector extends TerminalConnectorImpl {
|
||||
private OutputStream fOutputStream;
|
||||
private InputStream fInputStream;
|
||||
|
|
|
@ -33,7 +33,6 @@ import org.eclipse.tm.terminal.connector.serial.nls.Messages;
|
|||
/**
|
||||
* UNDER CONSTRUCTION
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
public class SerialPortHandler implements SerialPortEventListener, CommPortOwnershipListener {
|
||||
|
||||
/* default */ final ITerminalControl fControl;
|
||||
|
|
|
@ -11,25 +11,25 @@
|
|||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - extracted from TerminalProperties
|
||||
* Michael Scharf (Wind River) - extracted from TerminalProperties
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.connector.serial.connector;
|
||||
|
||||
import gnu.io.CommPortIdentifier;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
public class SerialProperties {
|
||||
protected List fSerialPortTable;
|
||||
protected List fBaudRateTable;
|
||||
protected List fDataBitsTable;
|
||||
protected List fStopBitsTable;
|
||||
protected List fParityTable;
|
||||
protected List fFlowControlTable;
|
||||
protected List<String> fSerialPortTable;
|
||||
protected List<String> fBaudRateTable;
|
||||
protected List<String> fDataBitsTable;
|
||||
protected List<String> fStopBitsTable;
|
||||
protected List<String> fParityTable;
|
||||
protected List<String> fFlowControlTable;
|
||||
protected String fDefaultConnType;
|
||||
protected String fDefaultSerialPort;
|
||||
protected String fDefaultBaudRate;
|
||||
|
@ -41,27 +41,27 @@ public class SerialProperties {
|
|||
public SerialProperties() {
|
||||
setupProperties();
|
||||
}
|
||||
public List getSerialPortTable() {
|
||||
public List<String> getSerialPortTable() {
|
||||
return fSerialPortTable;
|
||||
}
|
||||
|
||||
public List getBaudRateTable() {
|
||||
public List<String> getBaudRateTable() {
|
||||
return fBaudRateTable;
|
||||
}
|
||||
|
||||
public List getDataBitsTable() {
|
||||
public List<String> getDataBitsTable() {
|
||||
return fDataBitsTable;
|
||||
}
|
||||
|
||||
public List getStopBitsTable() {
|
||||
public List<String> getStopBitsTable() {
|
||||
return fStopBitsTable;
|
||||
}
|
||||
|
||||
public List getParityTable() {
|
||||
public List<String> getParityTable() {
|
||||
return fParityTable;
|
||||
}
|
||||
|
||||
public List getFlowControlTable() {
|
||||
public List<String> getFlowControlTable() {
|
||||
return fFlowControlTable;
|
||||
}
|
||||
public String getDefaultConnType() {
|
||||
|
@ -95,12 +95,12 @@ public class SerialProperties {
|
|||
return "5"; //$NON-NLS-1$
|
||||
}
|
||||
protected void setupProperties() {
|
||||
fSerialPortTable = new Vector();
|
||||
fBaudRateTable = new Vector();
|
||||
fDataBitsTable = new Vector();
|
||||
fStopBitsTable = new Vector();
|
||||
fParityTable = new Vector();
|
||||
fFlowControlTable = new Vector();
|
||||
fSerialPortTable = new ArrayList<String>();
|
||||
fBaudRateTable = new ArrayList<String>();
|
||||
fDataBitsTable = new ArrayList<String>();
|
||||
fStopBitsTable = new ArrayList<String>();
|
||||
fParityTable = new ArrayList<String>();
|
||||
fFlowControlTable = new ArrayList<String>();
|
||||
fDefaultConnType = ""; //$NON-NLS-1$
|
||||
fDefaultSerialPort = ""; //$NON-NLS-1$
|
||||
fDefaultBaudRate = ""; //$NON-NLS-1$
|
||||
|
@ -138,15 +138,15 @@ public class SerialProperties {
|
|||
fFlowControlTable.add("RTS/CTS"); //$NON-NLS-1$
|
||||
fFlowControlTable.add("Xon/Xoff"); //$NON-NLS-1$
|
||||
|
||||
fDefaultBaudRate = (String) fBaudRateTable.get(4);
|
||||
fDefaultDataBits = (String) fDataBitsTable.get(3);
|
||||
fDefaultStopBits = (String) fStopBitsTable.get(0);
|
||||
fDefaultParity = (String) fParityTable.get(0);
|
||||
fDefaultFlowControl = (String) fFlowControlTable.get(0);
|
||||
fDefaultBaudRate = fBaudRateTable.get(4);
|
||||
fDefaultDataBits = fDataBitsTable.get(3);
|
||||
fDefaultStopBits = fStopBitsTable.get(0);
|
||||
fDefaultParity = fParityTable.get(0);
|
||||
fDefaultFlowControl = fFlowControlTable.get(0);
|
||||
|
||||
Enumeration portIdEnum= CommPortIdentifier.getPortIdentifiers();
|
||||
Enumeration<CommPortIdentifier> portIdEnum= CommPortIdentifier.getPortIdentifiers();
|
||||
while (portIdEnum.hasMoreElements()) {
|
||||
CommPortIdentifier identifier = (CommPortIdentifier) portIdEnum.nextElement();
|
||||
CommPortIdentifier identifier = portIdEnum.nextElement();
|
||||
String strName = identifier.getName();
|
||||
int nPortType = identifier.getPortType();
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class SerialProperties {
|
|||
Collections.sort(fSerialPortTable);
|
||||
|
||||
if (!fSerialPortTable.isEmpty()) {
|
||||
fDefaultSerialPort = (String) fSerialPortTable.get(0);
|
||||
fDefaultSerialPort = fSerialPortTable.get(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
protected String fTimeout;
|
||||
final private SerialProperties fProperties=new SerialProperties();
|
||||
|
||||
public String getSerialPort() {
|
||||
@Override
|
||||
public String getSerialPort() {
|
||||
return fSerialPort;
|
||||
}
|
||||
|
||||
|
@ -42,7 +43,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
return fBaudRate;
|
||||
}
|
||||
|
||||
public int getBaudRate() {
|
||||
@Override
|
||||
public int getBaudRate() {
|
||||
int nBaudRate;
|
||||
|
||||
try {
|
||||
|
@ -62,7 +64,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
return fDataBits;
|
||||
}
|
||||
|
||||
public int getDataBits() {
|
||||
@Override
|
||||
public int getDataBits() {
|
||||
if (fDataBits.equals("5")) { //$NON-NLS-1$
|
||||
return SerialPort.DATABITS_5;
|
||||
} else if (fDataBits.equals("6")) { //$NON-NLS-1$
|
||||
|
@ -82,7 +85,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
return fStopBits;
|
||||
}
|
||||
|
||||
public int getStopBits() {
|
||||
@Override
|
||||
public int getStopBits() {
|
||||
if (fStopBits.equals("1_5")) { //$NON-NLS-1$
|
||||
return SerialPort.STOPBITS_1_5;
|
||||
} else if (fStopBits.equals("2")) { //$NON-NLS-1$
|
||||
|
@ -100,7 +104,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
return fParity;
|
||||
}
|
||||
|
||||
public int getParity() {
|
||||
@Override
|
||||
public int getParity() {
|
||||
if (fParity.equals("Even")) //$NON-NLS-1$
|
||||
{
|
||||
return SerialPort.PARITY_EVEN;
|
||||
|
@ -127,7 +132,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
return fFlowControl;
|
||||
}
|
||||
|
||||
public int getFlowControl() {
|
||||
@Override
|
||||
public int getFlowControl() {
|
||||
if (fFlowControl.equals("RTS/CTS")) //$NON-NLS-1$
|
||||
{
|
||||
return SerialPort.FLOWCONTROL_RTSCTS_IN;
|
||||
|
@ -144,7 +150,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
fFlowControl = strFlow;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
@Override
|
||||
public String getSummary() {
|
||||
return getSerialPort() + ", " + //$NON-NLS-1$
|
||||
getBaudRateString() + ", " + //$NON-NLS-1$
|
||||
getDataBitsString() + ", " + //$NON-NLS-1$
|
||||
|
@ -153,7 +160,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
getFlowControlString();
|
||||
}
|
||||
|
||||
public void load(ISettingsStore store) {
|
||||
@Override
|
||||
public void load(ISettingsStore store) {
|
||||
fSerialPort = store.get("SerialPort", fProperties.getDefaultSerialPort());//$NON-NLS-1$
|
||||
fBaudRate = store.get("BaudRate", fProperties.getDefaultBaudRate());//$NON-NLS-1$
|
||||
fDataBits = store.get("DataBits", fProperties.getDefaultDataBits());//$NON-NLS-1$
|
||||
|
@ -163,7 +171,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
fTimeout = store.get("Timeout",fProperties.getDefaultTimeout()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void save(ISettingsStore store) {
|
||||
@Override
|
||||
public void save(ISettingsStore store) {
|
||||
store.put("SerialPort", fSerialPort); //$NON-NLS-1$
|
||||
store.put("BaudRate", fBaudRate); //$NON-NLS-1$
|
||||
store.put("DataBits", fDataBits); //$NON-NLS-1$
|
||||
|
@ -176,7 +185,8 @@ public class SerialSettings implements ISerialSettings {
|
|||
return fProperties;
|
||||
}
|
||||
|
||||
public int getTimeout() {
|
||||
@Override
|
||||
public int getTimeout() {
|
||||
try {
|
||||
return Integer.parseInt(fTimeout);
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
|
|
|
@ -132,7 +132,8 @@ protected Control createDialogArea(Composite parent) {
|
|||
*
|
||||
* @param parent the parent of the widgets
|
||||
*/
|
||||
protected void createPasswordFields(Composite parent) {
|
||||
@SuppressWarnings("unused")
|
||||
protected void createPasswordFields(Composite parent) {
|
||||
texts=new Text[prompt.length];
|
||||
|
||||
for(int i=0; i<prompt.length; i++){
|
||||
|
|
|
@ -50,7 +50,7 @@ import com.jcraft.jsch.UserInfo;
|
|||
|
||||
public class SshConnection extends Thread {
|
||||
private static int fgNo;
|
||||
private final ITerminalControl fControl;
|
||||
/* default */ final ITerminalControl fControl;
|
||||
private final SshConnector fConn;
|
||||
private Session fSession;
|
||||
private boolean fDisconnectHasBeenCalled;
|
||||
|
@ -192,7 +192,7 @@ public class SshConnection extends Thread {
|
|||
}
|
||||
}
|
||||
|
||||
private synchronized boolean isSessionConnected() {
|
||||
/* default */ synchronized boolean isSessionConnected() {
|
||||
return !fDisconnectHasBeenCalled && fSession != null && fSession.isConnected();
|
||||
}
|
||||
|
||||
|
@ -238,8 +238,8 @@ public class SshConnection extends Thread {
|
|||
}
|
||||
|
||||
private class MyUserInfo implements UserInfo, UIKeyboardInteractive {
|
||||
private final String fConnectionId;
|
||||
private final String fUser;
|
||||
/* default */ final String fConnectionId;
|
||||
/* default */ final String fUser;
|
||||
private String fPassword;
|
||||
private String fPassphrase;
|
||||
private int fAttemptCount;
|
||||
|
|
|
@ -43,7 +43,6 @@ import org.eclipse.tm.terminal.view.ui.panels.AbstractExtendedConfigurationPanel
|
|||
/**
|
||||
* SSH wizard configuration panel implementation.
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
public class SshWizardConfigurationPanel extends AbstractExtendedConfigurationPanel {
|
||||
|
||||
private static final String SAVE_USER = "saveUser"; //$NON-NLS-1$
|
||||
|
|
|
@ -110,7 +110,7 @@ public class SshLauncherDelegate extends AbstractLauncherDelegate {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
@Override
|
||||
public Object getAdapter(Class adapter) {
|
||||
if (IMementoHandler.class.equals(adapter)) {
|
||||
return mementoHandler;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* Helmut Haigermoser and Ted Williams.
|
||||
*
|
||||
* Contributors:
|
||||
* Michael Scharf (Wind River) - extracted from TerminalNetworkPortMap
|
||||
* Michael Scharf (Wind River) - extracted from TerminalNetworkPortMap
|
||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.connector.telnet.connector;
|
||||
|
@ -52,8 +52,8 @@ public class NetworkPortMap {
|
|||
return null;
|
||||
}
|
||||
|
||||
public List getNameTable() {
|
||||
List names=new ArrayList();
|
||||
public List<String> getNameTable() {
|
||||
List<String> names=new ArrayList<String>();
|
||||
for (int i = 0; i < fPortMap.length; i++) {
|
||||
names.add(fPortMap[i][0]);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ class TelnetConnectWorker extends Thread {
|
|||
fConn = conn;
|
||||
fControl.setState(TerminalState.CONNECTING);
|
||||
}
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Retry the connect with after a little pause in case the
|
||||
// remote telnet server isn't ready. ConnectExceptions might
|
||||
// happen if the telnet server process did not initialized itself.
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* Michael Scharf (Wind River) - [209665] Add ability to log byte streams from terminal
|
||||
* Alex Panchenko (Xored) - [277061] TelnetConnection.isConnected() should check if socket was not closed
|
||||
* Uwe Stieber (Wind River) - [281329] Telnet connection not handling "SocketException: Connection reset" correct
|
||||
* Nils Hagge (Siemens AG) - [276023] close socket streams after connection is disconnected
|
||||
* Nils Hagge (Siemens AG) - [276023] close socket streams after connection is disconnected
|
||||
*******************************************************************************/
|
||||
package org.eclipse.tm.terminal.connector.telnet.connector;
|
||||
|
||||
|
@ -294,7 +294,8 @@ public class TelnetConnection extends Thread implements TelnetCodes {
|
|||
* them), and passes the remaining bytes to a TerminalDisplay object for
|
||||
* display.
|
||||
*/
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
Logger.log("Entered"); //$NON-NLS-1$
|
||||
|
||||
try {
|
||||
|
@ -314,16 +315,16 @@ public class TelnetConnection extends Thread implements TelnetCodes {
|
|||
// closed.
|
||||
terminalControl.setState(TerminalState.CLOSED);
|
||||
break;
|
||||
} else {
|
||||
// Process any TELNET protocol data that we receive. Don't
|
||||
// send any TELNET protocol data until we are sure the remote
|
||||
// endpoint is a TELNET server.
|
||||
}
|
||||
|
||||
int nProcessedBytes = processTelnetProtocol(nRawBytes);
|
||||
// Process any TELNET protocol data that we receive. Don't
|
||||
// send any TELNET protocol data until we are sure the remote
|
||||
// endpoint is a TELNET server.
|
||||
|
||||
if (nProcessedBytes > 0) {
|
||||
terminalControl.getRemoteToTerminalOutputStream().write(processedBytes, 0, nProcessedBytes);
|
||||
}
|
||||
int nProcessedBytes = processTelnetProtocol(nRawBytes);
|
||||
|
||||
if (nProcessedBytes > 0) {
|
||||
terminalControl.getRemoteToTerminalOutputStream().write(processedBytes, 0, nProcessedBytes);
|
||||
}
|
||||
}
|
||||
} catch (SocketException ex) {
|
||||
|
|
|
@ -590,7 +590,8 @@ class TelnetOption implements TelnetCodes
|
|||
// is _bad_ (it hangs the GUI).
|
||||
|
||||
Thread t=new Thread() {
|
||||
public void run() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
outputStream.write(NAWSDataFinal);
|
||||
} catch (IOException ex) {
|
||||
|
|
|
@ -23,7 +23,8 @@ public class TelnetSettings implements ITelnetSettings {
|
|||
protected String fNetworkPort;
|
||||
protected String fTimeout;
|
||||
private final TelnetProperties fProperties=new TelnetProperties();
|
||||
public String getHost() {
|
||||
@Override
|
||||
public String getHost() {
|
||||
return fHost;
|
||||
}
|
||||
|
||||
|
@ -35,7 +36,8 @@ public class TelnetSettings implements ITelnetSettings {
|
|||
return fNetworkPort;
|
||||
}
|
||||
|
||||
public int getNetworkPort() {
|
||||
@Override
|
||||
public int getNetworkPort() {
|
||||
try {
|
||||
return Integer.parseInt(fNetworkPort);
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
|
@ -47,17 +49,20 @@ public class TelnetSettings implements ITelnetSettings {
|
|||
fNetworkPort = strNetworkPort;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
@Override
|
||||
public String getSummary() {
|
||||
return getHost() + ":" + getNetworkPortString(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void load(ISettingsStore store) {
|
||||
@Override
|
||||
public void load(ISettingsStore store) {
|
||||
fHost = store.get("Host", fProperties.getDefaultHost());//$NON-NLS-1$
|
||||
fNetworkPort = store.get("NetworkPort", fProperties.getDefaultNetworkPort());//$NON-NLS-1$
|
||||
fTimeout = store.get("Timeout","10");//$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
public void save(ISettingsStore store) {
|
||||
@Override
|
||||
public void save(ISettingsStore store) {
|
||||
store.put("Host", fHost);//$NON-NLS-1$
|
||||
store.put("NetworkPort", fNetworkPort);//$NON-NLS-1$
|
||||
store.put("Timeout", fTimeout);//$NON-NLS-1$
|
||||
|
@ -66,7 +71,8 @@ public class TelnetSettings implements ITelnetSettings {
|
|||
public TelnetProperties getProperties() {
|
||||
return fProperties;
|
||||
}
|
||||
public int getTimeout() {
|
||||
@Override
|
||||
public int getTimeout() {
|
||||
try {
|
||||
return Integer.parseInt(fTimeout);
|
||||
} catch (NumberFormatException numberFormatException) {
|
||||
|
|
|
@ -38,21 +38,23 @@ import org.eclipse.swt.widgets.Text;
|
|||
import org.eclipse.tm.internal.terminal.provisional.api.AbstractSettingsPage;
|
||||
|
||||
public class TelnetSettingsPage extends AbstractSettingsPage {
|
||||
private Text fHostText;
|
||||
private Combo fNetworkPortCombo;
|
||||
private Text fTimeout;
|
||||
/* default */ Text fHostText;
|
||||
/* default */ Combo fNetworkPortCombo;
|
||||
/* default */ Text fTimeout;
|
||||
private final TelnetSettings fTerminalSettings;
|
||||
|
||||
public TelnetSettingsPage(TelnetSettings settings) {
|
||||
fTerminalSettings=settings;
|
||||
}
|
||||
public void saveSettings() {
|
||||
@Override
|
||||
public void saveSettings() {
|
||||
fTerminalSettings.setHost(fHostText.getText());
|
||||
fTerminalSettings.setTimeout(fTimeout.getText());
|
||||
fTerminalSettings.setNetworkPort(getNetworkPort());
|
||||
}
|
||||
|
||||
public void loadSettings() {
|
||||
@Override
|
||||
public void loadSettings() {
|
||||
if(fTerminalSettings!=null) {
|
||||
setHost(fTerminalSettings.getHost());
|
||||
setTimeout(fTerminalSettings.getTimeoutString());
|
||||
|
@ -95,7 +97,8 @@ public class TelnetSettingsPage extends AbstractSettingsPage {
|
|||
return fTerminalSettings.getProperties().getNetworkPortMap();
|
||||
}
|
||||
|
||||
public boolean validateSettings() {
|
||||
@Override
|
||||
public boolean validateSettings() {
|
||||
String message = null;
|
||||
int messageType = IMessageProvider.NONE;
|
||||
boolean valid = true;
|
||||
|
@ -144,7 +147,8 @@ public class TelnetSettingsPage extends AbstractSettingsPage {
|
|||
return valid;
|
||||
}
|
||||
|
||||
public void createControl(Composite parent) {
|
||||
@Override
|
||||
public void createControl(Composite parent) {
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
GridLayout gridLayout = new GridLayout(2, false);
|
||||
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
|
@ -162,7 +166,8 @@ public class TelnetSettingsPage extends AbstractSettingsPage {
|
|||
fHostText = new Text(composite, SWT.BORDER);
|
||||
fHostText.setLayoutData(gridData);
|
||||
fHostText.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(fHostText);
|
||||
}
|
||||
});
|
||||
|
@ -177,18 +182,20 @@ public class TelnetSettingsPage extends AbstractSettingsPage {
|
|||
fNetworkPortCombo = new Combo(composite, SWT.DROP_DOWN);
|
||||
fNetworkPortCombo.setLayoutData(gridData);
|
||||
fNetworkPortCombo.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(fNetworkPortCombo);
|
||||
}
|
||||
});
|
||||
fNetworkPortCombo.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
fireListeners(fNetworkPortCombo);
|
||||
}
|
||||
});
|
||||
createControlDecoration(fNetworkPortCombo);
|
||||
|
||||
List table = getNetworkPortMap().getNameTable();
|
||||
List<String> table = getNetworkPortMap().getNameTable();
|
||||
Collections.sort(table);
|
||||
loadCombo(fNetworkPortCombo, table);
|
||||
|
||||
|
@ -196,7 +203,8 @@ public class TelnetSettingsPage extends AbstractSettingsPage {
|
|||
fTimeout = new Text(composite, SWT.BORDER);
|
||||
fTimeout.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
fTimeout.addModifyListener(new ModifyListener() {
|
||||
public void modifyText(ModifyEvent e) {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
fireListeners(fTimeout);
|
||||
}
|
||||
});
|
||||
|
@ -204,9 +212,9 @@ public class TelnetSettingsPage extends AbstractSettingsPage {
|
|||
|
||||
loadSettings();
|
||||
}
|
||||
private void loadCombo(Combo ctlCombo, List table) {
|
||||
for (Iterator iter = table.iterator(); iter.hasNext();) {
|
||||
String label = (String) iter.next();
|
||||
private void loadCombo(Combo ctlCombo, List<String> table) {
|
||||
for (Iterator<String> iter = table.iterator(); iter.hasNext();) {
|
||||
String label = iter.next();
|
||||
ctlCombo.add(label);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue