mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +02:00
Bug 488419 - Make the NewSerialPortConnectionWizard public
Also changed a number of variables in the NewSerialPortConnectionWizardPage to be private and use getters for access. Change-Id: Ib677be603efaf1cab57879c628991b86bc796f47 Signed-off-by: Jonathan Williams <jonwilliams@qnx.com>
This commit is contained in:
parent
2269b3cf6d
commit
ad4c9cf354
4 changed files with 44 additions and 15 deletions
|
@ -14,3 +14,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||||
Bundle-ActivationPolicy: lazy
|
Bundle-ActivationPolicy: lazy
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
Export-Package: org.eclipse.remote.serial.ui
|
||||||
|
|
|
@ -20,6 +20,7 @@ import org.eclipse.remote.core.IRemoteConnection;
|
||||||
import org.eclipse.remote.core.IRemoteConnectionType;
|
import org.eclipse.remote.core.IRemoteConnectionType;
|
||||||
import org.eclipse.remote.core.IRemoteConnectionType.Service;
|
import org.eclipse.remote.core.IRemoteConnectionType.Service;
|
||||||
import org.eclipse.remote.core.exception.RemoteConnectionException;
|
import org.eclipse.remote.core.exception.RemoteConnectionException;
|
||||||
|
import org.eclipse.remote.serial.ui.NewSerialPortConnectionWizard;
|
||||||
import org.eclipse.remote.ui.AbstractRemoteUIConnectionService;
|
import org.eclipse.remote.ui.AbstractRemoteUIConnectionService;
|
||||||
import org.eclipse.remote.ui.IRemoteUIConnectionService;
|
import org.eclipse.remote.ui.IRemoteUIConnectionService;
|
||||||
import org.eclipse.remote.ui.IRemoteUIConnectionWizard;
|
import org.eclipse.remote.ui.IRemoteUIConnectionWizard;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - initial contribution
|
* QNX Software Systems - initial contribution
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.remote.serial.internal.ui;
|
package org.eclipse.remote.serial.ui;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import org.eclipse.remote.core.IRemoteConnectionType;
|
||||||
import org.eclipse.remote.core.IRemoteConnectionWorkingCopy;
|
import org.eclipse.remote.core.IRemoteConnectionWorkingCopy;
|
||||||
import org.eclipse.remote.core.exception.RemoteConnectionException;
|
import org.eclipse.remote.core.exception.RemoteConnectionException;
|
||||||
import org.eclipse.remote.serial.core.ISerialPortService;
|
import org.eclipse.remote.serial.core.ISerialPortService;
|
||||||
|
import org.eclipse.remote.serial.internal.ui.Activator;
|
||||||
import org.eclipse.remote.ui.IRemoteUIConnectionWizard;
|
import org.eclipse.remote.ui.IRemoteUIConnectionWizard;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
@ -45,11 +46,11 @@ public class NewSerialPortConnectionWizard extends Wizard implements IRemoteUICo
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
workingCopy.setAttribute(ISerialPortService.PORT_NAME_ATTR, page.portName);
|
workingCopy.setAttribute(ISerialPortService.PORT_NAME_ATTR, page.getPortName());
|
||||||
workingCopy.setAttribute(ISerialPortService.BAUD_RATE_ATTR, Integer.toString(page.baudRateIndex));
|
workingCopy.setAttribute(ISerialPortService.BAUD_RATE_ATTR, Integer.toString(page.getBaudRateIndex()));
|
||||||
workingCopy.setAttribute(ISerialPortService.BYTE_SIZE_ATTR, Integer.toString(page.byteSizeIndex));
|
workingCopy.setAttribute(ISerialPortService.BYTE_SIZE_ATTR, Integer.toString(page.getByteSizeIndex()));
|
||||||
workingCopy.setAttribute(ISerialPortService.PARITY_ATTR, Integer.toString(page.parityIndex));
|
workingCopy.setAttribute(ISerialPortService.PARITY_ATTR, Integer.toString(page.getParityIndex()));
|
||||||
workingCopy.setAttribute(ISerialPortService.STOP_BITS_ATTR, Integer.toString(page.stopBitsIndex));
|
workingCopy.setAttribute(ISerialPortService.STOP_BITS_ATTR, Integer.toString(page.getStopBitsIndex()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +69,7 @@ public class NewSerialPortConnectionWizard extends Wizard implements IRemoteUICo
|
||||||
public IRemoteConnectionWorkingCopy getConnection() {
|
public IRemoteConnectionWorkingCopy getConnection() {
|
||||||
if (workingCopy == null) {
|
if (workingCopy == null) {
|
||||||
try {
|
try {
|
||||||
workingCopy = connectionType.newConnection(page.name);
|
workingCopy = connectionType.newConnection(page.getName());
|
||||||
} catch (RemoteConnectionException e) {
|
} catch (RemoteConnectionException e) {
|
||||||
Activator.log(e.getStatus());
|
Activator.log(e.getStatus());
|
||||||
}
|
}
|
|
@ -8,7 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - initial contribution
|
* QNX Software Systems - initial contribution
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.remote.serial.internal.ui;
|
package org.eclipse.remote.serial.ui;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@ import org.eclipse.cdt.serial.Parity;
|
||||||
import org.eclipse.cdt.serial.SerialPort;
|
import org.eclipse.cdt.serial.SerialPort;
|
||||||
import org.eclipse.cdt.serial.StopBits;
|
import org.eclipse.cdt.serial.StopBits;
|
||||||
import org.eclipse.jface.wizard.WizardPage;
|
import org.eclipse.jface.wizard.WizardPage;
|
||||||
|
import org.eclipse.remote.serial.internal.ui.Activator;
|
||||||
|
import org.eclipse.remote.serial.internal.ui.Messages;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.KeyEvent;
|
import org.eclipse.swt.events.KeyEvent;
|
||||||
import org.eclipse.swt.events.KeyListener;
|
import org.eclipse.swt.events.KeyListener;
|
||||||
|
@ -32,12 +34,12 @@ import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
public class NewSerialPortConnectionWizardPage extends WizardPage {
|
public class NewSerialPortConnectionWizardPage extends WizardPage {
|
||||||
|
|
||||||
String name;
|
private String name;
|
||||||
String portName;
|
private String portName;
|
||||||
int baudRateIndex;
|
private int baudRateIndex;
|
||||||
int byteSizeIndex;
|
private int byteSizeIndex;
|
||||||
int parityIndex;
|
private int parityIndex;
|
||||||
int stopBitsIndex;
|
private int stopBitsIndex;
|
||||||
|
|
||||||
private String[] portNames;
|
private String[] portNames;
|
||||||
|
|
||||||
|
@ -48,7 +50,7 @@ public class NewSerialPortConnectionWizardPage extends WizardPage {
|
||||||
private Combo parityCombo;
|
private Combo parityCombo;
|
||||||
private Combo stopBitsCombo;
|
private Combo stopBitsCombo;
|
||||||
|
|
||||||
protected NewSerialPortConnectionWizardPage() {
|
public NewSerialPortConnectionWizardPage() {
|
||||||
super(NewSerialPortConnectionWizardPage.class.getName());
|
super(NewSerialPortConnectionWizardPage.class.getName());
|
||||||
setDescription(Messages.NewSerialPortConnectionWizardPage_Description);
|
setDescription(Messages.NewSerialPortConnectionWizardPage_Description);
|
||||||
setTitle(Messages.NewSerialPortConnectionWizardPage_Title);
|
setTitle(Messages.NewSerialPortConnectionWizardPage_Title);
|
||||||
|
@ -180,4 +182,28 @@ public class NewSerialPortConnectionWizardPage extends WizardPage {
|
||||||
setPageComplete(!name.isEmpty() && portName != null);
|
setPageComplete(!name.isEmpty() && portName != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPortName() {
|
||||||
|
return portName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBaudRateIndex() {
|
||||||
|
return baudRateIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getByteSizeIndex() {
|
||||||
|
return byteSizeIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getParityIndex() {
|
||||||
|
return parityIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStopBitsIndex() {
|
||||||
|
return stopBitsIndex;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue