Issue #1229 Changes for non-blocking SaveColorMapDialog.
Change-Id: I5308c5f2ca546c825863f89162f2f1143f0431fc Former-commit-id:1c4e87e968
[formerly086223e764
] [formerly 3874545f803dcb6ca00a8d3a25d8f6c9a8e55885 [formerly5e79024db3
]] [formerly7f3ab5434c
[formerly5e79024db3
[formerly b902eadfca48628bf8944d97019263e94618667a]]] Former-commit-id:7f3ab5434c
Former-commit-id: a4ad194b03c39475a030ce5186fa0c8dd107d6d7 [formerlyf77e146c65
] Former-commit-id:e4016f2f59
This commit is contained in:
parent
002e4e0e8b
commit
98f56ba457
2 changed files with 44 additions and 17 deletions
|
@ -63,6 +63,7 @@ import com.raytheon.viz.ui.EditorUtil;
|
||||||
import com.raytheon.viz.ui.UiPlugin;
|
import com.raytheon.viz.ui.UiPlugin;
|
||||||
import com.raytheon.viz.ui.VizWorkbenchManager;
|
import com.raytheon.viz.ui.VizWorkbenchManager;
|
||||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
|
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
||||||
import com.raytheon.viz.ui.editor.ISelectedPanesChangedListener;
|
import com.raytheon.viz.ui.editor.ISelectedPanesChangedListener;
|
||||||
|
|
||||||
|
@ -75,6 +76,7 @@ import com.raytheon.viz.ui.editor.ISelectedPanesChangedListener;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* lvenable Initial Creation.
|
* lvenable Initial Creation.
|
||||||
* Jul 24, 2007 njensen Hooked into backend.
|
* Jul 24, 2007 njensen Hooked into backend.
|
||||||
|
* Oct 17, 2012 1229 rferrel Changes for non-blocking SaveColorMapDialog.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -85,10 +87,10 @@ public class ColorEditDialog extends CaveSWTDialog implements
|
||||||
IVizEditorChangedListener, IRenderableDisplayChangedListener,
|
IVizEditorChangedListener, IRenderableDisplayChangedListener,
|
||||||
RemoveListener, AddListener, IResourceDataChanged,
|
RemoveListener, AddListener, IResourceDataChanged,
|
||||||
ISelectedPanesChangedListener, IColorEditCompCallback {
|
ISelectedPanesChangedListener, IColorEditCompCallback {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(ColorEditDialog.class);
|
.getHandler(ColorEditDialog.class);
|
||||||
|
|
||||||
private static final String NO_COLOR_TABLE = "No color table is being edited";
|
private final String NO_COLOR_TABLE = "No color table is being edited";
|
||||||
|
|
||||||
private String currentColormapName;
|
private String currentColormapName;
|
||||||
|
|
||||||
|
@ -144,6 +146,10 @@ public class ColorEditDialog extends CaveSWTDialog implements
|
||||||
|
|
||||||
private static ColorEditDialog instance = null;
|
private static ColorEditDialog instance = null;
|
||||||
|
|
||||||
|
private SaveColorMapDialog officeSaveAsDialog;
|
||||||
|
|
||||||
|
private SaveColorMapDialog saveAsDialog;
|
||||||
|
|
||||||
public static void openDialog(Shell parent,
|
public static void openDialog(Shell parent,
|
||||||
IDisplayPaneContainer container,
|
IDisplayPaneContainer container,
|
||||||
AbstractVizResource<?, ?> singleRscToEdit, boolean rightImages,
|
AbstractVizResource<?, ?> singleRscToEdit, boolean rightImages,
|
||||||
|
@ -831,24 +837,44 @@ public class ColorEditDialog extends CaveSWTDialog implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void officeSaveAs() {
|
private void officeSaveAs() {
|
||||||
SaveColorMapDialog saveDialog = new SaveColorMapDialog(shell,
|
if (mustCreate(officeSaveAsDialog)) {
|
||||||
(ColorMap) cap.getColorMapParameters().getColorMap(), true,
|
officeSaveAsDialog = new SaveColorMapDialog(shell, (ColorMap) cap
|
||||||
currentColormapName);
|
.getColorMapParameters().getColorMap(), true,
|
||||||
String newName = (String) saveDialog.open();
|
currentColormapName);
|
||||||
if (newName != null) {
|
officeSaveAsDialog.setCloseCallback(new ICloseCallback() {
|
||||||
currentColormapName = newName;
|
|
||||||
completeSave();
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
if (returnValue instanceof String) {
|
||||||
|
currentColormapName = (String) returnValue;
|
||||||
|
completeSave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
officeSaveAsDialog.open();
|
||||||
|
} else {
|
||||||
|
officeSaveAsDialog.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveAs() {
|
private void saveAs() {
|
||||||
SaveColorMapDialog saveDialog = new SaveColorMapDialog(shell,
|
if (mustCreate(saveAsDialog)) {
|
||||||
(ColorMap) cap.getColorMapParameters().getColorMap(), false,
|
saveAsDialog = new SaveColorMapDialog(shell, (ColorMap) cap
|
||||||
currentColormapName);
|
.getColorMapParameters().getColorMap(), false,
|
||||||
String newName = (String) saveDialog.open();
|
currentColormapName);
|
||||||
if (newName != null) {
|
saveAsDialog.setCloseCallback(new ICloseCallback() {
|
||||||
currentColormapName = newName;
|
|
||||||
completeSave();
|
@Override
|
||||||
|
public void dialogClosed(Object returnValue) {
|
||||||
|
if (returnValue instanceof String) {
|
||||||
|
currentColormapName = (String) returnValue;
|
||||||
|
completeSave();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
saveAsDialog.open();
|
||||||
|
} else {
|
||||||
|
saveAsDialog.bringToTop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,6 +55,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Jul 24, 2007 njensen Initial creation
|
* Jul 24, 2007 njensen Initial creation
|
||||||
|
* Oct 17, 2012 1229 rferrel Dialog is non-blocking.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -85,7 +86,7 @@ public class SaveColorMapDialog extends CaveSWTDialog {
|
||||||
*/
|
*/
|
||||||
public SaveColorMapDialog(Shell parent, ColorMap aColorMap,
|
public SaveColorMapDialog(Shell parent, ColorMap aColorMap,
|
||||||
boolean aSiteContext, String aCurrentColormapName) {
|
boolean aSiteContext, String aCurrentColormapName) {
|
||||||
super(parent);
|
super(parent, SWT.NONE, CAVE.DO_NOT_BLOCK);
|
||||||
colorMapToSave = aColorMap;
|
colorMapToSave = aColorMap;
|
||||||
siteContext = aSiteContext;
|
siteContext = aSiteContext;
|
||||||
currentColormapName = new String(aCurrentColormapName == null ? ""
|
currentColormapName = new String(aCurrentColormapName == null ? ""
|
||||||
|
|
Loading…
Add table
Reference in a new issue