From f507dc1d73ceb039bc3f4f76a4c4985247245462 Mon Sep 17 00:00:00 2001 From: Eclipse PDE Bot Date: Thu, 6 Mar 2025 02:32:13 +0000 Subject: [PATCH 1/2] Perform clean code of apitools/org.eclipse.pde.api.tools.ui --- .../internal/actions/TreeViewerNavigator.java | 57 ++++++++++++------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/TreeViewerNavigator.java b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/TreeViewerNavigator.java index 775735c363..a4eb928c6a 100644 --- a/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/TreeViewerNavigator.java +++ b/apitools/org.eclipse.pde.api.tools.ui/src/org/eclipse/pde/api/tools/ui/internal/actions/TreeViewerNavigator.java @@ -32,17 +32,20 @@ public TreeViewerNavigator(TreeViewer viewer) { public void navigateNext(boolean forward) { TreeItem currentItem = getCurrentItem(forward); - if (currentItem == null) + if (currentItem == null) { return; + } TreeItem nextItem = null; if (forward) { nextItem = getNextItemForward(currentItem); - if (nextItem == null) + if (nextItem == null) { nextItem = getFirstItem(); + } } else { nextItem = getNextItemBackward(currentItem); - if (nextItem == null) + if (nextItem == null) { nextItem = getLastItem(); + } } if (nextItem != null) { internalSetSelection(nextItem); @@ -51,22 +54,26 @@ public void navigateNext(boolean forward) { private TreeItem getFirstItem() { TreeItem[] roots = fViewer.getTree().getItems(); - if (roots.length == 0) + if (roots.length == 0) { return null; + } for (TreeItem root : roots) { - if (hasMatches(root)) + if (hasMatches(root)) { return root; + } TreeItem firstChild = getFirstChildWithMatches(roots[0]); - if (firstChild != null) + if (firstChild != null) { return firstChild; + } } return null; } private TreeItem getLastItem() { TreeItem[] roots = fViewer.getTree().getItems(); - if (roots.length == 0) + if (roots.length == 0) { return null; + } return getLastChildWithMatches(roots[roots.length-1]); } @@ -75,16 +82,19 @@ private TreeItem getNextItemBackward(TreeItem currentItem) { TreeItem previousSibling = getNextSibling(currentItem, false); if (previousSibling != null) { TreeItem lastChild = getLastChildWithMatches(previousSibling); - if (lastChild != null) + if (lastChild != null) { return lastChild; - if (hasMatches(previousSibling)) + } + if (hasMatches(previousSibling)) { return previousSibling; + } return null; } TreeItem parent = currentItem.getParentItem(); if (parent != null) { - if (hasMatches(parent)) + if (hasMatches(parent)) { return parent; + } return getNextItemBackward(parent); } return null; @@ -92,30 +102,35 @@ private TreeItem getNextItemBackward(TreeItem currentItem) { private TreeItem getLastChildWithMatches(TreeItem currentItem) { TreeItem[] children = getChildren(currentItem); - if (children.length == 0) + if (children.length == 0) { return null; + } TreeItem recursiveChild = getLastChildWithMatches(children[children.length-1]); - if (recursiveChild == null) + if (recursiveChild == null) { return children[children.length-1]; + } return recursiveChild; } private TreeItem getNextItemForward(TreeItem currentItem) { TreeItem child = getFirstChildWithMatches(currentItem); - if (child != null) + if (child != null) { return child; + } TreeItem nextSibling = getNextSibling(currentItem, true); if (nextSibling != null) { - if (hasMatches(nextSibling)) + if (hasMatches(nextSibling)) { return nextSibling; + } return getFirstChildWithMatches(nextSibling); } TreeItem parent = currentItem.getParentItem(); while (parent != null) { nextSibling = getNextSibling(parent, true); if (nextSibling != null) { - if (hasMatches(nextSibling)) + if (hasMatches(nextSibling)) { return nextSibling; + } return getFirstChildWithMatches(nextSibling); } parent = parent.getParentItem(); @@ -125,12 +140,14 @@ private TreeItem getNextItemForward(TreeItem currentItem) { private TreeItem getFirstChildWithMatches(TreeItem item) { TreeItem[] children = getChildren(item); - if (children.length == 0) + if (children.length == 0) { return null; + } TreeItem child = children[0]; - if (hasMatches(child)) + if (hasMatches(child)) { return child; + } return getFirstChildWithMatches(child); } @@ -141,8 +158,9 @@ private TreeItem[] getChildren(TreeItem item) { private TreeItem getNextSibling(TreeItem currentItem, boolean forward) { TreeItem[] siblings = getSiblings(currentItem); - if (siblings.length < 2) + if (siblings.length < 2) { return null; + } int index = -1; for (int i = 0; i Date: Thu, 6 Mar 2025 02:36:18 +0000 Subject: [PATCH 2/2] Version bump(s) for 4.36 stream --- apitools/org.eclipse.pde.api.tools.ui/META-INF/MANIFEST.MF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apitools/org.eclipse.pde.api.tools.ui/META-INF/MANIFEST.MF b/apitools/org.eclipse.pde.api.tools.ui/META-INF/MANIFEST.MF index 7581923a0a..a298a17cef 100644 --- a/apitools/org.eclipse.pde.api.tools.ui/META-INF/MANIFEST.MF +++ b/apitools/org.eclipse.pde.api.tools.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.pde.api.tools.ui; singleton:=true -Bundle-Version: 1.4.0.qualifier +Bundle-Version: 1.4.100.qualifier Bundle-Localization: plugin Bundle-ActivationPolicy: lazy Bundle-Vendor: %providerName