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.views/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: %pluginName
Bundle-SymbolicName: org.eclipse.ui.views; singleton:=true
Bundle-Version: 3.12.700.qualifier
Bundle-Version: 3.12.800.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.ui.internal.views.contentoutline;x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class ContentOutline extends PageBookView implements ISelectionProvider,
/**
* Message to show on the default page.
*/
private String defaultText =ContentOutlineMessages.ContentOutline_noOutline;
private final String defaultText =ContentOutlineMessages.ContentOutline_noOutline;

/**
* Creates a content outline view with no content outline pages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
* </p>
*/
public abstract class ContentOutlinePage extends Page implements IContentOutlinePage, ISelectionChangedListener {
private ListenerList<ISelectionChangedListener> selectionChangedListeners = new ListenerList<>();
private final ListenerList<ISelectionChangedListener> selectionChangedListeners = new ListenerList<>();

private TreeViewer treeViewer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class ComboBoxPropertyDescriptor extends PropertyDescriptor {
/**
* The labels to display in the combo box
*/
private String[] labels;
private final String[] labels;

/**
* Creates an property descriptor with the given id, display name, and list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/**
* System clipboard
*/
private Clipboard clipboard;
private final Clipboard clipboard;

/**
* Creates the action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
try {
PropertySheet sheet = findPropertySheet(event, context);
sheet.show(context);
if (activePart instanceof PropertySheet) {
PropertySheet parent = (PropertySheet) activePart;
if (activePart instanceof PropertySheet parent) {
parent.setPinned(true);
} else if(!sheet.isPinned()) {
sheet.setPinned(PIN_NEW_PROPERTY_VIEW);
Expand All @@ -84,8 +83,7 @@ public Object execute(ExecutionEvent event) throws ExecutionException {
protected PropertyShowInContext getShowInContext(ExecutionEvent event)
throws ExecutionException {
IWorkbenchPart activePart = HandlerUtil.getActivePartChecked(event);
if (activePart instanceof PropertySheet) {
PropertySheet sheet = (PropertySheet) activePart;
if (activePart instanceof PropertySheet sheet) {
return (PropertyShowInContext) sheet.getShowInContext();
}
IShowInSource adapter = Adapters.adapt(activePart, IShowInSource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public class PropertyDescriptor implements IPropertyDescriptor {
/**
* The property id.
*/
private Object id;
private final Object id;

/**
* The name to display for the property.
*/
private String display;
private final String display;

/**
* Category name, or <code>null</code> if none (the default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class PropertySheet extends PageBookView
/**
* Message to show on the default page.
*/
private String defaultText = PropertiesMessages.PropertyViewer_noProperties;
private final String defaultText = PropertiesMessages.PropertyViewer_noProperties;

/**
* The initial selection when the property sheet opens
Expand Down Expand Up @@ -410,8 +410,9 @@ protected boolean isImportant(IWorkbenchPart part) {
@Override
public void partClosed(IWorkbenchPart part) {
if (part.equals(currentPart)) {
if (isPinned())
if (isPinned()) {
pinPropertySheetAction.setChecked(false);
}
currentSelection = null;
currentPart = null;
}
Expand Down Expand Up @@ -656,8 +657,7 @@ public ShowInContext getShowInContext() {
@Override
public boolean show(ShowInContext aContext) {
if (!isPinned()
&& aContext instanceof PropertyShowInContext) {
PropertyShowInContext context = (PropertyShowInContext) aContext;
&& aContext instanceof PropertyShowInContext context) {
IWorkbenchPart part = context.getPart();
if (part != null) {
partActivated(part);
Expand Down Expand Up @@ -689,8 +689,9 @@ private HashSet<String> getIgnoredViews() {
for (IConfigurationElement element : elements) {
if ("excludeSources".equalsIgnoreCase(element.getName())) { //$NON-NLS-1$
String id = element.getAttribute("id"); //$NON-NLS-1$
if (id != null)
if (id != null) {
ignoredViews.add(id);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* entries so they are displayed together.
*/
/*package*/class PropertySheetCategory {
private String categoryName;
private final String categoryName;

private List<IPropertySheetEntry> entries = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class PropertySheetEntry extends EventManager implements IPropertySheetEn
* Create the CellEditorListener for this entry. It listens for value
* changes in the CellEditor, and cancel and finish requests.
*/
private ICellEditorListener cellEditorListener = new ICellEditorListener() {
private final ICellEditorListener cellEditorListener = new ICellEditorListener() {
@Override
public void editorValueChanged(boolean oldValidState,
boolean newValidState) {
Expand Down Expand Up @@ -438,8 +438,9 @@ protected PropertySheetEntry getParent() {
* @since 3.1 (was previously private)
*/
protected IPropertySource getPropertySource(Object object) {
if (sources.containsKey(object))
if (sources.containsKey(object)) {
return sources.get(object);
}

IPropertySource result = null;
IPropertySourceProvider provider = propertySourceProvider;
Expand Down Expand Up @@ -608,8 +609,7 @@ public void resetPropertyValue() {
IPropertySource source = getPropertySource(object);
if (source.isPropertySet(descriptor.getId())) {
// fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=21756
if (source instanceof IPropertySource2) {
IPropertySource2 extendedSource = (IPropertySource2) source;
if (source instanceof IPropertySource2 extendedSource) {
// continue with next if property is not resettable
if (!extendedSource.isPropertyResettable(descriptor.getId())) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ private Object getFirstContext(Object helpContext, HelpEvent e) {
Object[] contexts;
contexts = (Object[]) helpContext;

if (contexts.length > 0)
if (contexts.length > 0) {
return contexts[0];
}
return null;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class PropertySheetSorter {
/**
* The collator used to sort strings.
*/
private Collator collator;
private final Collator collator;

/**
* Creates a new sorter, which uses the default collator to sort strings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PropertySheetViewer extends Viewer {
* corresponding TreeItem. This is used in 'findItem' to
* greatly increase the performance.
*/
private HashMap<Object, TreeItem> entryToItemMap = new HashMap<>();
private final HashMap<Object, TreeItem> entryToItemMap = new HashMap<>();

private TreeEditor treeEditor;

Expand All @@ -95,7 +95,7 @@ class PropertySheetViewer extends Viewer {
private static String MISCELLANEOUS_CATEGORY_NAME = PropertiesMessages.PropertyViewer_misc;

// Cell editor support.
private int columnToEdit = 1;
private final int columnToEdit = 1;

private CellEditor cellEditor;

Expand All @@ -113,7 +113,7 @@ class PropertySheetViewer extends Viewer {
private IStatusLineManager statusLineManager;

// Cell editor activation listeners
private ListenerList<ICellEditorActivationListener> activationListeners = new ListenerList<>();
private final ListenerList<ICellEditorActivationListener> activationListeners = new ListenerList<>();

// the property sheet sorter
private PropertySheetSorter sorter = new PropertySheetSorter();
Expand Down Expand Up @@ -382,8 +382,9 @@ private void createItem(Object node, Widget parent, int index) {
// removed from the cache
item.addDisposeListener(e -> {
Object possibleEntry = e.widget.getData();
if (possibleEntry != null)
if (possibleEntry != null) {
entryToItemMap.remove(possibleEntry);
}
});

// add our listener
Expand Down Expand Up @@ -713,10 +714,8 @@ private void handleSelect(TreeItem selection) {
setErrorMessage(null);
} else {
Object object = selection.getData();
if (object instanceof IPropertySheetEntry) {
if (object instanceof IPropertySheetEntry activeEntry) {
// get the entry for this item
IPropertySheetEntry activeEntry = (IPropertySheetEntry) object;

// display the description for the item
setMessage(activeEntry.getDescription());

Expand Down Expand Up @@ -795,8 +794,9 @@ public void widgetSelected(SelectionEvent e) {

@Override
public void widgetDefaultSelected(SelectionEvent e) {
if (e.item instanceof TreeItem)
if (e.item instanceof TreeItem) {
handleSelect((TreeItem) e.item);
}
}
});
// Part2: handle single click activation of cell editor
Expand Down Expand Up @@ -1326,9 +1326,7 @@ private void updateEntry(IPropertySheetEntry entry, TreeItem item) {
item.setImage(1, image);
}

if (entry instanceof PropertySheetEntry) {
PropertySheetEntry entry2 = (PropertySheetEntry) entry;

if (entry instanceof PropertySheetEntry entry2) {
Color color = entry2.getForeground();
if (item.getForeground() != color) {
item.setForeground(color);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ public int hashCode() {

@Override
public boolean equals(Object obj) {
if (this == obj)
if (this == obj) {
return true;
if (obj == null)
}
if (obj == null) {
return false;
if (getClass() != obj.getClass())
}
if (getClass() != obj.getClass()) {
return false;
}
PropertyShowInContext other = (PropertyShowInContext) obj;
if (Objects.equals(part, other.part) && Objects.equals(getSelection(), other.getSelection())) {
// input needs to be equal, but only if both are really set.
Expand Down
Loading