2020import de .uka .ilkd .key .gui .extension .api .TabPanel ;
2121import de .uka .ilkd .key .gui .fonticons .FontAwesomeSolid ;
2222import de .uka .ilkd .key .gui .fonticons .IconFontSwing ;
23- import de .uka .ilkd .key .gui .settings .InvalidSettingsInputException ;
2423import de .uka .ilkd .key .gui .settings .SettingsProvider ;
25- import de .uka .ilkd .key .pp .PosInSequent ;
26- import de .uka .ilkd .key .proof .Node ;
27- import de .uka .ilkd .key .proof .Proof ;
28- import de .uka .ilkd .key .rule .Rule ;
2924
30- import org .jspecify .annotations .NonNull ;
25+ import org .jspecify .annotations .NullMarked ;
26+ import org .jspecify .annotations .Nullable ;
3127import org .slf4j .Logger ;
3228import org .slf4j .LoggerFactory ;
3329
3834@ KeYGuiExtension .Info (name = "Test Extension" ,
3935 description = "Should only be used for testing of the extension facade" , priority = 100000 ,
4036 optional = true )
37+ @ NullMarked
4138public class TestExtension implements KeYGuiExtension , KeYGuiExtension .MainMenu ,
4239 KeYGuiExtension .LeftPanel , KeYGuiExtension .StatusLine , KeYGuiExtension .ContextMenu ,
4340 KeYGuiExtension .Toolbar , KeYGuiExtension .KeyboardShortcuts , KeYGuiExtension .Settings {
@@ -47,26 +44,8 @@ public class TestExtension implements KeYGuiExtension, KeYGuiExtension.MainMenu,
4744 private final KeyAction actionTest = new TestAction ();
4845 private final ContextMenuAdapter cmAdapter = new ContextMenuAdapter () {
4946 @ Override
50- public List <Action > getContextActions (KeYMediator mediator , ContextMenuKind kind ,
51- Proof underlyingObject ) {
52- return Collections .singletonList (actionTest );
53- }
54-
55- @ Override
56- public List <Action > getContextActions (KeYMediator mediator , ContextMenuKind kind ,
57- Node underlyingObject ) {
58- return Collections .singletonList (actionTest );
59- }
60-
61- @ Override
62- public List <Action > getContextActions (KeYMediator mediator , ContextMenuKind kind ,
63- PosInSequent underlyingObject ) {
64- return Collections .singletonList (actionTest );
65- }
66-
67- @ Override
68- public List <Action > getContextActions (KeYMediator mediator , ContextMenuKind kind ,
69- Rule underlyingObject ) {
47+ public <T > List <Action > getContextActions (KeYMediator mediator , ContextMenuKind <T > kind ,
48+ @ Nullable T underlyingObject ) {
7049 return Collections .singletonList (actionTest );
7150 }
7251 };
@@ -77,8 +56,8 @@ public List<Action> getMainMenuActions(MainWindow mainWindow) {
7756 }
7857
7958 @ Override
80- public List <Action > getContextActions (KeYMediator mediator , ContextMenuKind kind ,
81- Object underlyingObject ) {
59+ public < T > List <Action > getContextActions (KeYMediator mediator , ContextMenuKind < T > kind ,
60+ @ Nullable T underlyingObject ) {
8261 return cmAdapter .getContextActions (mediator , kind , underlyingObject );
8362 }
8463
@@ -100,8 +79,8 @@ public SettingsProvider getSettings() {
10079 }
10180
10281 @ Override
103- public @ NonNull Collection <TabPanel > getPanels (@ NonNull MainWindow window ,
104- @ NonNull KeYMediator mediator ) {
82+ public Collection <TabPanel > getPanels (MainWindow window ,
83+ KeYMediator mediator ) {
10584 return Collections .singleton (new TabPanel () {
10685 @ Override
10786 public String getTitle () {
@@ -122,8 +101,6 @@ public Collection<Action> getShortcuts(KeYMediator mediator, String componentId,
122101 }
123102
124103 private static class TestAction extends KeyAction {
125- private static final long serialVersionUID = -2701623640497343330L ;
126-
127104 public TestAction () {
128105 setName ("Test" );
129106 setMenuPath ("Test.Test.Test" );
@@ -153,7 +130,7 @@ public JPanel getPanel(MainWindow window) {
153130 }
154131
155132 @ Override
156- public void applySettings (MainWindow window ) throws InvalidSettingsInputException {
133+ public void applySettings (MainWindow window ) {
157134 LOGGER .trace ("TestSettingsProvider.applySettings" );
158135 }
159136 }
0 commit comments