Omaha #3401 Enter events to upper case verification added.
Change-Id: I32e51568049dcd442b98b929af3041bc741ea6e3 Former-commit-id:2f9df228d7
[formerly1d6bec894e
] [formerly334d738c79
] [formerly2f9df228d7
[formerly1d6bec894e
] [formerly334d738c79
] [formerly8cde49f98e
[formerly334d738c79
[formerly 414f6e16547e0535ae36c5c4cc86f43db54b689c]]]] Former-commit-id:8cde49f98e
Former-commit-id:8ff4776207
[formerly2e30187e47
] [formerly 9803e31e7a551d16b0b4b241ac6fbe2af4a04c36 [formerlyae35ba438a
]] Former-commit-id: 16a4af6421c896a3c2b39b9b08433cd5a72153ab [formerlya5f2fcf963
] Former-commit-id:73b08f33c6
This commit is contained in:
parent
4b5c6441f8
commit
2d45fc13e0
1 changed files with 33 additions and 1 deletions
|
@ -23,8 +23,13 @@ import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.jface.dialogs.MessageDialog;
|
import org.eclipse.jface.dialogs.MessageDialog;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.events.KeyAdapter;
|
||||||
|
import org.eclipse.swt.events.KeyEvent;
|
||||||
|
import org.eclipse.swt.events.KeyListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
|
import org.eclipse.swt.events.VerifyEvent;
|
||||||
|
import org.eclipse.swt.events.VerifyListener;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
@ -77,6 +82,7 @@ import com.vividsolutions.jts.io.WKTWriter;
|
||||||
* Apr 21, 2014 3041 lvenable Added dispose check to runAsync call and cleaned up
|
* Apr 21, 2014 3041 lvenable Added dispose check to runAsync call and cleaned up
|
||||||
* code. Wrote ticket #3047 for common_obs_spatial
|
* code. Wrote ticket #3047 for common_obs_spatial
|
||||||
* for the city/state issues.
|
* for the city/state issues.
|
||||||
|
* Nov 11, 2014 3401 rferrel Add Enter key events.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -149,6 +155,25 @@ public class PutHomeCursorDialog extends CaveSWTDialog implements
|
||||||
/** Close button. */
|
/** Close button. */
|
||||||
private Button closeBtn;
|
private Button closeBtn;
|
||||||
|
|
||||||
|
/** verify listener force entry to upper case. */
|
||||||
|
private VerifyListener verifyToUpperCase = new VerifyListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void verifyText(VerifyEvent e) {
|
||||||
|
e.text = e.text.toUpperCase();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Performs update when Enter key is pressed. */
|
||||||
|
private KeyListener keyListenerUpdate = new KeyAdapter() {
|
||||||
|
@Override
|
||||||
|
public void keyPressed(KeyEvent e) {
|
||||||
|
if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
|
||||||
|
updateStation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
@ -170,7 +195,6 @@ public class PutHomeCursorDialog extends CaveSWTDialog implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object constructShellLayoutData() {
|
protected Object constructShellLayoutData() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return super.constructShellLayoutData();
|
return super.constructShellLayoutData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,6 +313,8 @@ public class PutHomeCursorDialog extends CaveSWTDialog implements
|
||||||
stationTextField = new Text(controlsComp, SWT.BORDER);
|
stationTextField = new Text(controlsComp, SWT.BORDER);
|
||||||
GridData data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
GridData data = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||||
stationTextField.setLayoutData(data);
|
stationTextField.setLayoutData(data);
|
||||||
|
stationTextField.addKeyListener(keyListenerUpdate);
|
||||||
|
stationTextField.addVerifyListener(verifyToUpperCase);
|
||||||
|
|
||||||
// Add a separator line.
|
// Add a separator line.
|
||||||
addSeparator(controlsComp);
|
addSeparator(controlsComp);
|
||||||
|
@ -308,6 +334,8 @@ public class PutHomeCursorDialog extends CaveSWTDialog implements
|
||||||
cityTextField = new Text(controlsComp, SWT.BORDER);
|
cityTextField = new Text(controlsComp, SWT.BORDER);
|
||||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||||
cityTextField.setLayoutData(gd);
|
cityTextField.setLayoutData(gd);
|
||||||
|
cityTextField.addKeyListener(keyListenerUpdate);
|
||||||
|
cityTextField.addVerifyListener(verifyToUpperCase);
|
||||||
|
|
||||||
stateLabel = new Label(controlsComp, SWT.NONE);
|
stateLabel = new Label(controlsComp, SWT.NONE);
|
||||||
stateLabel.setText("State:");
|
stateLabel.setText("State:");
|
||||||
|
@ -317,6 +345,8 @@ public class PutHomeCursorDialog extends CaveSWTDialog implements
|
||||||
stateTextField = new Text(controlsComp, SWT.BORDER);
|
stateTextField = new Text(controlsComp, SWT.BORDER);
|
||||||
stateTextField.setTextLimit(2);
|
stateTextField.setTextLimit(2);
|
||||||
stateTextField.setLayoutData(gd);
|
stateTextField.setLayoutData(gd);
|
||||||
|
stateTextField.addKeyListener(keyListenerUpdate);
|
||||||
|
stateTextField.addVerifyListener(verifyToUpperCase);
|
||||||
|
|
||||||
// Add a separator line.
|
// Add a separator line.
|
||||||
addSeparator(controlsComp);
|
addSeparator(controlsComp);
|
||||||
|
@ -345,10 +375,12 @@ public class PutHomeCursorDialog extends CaveSWTDialog implements
|
||||||
lonTextField = new Text(controlsComp, SWT.BORDER);
|
lonTextField = new Text(controlsComp, SWT.BORDER);
|
||||||
lonTextField.setLayoutData(new GridData(80, SWT.DEFAULT));
|
lonTextField.setLayoutData(new GridData(80, SWT.DEFAULT));
|
||||||
lonTextField.setLayoutData(gd);
|
lonTextField.setLayoutData(gd);
|
||||||
|
lonTextField.addKeyListener(keyListenerUpdate);
|
||||||
|
|
||||||
Coordinate point = PointsDataManager.getInstance().getHome();
|
Coordinate point = PointsDataManager.getInstance().getHome();
|
||||||
lonTextField.setText(String.valueOf(point.x));
|
lonTextField.setText(String.valueOf(point.x));
|
||||||
latTextField.setText(String.valueOf(point.y));
|
latTextField.setText(String.valueOf(point.y));
|
||||||
|
latTextField.addKeyListener(keyListenerUpdate);
|
||||||
|
|
||||||
// Add a separator line.
|
// Add a separator line.
|
||||||
addSeparator(controlsComp);
|
addSeparator(controlsComp);
|
||||||
|
|
Loading…
Add table
Reference in a new issue