Merge "Issue #1018 disable many toolbar and menu items when the current editor is not a display pane container" into development

Former-commit-id: a14db247fb [formerly d70d78d664] [formerly 2cb82b7170] [formerly 91e0ba8c23 [formerly 2cb82b7170 [formerly d252760b0e39002e53a5fce809b38521ca2351aa]]]
Former-commit-id: 91e0ba8c23
Former-commit-id: 00bff8ae22a58ce9c1926f3f681e442f45f7f40f [formerly 5b26d1e93e]
Former-commit-id: 1da09f201e
This commit is contained in:
Nate Jensen 2012-08-14 16:52:40 -05:00 committed by Gerrit Code Review
commit d834aad044
9 changed files with 85 additions and 9 deletions

View file

@ -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

View file

@ -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()

View file

@ -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"

View file

@ -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>

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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"

View file

@ -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());