1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-03-28 14:56:28 +01:00

Move away of the deprecated AbstractUIPlugin.getWorkbench

Use PlatformUI.getWorkbench instead.

Change-Id: I8c0eb2c4b3b414e61f03fc9d9becd1d574f7e26d
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
Alexander Kurtakov 2020-02-04 11:16:52 +02:00
parent 2f20829144
commit f90f900e48
51 changed files with 104 additions and 79 deletions

View file

@ -26,6 +26,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -139,7 +140,7 @@ public class AutotoolsUIPlugin extends AbstractUIPlugin {
* Returns the active workbench window or <code>null</code> if none
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
/**

View file

@ -18,7 +18,6 @@ package org.eclipse.cdt.internal.autotools.ui.preferences;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.autotools.ui.AutotoolsUIPlugin;
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.jface.preference.IPreferenceStore;
@ -44,6 +43,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchViewerComparator;
/**
@ -252,7 +252,7 @@ public class AutoconfEditorPreferencePage extends AbstractEditorPreferencePage {
@Override
protected Control createContents(Composite parent) {
AutotoolsUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
getOverlayStore().load();
getOverlayStore().start();

View file

@ -18,7 +18,6 @@ package org.eclipse.cdt.internal.autotools.ui.preferences;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.autotools.ui.AutotoolsUIPlugin;
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
import org.eclipse.cdt.ui.PreferenceConstants;
import org.eclipse.jface.preference.IPreferenceStore;
@ -43,6 +42,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchViewerComparator;
/**
@ -233,7 +233,7 @@ public class AutomakeEditorPreferencePage extends AbstractEditorPreferencePage {
@Override
protected Control createContents(Composite parent) {
AutotoolsUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
getOverlayStore().load();
getOverlayStore().start();

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.make.ui; singleton:=true
Bundle-Version: 7.3.200.qualifier
Bundle-Version: 7.3.300.qualifier
Bundle-Activator: org.eclipse.cdt.make.internal.ui.MakeUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
@ -104,7 +105,7 @@ public class MakeUIPlugin extends AbstractUIPlugin {
* Returns the active workbench window or <code>null</code> if none
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
/**
@ -240,7 +241,7 @@ public class MakeUIPlugin extends AbstractUIPlugin {
if (getActiveWorkbenchShell() != null) {
return getActiveWorkbenchShell();
}
IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
return windows[0].getShell();
}

View file

@ -19,7 +19,6 @@ package org.eclipse.cdt.make.internal.ui.preferences;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.cdt.make.internal.ui.preferences.OverlayPreferenceStore.OverlayKey;
import org.eclipse.cdt.make.internal.ui.text.ColorManager;
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
@ -49,6 +48,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.model.WorkbenchViewerComparator;
/**
@ -241,7 +241,7 @@ public class MakefileEditorPreferencePage extends AbstractMakefileEditorPreferen
@Override
protected Control createContents(Composite parent) {
MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
IMakeHelpContextIds.MAKE_EDITOR_PREFERENCE_PAGE);
getOverlayStore().load();
getOverlayStore().start();

View file

@ -101,7 +101,7 @@ public class MakeView extends ViewPart {
@Override
public void createPartControl(Composite parent) {
MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(parent, IMakeHelpContextIds.MAKE_VIEW);
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IMakeHelpContextIds.MAKE_VIEW);
fViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
fViewer.setUseHashlookup(true);
fViewer.setContentProvider(new MakeContentProvider());

View file

@ -23,6 +23,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
@ -54,7 +55,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
* Returns the active workbench window or <code>null</code> if none
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
/**
@ -121,7 +122,7 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin {
if (getActiveWorkbenchShell() != null) {
return getActiveWorkbenchShell();
} else {
IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
return windows[0].getShell();
}
}

View file

@ -13,11 +13,11 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.cview;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionProviderAction;
/**
@ -60,7 +60,7 @@ public abstract class CViewAction extends SelectionProviderAction {
* Returns the workbench.
*/
protected IWorkbench getWorkbench() {
return CUIPlugin.getDefault().getWorkbench();
return PlatformUI.getWorkbench();
}
/**

View file

@ -33,6 +33,7 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.model.IWorkbenchAdapter;
@ -68,7 +69,7 @@ class CPElementLabelProvider extends LabelProvider implements IColorProvider {
fOutputImage = CDTSharedImages.getImageDescriptor(CDTSharedImages.IMG_OBJS_CONTAINER);
fContainerImage = CDTSharedImages.getImageDescriptor(CDTSharedImages.IMG_OBJS_LIBRARY);
IWorkbench workbench = CUIPlugin.getDefault().getWorkbench();
IWorkbench workbench = PlatformUI.getWorkbench();
fProjectImage = workbench.getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
bShowExported = showExported;

View file

@ -66,6 +66,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@ -212,8 +213,7 @@ public class CPathIncludeSymbolEntryPage extends CPathIncludeSymbolEntryBasePage
fIncludeSymPathsList.setButtonsMinWidth(buttonBarWidth);
setControl(composite);
fIncludeSymPathsList.getTreeViewer().addFilter(fFilter);
CUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(composite,
ICHelpContextIds.PROJECT_INCLUDE_PATHS_SYMBOLS);
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICHelpContextIds.PROJECT_INCLUDE_PATHS_SYMBOLS);
}
@Override

View file

@ -67,6 +67,7 @@ import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.model.WorkbenchLabelProvider;
@ -260,8 +261,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
fIncludeSymPathsList.setButtonsMinWidth(buttonBarWidth);
setControl(composite);
fIncludeSymPathsList.getTreeViewer().addFilter(fFilter);
CUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(composite,
ICHelpContextIds.PROJECT_INCLUDE_PATHS_SYMBOLS);
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, ICHelpContextIds.PROJECT_INCLUDE_PATHS_SYMBOLS);
}
@Override

View file

@ -14,10 +14,10 @@
package org.eclipse.cdt.internal.ui.dialogs.cpaths;
import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.cdt.ui.wizards.IPathEntryContainerPage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
public class ProjectContainerDescriptor implements IContainerDescriptor {
@ -39,7 +39,7 @@ public class ProjectContainerDescriptor implements IContainerDescriptor {
@Override
public Image getImage() {
return CUIPlugin.getDefault().getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT);
return PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT);
}

View file

@ -45,6 +45,7 @@ import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
public class FileTransferDragAdapter implements TransferDragSourceListener {
@ -168,7 +169,7 @@ public class FileTransferDragAdapter implements TransferDragSourceListener {
private static void runOperation(IRunnableWithProgress operation, boolean fork, boolean cancelable) {
try {
IWorkbench workbench = CUIPlugin.getDefault().getWorkbench();
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
Shell parent = window.getShell();

View file

@ -46,6 +46,7 @@ import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.undo.DocumentUndoManagerRegistry;
import org.eclipse.text.undo.IDocumentUndoManager;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.TextEditorAction;
@ -62,8 +63,7 @@ public class AddIncludeAction extends TextEditorAction {
*/
public AddIncludeAction(ITextEditor editor) {
super(CEditorMessages.getBundleForConstructedKeys(), "AddInclude.", editor); //$NON-NLS-1$
CUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(this,
ICHelpContextIds.ADD_INCLUDE_ON_SELECTION_ACTION);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.ADD_INCLUDE_ON_SELECTION_ACTION);
final Shell shell = editor.getEditorSite().getShell();
fAmbiguityResolver = new IElementSelector() {
@SuppressWarnings("unchecked")

View file

@ -39,6 +39,7 @@ import org.eclipse.text.edits.MultiTextEdit;
import org.eclipse.text.undo.DocumentUndoManagerRegistry;
import org.eclipse.text.undo.IDocumentUndoManager;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.TextEditorAction;
@ -52,7 +53,7 @@ public class OrganizeIncludesAction extends TextEditorAction {
*/
public OrganizeIncludesAction(ITextEditor editor) {
super(CEditorMessages.getBundleForConstructedKeys(), "OrganizeIncludes.", editor); //$NON-NLS-1$
CUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.ORGANIZE_INCLUDES_ACTION);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, ICHelpContextIds.ORGANIZE_INCLUDES_ACTION);
}
@Override

View file

@ -16,7 +16,6 @@
package org.eclipse.cdt.internal.ui.refactoring.togglefunction;
import org.eclipse.cdt.internal.ui.refactoring.changes.CreateFileChange;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
@ -56,7 +55,7 @@ public class ToggleFileCreator {
}
final boolean[] answer = new boolean[1];
Runnable r = () -> {
Shell shell = CUIPlugin.getDefault().getWorkbench().getWorkbenchWindows()[0].getShell();
Shell shell = PlatformUI.getWorkbench().getWorkbenchWindows()[0].getShell();
String functionName;
if (context.getDeclaration() != null) {
functionName = context.getDeclaration().getRawSignature();

View file

@ -51,6 +51,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.model.IWorkbenchAdapter;
@ -107,7 +108,7 @@ public class CElementImageProvider {
private static ImageDescriptor DESC_OBJ_PROJECT;
//private static ImageDescriptor DESC_OBJ_FOLDER;
{
ISharedImages images = CUIPlugin.getDefault().getWorkbench().getSharedImages();
ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
DESC_OBJ_PROJECT_CLOSED = images.getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED);
DESC_OBJ_PROJECT = images.getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
//DESC_OBJ_FOLDER= images.getImageDescriptor(ISharedImages.IMG_OBJ_FOLDER);

View file

@ -39,6 +39,7 @@ import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.NewProjectAction;
public abstract class AbstractOpenWizardAction extends Action implements IWorkbenchWindowActionDelegate {
@ -78,7 +79,7 @@ public abstract class AbstractOpenWizardAction extends Action implements IWorkbe
}
protected IWorkbench getWorkbench() {
return CUIPlugin.getDefault().getWorkbench();
return PlatformUI.getWorkbench();
}
private boolean isOfAcceptedType(Object obj) {

View file

@ -17,12 +17,12 @@ package org.eclipse.cdt.internal.ui.workingsets;
import java.util.Collection;
import java.util.List;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.CompoundContributionItem;
/**
@ -76,7 +76,7 @@ abstract class AbstractWorkingSetsContribution extends CompoundContributionItem
private IWorkingSetManager getWorkingsetManager() {
if (workingSetManager == null) {
workingSetManager = CUIPlugin.getDefault().getWorkbench().getWorkingSetManager();
workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager();
}
return workingSetManager;

View file

@ -36,6 +36,7 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.XMLMemento;
/**
@ -58,7 +59,7 @@ public class WorkingSetConfigurationManager {
static final String ATTR_CONFIG = "config"; //$NON-NLS-1$
static final String ATTR_FACTORY = "factory"; //$NON-NLS-1$
static IWorkingSetManager WS_MGR = CUIPlugin.getDefault().getWorkbench().getWorkingSetManager();
static IWorkingSetManager WS_MGR = PlatformUI.getWorkbench().getWorkingSetManager();
private static final WorkingSetConfigurationManager INSTANCE = new WorkingSetConfigurationManager();

View file

@ -16,7 +16,6 @@
package org.eclipse.cdt.ui.actions;
import org.eclipse.cdt.internal.ui.workingsets.WorkingSetConfigurationDialog;
import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@ -25,12 +24,13 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
/**
*/
public class WorkingSetConfigAction implements IWorkbenchWindowActionDelegate, IPropertyChangeListener {
private static final IWorkingSetManager wsm = CUIPlugin.getDefault().getWorkbench().getWorkingSetManager();
private static final IWorkingSetManager wsm = PlatformUI.getWorkbench().getWorkingSetManager();
private boolean enabled = true;
private IWorkbenchWindow window;
private IAction action;

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui; singleton:=true
Bundle-Version: 8.3.300.qualifier
Bundle-Version: 8.3.400.qualifier
Bundle-Activator: org.eclipse.cdt.debug.ui.CDebugUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.cdt.debug.core.model.ICValue;
import org.eclipse.cdt.debug.core.model.IEnableDisableTarget;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.debug.ui.breakpoints.CBreakpointPropertyDialogAction;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IMarker;
@ -62,6 +61,7 @@ import org.eclipse.ui.IPathEditorInput;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IURIEditorInput;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
@ -252,7 +252,7 @@ public class CDebugUIUtils {
if (e != null)
detail = e.getMessage();
Shell shell = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
MessageDialog.openError(shell, title, message + "\n" + detail); //$NON-NLS-1$
return Status.OK_STATUS;

View file

@ -19,7 +19,6 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDebugConstants;
import org.eclipse.cdt.debug.core.model.ISteppingModeTarget;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@ -28,6 +27,7 @@ import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
@ -84,7 +84,7 @@ public class SetSteppingModeHandler extends AbstractHandler implements IElementU
*/
@Override
public boolean isEnabled() {
IWorkbenchWindow window = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
return (window != null && getSteppingModeTarget(window) != null);
}
@ -93,7 +93,7 @@ public class SetSteppingModeHandler extends AbstractHandler implements IElementU
*/
@Override
public boolean isHandled() {
IWorkbenchWindow window = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
return (window != null && getSteppingModeTarget(window) != null);
}

View file

@ -44,6 +44,7 @@ import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartReference;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.progress.UIJob;
@ -59,8 +60,8 @@ public class DisassemblyEditorManager implements IWindowListener, IDisassemblyCo
fEditorParts = new HashMap<>();
fOpenDisassemblyPolicy = new HashMap<>();
fSteppingModePolicy = new HashMap<>();
CDebugUIPlugin.getDefault().getWorkbench().addWindowListener(this);
IWorkbenchWindow window = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
PlatformUI.getWorkbench().addWindowListener(this);
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
window.getPartService().addPartListener(this);
}
@ -69,7 +70,7 @@ public class DisassemblyEditorManager implements IWindowListener, IDisassemblyCo
public void dispose() {
getDisassemblyManager().removeDisassemblyContextListener(this);
CDebugUIPlugin.getDefault().getWorkbench().removeWindowListener(this);
PlatformUI.getWorkbench().removeWindowListener(this);
fSteppingModePolicy.clear();
fOpenDisassemblyPolicy.clear();
fEditorParts.clear();

View file

@ -50,6 +50,7 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.dialogs.EncodingFieldEditor;
import org.osgi.service.prefs.BackingStoreException;
@ -330,7 +331,7 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
private void refreshViews() {
BusyIndicator.showWhile(getShell().getDisplay(), () -> {
// Refresh interested views
IWorkbenchWindow[] windows = CDebugUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
IWorkbenchPage page = null;
for (int i = 0; i < windows.length; i++) {
page = windows[i].getActivePage();

View file

@ -51,6 +51,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
/**
@ -174,7 +175,7 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
private void doAddMemoryBlocks(final IMemoryRenderingSite renderingSite, final Object context,
final IMemorySpaceAwareMemoryBlockRetrieval retrieval, String[] memorySpaces) {
Shell shell = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
// create dialog to ask for expression/address to block
AddMemoryBlockDialog dialog = new AddMemoryBlockDialog(shell, memorySpaces);
@ -360,7 +361,7 @@ public class AddMemoryBlocks implements IAddMemoryBlocksTarget {
if (e != null)
detail = e.getMessage();
Shell shell = CDebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
MessageDialog.openError(shell, title, message + "\n" + detail); //$NON-NLS-1$
return Status.OK_STATUS;

View file

@ -223,7 +223,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
* @return the active workbench window
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
public static IWorkbenchPage getActivePage() {

View file

@ -60,6 +60,7 @@ import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
public class ImportExecutablePageOne extends WizardPage {
@ -209,7 +210,7 @@ public class ImportExecutablePageOne extends WizardPage {
Dialog.applyDialogFont(workArea);
selectSingleButton.setSelection(true);
checkControlState();
CDebugUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
ICDebugHelpContextIds.IMPORT_EXECUTABLE_PAGE_ONE);
}

View file

@ -24,7 +24,6 @@ import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.parser.util.StringUtil;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@ -51,6 +50,7 @@ import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
public class ImportExecutablePageTwo extends WizardPage {
@ -304,7 +304,7 @@ public class ImportExecutablePageTwo extends WizardPage {
});
addLaunchConfigTypes();
updateControls();
CDebugUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
ICDebugHelpContextIds.IMPORT_EXECUTABLE_PAGE_TWO);
}

View file

@ -29,6 +29,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -162,7 +163,7 @@ public class MulticoreVisualizerUIPlugin extends AbstractUIPlugin {
return debugDialogShell;
debugDialogShell = null;
}
IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
return windows[0].getShell();
}
@ -176,7 +177,7 @@ public class MulticoreVisualizerUIPlugin extends AbstractUIPlugin {
* @return the active workbench window
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
public static IWorkbenchPage getActivePage() {

View file

@ -34,6 +34,7 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
import org.osgi.framework.BundleContext;
@ -151,7 +152,7 @@ public class GdbUIPlugin extends AbstractUIPlugin {
return debugDialogShell;
debugDialogShell = null;
}
IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
return windows[0].getShell();
}
@ -208,7 +209,7 @@ public class GdbUIPlugin extends AbstractUIPlugin {
* @return the active workbench window
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
public static IWorkbenchPage getActivePage() {

View file

@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
public class CDebuggerTab extends CLaunchConfigurationTab {
/**
@ -122,7 +123,7 @@ public class CDebuggerTab extends CLaunchConfigurationTab {
fContents = new Composite(fContainer, SWT.NONE);
setControl(fContainer);
GdbUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB);
int numberOfColumns = fAttachMode ? 2 : 1;
GridLayout layout = new GridLayout(numberOfColumns, false);

View file

@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.cdt.dsf.ui;singleton:=true
Bundle-Version: 2.5.300.qualifier
Bundle-Version: 2.5.400.qualifier
Bundle-Activator: org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",

View file

@ -55,6 +55,7 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PlatformUI;
/**
* Creates an information control to display an expression in a hover control.
@ -439,7 +440,7 @@ public class ExpressionInformationControlCreator implements IInformationControlC
* @return a view to emulate or <code>null</code>
*/
private AbstractDebugView getViewToEmulate() {
IWorkbenchPage page = DsfUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
AbstractDebugView expressionsView = (AbstractDebugView) page.findView(IDebugUIConstants.ID_EXPRESSION_VIEW);
if (expressionsView != null && expressionsView.isVisible()) {
return expressionsView;

View file

@ -27,6 +27,7 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.texteditor.ITextEditor;
@ -109,7 +110,7 @@ public class DsfSourceSelectionResolver implements Runnable {
return fEditorPage;
}
final IWorkbench wb = DsfUIPlugin.getDefault().getWorkbench();
final IWorkbench wb = PlatformUI.getWorkbench();
// Run in UI thread to access UI resources
ResolveEditorRunnable reditorRunnable = new ResolveEditorRunnable() {
TextEditor result = null;

View file

@ -61,6 +61,7 @@ import org.eclipse.ui.ISources;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
/**
* DSF version of handler for viewing variable in memory view command.
@ -200,7 +201,7 @@ public class DsfViewMemoryHandler extends AbstractHandler {
private void showInMemoryView(VariableExpressionVMC contexts[]) {
try {
IWorkbenchPage page = DsfUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart memoryView = page.showView(IDebugUIConstants.ID_MEMORY_VIEW, null, IWorkbenchPage.VIEW_ACTIVATE);
final IMemoryRenderingSite memRendSite = (IMemoryRenderingSite) memoryView;
for (final VariableExpressionVMC context : contexts) {

View file

@ -29,6 +29,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ResourceLocator;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -174,7 +175,7 @@ public class DsfUIPlugin extends AbstractUIPlugin {
* @return the active workbench shell or <code>null</code> if none
*/
public static Shell getActiveWorkbenchShell() {
IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
return window.getShell();
}

View file

@ -31,6 +31,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.util.tracker.ServiceTracker;
@ -153,8 +154,8 @@ public class TriggerCellModifier implements ICellModifier {
}
private Shell getShell() {
if (DsfExamplesPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow() != null) {
return DsfExamplesPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
}
return null;
}

View file

@ -20,6 +20,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ResourceLocator;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -65,7 +66,7 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
}
public static Shell getActiveWorkbenchShell() {
IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
return window.getShell();
}
@ -76,7 +77,7 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
if (getActiveWorkbenchShell() != null) {
return getActiveWorkbenchShell();
}
IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
return windows[0].getShell();
}

View file

@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.docker.launcher;
import org.eclipse.cdt.docker.launcher.DockerLaunchUIPlugin;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ITreeSelection;
import org.eclipse.linuxtools.docker.core.IDockerConnection;
@ -18,6 +17,7 @@ import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
public class ConnectionListener implements ISelectionListener {
@ -35,7 +35,7 @@ public class ConnectionListener implements ISelectionListener {
}
public void init() {
IWorkbench workbench = DockerLaunchUIPlugin.getDefault().getWorkbench();
IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench != null) {
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
if (window != null) {

View file

@ -24,6 +24,7 @@ import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
@ -78,7 +79,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
return debugDialogShell;
debugDialogShell = null;
}
IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
return windows[0].getShell();
}
@ -135,7 +136,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
* @return the active workbench window
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
public static IWorkbenchPage getActivePage() {

View file

@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
/**
* A launch configuration tab that displays and edits program arguments,
@ -69,7 +70,7 @@ public abstract class CAbstractArgumentsTab extends CLaunchConfigurationTab {
comp.setLayoutData(gd);
setControl(comp);
LaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_ARGUMNETS_TAB);
createArgumentComponent(comp, 1);

View file

@ -61,6 +61,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.TwoPaneElementSelector;
/**
@ -114,7 +115,7 @@ public class CMainTab2 extends CAbstractMainTab {
Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
LaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
GridLayout topLayout = new GridLayout();

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.floatingpoint;singleton:=true
Bundle-Version: 1.0.200.qualifier
Bundle-Version: 1.0.300.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core;bundle-version="3.7.100",
org.eclipse.debug.ui;bundle-version="3.8.1",

View file

@ -1101,7 +1101,7 @@ public class FPRendering extends AbstractMemoryRendering implements IRepositiona
if (fConnection == null) {
fConnection = () -> {
// update UI asynchronously
Display display = FPRenderingPlugin.getDefault().getWorkbench().getDisplay();
Display display = PlatformUI.getWorkbench().getDisplay();
display.asyncExec(() -> {
try {
if (fBigBaseAddress != FPRendering.this.fRendering.getMemoryBlock().getBigBaseAddress()) {

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.traditional;singleton:=true
Bundle-Version: 1.5.100.qualifier
Bundle-Version: 1.5.200.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core,
org.eclipse.debug.ui,

View file

@ -1269,7 +1269,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
if (fConnection == null) {
fConnection = () -> {
// update UI asynchronously
Display display = TraditionalRenderingPlugin.getDefault().getWorkbench().getDisplay();
Display display = PlatformUI.getWorkbench().getDisplay();
display.asyncExec(() -> {
try {
if (fBigBaseAddress != TraditionalRendering.this.fRendering.getMemoryBlock()

View file

@ -43,6 +43,7 @@ import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewSite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.part.ViewPart;
@ -121,7 +122,7 @@ public class ResultsView extends ViewPart {
@Override
public void createPartControl(Composite parent) {
sessionsManager = TestsRunnerPlugin.getDefault().getTestingSessionsManager();
IWorkbench workbench = TestsRunnerPlugin.getDefault().getWorkbench();
IWorkbench workbench = PlatformUI.getWorkbench();
Clipboard clipboard = new Clipboard(parent.getDisplay());
this.parent = parent;

View file

@ -43,6 +43,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
/**
* Launch delegate implementation that redirects its queries to the preferred
@ -239,11 +240,10 @@ public abstract class BaseTestsLaunchDelegate extends LaunchConfigurationDelegat
private void activateTestingView() {
Display.getDefault().syncExec(() -> {
try {
IWorkbenchWindow activeWindow = TestsRunnerPlugin.getDefault().getWorkbench()
.getActiveWorkbenchWindow();
IWorkbenchWindow activeWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IViewPart view = activeWindow.getActivePage()
.showView(ITestsRunnerConstants.TESTS_RUNNER_RESULTS_VIEW_ID);
TestsRunnerPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(view);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(view);
} catch (PartInitException e) {
TestsRunnerPlugin.log(e);
}