-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate Refresh Action to Command/Handler framework and support
visibility only whne CDT debug is active. See #1034
- Loading branch information
1 parent
8d06425
commit e381b41
Showing
4 changed files
with
153 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
...ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/RefreshActionDelegate.java
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
...sf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/viewmodel/actions/ViewRefreshHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 Advantest Europe GmbH and others. | ||
* | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Raghunandana Murthappa | ||
*******************************************************************************/ | ||
package org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.actions; | ||
|
||
import org.eclipse.cdt.dsf.debug.ui.viewmodel.actions.VMHandlerUtils; | ||
import org.eclipse.cdt.dsf.ui.viewmodel.IVMProvider; | ||
import org.eclipse.cdt.dsf.ui.viewmodel.update.ICachingVMProvider; | ||
import org.eclipse.core.commands.AbstractHandler; | ||
import org.eclipse.core.commands.ExecutionEvent; | ||
import org.eclipse.core.commands.ExecutionException; | ||
import org.eclipse.core.runtime.IStatus; | ||
import org.eclipse.ui.IViewPart; | ||
import org.eclipse.ui.IWorkbenchPart; | ||
import org.eclipse.ui.handlers.HandlerUtil; | ||
|
||
/** | ||
* Handler that handles the 'Refresh' toolbar contribution item that is present on all debug views. | ||
* | ||
* @author Raghunandana Murthappa | ||
*/ | ||
public class ViewRefreshHandler extends AbstractHandler { | ||
@Override | ||
public Object execute(ExecutionEvent event) throws ExecutionException { | ||
IWorkbenchPart activePart = HandlerUtil.getActivePart(event); | ||
if (activePart instanceof IViewPart view) { | ||
IVMProvider provider = VMHandlerUtils.getVMProviderForPart(view); | ||
if (provider instanceof ICachingVMProvider cachingVmProvider) { | ||
cachingVmProvider.refresh(); | ||
} | ||
} | ||
return IStatus.OK; | ||
} | ||
} |