1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00

Removed dependencies on the compatibility plugin and replaced deprecated classes and methods.

Warning cleanup.
This commit is contained in:
Mikhail Khodjaiants 2004-05-21 19:59:49 +00:00
parent 7629490929
commit 34df8b137e
38 changed files with 3187 additions and 3194 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -16,7 +16,7 @@
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.debug.core"/>
<import plugin="org.eclipse.cdt.core"/>
<import plugin="org.eclipse.core.runtime.compatibility"/>
<import plugin="org.eclipse.core.runtime"/>
</requires>

View file

@ -14,7 +14,6 @@ import java.text.MessageFormat;
import java.util.HashMap;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
import org.eclipse.cdt.debug.internal.core.DebugConfiguration;
import org.eclipse.cdt.debug.internal.core.ListenerList;
@ -26,21 +25,26 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IBreakpointManager;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.osgi.framework.BundleContext;
/**
* The plugin class for C/C++ debug core.
*/
public class CDebugCorePlugin extends Plugin {
/**
* The plug-in identifier (value <code>"org.eclipse.cdt.debug.core"</code>).
*/
public static final String PLUGIN_ID = "org.eclipse.cdt.debug.core" ; //$NON-NLS-1$
/**
* Status code indicating an unexpected internal error.
*/
@ -73,8 +77,8 @@ public class CDebugCorePlugin extends Plugin {
/**
* The constructor.
*/
public CDebugCorePlugin( IPluginDescriptor descriptor ) {
super( descriptor );
public CDebugCorePlugin() {
super();
plugin = this;
}
@ -106,9 +110,9 @@ public class CDebugCorePlugin extends Plugin {
// If the default instance is not yet initialized,
// return a static identifier. This identifier must
// match the plugin id defined in plugin.xml
return "org.eclipse.cdt.debug.core"; //$NON-NLS-1$
return PLUGIN_ID;
}
return getDefault().getDescriptor().getUniqueIdentifier();
return getDefault().getBundle().getSymbolicName();
}
public static String getResourceString( String key ) {
@ -173,8 +177,7 @@ public class CDebugCorePlugin extends Plugin {
}
private void initializeDebugConfiguration() {
IPluginDescriptor descriptor = getDefault().getDescriptor();
IExtensionPoint extensionPoint = descriptor.getExtensionPoint( "CDebugger" ); //$NON-NLS-1$
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint( getUniqueIdentifier(), "CDebugger" ); //$NON-NLS-1$
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
fDebugConfigurations = new HashMap( infos.length );
for( int i = 0; i < infos.length; i++ ) {
@ -203,26 +206,6 @@ public class CDebugCorePlugin extends Plugin {
return dbgCfg;
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#shutdown()
*/
public void shutdown() throws CoreException {
setSessionManager( null );
disposeBreakpointListenersList();
resetBreakpointsInstallCount();
super.shutdown();
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#startup()
*/
public void startup() throws CoreException {
super.startup();
createBreakpointListenersList();
resetBreakpointsInstallCount();
setSessionManager( new SessionManager() );
}
protected void resetBreakpointsInstallCount() {
IBreakpointManager bm = DebugPlugin.getDefault().getBreakpointManager();
IBreakpoint[] breakpoints = bm.getBreakpoints( getUniqueIdentifier() );
@ -291,4 +274,24 @@ public class CDebugCorePlugin extends Plugin {
fBreakpointListeners.removeAll();
fBreakpointListeners = null;
}
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start( BundleContext context ) throws Exception {
super.start( context );
createBreakpointListenersList();
resetBreakpointsInstallCount();
setSessionManager( new SessionManager() );
}
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop( BundleContext context ) throws Exception {
setSessionManager( null );
disposeBreakpointListenersList();
resetBreakpointsInstallCount();
super.stop( context );
}
}

View file

@ -16,7 +16,7 @@ public interface ICDebugConstants
/**
* C/C++ debug plug-in identifier (value <code>"org.eclipse.cdt.debug.core"</code>).
*/
public static final String PLUGIN_ID = CDebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier();
public static final String PLUGIN_ID = CDebugCorePlugin.getUniqueIdentifier();
/**
* The identifier of the default variable format to use in the variables view

View file

@ -210,11 +210,9 @@ public class CBreakpointManager implements ICDIEventListener, IAdaptable {
ICSourceLocator sl = getSourceLocator();
if ( sl != null )
return sl.contains( project );
else {
if ( project.equals( getExecFile().getProject() ) )
return true;
return CDebugUtils.isReferencedProject( getExecFile().getProject(), project );
}
if ( project.equals( getExecFile().getProject() ) )
return true;
return CDebugUtils.isReferencedProject( getExecFile().getProject(), project );
}
}
return true;

View file

@ -7,12 +7,11 @@ package org.eclipse.cdt.debug.internal.core;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
import org.eclipse.cdt.debug.core.ICDebugConfiguration;
import org.eclipse.cdt.debug.core.ICDebugger;
import org.eclipse.core.boot.BootLoader;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
public class DebugConfiguration implements ICDebugConfiguration {
/**
@ -64,7 +63,7 @@ public class DebugConfiguration implements ICDebugConfiguration {
}
public boolean supportsCPU(String cpu) {
String nativeCPU = BootLoader.getOSArch();
String nativeCPU = Platform.getOSArch();
boolean ret = false;
if ( nativeCPU.startsWith(cpu) ) {
ret = getCPUs().contains(PLATFORM_NATIVE);
@ -99,7 +98,7 @@ public class DebugConfiguration implements ICDebugConfiguration {
fCPUs.add(PLATFORM_NATIVE);
}
else {
String nativeCPU = BootLoader.getOSArch();
String nativeCPU = Platform.getOSArch();
StringTokenizer tokenizer = new StringTokenizer(cpus, ","); //$NON-NLS-1$
fCPUs = new HashSet(tokenizer.countTokens());
while (tokenizer.hasMoreTokens()) {

View file

@ -753,9 +753,7 @@ public class CThread extends CDebugElement
{
CStackFrame frame = (CStackFrame)(((IAdaptable)it.next()).getAdapter( CStackFrame.class ));
if ( frame != null )
{
((CStackFrame)frame).dispose();
}
frame.dispose();
}
fStackFrames.clear();
setLastStackDepth( 0 );

View file

@ -345,8 +345,7 @@ public class CValue extends CDebugElement implements ICValue
BigInteger bigValue = new BigInteger( value.getValueString() );
return bigValue.toString();
}
else
return Long.toString( value.longValue() );
return Long.toString( value.longValue() );
}
case ICDIFormat.HEXADECIMAL:
{

View file

@ -199,7 +199,7 @@ public abstract class CVariable extends CDebugElement
{
if ( getCDIVariableObject() instanceof ICDIArgumentObject )
fCDIVariable = getCDISession().getVariableManager().createArgument( (ICDIArgumentObject)getCDIVariableObject() );
else if ( getCDIVariableObject() instanceof ICDIVariableObject )
else
fCDIVariable = getCDISession().getVariableManager().createVariable( getCDIVariableObject() );
}
catch( CDIException e )

View file

@ -214,10 +214,11 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
LinkedList list = new LinkedList();
for ( int j = 0; j < wsFiles.length; ++j )
if ( wsFiles[j].exists() )
{
if ( !searchForDuplicateFiles() )
return wsFiles[j];
else
list.add( wsFiles[j] );
list.add( wsFiles[j] );
}
if ( list.size() > 0 )
return ( list.size() == 1 ) ? list.getFirst() : list;
@ -271,14 +272,14 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
LinkedList list = new LinkedList();
for ( int j = 0; j < wsFiles.length; ++j )
if ( wsFiles[j].exists() )
{
if ( !searchForDuplicateFiles() )
return wsFiles[j];
else
list.add( wsFiles[j] );
list.add( wsFiles[j] );
}
if ( list.size() > 0 )
return ( list.size() == 1 ) ? list.getFirst() : list;
else
return createExternalFileStorage( path );
return createExternalFileStorage( path );
}
return null;
}

View file

@ -163,10 +163,11 @@ public class CProjectSourceLocation implements IProjectSourceLocation
IFile[] wsFiles = CDebugCorePlugin.getWorkspace().getRoot().findFilesForLocation( path );
for ( int i = 0; i < wsFiles.length; ++i )
if ( wsFiles[i].getProject().equals( getProject() ) && wsFiles[i].exists() )
{
if ( !searchForDuplicateFiles() )
return wsFiles[i];
else
list.add( wsFiles[i] );
list.add( wsFiles[i] );
}
}
return ( list.size() > 0 ) ? ( ( list.size() == 1 ) ? list.getFirst() : list ) : null;
}
@ -186,10 +187,11 @@ public class CProjectSourceLocation implements IProjectSourceLocation
IFile[] wsFiles = CDebugCorePlugin.getWorkspace().getRoot().findFilesForLocation( path );
for ( int j = 0; j < wsFiles.length; ++j )
if ( wsFiles[j].exists() )
{
if ( !searchForDuplicateFiles() )
return wsFiles[j];
else
list.add( wsFiles[j] );
list.add( wsFiles[j] );
}
}
}
return ( list.size() > 0 ) ? ( ( list.size() == 1 ) ? list.getFirst() : list ) : null;

View file

@ -123,8 +123,6 @@ public class SourceUtils
public static ICSourceLocation[] initializeSourceLocations( Element root )
{
List sourceLocations = new LinkedList();
ClassLoader classLoader = CDebugCorePlugin.getDefault() .getDescriptor().getPluginClassLoader();
NodeList list = root.getChildNodes();
int length = list.getLength();
for ( int i = 0; i < length; ++i )
@ -146,7 +144,7 @@ public class SourceUtils
Class clazz = null;
try
{
clazz = classLoader.loadClass( className );
clazz = CDebugCorePlugin.getDefault().getBundle().loadClass( className );
}
catch( ClassNotFoundException e )
{

View file

@ -1,3 +1,14 @@
2004-05-21 Mikhail Khodjaiants
Removed dependencies on the compatibility plugin and replaced deprecated classes and methods.
Warning cleanup.
* GDBServerDebuggerPage.java
* IMIUIConstants.java
* MIUIPlugin.java
* SerialPortSettingsBlock.java
* TCPSettingsBlock.java
* SelectionButtonDialogFieldGroup.java
* plugin.xml
2004-04-29 Mikhail Khodjaiants
Fix for bug 59083: Two short cut keys in one sentence.
* MIUIPluginResources.properties

View file

@ -21,7 +21,7 @@
<import plugin="org.eclipse.cdt.ui"/>
<import plugin="org.eclipse.debug.core"/>
<import plugin="org.eclipse.debug.ui"/>
<import plugin="org.eclipse.core.runtime.compatibility"/>
<import plugin="org.eclipse.core.runtime"/>
</requires>

View file

@ -193,7 +193,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
field.setDialogFieldListener(
new IDialogFieldListener()
{
public void dialogFieldChanged( DialogField field )
public void dialogFieldChanged( DialogField f )
{
connectionTypeChanged();
}

View file

@ -14,7 +14,7 @@ package org.eclipse.cdt.debug.mi.internal.ui;
public interface IMIUIConstants
{
/**
* C/C++ Debug UI plug-in identifier (value <code>"org.eclipse.cdt.debug.ui"</code>).
* Plug-in identifier (value <code>"org.eclipse.cdt.debug.mi.ui"</code>).
*/
public static final String PLUGIN_ID = MIUIPlugin.getDefault().getDescriptor().getUniqueIdentifier();
public static final String PLUGIN_ID = MIUIPlugin.getUniqueIdentifier();
}

View file

@ -1,14 +1,21 @@
package org.eclipse.cdt.debug.mi.internal.ui;
import org.eclipse.ui.plugin.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.resources.*;
import java.util.*;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
* The main plugin class to be used in the desktop.
*/
public class MIUIPlugin extends AbstractUIPlugin {
/**
* The plug-in identifier (value <code>"org.eclipse.cdt.debug.mi.ui"</code>).
*/
public static final String PLUGIN_ID = "org.eclipse.cdt.debug.mi.ui" ; //$NON-NLS-1$
//The shared instance.
private static MIUIPlugin plugin;
//Resource bundle.
@ -23,8 +30,8 @@ public class MIUIPlugin extends AbstractUIPlugin {
/**
* The constructor.
*/
public MIUIPlugin(IPluginDescriptor descriptor) {
super(descriptor);
public MIUIPlugin() {
super();
plugin = this;
}
@ -62,4 +69,19 @@ public class MIUIPlugin extends AbstractUIPlugin {
public ResourceBundle getResourceBundle() {
return resourceBundle;
}
/**
* Convenience method which returns the unique identifier of this plugin.
*
* @return the unique identifier of this plugin
*/
public static String getUniqueIdentifier() {
if ( getDefault() == null ) {
// If the default instance is not yet initialized,
// return a static identifier. This identifier must
// match the plugin id defined in plugin.xml
return PLUGIN_ID; //$NON-NLS-1$
}
return getDefault().getBundle().getSymbolicName();
}
}

View file

@ -114,7 +114,7 @@ public class SerialPortSettingsBlock extends Observable
field.setDialogFieldListener(
new IDialogFieldListener()
{
public void dialogFieldChanged( DialogField field )
public void dialogFieldChanged( DialogField f )
{
deviceFieldChanged();
}
@ -130,7 +130,7 @@ public class SerialPortSettingsBlock extends Observable
field.setDialogFieldListener(
new IDialogFieldListener()
{
public void dialogFieldChanged( DialogField field )
public void dialogFieldChanged( DialogField f )
{
speedFieldChanged();
}

View file

@ -108,7 +108,7 @@ public class TCPSettingsBlock extends Observable
field.setDialogFieldListener(
new IDialogFieldListener()
{
public void dialogFieldChanged( DialogField field )
public void dialogFieldChanged( DialogField f )
{
hostNameFieldChanged();
}
@ -123,7 +123,7 @@ public class TCPSettingsBlock extends Observable
field.setDialogFieldListener(
new IDialogFieldListener()
{
public void dialogFieldChanged( DialogField field )
public void dialogFieldChanged( DialogField f )
{
portNumberFieldChanged();
}

View file

@ -87,14 +87,13 @@ public class SelectionButtonDialogFieldGroup extends DialogField {
buttonsgroup.setLayoutData(gd);
return new Control[] { label, buttonsgroup };
} else {
Composite buttonsgroup= getSelectionButtonsGroup(parent);
GridData gd= new GridData();
gd.horizontalSpan= nColumns;
buttonsgroup.setLayoutData(gd);
return new Control[] { buttonsgroup };
}
}
Composite buttonsgroup= getSelectionButtonsGroup(parent);
GridData gd= new GridData();
gd.horizontalSpan= nColumns;
buttonsgroup.setLayoutData(gd);
return new Control[] { buttonsgroup };
}
/*

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -24,7 +24,7 @@
<import plugin="org.eclipse.cdt.debug.core"/>
<import plugin="org.eclipse.cdt.ui"/>
<import plugin="org.eclipse.cdt.core"/>
<import plugin="org.eclipse.core.runtime.compatibility"/>
<import plugin="org.eclipse.core.runtime"/>
</requires>
@ -1074,44 +1074,6 @@
id="org.eclipse.cdt.debug.internal.ui.ErrorStatusHandler">
</statusHandler>
</extension>
<extension
point="org.eclipse.debug.ui.debugActionGroups">
<debugActionGroup
name="%CDebugActionGroup.name"
visible="true"
id="org.eclipse.cdt.debug.ui.cDebugActionGroup">
<action
id="org.eclipse.cdt.debug.internal.ui.actions.RestartActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.SwitchToDisassemblyActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.AddGlobalsActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.AddAddressBreakpointActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.JumpToLineActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.ui.internal.actions.ManageBreakpointActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.ManageWatchpointActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.AddExpressionActionDelegate">
</action>
<action
id="org.eclipse.cdt.debug.internal.ui.actions.SignalZeroWorkbenchActionDelegate">
</action>
</debugActionGroup>
</extension>
<extension
point="org.eclipse.ui.propertyPages">
<page

View file

@ -87,7 +87,7 @@ public class CDebugImageDescriptorRegistry
{
fDisplay.asyncExec(new Runnable() {
public void run() {
fDisplay.disposeExec( new Runnable() {
getDisplay().disposeExec( new Runnable() {
public void run() {
dispose();
}
@ -95,4 +95,8 @@ public class CDebugImageDescriptorRegistry
}
} );
}
protected Display getDisplay() {
return fDisplay;
}
}

View file

@ -34,7 +34,7 @@ public class CDebugImages
String pathSuffix = "icons/full/"; //$NON-NLS-1$
try
{
fgIconBaseURL = new URL( CDebugUIPlugin.getDefault().getDescriptor().getInstallURL(), pathSuffix );
fgIconBaseURL = new URL( CDebugUIPlugin.getDefault().getBundle().getEntry( "/" ), pathSuffix ); //$NON-NLS-1$
}
catch( MalformedURLException e )
{

View file

@ -91,11 +91,7 @@ public class LineBreakingReader {
int wordWidth= fGC.textExtent(word).x;
int nextWidth= wordWidth + currWidth;
if (nextWidth > fMaxWidth) {
if (currWidth > 0) {
return currOffset;
} else {
return nextOffset;
}
return (currWidth > 0) ? currOffset : nextOffset;
}
currWidth= nextWidth;
currOffset= nextOffset;

View file

@ -28,11 +28,7 @@ public abstract class SingleCharReader extends Reader {
for (int i= off; i < end; i++) {
int ch= read();
if (ch == -1) {
if (i == off) {
return -1;
} else {
return i - off;
}
return (i == off) ? -1 : i - off;
}
cbuf[i]= (char)ch;
}

View file

@ -71,24 +71,23 @@ public abstract class SubstitutionTextReader extends SingleCharReader {
fIndex= 0;
}
return ch;
} else {
int ch= fCharAfterWhiteSpace;
if (ch == -1) {
ch= fReader.read();
}
if (fSkipWhiteSpace && Character.isWhitespace((char)ch)) {
do {
ch= fReader.read();
} while (Character.isWhitespace((char)ch));
if (ch != -1) {
fCharAfterWhiteSpace= ch;
return ' ';
}
} else {
fCharAfterWhiteSpace= -1;
}
return ch;
}
int ch= fCharAfterWhiteSpace;
if (ch == -1) {
ch= fReader.read();
}
if (fSkipWhiteSpace && Character.isWhitespace((char)ch)) {
do {
ch= fReader.read();
} while (Character.isWhitespace((char)ch));
if (ch != -1) {
fCharAfterWhiteSpace= ch;
return ' ';
}
} else {
fCharAfterWhiteSpace= -1;
}
return ch;
}
/**

View file

@ -243,11 +243,7 @@ public abstract class AbstractDebugActionDelegate implements IWorkbenchWindowAct
//as the selection can be out of date for context menu
//actions. See bug 14556
ISelection s= getView().getViewSite().getSelectionProvider().getSelection();
if (s instanceof IStructuredSelection) {
return (IStructuredSelection)s;
} else {
return StructuredSelection.EMPTY;
}
return (s instanceof IStructuredSelection)? (IStructuredSelection)s : StructuredSelection.EMPTY;
}
return fSelection;
}

View file

@ -5,15 +5,14 @@
*/
package org.eclipse.cdt.debug.internal.ui.actions;
import org.eclipse.cdt.debug.core.CDebugModel;
import org.eclipse.cdt.debug.core.model.IExecFileInfo;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IDebugElement;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.window.Window;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
/**
*

View file

@ -67,14 +67,8 @@ public class AddExpressionActionDelegate extends AbstractEditorActionDelegate
protected Shell getShell()
{
if ( getTargetPart() != null )
{
return getTargetPart().getSite().getShell();
}
else
{
return CDebugUIPlugin.getActiveWorkbenchShell();
}
return ( getTargetPart() != null ) ?
getTargetPart().getSite().getShell() : CDebugUIPlugin.getActiveWorkbenchShell();
}
private void createExpression( final String text )

View file

@ -124,9 +124,7 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
}
return;
}
else {
errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$
}
errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$
}
}
}

View file

@ -87,14 +87,13 @@ public class SelectionButtonDialogFieldGroup extends DialogField {
buttonsgroup.setLayoutData(gd);
return new Control[] { label, buttonsgroup };
} else {
Composite buttonsgroup= getSelectionButtonsGroup(parent);
GridData gd= new GridData();
gd.horizontalSpan= nColumns;
buttonsgroup.setLayoutData(gd);
return new Control[] { buttonsgroup };
}
Composite buttonsgroup= getSelectionButtonsGroup(parent);
GridData gd= new GridData();
gd.horizontalSpan= nColumns;
buttonsgroup.setLayoutData(gd);
return new Control[] { buttonsgroup };
}
/*

View file

@ -111,12 +111,12 @@ public class SourcePreferencePage extends PreferencePage implements IWorkbenchPr
new SourceListDialogField( CDebugUIPlugin.getResourceString("internal.ui.preferences.SourcePreferencePage.Source_locations"), //$NON-NLS-1$
new IListAdapter()
{
public void customButtonPressed( DialogField field, int index )
public void customButtonPressed( DialogField f, int index )
{
sourceButtonPressed( index );
}
public void selectionChanged(DialogField field)
public void selectionChanged(DialogField f)
{
}
} );

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.debug.internal.ui.views.disassembly;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.IDisassembly;
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
@ -52,7 +51,6 @@ import org.eclipse.jface.text.source.IOverviewRuler;
import org.eclipse.jface.text.source.ISharedTextColors;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
import org.eclipse.jface.text.source.OverviewRuler;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.text.source.VerticalRuler;
@ -302,15 +300,12 @@ public class DisassemblyView extends AbstractDebugEventHandlerView
protected void createActions() {
IAction action;
IVerticalRuler ruler = getVerticalRuler();
if ( ruler instanceof IVerticalRulerInfo ) {
IVerticalRulerInfo info = (IVerticalRulerInfo)ruler;
action= new ToggleBreakpointRulerAction( this, info );
setAction( IInternalCDebugUIConstants.ACTION_TOGGLE_BREAKPOINT, action );
action= new EnableDisableBreakpointRulerAction( this, info );
setAction( IInternalCDebugUIConstants.ACTION_ENABLE_DISABLE_BREAKPOINT, action );
action= new CBreakpointPropertiesRulerAction( this, info );
setAction( IInternalCDebugUIConstants.ACTION_BREAKPOINT_PROPERTIES, action );
}
action= new ToggleBreakpointRulerAction( this, ruler );
setAction( IInternalCDebugUIConstants.ACTION_TOGGLE_BREAKPOINT, action );
action= new EnableDisableBreakpointRulerAction( this, ruler );
setAction( IInternalCDebugUIConstants.ACTION_ENABLE_DISABLE_BREAKPOINT, action );
action= new CBreakpointPropertiesRulerAction( this, ruler );
setAction( IInternalCDebugUIConstants.ACTION_BREAKPOINT_PROPERTIES, action );
}
/* (non-Javadoc)

View file

@ -211,7 +211,7 @@ public class SourceLocationSelectionPage extends WizardSelectionPage
ArrayList result = new ArrayList( allProjects.length );
for ( int i = 0; i < allProjects.length; ++i )
{
if ( ( CoreModel.getDefault().hasCNature( allProjects[i] ) || CoreModel.getDefault().hasCNature( allProjects[i] ) ) &&
if ( ( CoreModel.hasCNature( allProjects[i] ) || CoreModel.hasCCNature( allProjects[i] ) ) &&
allProjects[i].isOpen() &&
!projects.contains( allProjects[i] ) )
{

View file

@ -15,7 +15,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.model.ISwitchToFrame;
import org.eclipse.cdt.debug.core.model.ISwitchToThread;
@ -31,8 +30,8 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IDebugElement;
@ -54,12 +53,18 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListener
{
/**
* The plug-in identifier (value <code>"org.eclipse.cdt.debug.ui"</code>).
*/
public static final String PLUGIN_ID = "org.eclipse.cdt.debug.ui" ; //$NON-NLS-1$
//The shared instance.
private static CDebugUIPlugin plugin;
//Resource bundle.
@ -72,9 +77,9 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
/**
* The constructor.
*/
public CDebugUIPlugin( IPluginDescriptor descriptor )
public CDebugUIPlugin()
{
super( descriptor );
super();
plugin = this;
try
{
@ -147,9 +152,9 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
// If the default instance is not yet initialized,
// return a static identifier. This identifier must
// match the plugin id defined in plugin.xml
return "org.eclipse.cdt.debug.ui"; //$NON-NLS-1$
return PLUGIN_ID;
}
return getDefault().getDescriptor().getUniqueIdentifier();
return getDefault().getBundle().getSymbolicName();
}
/**
@ -226,8 +231,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
protected void initializeDebuggerPageMap() {
fDebuggerPageMap = new HashMap(10);
IPluginDescriptor descriptor= getDefault().getDescriptor();
IExtensionPoint extensionPoint= descriptor.getExtensionPoint("CDebuggerPage"); //$NON-NLS-1$
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint("CDebuggerPage"); //$NON-NLS-1$
IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
for (int i = 0; i < infos.length; i++) {
String id = infos[i].getAttribute("debuggerID"); //$NON-NLS-1$
@ -317,46 +321,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
return getDefault().fImageDescriptorRegistry;
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#shutdown()
*/
public void shutdown() throws CoreException
{
CDebugCorePlugin.getDefault().removeCBreakpointListener( CBreakpointUpdater.getInstance() );
// TODO: PR 52155, this is big hammer approach, but it is ok for
// Since the code will be remove when we align ourselves
// with Eclipse-3.0
try
{
IWorkbenchWindow ww = getActiveWorkbenchWindow();
if ( ww != null )
{
ww.getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
}
} catch (Exception e) {
// Big hammer.
}
if ( fImageDescriptorRegistry != null )
{
fImageDescriptorRegistry.dispose();
}
super.shutdown();
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#startup()
*/
public void startup() throws CoreException
{
super.startup();
IWorkbenchWindow ww = getActiveWorkbenchWindow();
if ( ww != null )
{
ww.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
}
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
}
/* (non-Javadoc)
* @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
*/
@ -439,4 +403,31 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
{
return DefaultSourceLocator.ID_OLD_DEFAULT_SOURCE_LOCATOR;
}
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start( BundleContext context ) throws Exception {
super.start( context );
IWorkbenchWindow ww = getActiveWorkbenchWindow();
if ( ww != null ) {
ww.getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
}
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
}
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop( BundleContext context ) throws Exception {
CDebugCorePlugin.getDefault().removeCBreakpointListener( CBreakpointUpdater.getInstance() );
IWorkbenchWindow ww = getActiveWorkbenchWindow();
if ( ww != null ) {
ww.getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this );
}
if ( fImageDescriptorRegistry != null ) {
fImageDescriptorRegistry.dispose();
}
super.stop( context );
}
}