Skip to content

Commit c94d24f

Browse files
authored
Merge branch 'eclipse-platform:master' into master
2 parents 16558e5 + cbe2947 commit c94d24f

File tree

41 files changed

+644
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+644
-335
lines changed

debug/org.eclipse.debug.ui/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %pluginName
44
Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true
5-
Bundle-Version: 3.18.900.qualifier
5+
Bundle-Version: 3.19.0.qualifier
66
Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin
77
Bundle-Vendor: %providerName
88
Bundle-Localization: plugin
Lines changed: 15 additions & 0 deletions
Loading

debug/org.eclipse.debug.ui/plugin.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ BreakpointWorkingSet.name=Breakpoint
356356
BreakpointWorkingSet.description=Breakpoint workingsets contain listings of workspace breakpoints
357357
memoryRenderingsExtensionPointName = Memory Renderings
358358
TableRenderingPrefActionName = &Table Renderings Preferences...
359-
359+
BreakpointEnablement.label=Enablement
360360

361361
NewMemoryViewAction.label=&New Memory View
362362
NewMemoryViewAction.tooltip=New Memory View

debug/org.eclipse.debug.ui/plugin.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,6 +3044,11 @@ M4 = Platform-specific fourth key
30443044
class="org.eclipse.debug.internal.ui.views.breakpoints.WorkingSetBreakpointOrganizer"
30453045
icon="$nl$/icons/full/obj16/fldr_obj.svg"
30463046
id="org.eclipse.debug.ui.workingSetOrganizer"/>
3047+
<breakpointOrganizer
3048+
label="%BreakpointEnablement.label"
3049+
class="org.eclipse.debug.internal.ui.views.breakpoints.BreakpointEnablement"
3050+
icon="$nl$/icons/full/obj16/brkp_grp4.svg"
3051+
id="org.eclipse.debug.ui.breakpointEnablement"/>
30473052
<breakpointOrganizer
30483053
othersLabel="%BreakpointType.others"
30493054
label="%BreakpointType.label"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 IBM Corporation and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* IBM Corporation - initial API and implementation
13+
*******************************************************************************/
14+
package org.eclipse.debug.internal.ui.views.breakpoints;
15+
16+
import org.eclipse.core.resources.IMarkerDelta;
17+
import org.eclipse.core.runtime.CoreException;
18+
import org.eclipse.core.runtime.IAdaptable;
19+
import org.eclipse.debug.core.DebugPlugin;
20+
import org.eclipse.debug.core.IBreakpointListener;
21+
import org.eclipse.debug.core.model.IBreakpoint;
22+
import org.eclipse.debug.ui.AbstractBreakpointOrganizerDelegate;
23+
import org.eclipse.debug.ui.BreakpointTypeCategory;
24+
25+
/**
26+
* Breakpoint organizers for breakpoint types based on breakpoint enablement
27+
* state.
28+
*/
29+
public class BreakpointEnablement extends AbstractBreakpointOrganizerDelegate implements IBreakpointListener {
30+
31+
private final BreakpointTypeCategory ENABLED = new BreakpointTypeCategory("Enabled", 0); //$NON-NLS-1$
32+
private final BreakpointTypeCategory DISABLED = new BreakpointTypeCategory("Disabled", 1); //$NON-NLS-1$
33+
34+
public BreakpointEnablement() {
35+
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
36+
}
37+
38+
@Override
39+
public void dispose() {
40+
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
41+
}
42+
43+
@Override
44+
public IAdaptable[] getCategories(IBreakpoint breakpoint) {
45+
try {
46+
IAdaptable[] categories;
47+
if (breakpoint.isEnabled()) {
48+
categories = new IAdaptable[] { ENABLED };
49+
} else {
50+
categories = new IAdaptable[] { DISABLED };
51+
}
52+
return categories;
53+
} catch (CoreException e) {
54+
DebugPlugin.log(e);
55+
}
56+
return null;
57+
}
58+
59+
@Override
60+
public void breakpointAdded(IBreakpoint breakpoint) {
61+
}
62+
63+
@Override
64+
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
65+
}
66+
67+
@Override
68+
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
69+
fireCategoryChanged(ENABLED);
70+
}
71+
}

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*****************************************************************
2-
* Copyright (c) 2009, 2016 Texas Instruments and others
2+
* Copyright (c) 2009, 2025 Texas Instruments and others
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -29,6 +29,7 @@
2929
import org.eclipse.debug.internal.ui.breakpoints.provisional.OtherBreakpointCategory;
3030
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
3131
import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
32+
import org.eclipse.debug.ui.BreakpointTypeCategory;
3233

3334
/**
3435
* Breakpoint element comparator.
@@ -74,6 +75,12 @@ private int doCompare(IBreakpointContainer c1, IBreakpointContainer c2) {
7475
return -1;
7576
}
7677

78+
if (c1.getCategory() instanceof BreakpointTypeCategory breakType1 && breakType1.isSortable()) {
79+
if (c2.getCategory() instanceof BreakpointTypeCategory breakType2 && breakType2.isSortable()) {
80+
return Integer.compare(breakType1.getSortPriority(), breakType2.getSortPriority());
81+
}
82+
}
83+
7784
// Rest of categories should be listed alphabetically.
7885
if (fContext != null) {
7986
String name1 = fContext.getModelPresentation().getText(c1);

debug/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class BreakpointTypeCategory extends PlatformObject implements IBreakpoin
3131

3232
private final String fName;
3333
private ImageDescriptor fImageDescriptor = DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJS_BREAKPOINT_TYPE);
34-
34+
private boolean fSortable;
35+
private int fSortPriority;
3536
/**
3637
* Constructs a type category for the given type name.
3738
*
@@ -55,6 +56,20 @@ public BreakpointTypeCategory(String name, ImageDescriptor descriptor) {
5556
}
5657
}
5758

59+
/**
60+
* Constructs a type category for the given type name with the given sort
61+
* priority.
62+
*
63+
* @param name breakpoint type name
64+
* @param sortPriority used to calculate the sort order of this category
65+
* @since 3.19
66+
*/
67+
public BreakpointTypeCategory(String name, int sortPriority) {
68+
fName = name;
69+
fSortable = true;
70+
fSortPriority = sortPriority;
71+
}
72+
5873
/**
5974
* Returns the name of this category's breakpoint type.
6075
*
@@ -64,6 +79,16 @@ protected String getName() {
6479
return fName;
6580
}
6681

82+
/**
83+
* Returns the sorting priority of this category.
84+
*
85+
* @return the sorting priority of this category, default is {@code 0}
86+
* @since 3.19
87+
*/
88+
public int getSortPriority() {
89+
return fSortPriority;
90+
}
91+
6792
@Override
6893
public boolean equals(Object object) {
6994
if (object instanceof BreakpointTypeCategory type) {
@@ -72,6 +97,16 @@ public boolean equals(Object object) {
7297
return false;
7398
}
7499

100+
/**
101+
* Returns whether category has some sort order or not.
102+
*
103+
* @return whether category can be sorted or not.
104+
* @since 3.19
105+
*/
106+
public boolean isSortable() {
107+
return fSortable;
108+
}
109+
75110
@Override
76111
public int hashCode() {
77112
return getName().hashCode();

resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,10 @@ private void basicBuild(final IBuildConfiguration buildConfiguration, final int
411411
try {
412412
final IProject project = buildConfiguration.getProject();
413413
final ICommand[] commands;
414-
if (project.isAccessible())
415-
commands = ((Project) project).internalGetDescription().getBuildSpec(false);
416-
else
414+
if (project.isAccessible()) {
415+
ProjectDescription description = ((Project) project).internalGetDescription();
416+
commands = description == null ? null : description.getBuildSpec(false);
417+
} else
417418
commands = null;
418419
int work = commands == null ? 0 : commands.length;
419420
monitor.beginTask(NLS.bind(Messages.events_building_1, project.getFullPath()), work);
@@ -708,6 +709,9 @@ public ArrayList<BuilderPersistentInfo> createBuildersPersistentInfo(IProject pr
708709
ArrayList<BuilderPersistentInfo> oldInfos = getBuildersPersistentInfo(project);
709710

710711
ProjectDescription desc = ((Project) project).internalGetDescription();
712+
if (desc == null) {
713+
return null;
714+
}
711715
ICommand[] commands = desc.getBuildSpec(false);
712716
if (commands.length == 0)
713717
return null;
@@ -1577,7 +1581,8 @@ public ISchedulingRule getRule(IBuildConfiguration buildConfiguration, int trigg
15771581
final ICommand[] commands;
15781582
if (project.isAccessible()) {
15791583
Set<ISchedulingRule> rules = new HashSet<>();
1580-
commands = ((Project) project).internalGetDescription().getBuildSpec(false);
1584+
ProjectDescription description = ((Project) project).internalGetDescription();
1585+
commands = description == null ? new ICommand[0] : description.getBuildSpec(false);
15811586
boolean hasNullBuildRule = false;
15821587
BuildContext context = new BuildContext(buildConfiguration);
15831588
for (int i = 0; i < commands.length; i++) {

0 commit comments

Comments
 (0)