Issue #1018 disable many toolbar and menu items when the current editor is not a display pane container
Former-commit-id:0857d971b5
[formerlya4c46c7f55
[formerly 7ae4af9778cfa58fc755041479aadec5e6ad90b0]] Former-commit-id:a4c46c7f55
Former-commit-id:474fe44037
This commit is contained in:
parent
9aa0da6f76
commit
2c64112a4c
9 changed files with 85 additions and 9 deletions
|
@ -1400,6 +1400,11 @@
|
|||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.TimeOptionsAction"
|
||||
commandId="com.raytheon.uf.viz.d2d.ui.actions.timeOptionsAction">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.LocateCursorAction"
|
||||
|
@ -1485,6 +1490,11 @@
|
|||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.CopyOutAWIPSProcedure"
|
||||
commandId="com.raytheon.viz.ui.copyOutAWIPSProcedure">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.SetPerspectiveHandler"
|
||||
|
@ -1497,6 +1507,11 @@
|
|||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.ShowPrintDialog"
|
||||
commandId="com.raytheon.uf.viz.d2d.ui.actions.showPrintDialog">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.IncreaseBlendAmount"
|
||||
|
@ -1509,6 +1524,11 @@
|
|||
<handler
|
||||
class="com.raytheon.uf.viz.d2d.ui.actions.ToggleTool"
|
||||
commandId="com.raytheon.uf.viz.d2d.ui.actions.toggleTool">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
<extension
|
||||
|
|
|
@ -68,6 +68,9 @@ public class TimeOptionsAction extends AbstractTool {
|
|||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
super.execute(event);
|
||||
if (this.editor == null) {
|
||||
return null;
|
||||
}
|
||||
IRenderableDisplay iDisplay = this.editor.getActiveDisplayPane()
|
||||
.getRenderableDisplay();
|
||||
D2DTimeMatcher matcher = ((D2DTimeMatcher) iDisplay.getDescriptor()
|
||||
|
|
|
@ -208,6 +208,11 @@
|
|||
<handler
|
||||
class="com.raytheon.viz.ui.actions.ImagePropertiesAction"
|
||||
commandId="com.raytheon.viz.ui.imageProperties">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.viz.ui.personalities.awips.ClosePerspectiveHandler"
|
||||
|
|
|
@ -70,22 +70,47 @@
|
|||
<handler
|
||||
class="com.raytheon.viz.ui.tools.looping.CombinedFrameTool"
|
||||
commandId="com.raytheon.viz.ui.tools.looping.frameTool">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.viz.ui.tools.looping.LoopTool"
|
||||
commandId="com.raytheon.viz.ui.tools.looping.loop">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.viz.ui.tools.looping.LoopPropertiesTool"
|
||||
commandId="com.raytheon.viz.ui.tools.looping.loopProperties">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.viz.ui.tools.looping.FasterLoopSpeedTool"
|
||||
commandId="com.raytheon.viz.ui.tools.looping.fasterLoop">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.viz.ui.tools.looping.SlowerLoopSpeedTool"
|
||||
commandId="com.raytheon.viz.ui.tools.looping.slowerLoop">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
</extension>
|
||||
|
||||
|
|
|
@ -50,7 +50,9 @@ public class FasterLoopSpeedTool extends AbstractTool {
|
|||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
super.execute(arg0);
|
||||
PageUpDownKey.handlePageUp(editor);
|
||||
if (editor != null) {
|
||||
PageUpDownKey.handlePageUp(editor);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@ public class LoopPropertiesTool extends AbstractTool {
|
|||
|
||||
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||
.getShell();
|
||||
|
||||
LoopPropertiesDialog.openDialog(shell, this.editor);
|
||||
|
||||
if (editor != null) {
|
||||
LoopPropertiesDialog.openDialog(shell, this.editor);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,9 @@ public class SlowerLoopSpeedTool extends AbstractTool {
|
|||
@Override
|
||||
public Object execute(ExecutionEvent arg0) throws ExecutionException {
|
||||
super.execute(arg0);
|
||||
PageUpDownKey.handlePageDown(editor);
|
||||
if (editor != null) {
|
||||
PageUpDownKey.handlePageDown(editor);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -451,10 +451,20 @@
|
|||
<handler
|
||||
class="com.raytheon.viz.ui.actions.SaveBundle"
|
||||
commandId="com.raytheon.viz.ui.saveBundle">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.viz.ui.actions.SaveProcedure"
|
||||
commandId="com.raytheon.viz.ui.saveProcedure">
|
||||
<activeWhen>
|
||||
<with variable="activeEditor">
|
||||
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
|
||||
</with>
|
||||
</activeWhen>
|
||||
</handler>
|
||||
<handler
|
||||
class="com.raytheon.viz.ui.actions.LoadSerializedXml"
|
||||
|
|
|
@ -242,11 +242,20 @@ public class LoadSerializedXml extends AbstractHandler {
|
|||
final boolean multiEditor = container instanceof IMultiPaneEditor;
|
||||
|
||||
if (multiEditor) {
|
||||
while (container.getDisplayPanes().length > b.getDisplays().length) {
|
||||
((IMultiPaneEditor) container)
|
||||
.removePane(container.getDisplayPanes()[container
|
||||
.getDisplayPanes().length - 1]);
|
||||
if (container.getDisplayPanes().length > b.getDisplays().length) {
|
||||
VizApp.runSync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
while (container.getDisplayPanes().length > b
|
||||
.getDisplays().length) {
|
||||
((IMultiPaneEditor) container).removePane(container
|
||||
.getDisplayPanes()[container
|
||||
.getDisplayPanes().length - 1]);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
List<AbstractRenderableDisplay> orderedDisplays = Arrays.asList(b
|
||||
.getDisplays());
|
||||
|
|
Loading…
Add table
Reference in a new issue