Issue #1790 Changes for non-blocking StationListDlg.
Change-Id: Ib0cbfd64fca2d4dcbea68b5e0db8b34a5a7af6be Former-commit-id:6ad80607bc
[formerly 5d68d67451c45d38a962f58c246b2effcd0cc253] Former-commit-id:c5a95dcb44
This commit is contained in:
parent
611661ccc9
commit
281e7f53cb
2 changed files with 57 additions and 5 deletions
|
@ -36,6 +36,7 @@ import org.eclipse.ui.PlatformUI;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 6/27/06 lvenable Initial creation.
|
* 6/27/06 lvenable Initial creation.
|
||||||
|
* 03/29/2013 1790 rferrel Changes for non-blocking StationListDlg.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -43,13 +44,21 @@ import org.eclipse.ui.PlatformUI;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class StationListAction extends AbstractHandler {
|
public class StationListAction extends AbstractHandler {
|
||||||
|
/*
|
||||||
|
* Active dialog.
|
||||||
|
*/
|
||||||
|
private StationListDlg stationListDlg;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
if (stationListDlg == null || stationListDlg.isDisposed()) {
|
||||||
.getShell();
|
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
StationListDlg stationListDlg = new StationListDlg(shell);
|
.getShell();
|
||||||
stationListDlg.open();
|
stationListDlg = new StationListDlg(shell);
|
||||||
|
stationListDlg.open();
|
||||||
|
} else {
|
||||||
|
stationListDlg.bringToTop();
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
||||||
* 01/10/2008 1802 askripsk Finished single and double clicks.
|
* 01/10/2008 1802 askripsk Finished single and double clicks.
|
||||||
* 07/03/2010 5906 mduff Fixed the list to match the data.
|
* 07/03/2010 5906 mduff Fixed the list to match the data.
|
||||||
* 02/05/2013 1578 rferrel Changes for non-blocking singleton TimeSeriesDlg.
|
* 02/05/2013 1578 rferrel Changes for non-blocking singleton TimeSeriesDlg.
|
||||||
|
* 03/29/2013 1790 rferrel Make dialog non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -107,13 +108,18 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
* Parent shell.
|
* Parent shell.
|
||||||
*/
|
*/
|
||||||
public StationListDlg(Shell parent) {
|
public StationListDlg(Shell parent) {
|
||||||
super(parent);
|
super(parent, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK);
|
||||||
setText("Station List");
|
setText("Station List");
|
||||||
|
|
||||||
PointDataControlManager.getInstance().addMapUpdateListener(this);
|
PointDataControlManager.getInstance().addMapUpdateListener(this);
|
||||||
HydroDisplayManager.getInstance().addStationSelectionListener(this);
|
HydroDisplayManager.getInstance().addStationSelectionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected Layout constructShellLayout() {
|
protected Layout constructShellLayout() {
|
||||||
// Create the main layout for the shell.
|
// Create the main layout for the shell.
|
||||||
|
@ -123,6 +129,11 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
return mainLayout;
|
return mainLayout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#disposed()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void disposed() {
|
protected void disposed() {
|
||||||
font.dispose();
|
font.dispose();
|
||||||
|
@ -132,6 +143,13 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||||
|
* .eclipse.swt.widgets.Shell)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void initializeComponents(Shell shell) {
|
protected void initializeComponents(Shell shell) {
|
||||||
setReturnValue(false);
|
setReturnValue(false);
|
||||||
|
@ -287,6 +305,9 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepare the display of the stations.
|
||||||
|
*/
|
||||||
private void populateStationList() {
|
private void populateStationList() {
|
||||||
PointDataControlManager pdcManager = PointDataControlManager
|
PointDataControlManager pdcManager = PointDataControlManager
|
||||||
.getInstance();
|
.getInstance();
|
||||||
|
@ -327,6 +348,10 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
setSelection();
|
setSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get site for the current selection and update the perspective's map to
|
||||||
|
* have the site slected.
|
||||||
|
*/
|
||||||
private void selectSite() {
|
private void selectSite() {
|
||||||
HydroDisplayManager displayManager = HydroDisplayManager.getInstance();
|
HydroDisplayManager displayManager = HydroDisplayManager.getInstance();
|
||||||
if (dataList.getSelectionIndex() == -1) {
|
if (dataList.getSelectionIndex() == -1) {
|
||||||
|
@ -357,6 +382,9 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the list to the manager's current station.
|
||||||
|
*/
|
||||||
private void setSelection() {
|
private void setSelection() {
|
||||||
// Select the previously selected station
|
// Select the previously selected station
|
||||||
GageData currStation = HydroDisplayManager.getInstance()
|
GageData currStation = HydroDisplayManager.getInstance()
|
||||||
|
@ -381,6 +409,13 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.viz.hydrocommon.listeners.MapUpdateListener#notifyUpdate
|
||||||
|
* (com.raytheon.viz.hydrocommon.events.MapUpdateEvent)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void notifyUpdate(MapUpdateEvent mue) {
|
public void notifyUpdate(MapUpdateEvent mue) {
|
||||||
VizApp.runSync(new Runnable() {
|
VizApp.runSync(new Runnable() {
|
||||||
|
@ -393,6 +428,14 @@ public class StationListDlg extends CaveSWTDialog implements MapUpdateListener,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.raytheon.viz.hydrocommon.listeners.StationSelectionChangeListener
|
||||||
|
* #notifyUpdate
|
||||||
|
* (com.raytheon.viz.hydrocommon.events.StationSelectionChangeEvent)
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void notifyUpdate(StationSelectionChangeEvent sdue) {
|
public void notifyUpdate(StationSelectionChangeEvent sdue) {
|
||||||
setSelection();
|
setSelection();
|
||||||
|
|
Loading…
Add table
Reference in a new issue