Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.ui.navigator/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.ui.navigator; singleton:=true
Bundle-Version: 3.13.200.qualifier
Bundle-Version: 3.13.300.qualifier
Bundle-Activator: org.eclipse.ui.internal.navigator.NavigatorPlugin
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class CommonNavigatorActionGroup extends ActionGroup implements IMementoA

private final CommonViewer commonViewer;

private CommonNavigator commonNavigator;
private final CommonNavigator commonNavigator;

private final LinkHelperService linkHelperService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
public class CommonNavigatorFrameSource extends TreeViewerFrameSource {

private CommonNavigator navigator;
private final CommonNavigator navigator;

/**
* Constructs a new frame source for the specified common navigator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
public class CommonViewerSiteDelegate implements ICommonViewerSite {


private String id;
private final String id;
private ISelectionProvider selectionProvider;
private Shell shell;
private final Shell shell;

public CommonViewerSiteDelegate(String anId, ISelectionProvider aSelectionProvider, Shell aShell) {
Assert.isNotNull(anId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class CommonViewerSiteIEditorPartSiteDelegate implements
ICommonViewerWorkbenchSite {

private IEditorSite editorSite;
private final IEditorSite editorSite;

public CommonViewerSiteIEditorPartSiteDelegate(IEditorSite anEditorSite) {
editorSite = anEditorSite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
*/
public class CommonViewerSiteIPageSiteDelegate implements ICommonViewerSite {

private IPageSite pageSite;
private final IPageSite pageSite;

private String viewerId;
private final String viewerId;

public CommonViewerSiteIPageSiteDelegate(String aViewerId,
IPageSite aPageSite) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
public class CommonViewerSiteIViewSiteDelegate implements ICommonViewerWorkbenchSite {

private IViewSite viewSite;
private final IViewSite viewSite;

public CommonViewerSiteIViewSiteDelegate(IViewSite aViewSite) {
viewSite = aViewSite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ContributorTrackingSet extends LinkedHashSet {

private INavigatorContentDescriptor contributor;
private INavigatorContentDescriptor firstClassContributor;
private NavigatorContentService contentService;
private final NavigatorContentService contentService;

/**
* Construct a tracking set.
Expand Down Expand Up @@ -71,8 +71,9 @@ public boolean remove(Object o) {
@Override
public void clear() {
Iterator it = iterator();
while (it.hasNext())
while (it.hasNext()) {
contentService.forgetContribution(it.next());
}
super.clear();
}

Expand Down Expand Up @@ -104,8 +105,9 @@ public void setContributor(INavigatorContentDescriptor newContributor, INavigato

public void setContents(Object[] contents) {
super.clear();
if(contents != null)
if(contents != null) {
addAll(Arrays.asList(contents));
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public CustomAndExpression(IConfigurationElement element) {
Assert.isNotNull(element);

final IConfigurationElement[] children = element.getChildren();
if (children.length == 0)
if (children.length == 0) {
return;
}
SafeRunner.run(new NavigatorSafeRunnable() {
@Override
public void run() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public final class NavigatorActivationService implements

private final ListenerList<IExtensionActivationListener> listeners = new ListenerList<>();

private INavigatorContentService contentService;
private final INavigatorContentService contentService;

/**
* Create an instance of the service.
Expand All @@ -94,16 +94,19 @@ public NavigatorActivationService(INavigatorContentService aContentService) {
@Override
public boolean isNavigatorExtensionActive(String aNavigatorExtensionId) {
Boolean b = activatedExtensionsMap.get(aNavigatorExtensionId);
if(b != null)
if(b != null) {
return b.booleanValue();
}
synchronized (activatedExtensionsMap) {
NavigatorContentDescriptor descriptor = CONTENT_DESCRIPTOR_REGISTRY.getContentDescriptor(aNavigatorExtensionId);
if (descriptor == null)
if (descriptor == null) {
return false;
if(descriptor.isActiveByDefault())
}
if(descriptor.isActiveByDefault()) {
activatedExtensionsMap.put(aNavigatorExtensionId, Boolean.TRUE);
else
} else {
activatedExtensionsMap.put(aNavigatorExtensionId, Boolean.FALSE);
}
return descriptor.isActiveByDefault();
}
}
Expand Down Expand Up @@ -241,8 +244,9 @@ private void notifyListeners(String[] navigatorExtensionIds,
boolean toEnable) {

if(navigatorExtensionIds != null) { // should really never be null, but just in case
if(navigatorExtensionIds.length > 1)
if(navigatorExtensionIds.length > 1) {
Arrays.sort(navigatorExtensionIds);
}

for (IExtensionActivationListener element : listeners) {
element.onExtensionActivation(contentService.getViewerId(), navigatorExtensionIds, toEnable);
Expand Down Expand Up @@ -275,8 +279,9 @@ private void revertExtensionActivations() {
} else {
// IS THIS THE RIGHT WAY TO HANDLE THIS CASE?
NavigatorContentDescriptor descriptor = CONTENT_DESCRIPTOR_REGISTRY.getContentDescriptor(contentExtensionId);
if(descriptor != null)
if(descriptor != null) {
activatedExtensionsMap.put(id, Boolean.valueOf(descriptor.isActiveByDefault()));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public class NavigatorContentService implements IExtensionActivationListener,
* to record the object/description associations which are when stored
* in the Tree associated with the viewer.
*/
private Map<Object, INavigatorContentDescriptor> contributionMemory;
private Map<Object, INavigatorContentDescriptor> contributionMemoryFirstClass;
private final Map<Object, INavigatorContentDescriptor> contributionMemory;
private final Map<Object, INavigatorContentDescriptor> contributionMemoryFirstClass;

private ILabelProvider labelProvider;

Expand Down Expand Up @@ -338,8 +338,9 @@ protected void updateService(Viewer aViewer, Object anOldInput, Object aNewInput
// Prevents the world from being started again once we have been disposed. In
// the dispose process, the ContentViewer will call setInput() on the
// NavigatorContentServiceContentProvider, which gets us here
if (isDisposed)
if (isDisposed) {
return;
}
NavigatorContentDescriptorManager.getInstance().clearCache();
synchronized (this) {
if (structuredViewerManager == null) {
Expand Down Expand Up @@ -579,8 +580,9 @@ public INavigatorContentExtension getContentExtensionById(
String anExtensionId) {
NavigatorContentDescriptor descriptor = CONTENT_DESCRIPTOR_REGISTRY
.getContentDescriptor(anExtensionId);
if (descriptor != null)
if (descriptor != null) {
return getExtension(descriptor);
}
return null;
}

Expand Down Expand Up @@ -667,9 +669,10 @@ public void rememberContribution(INavigatorContentDescriptor source,
synchronized (this) {
if (contributionMemory.get(element) == null
|| contributionMemoryFirstClass.get(element) == firstClassSource) {
if (Policy.DEBUG_RESOLUTION)
if (Policy.DEBUG_RESOLUTION) {
System.out
.println("rememberContribution: " + Policy.getObjectString(element) + " source: " + source); //$NON-NLS-1$//$NON-NLS-2$
}
contributionMemory.put(element, source);
contributionMemoryFirstClass.put(element, firstClassSource);
}
Expand Down Expand Up @@ -719,17 +722,20 @@ public int getContributionMemorySize() {
* @see #findContentExtensionsByTriggerPoint(Object)
*/
public synchronized NavigatorContentDescriptor getSourceOfContribution(Object element) {
if (element == null)
if (element == null) {
return null;
if (structuredViewerManager == null)
}
if (structuredViewerManager == null) {
return null;
}
// Try here first because it might not yet be in the tree
NavigatorContentDescriptor src;
synchronized (this) {
src = (NavigatorContentDescriptor) contributionMemory.get(element);
}
if (src != null)
if (src != null) {
return src;
}
return (NavigatorContentDescriptor) structuredViewerManager.getData(element);
}
public static final boolean CONSIDER_OVERRIDES = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,13 @@ private Object[] internalGetChildren(final Object aParentElement,
public void run() throws Exception {
if (!isOverridingExtensionInSet(foundExtension.getDescriptor(),
enabledExtensions)) {
if (elements)
if (elements) {
contributedChildren = foundExtension.internalGetContentProvider()
.getElements(aParentElementOrPath);
else
} else {
contributedChildren = foundExtension.internalGetContentProvider()
.getChildren(aParentElementOrPath);
}
overridingExtensions = foundExtension
.getOverridingExtensionsForTriggerPoint(aParentElement);
INavigatorContentDescriptor foundDescriptor = foundExtension
Expand Down Expand Up @@ -494,8 +495,7 @@ public void dispose() {
* @return the element
*/
private Object internalAsElement(Object parentElementOrPath) {
if (parentElementOrPath instanceof TreePath) {
TreePath tp = (TreePath) parentElementOrPath;
if (parentElementOrPath instanceof TreePath tp) {
if (tp.getSegmentCount() > 0) {
return tp.getLastSegment();
}
Expand Down Expand Up @@ -605,10 +605,11 @@ private Set findPaths(TreePathCompiler aPathCompiler) {
String msg = cpe.getMessage() != null ? cpe.getMessage() : cpe.toString();
NavigatorPlugin.logError(0, msg, cpe);
}
if (foundPaths.isEmpty())
if (foundPaths.isEmpty()) {
parentPaths.add(c);
else
} else {
parentPaths.addAll(foundPaths);
}
}
}
return parentPaths;
Expand Down Expand Up @@ -638,15 +639,17 @@ public void run() throws Exception {
for (TreePath parentTreePath : parentTreePaths) {

parent = parentTreePath.getLastSegment();
if ((parent = findParent(foundExtension, anElement, parent)) != null)
if ((parent = findParent(foundExtension, anElement, parent)) != null) {
parents.add(parent);
}
}

} else {
parent = foundExtension.internalGetContentProvider().getParent(
anElement);
if ((parent = findParent(foundExtension, anElement, parent)) != null)
if ((parent = findParent(foundExtension, anElement, parent)) != null) {
parents.add(parent);
}
}
}
}
Expand Down Expand Up @@ -678,8 +681,9 @@ private Object findParent(NavigatorContentExtension anExtension, Object anElemen
piplineContentProvider = overridingExtension.internalGetContentProvider();
suggestedOverriddenParent = piplineContentProvider.getPipelinedParent(anElement, lastValidParent);

if (suggestedOverriddenParent != null && !suggestedOverriddenParent.equals(aSuggestedParent))
if (suggestedOverriddenParent != null && !suggestedOverriddenParent.equals(aSuggestedParent)) {
lastValidParent = suggestedOverriddenParent;
}

// should never return null
lastValidParent = findParent(overridingExtension, anElement, lastValidParent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ public String getDescription(Object anElement) {

Object target;

if (anElement instanceof IStructuredSelection) {
if (anElement instanceof IStructuredSelection structuredSelection) {

IStructuredSelection structuredSelection = (IStructuredSelection) anElement;
if (structuredSelection.size() > 1) {
return getDefaultStatusBarMessage(structuredSelection.size());
}
Expand Down
Loading
Loading