Merge "Issue #2647 Fix window focus problems." into development

Former-commit-id: 3d586d2e95877c79bdaa88080d920ce12c1dd5c4
This commit is contained in:
Nate Jensen 2014-01-10 11:14:53 -06:00 committed by Gerrit Code Review
commit 5e1dfbf0f8
2 changed files with 16 additions and 25 deletions

View file

@ -32,7 +32,6 @@ import org.eclipse.swt.widgets.Menu;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.localization.HierarchicalPreferenceStore;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
@ -44,18 +43,17 @@ import com.raytheon.uf.viz.d2d.ui.dialogs.ImageBlinkDialog;
import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
/**
*
* BlinkToggleAction
*
* Enable blinking on a resource
*
* <pre>
*
* SOFTWARE HISTORY
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 15, 2007 chammack Initial Creation.
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Oct 15, 2007 chammack Initial Creation.
* Jan 09, 2014 2647 bsteffen Get properties directly from resource.
*
* </pre>
*
@ -82,8 +80,8 @@ public class BlinkToggleAction extends AbstractRightClickAction implements
private static float[] blinkRates;
static {
blinkRates = ((HierarchicalPreferenceStore) Activator.getDefault()
.getPreferenceStore()).getFloatArray("blinkRate");
blinkRates = Activator.getDefault().getPreferenceStore()
.getFloatArray("blinkRate");
Arrays.sort(blinkRates);
}
@ -119,11 +117,10 @@ public class BlinkToggleAction extends AbstractRightClickAction implements
*/
@Override
public void run() {
System.out.println("TODO: Handle mode = " + mode);
switch (mode) {
case OTHER: {
ResourceProperties props = getDescriptor().getResourceList()
.getProperties(getTopMostSelectedResource());
ResourceProperties props = getTopMostSelectedResource()
.getProperties();
boolean isEnabled = props.isBlinking();
props.setBlinking(!isEnabled);
this.setChecked(!isEnabled);
@ -154,8 +151,7 @@ public class BlinkToggleAction extends AbstractRightClickAction implements
} else {
mode = InternalMode.OTHER;
ResourceProperties topMostProps = getDescriptor().getResourceList()
.getProperties(topMost);
ResourceProperties topMostProps = topMost.getProperties();
boolean isEnabled = topMostProps.isBlinking();
this.setChecked(isEnabled);
}
@ -314,7 +310,6 @@ public class BlinkToggleAction extends AbstractRightClickAction implements
}
private class BlinkRateAction extends Action {
boolean preSelected;
private float rate;

View file

@ -68,9 +68,12 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 07/07/09 bgonzale Initial Creation.
* Date Ticket# Engineer Description
* ------------- -------- ----------- -----------------------------------------
* Jul 07, 2009 bgonzale Initial Creation.
* Jan 09, 2014 2647 bsteffen Do not change active editor on focus
* because that causes problems when
* switching windows.
* </pre>
*
* @author bgonzale
@ -166,13 +169,6 @@ public class PaneManager extends InputAdapter implements IMultiPaneEditor {
pane.addListener(SWT.MouseExit, inputManager);
pane.addListener(SWT.MouseEnter, inputManager);
pane.addListener(SWT.FocusIn, new Listener() {
@Override
public void handleEvent(Event event) {
activatedPane = pane;
}
});
pane.addListener(SWT.MouseEnter, new Listener() {
@Override
public void handleEvent(Event event) {