Issue #1242 Fix wierd GFE behavior when Grid Manager is maximized.

Change-Id: I2e6d6929a8a8af8dab3320bdf8cda3466fe05fa8

Former-commit-id: 4fb21077aba1dd9cfafc7f046b02f24f750c6384
This commit is contained in:
Ron Anderson 2012-10-04 08:57:02 -05:00
parent bcd6709455
commit 8e8c713884
3 changed files with 18 additions and 21 deletions

View file

@ -34,9 +34,14 @@
</equals> </equals>
</iterate> </iterate>
</with> </with>
<with variable="activeEditor"> <or>
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/> <with variable="activePart">
</with> <instanceof value="com.raytheon.viz.gfe.GridManagerView"/>
</with>
<with variable="activeEditor">
<instanceof value="com.raytheon.uf.viz.core.IDisplayPaneContainer"/>
</with>
</or>
</and> </and>
</definition> </definition>
</extension> </extension>

View file

@ -22,9 +22,9 @@ package com.raytheon.viz.gfe.gridmanager.action;
import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.ExecutionException;
import com.raytheon.uf.viz.core.drawables.IDescriptor.FrameChangeOperation; import com.raytheon.uf.viz.core.drawables.IFrameCoordinator.FrameChangeOperation;
import com.raytheon.viz.gfe.core.DataManager; import com.raytheon.viz.gfe.core.DataManager;
import com.raytheon.viz.ui.EditorUtil; import com.raytheon.viz.gfe.gridmanager.IGridManager;
import com.raytheon.viz.ui.tools.AbstractTool; import com.raytheon.viz.ui.tools.AbstractTool;
/** /**
@ -56,36 +56,28 @@ public class GFEFrameTool extends AbstractTool {
@Override @Override
public Object execute(ExecutionEvent arg0) throws ExecutionException { public Object execute(ExecutionEvent arg0) throws ExecutionException {
this.editor = EditorUtil.getActiveVizContainer();
if (this.editor == null) {
return null;
}
this.editor.getLoopProperties().setLooping(false);
String operationStr = arg0.getParameter("operation"); String operationStr = arg0.getParameter("operation");
FrameChangeOperation operation = FrameChangeOperation FrameChangeOperation operation = FrameChangeOperation
.valueOf(operationStr); .valueOf(operationStr);
DataManager dm = DataManager.getCurrentInstance(); IGridManager gm = DataManager.getCurrentInstance().getGridManager();
switch (operation) { switch (operation) {
case PREVIOUS: case PREVIOUS:
dm.getGridManager().previousSelectedGrid(); gm.previousSelectedGrid();
break; break;
case NEXT: case NEXT:
dm.getGridManager().nextSelectedGrid(); gm.nextSelectedGrid();
break; break;
case FIRST: case FIRST:
dm.getGridManager().firstSelectedGrid(); gm.firstSelectedGrid();
break; break;
case LAST: case LAST:
dm.getGridManager().lastSelectedGrid(); gm.lastSelectedGrid();
break; break;
} }
editor.refresh(); gm.redraw();
dm.getGridManager().redraw();
return null; return null;

View file

@ -69,13 +69,13 @@ public abstract class AbstractWorkbenchPartContextActivator implements
protected abstract boolean isPerspectivePart(IWorkbenchPartReference partRef); protected abstract boolean isPerspectivePart(IWorkbenchPartReference partRef);
private void deactivate(IWorkbenchPartReference partRef) { private void deactivate(IWorkbenchPartReference partRef) {
if (isPerspectivePart(partRef)) { if ((partRef != null) && isPerspectivePart(partRef)) {
contextManager.deactivateContexts(this); contextManager.deactivateContexts(this);
} }
} }
private void activate(IWorkbenchPartReference partRef) { private void activate(IWorkbenchPartReference partRef) {
if (isPerspectivePart(partRef)) { if ((partRef != null) && isPerspectivePart(partRef)) {
contextManager.activateContexts(this); contextManager.activateContexts(this);
} else { } else {
contextManager.deactivateContexts(this); contextManager.deactivateContexts(this);