Issue #1234 PointsMgrDialog now adds new nodes when no node selected and VolumeBrowserDlg accounts for having no points.

Change-Id: Ida0439f71f0aed57e18f0fc043f6ac5503fa11d1

Former-commit-id: 01d49de150 [formerly d688c3793e] [formerly c9674e872d [formerly f70c63c1ece76df9f94fdfcee3e373b5ae4cea3c]]
Former-commit-id: c9674e872d
Former-commit-id: 370e6956fc
This commit is contained in:
Roger Ferrel 2012-10-02 14:41:30 -05:00
parent 3f4f732492
commit 694f955395
2 changed files with 31 additions and 10 deletions

View file

@ -89,6 +89,9 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* ------------ ---------- ----------- --------------------------
* October-2010 epolster Initial Creation.
* Jul 31, 2012 #875 rferrel Integrated into CAVE.
* Oct 2, 2012 #1234 rferrel Clicking on new group/point when no
* node selected will now add the new
* to the root node.
*
* </pre>
*
@ -277,7 +280,7 @@ public class PointsMgrDialog extends CaveJFACEDialog implements
createPoint();
}
};
createPointAction.setText("New Point");
createPointAction.setText("New Point...");
editNodeAction = new Action() {
@Override
@ -285,7 +288,7 @@ public class PointsMgrDialog extends CaveJFACEDialog implements
editNode();
}
};
editNodeAction.setText("Edit");
editNodeAction.setText("Edit...");
deleteNodeAction = new Action() {
@Override
@ -371,7 +374,7 @@ public class PointsMgrDialog extends CaveJFACEDialog implements
}
});
newButton = createButton(parent, NEW_POINT_ID, "New Point", false);
newButton = createButton(parent, NEW_POINT_ID, "New Point...", false);
newButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -379,7 +382,7 @@ public class PointsMgrDialog extends CaveJFACEDialog implements
}
});
editButton = createButton(parent, EDIT_POINT_ID, "Edit", false);
editButton = createButton(parent, EDIT_POINT_ID, "Edit...", false);
editButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@ -407,13 +410,15 @@ public class PointsMgrDialog extends CaveJFACEDialog implements
}
private void createGroup() {
IPointNode parentNode = null;
selectedNode = getSelectedPoint();
if (selectedNode == null) {
return;
parentNode = dataManager.getPoint("");
} else {
parentNode = dataManager.getParent(selectedNode);
}
IPointNode parentNode = dataManager.getParent(selectedNode);
try {
setCursorBusy(true);
editSelectedNode = true;
@ -429,6 +434,9 @@ public class PointsMgrDialog extends CaveJFACEDialog implements
private void createPoint() {
Point point = getSelectedPoint();
if (point == null) {
point = dataManager.getPoint("");
}
if (point != null) {
ICloseCallback cb = new ICloseCallback() {

View file

@ -44,6 +44,9 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.VizApp;
import com.raytheon.uf.viz.core.VizConstants;
import com.raytheon.uf.viz.core.globals.IGlobalChangedListener;
@ -72,6 +75,8 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
* Jul 21, 2012 #875 rferrel Now uses points.
* Sep 26, 2012 #1216 rferrel Point Change listener added to update
* the Time Series Point menu.
* Oct 2, 2012 #1234 rferrel Time series Point menu accounts for
* having no points.
*
* </pre>
*
@ -81,6 +86,9 @@ import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
public class VolumeBrowserDlg extends CaveSWTDialog implements
IGlobalChangedListener {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(VolumeBrowserDlg.class);
private VolumeBrowserDialogSettings dialogSettings;
/**
@ -839,10 +847,15 @@ public class VolumeBrowserDlg extends CaveSWTDialog implements
Menu pntsMenu = new Menu(menuBar);
pointsMI.setMenu(pntsMenu);
IPointNode firstPoint = populatePointsMenu(pntsMenu, null);
pointsMI.setText("Point " + firstPoint.getName());
pointsMI.setData(firstPoint);
if (firstPoint == null) {
statusHandler.handle(Priority.WARN, "No Points available.");
pointsMI.setText("NO POINTS");
} else {
pointsMI.setText("Point " + firstPoint.getName());
pointsMI.setData(firstPoint);
dialogSettings.setPointsSelection((Point) pointsMI.getData());
dialogSettings.setPointsSelection((Point) pointsMI.getData());
}
}
/**