Omaha #3531 fixed localization perspective refresh issue

paths were compared by string prefixes instead of path prefixes

Change-Id: I6dd55001f505dda65df21e54727f262e247a30ba

Former-commit-id: 673ccf5851 [formerly 7268d3dc76 [formerly 3d790a851b] [formerly 673ccf5851 [formerly 3cda9077130f30c21dbee5e8d16b59937a896cdd]]]
Former-commit-id: 7268d3dc76 [formerly 3d790a851b]
Former-commit-id: 7268d3dc76
Former-commit-id: 78a3277f25
This commit is contained in:
Brian Clements 2014-09-18 10:55:34 -05:00
parent 26e487d1ec
commit e0a12e23d6
3 changed files with 27 additions and 11 deletions

View file

@ -1,8 +0,0 @@
#Fri Apr 22 11:17:49 CDT 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Localization Perspective Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.localization.perspective;singleton:=true
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.localization.perspective.Activator
Bundle-Vendor: Raytheon
Require-Bundle: org.python.pydev,
@ -25,5 +25,5 @@ Require-Bundle: org.python.pydev,
com.raytheon.uf.common.util;bundle-version="1.12.1174",
com.python.pydev.analysis;bundle-version="2.7.3"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: com.raytheon.uf.viz.localization.perspective.editor

View file

@ -21,6 +21,7 @@ package com.raytheon.uf.viz.localization.perspective.view;
import java.io.File;
import java.net.URL;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@ -135,6 +136,7 @@ import com.raytheon.uf.viz.localization.service.ILocalizationService;
* Sep 17, 2013 2285 mschenke Made openFile refresh items if file not found
* Oct 9, 2013 2104 mschenke Fixed file delete/add refresh issue and file change message
* found when testing scalesInfo.xml file
* Sep 18, 2014 3531 bclement fixed file delete/add refresh issue when paths share string prefixes
*
* </pre>
*
@ -1437,11 +1439,33 @@ public class FileTreeView extends ViewPart implements IPartListener2,
return null;
}
/**
* @see #find(TreeItem, LocalizationContext, java.nio.file.Path, boolean)
* @param item
* @param ctx
* @param path
* @param populateToFind
* @return null if no item found
*/
private TreeItem find(TreeItem item, LocalizationContext ctx, String path,
boolean populateToFind) {
return find(item, ctx, Paths.get(path), populateToFind);
}
/**
* Recursively search tree for node matching path starting at item
*
* @param item
* @param ctx
* @param path
* @param populateToFind
* @return null if no item found
*/
private TreeItem find(TreeItem item, LocalizationContext ctx,
java.nio.file.Path path, boolean populateToFind) {
FileTreeEntryData data = (FileTreeEntryData) item.getData();
if (data.getPathData().getType() == ctx.getLocalizationType()) {
String itemPath = data.getPath();
java.nio.file.Path itemPath = Paths.get(data.getPath());
if (path.startsWith(itemPath)) {
if (path.equals(itemPath)
|| (data.hasRequestedChildren() == false && !populateToFind)) {