GP-4023 - Fix to not show debugger bookmarks in the CodeBrowser

This commit is contained in:
dragonmacher 2025-08-29 14:10:16 -04:00
parent 91ec97a946
commit b36dfb6766
6 changed files with 49 additions and 13 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -52,6 +52,7 @@ public class BookmarkDBManager implements BookmarkManager, ErrorHandler, Manager
private boolean upgrade = false;
private Map<String, BookmarkType> typesByName = new TreeMap<>();
private Set<String> definedTypes = new HashSet<>();
private ObjectArray typesArray = new ObjectArray();
private Lock lock;
@ -235,6 +236,11 @@ public class BookmarkDBManager implements BookmarkManager, ErrorHandler, Manager
return (BookmarkTypeDB) typesArray.get(typeID);
}
@Override
public boolean isDefinedType(String type) {
return definedTypes.contains(type);
}
@Override
public BookmarkType defineType(String type, Icon icon, Color color, int priority) {
lock.acquire();
@ -251,6 +257,7 @@ public class BookmarkDBManager implements BookmarkManager, ErrorHandler, Manager
bmt.setIcon(icon);
bmt.setMarkerColor(color);
bmt.setMarkerPriority(priority);
definedTypes.add(type);
}
catch (IOException e) {
dbError(e);

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -66,6 +66,15 @@ public interface BookmarkManager {
*/
BookmarkType defineType(String type, Icon icon, Color color, int priority);
/**
* Returns true if the given bookmark type has been defined via a call to
* {@link #defineType(String, Icon, Color, int)}. This allows clients to know whether the
* given type should be displayed.
* @param type the type to check
* @return true if defined
*/
boolean isDefinedType(String type);
/**
* Returns list of known bookmark types
* @return list of known bookmark types