Externalizing strings.
|
@ -10,7 +10,6 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.core;
|
package org.eclipse.cdt.debug.core;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
@ -67,7 +66,7 @@ public class CDebugCorePlugin extends Plugin {
|
||||||
private SessionManager fSessionManager = null;
|
private SessionManager fSessionManager = null;
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
fgResourceBundle = ResourceBundle.getBundle( "org.eclipse.cdt.debug.core.CDebugCorePluginResources" ); //$NON-NLS-1$
|
fgResourceBundle = ResourceBundle.getBundle( "org.eclipse.cdt.debug.internal.core.CDebugCorePluginResources" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch( MissingResourceException x ) {
|
catch( MissingResourceException x ) {
|
||||||
fgResourceBundle = null;
|
fgResourceBundle = null;
|
||||||
|
@ -127,13 +126,7 @@ public class CDebugCorePlugin extends Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFormattedString( String key, String arg ) {
|
|
||||||
return MessageFormat.format( getResourceString( key ), new String[]{ arg } );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getFormattedString( String key, String[] args ) {
|
|
||||||
return MessageFormat.format( getResourceString( key ), args );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ResourceBundle getResourceBundle() {
|
public static ResourceBundle getResourceBundle() {
|
||||||
return fgResourceBundle;
|
return fgResourceBundle;
|
||||||
|
@ -200,7 +193,7 @@ public class CDebugCorePlugin extends Plugin {
|
||||||
}
|
}
|
||||||
ICDebugConfiguration dbgCfg = (ICDebugConfiguration)fDebugConfigurations.get( id );
|
ICDebugConfiguration dbgCfg = (ICDebugConfiguration)fDebugConfigurations.get( id );
|
||||||
if ( dbgCfg == null ) {
|
if ( dbgCfg == null ) {
|
||||||
IStatus status = new Status( IStatus.ERROR, getUniqueIdentifier(), 100, CDebugCorePlugin.getResourceString( "core.CDebugCorePlugin.No_such_debugger" ), null ); //$NON-NLS-1$
|
IStatus status = new Status( IStatus.ERROR, getUniqueIdentifier(), 100, DebugCoreMessages.getString( "CDebugCorePlugin.0" ), null ); //$NON-NLS-1$
|
||||||
throw new CoreException( status );
|
throw new CoreException( status );
|
||||||
}
|
}
|
||||||
return dbgCfg;
|
return dbgCfg;
|
||||||
|
|
|
@ -1,46 +0,0 @@
|
||||||
core.CDebugCorePlugin.No_such_debugger=No such debugger
|
|
||||||
core.CDebugCorePlugin.Unable_to_set_temp_brkpt=Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?
|
|
||||||
|
|
||||||
internal.core.sourcelookup.CSourceLocator.Unable_to_create_memento=Unable to create memento for C/C++ source locator.
|
|
||||||
internal.core.sourcelookup.CSourceLocator.Unable_to_restore_src_locator=Unable to restore C/C++ source locator - invalid format.
|
|
||||||
internal.core.sourcelookup.CSourceLocator.Exception_initializing_src_locator=Exception occurred initializing source locator.
|
|
||||||
internal.core.sourcelookup.CSourceLocator.Error_initializing_src_location=Error initializing directory source location.
|
|
||||||
|
|
||||||
internal.core.sourcelookup.CProjectSourceLocation.Unable_to_initialize_src_location_no_project_name=Unable to initialize source location - missing project name
|
|
||||||
internal.core.sourcelookup.CProjectSourceLocation.Exception_intializing_src_location=Exception occurred initializing source location.
|
|
||||||
internal.core.sourcelookup.CProjectSourceLocation.Unable_to_create_memento_for_src_location=Unable to create memento for C/C++ project source location {0}.
|
|
||||||
|
|
||||||
internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_create_memento=Unable to create memento for C/C++ directory source location {0}
|
|
||||||
internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_no_dir=Unable to initialize source location - missing directory path
|
|
||||||
internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_invalid_dir=Unable to initialize source location - invalid directory path {0}
|
|
||||||
internal.core.sourcelookup.CDirectorySourceLocation.Exception_initializing_src_location=Exception occurred initializing source location.
|
|
||||||
internal.core.CBreakpointManager.Set_breakpoint_failed=Set breakpoint failed. Reason:
|
|
||||||
internal.core.CBreakpointManager.Delete_breakpoint_failed=Delete breakpoint failed. Reason:
|
|
||||||
internal.core.CBreakpointManager.Change_brkpt_properties_failed=Change breakpoint properties failed. Reason:
|
|
||||||
internal.core.breakpoints.CLineBreakpoint.Line_breakpoint=Line breakpoint:
|
|
||||||
internal.core.breakpoints.CLineBreakpoint.line=line:
|
|
||||||
internal.core.breakpoints.CBreakpoint.ignore_count=ignore count:
|
|
||||||
internal.core.breakpoints.CWatchpoint.Write_watchpoint=Write watchpoint
|
|
||||||
internal.core.breakpoints.CWatchpoint.Read_watchpoint=Read watchpoint
|
|
||||||
internal.core.breakpoints.CWatchpoint.Access_watchpoint=Access watchpoint
|
|
||||||
internal.core.breakpoints.CWatchpoint.Watchpoint=Watchpoint:
|
|
||||||
internal.core.breakpoints.CWatchpoint.at=at
|
|
||||||
internal.core.breakpoints.CAddressBreakpoint.Address_breakpoint=Address breakpoint:
|
|
||||||
internal.core.breakpoints.CAddressBreakpoint.address=\ [address:
|
|
||||||
internal.core.breakpoints.CFunctionBreakpoint.Function_breakpoint=Function breakpoint:
|
|
||||||
internal.core.breakpoints.CFunctionBreakpoint.function=function:
|
|
||||||
internal.core.breakpoints.CBreakpoint.if=\ if
|
|
||||||
internal.core.model.CStackFrame.function_at_file={0} at {1}:
|
|
||||||
internal.core.model.CArrayPartition.Type_not_available=Type is not available.
|
|
||||||
internal.core.model.CArrayPartition.Qualified_name_not_available=Qualified name is not available.
|
|
||||||
internal.core.model.CVariable.Value_modification_unsupported=Variable does not support value modification.
|
|
||||||
internal.core.model.CVariable.Qualified_name_unavailable=Qualified name is not available.
|
|
||||||
internal.core.model.CVariable.Type_unavailable=Type is not available.
|
|
||||||
internal.core.model.CVariable.not_available=not available: {0}
|
|
||||||
internal.core.model.CValue.Not_available=not available:
|
|
||||||
internal.core.model.CModificationVariable.Unable_to_set_value=Unable to set value.
|
|
||||||
internal.core.model.CThread.Stack_not_available=Stack is not available:
|
|
||||||
internal.core.model.CDebugTarget.Disconnect_session_unsupported=Session does not support \'disconnect\'
|
|
||||||
internal.core.model.CDebugTarget.Execution_suspended_because_of_error=The execution of program is suspended because of error.
|
|
||||||
internal.core.model.CDebugElement.Target_request_failed=Target request failed:
|
|
||||||
internal.core.DisassemblyStorage.disassembly=disassembly
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.core;
|
package org.eclipse.cdt.debug.core;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
|
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
||||||
|
@ -373,8 +374,7 @@ public class CDebugModel
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
catch( DebugException e )
|
||||||
{
|
{
|
||||||
//String message = MessageFormat.format( "Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?", new String[] { e.getStatus().getMessage() } );
|
String message = MessageFormat.format( DebugCoreMessages.getString( "CDebugModel.0" ), new String[] { e.getStatus().getMessage() } ); //$NON-NLS-1$
|
||||||
String message = CDebugCorePlugin.getFormattedString("core.CDebugCorePlugin.Unable_to_set_temp_brkpt", new String[] { e.getStatus().getMessage() } ); //$NON-NLS-1$
|
|
||||||
IStatus newStatus = new Status( IStatus.WARNING,
|
IStatus newStatus = new Status( IStatus.WARNING,
|
||||||
e.getStatus().getPlugin(),
|
e.getStatus().getPlugin(),
|
||||||
ICDebugInternalConstants.STATUS_CODE_QUESTION,
|
ICDebugInternalConstants.STATUS_CODE_QUESTION,
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.core;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
//import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
public class DebugCoreMessages {
|
||||||
|
|
||||||
|
// private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.core.DebugCoreMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
// private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private DebugCoreMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
try {
|
||||||
|
return CDebugCorePlugin.getResourceString( key );
|
||||||
|
// return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
CDebugCorePlugin.0=No such debugger
|
||||||
|
CDebugModel.0=Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?
|
|
@ -10,6 +10,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.core;
|
package org.eclipse.cdt.debug.internal.core;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -291,13 +292,13 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
setBreakpointCondition( breakpoint );
|
setBreakpointCondition( breakpoint );
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
requestFailed( CDebugCorePlugin.getResourceString( "internal.core.CBreakpointManager.Set_breakpoint_failed" ) + e.getMessage(), e ); //$NON-NLS-1$
|
requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.0" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e ) {
|
catch( NumberFormatException e ) {
|
||||||
requestFailed( CDebugCorePlugin.getResourceString( "internal.core.CBreakpointManager.Set_breakpoint_failed" ) + e.getMessage(), e ); //$NON-NLS-1$
|
requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.1" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
targetRequestFailed( CDebugCorePlugin.getResourceString( "internal.core.CBreakpointManager.Set_breakpoint_failed" ) + e.getMessage(), e ); //$NON-NLS-1$
|
targetRequestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.2" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,7 +314,7 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
bm.deleteBreakpoints( new ICDIBreakpoint[]{ cdiBreakpoint } );
|
bm.deleteBreakpoints( new ICDIBreakpoint[]{ cdiBreakpoint } );
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
targetRequestFailed( CDebugCorePlugin.getResourceString( "internal.core.CBreakpointManager.Delete_breakpoint_failed" ) + e.getMessage(), e ); //$NON-NLS-1$
|
targetRequestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.3" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -343,10 +344,10 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
requestFailed( CDebugCorePlugin.getResourceString( "internal.core.CBreakpointManager.Change_brkpt_properties_failed" ) + e.getMessage(), e ); //$NON-NLS-1$
|
requestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.4" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
targetRequestFailed( CDebugCorePlugin.getResourceString( "internal.core.CBreakpointManager.Change_brkpt_properties_failed" ) + e.getMessage(), e ); //$NON-NLS-1$
|
targetRequestFailed( MessageFormat.format( InternalDebugCoreMessages.getString( "CBreakpointManager.5" ), new String[] { e.getMessage() } ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -670,4 +671,4 @@ public class CBreakpointManager implements IBreakpointManagerListener, ICDIEvent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
CDebugCorePlugin.0=No such debugger
|
||||||
|
CDebugModel.0=Unable to set temporary breakpoint in main.\nReason: {0}\nContinue?
|
||||||
|
CBreakpointManager.0=Set breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.1=Set breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.2=Set breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.3=Delete breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.4=Change breakpoint properties failed. Reason: {0}.
|
||||||
|
CBreakpointManager.5=Change breakpoint properties failed. Reason: {0}.
|
||||||
|
CDebugTarget.Unable_to_get_globals_1=Unable to get globals. Reason:
|
||||||
|
CArrayPartition.0=Type is not available.
|
||||||
|
CArrayPartition.1=Qualified name is not available.
|
||||||
|
CDebugTarget.0=Session does not support 'disconnect'.
|
||||||
|
CDebugTarget.1=Execution is suspended because of error.
|
||||||
|
CModificationVariable.0=Unable to set value.
|
||||||
|
CModificationVariable.1=Unable to set value.
|
||||||
|
CStackFrame.0={0} at {1}: {2}
|
||||||
|
CThread.0=Stack is not available: {0}.
|
||||||
|
CThread.1=Stack is not available: {0}.
|
||||||
|
CValue.0=not available:
|
||||||
|
CVariable.0=not available: {0}
|
||||||
|
CVariable.1=not available: {0}
|
||||||
|
CVariable.2=Variable does not support value modification.
|
||||||
|
CVariable.3=Variable does not support value modification.
|
||||||
|
CVariable.4=Qualified name is not available.
|
||||||
|
CVariable.5=Type is not available.
|
||||||
|
CDirectorySourceLocation.0=Unable to create memento for C/C++ directory source location {0}.
|
||||||
|
CDirectorySourceLocation.1=Unable to initialize source location - missing directory path.
|
||||||
|
CDirectorySourceLocation.2=Unable to initialize source location - invalid directory path {0}.
|
||||||
|
CDirectorySourceLocation.3=Exception occurred initializing source location.
|
||||||
|
CProjectSourceLocation.0=Unable to create memento for C/C++ project source location {0}.
|
||||||
|
CProjectSourceLocation.1=Unable to initialize source location - missing project name
|
||||||
|
CProjectSourceLocation.2=Exception occurred initializing source location.
|
||||||
|
CSourceLocator.0=Unable to create memento for C/C++ source locator.
|
||||||
|
CSourceLocator.1=Unable to restore C/C++ source locator - invalid format.
|
||||||
|
CSourceLocator.2=Exception occurred initializing source locator.
|
||||||
|
CSourceLocator.3=Error initializing directory source location.
|
|
@ -0,0 +1,35 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.internal.core;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
//import java.util.ResourceBundle;
|
||||||
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
|
|
||||||
|
public class InternalDebugCoreMessages {
|
||||||
|
|
||||||
|
// private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.core.InternalDebugCoreMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
// private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private InternalDebugCoreMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
try {
|
||||||
|
return CDebugCorePlugin.getResourceString( key );
|
||||||
|
// return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
CBreakpointManager.0=Set breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.1=Set breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.2=Set breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.3=Delete breakpoint failed. Reason: {0}.
|
||||||
|
CBreakpointManager.4=Change breakpoint properties failed. Reason: {0}.
|
||||||
|
CBreakpointManager.5=Change breakpoint properties failed. Reason: {0}.
|
|
@ -8,7 +8,6 @@ package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
|
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
||||||
|
@ -18,7 +17,6 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue;
|
||||||
import org.eclipse.cdt.debug.core.model.ICType;
|
import org.eclipse.cdt.debug.core.model.ICType;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.model.IValue;
|
import org.eclipse.debug.core.model.IValue;
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -178,7 +176,7 @@ public class CArrayPartition extends CVariable
|
||||||
}
|
}
|
||||||
catch (CDIException e)
|
catch (CDIException e)
|
||||||
{
|
{
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CArrayPartition.Type_not_available"), e ); //$NON-NLS-1$
|
requestFailed( CoreModelMessages.getString( "CArrayPartition.0" ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fType;
|
return fType;
|
||||||
|
@ -208,7 +206,7 @@ public class CArrayPartition extends CVariable
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CArrayPartition.Qualified_name_not_available"), e ); //$NON-NLS-1$
|
requestFailed( CoreModelMessages.getString( "CArrayPartition.1" ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fQualifiedName;
|
return fQualifiedName;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.internal.core.model;
|
package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
import org.eclipse.cdt.debug.core.CDebugModel;
|
import org.eclipse.cdt.debug.core.CDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.CDebugUtils;
|
import org.eclipse.cdt.debug.core.CDebugUtils;
|
||||||
|
@ -250,7 +251,7 @@ public class CDebugElement extends PlatformObject
|
||||||
*/
|
*/
|
||||||
public void targetRequestFailed( String message, CDIException e ) throws DebugException
|
public void targetRequestFailed( String message, CDIException e ) throws DebugException
|
||||||
{
|
{
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CDebugElement.Target_request_failed") + message, e, DebugException.TARGET_REQUEST_FAILED ); //$NON-NLS-1$
|
requestFailed( MessageFormat.format( "Target request failed: {0}.", new String[] { message } ), e, DebugException.TARGET_REQUEST_FAILED ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -275,7 +276,7 @@ public class CDebugElement extends PlatformObject
|
||||||
*/
|
*/
|
||||||
public void targetRequestFailed( String message, Throwable e ) throws DebugException
|
public void targetRequestFailed( String message, Throwable e ) throws DebugException
|
||||||
{
|
{
|
||||||
throwDebugException( CDebugCorePlugin.getResourceString("internal.core.model.CDebugElement.Target_request_failed") + message, DebugException.TARGET_REQUEST_FAILED, e ); //$NON-NLS-1$
|
throwDebugException( MessageFormat.format( "Target request failed: {0}.", new String[] { message } ), DebugException.TARGET_REQUEST_FAILED, e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -865,7 +865,7 @@ public class CDebugTarget extends CDebugElement
|
||||||
|
|
||||||
if ( !canDisconnect() )
|
if ( !canDisconnect() )
|
||||||
{
|
{
|
||||||
notSupported( CDebugCorePlugin.getResourceString("internal.core.model.CDebugTarget.Disconnect_session_unsupported") ); //$NON-NLS-1$
|
notSupported( CoreModelMessages.getString( "CDebugTarget.0" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -1549,7 +1549,8 @@ public class CDebugTarget extends CDebugElement
|
||||||
{
|
{
|
||||||
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(),
|
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(),
|
||||||
ICDebugInternalConstants.STATUS_CODE_ERROR,
|
ICDebugInternalConstants.STATUS_CODE_ERROR,
|
||||||
CDebugCorePlugin.getResourceString("internal.core.model.CDebugTarget.Execution_suspended_because_of_error"), null ); //$NON-NLS-1$
|
CoreModelMessages.getString( "CDebugTarget.1" ), //$NON-NLS-1$
|
||||||
|
null );
|
||||||
StringTokenizer st = new StringTokenizer( info.getDetailMessage(), "\n\r" ); //$NON-NLS-1$
|
StringTokenizer st = new StringTokenizer( info.getDetailMessage(), "\n\r" ); //$NON-NLS-1$
|
||||||
while( st.hasMoreTokens() )
|
while( st.hasMoreTokens() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.model.IValue;
|
import org.eclipse.debug.core.model.IValue;
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
import org.eclipse.debug.core.model.IValueModification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -70,7 +70,7 @@ public class CModificationVariable extends CVariable
|
||||||
if ( cdiVariable != null )
|
if ( cdiVariable != null )
|
||||||
cdiVariable.setValue( newExpression );
|
cdiVariable.setValue( newExpression );
|
||||||
else
|
else
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CModificationVariable.Unable_to_set_value"), null ); //$NON-NLS-1$
|
requestFailed( CoreModelMessages.getString( "CModificationVariable.0" ), null ); //$NON-NLS-1$
|
||||||
|
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
|
@ -94,7 +94,7 @@ public class CModificationVariable extends CVariable
|
||||||
if ( cdiVariable != null )
|
if ( cdiVariable != null )
|
||||||
cdiVariable.setValue( value );
|
cdiVariable.setValue( value );
|
||||||
else
|
else
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CModificationVariable.Unable_to_set_value"), null ); //$NON-NLS-1$
|
requestFailed( CoreModelMessages.getString( "CModificationVariable.1" ), null ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.core.model;
|
package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -220,7 +221,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
|
||||||
else {
|
else {
|
||||||
return func;
|
return func;
|
||||||
}
|
}
|
||||||
return CDebugCorePlugin.getFormattedString( "internal.core.model.CStackFrame.function_at_file", new String[]{ func, file } ) + line; //$NON-NLS-1$
|
return MessageFormat.format( CoreModelMessages.getString( "CStackFrame.0" ), new String[]{ func, file, line } ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -6,12 +6,11 @@
|
||||||
|
|
||||||
package org.eclipse.cdt.debug.internal.core.model;
|
package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
|
||||||
import org.eclipse.cdt.debug.core.CDebugUtils;
|
import org.eclipse.cdt.debug.core.CDebugUtils;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
|
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
|
||||||
|
@ -272,7 +271,7 @@ public class CThread extends CDebugElement
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
setStatus( ICDebugElementErrorStatus.WARNING, CDebugCorePlugin.getResourceString("internal.core.model.CThread.Stack_not_available") + e.getMessage() ); //$NON-NLS-1$
|
setStatus( ICDebugElementErrorStatus.WARNING, MessageFormat.format( CoreModelMessages.getString( "CThread.0" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||||
targetRequestFailed( e.getMessage(), null );
|
targetRequestFailed( e.getMessage(), null );
|
||||||
}
|
}
|
||||||
return new ICDIStackFrame[0];
|
return new ICDIStackFrame[0];
|
||||||
|
@ -1041,7 +1040,7 @@ public class CThread extends CDebugElement
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
setStatus( ICDebugElementErrorStatus.WARNING, CDebugCorePlugin.getResourceString("internal.core.model.CThread.Stack_not_available") + e.getMessage() ); //$NON-NLS-1$
|
setStatus( ICDebugElementErrorStatus.WARNING, MessageFormat.format( CoreModelMessages.getString( "CThread.1" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return depth;
|
return depth;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIFormat;
|
import org.eclipse.cdt.debug.core.cdi.ICDIFormat;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
||||||
|
@ -33,7 +32,6 @@ import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator;
|
||||||
import org.eclipse.cdt.debug.core.model.ICValue;
|
import org.eclipse.cdt.debug.core.model.ICValue;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.debug.core.model.IVariable;
|
import org.eclipse.debug.core.model.IVariable;
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -187,7 +185,7 @@ public class CValue extends CDebugElement implements ICValue
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CValue.Not_available"), e ); //$NON-NLS-1$
|
requestFailed( CoreModelMessages.getString( "CValue.0" ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return Arrays.asList( vars );
|
return Arrays.asList( vars );
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
package org.eclipse.cdt.debug.internal.core.model;
|
package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.debug.core.ICDebugConstants;
|
import org.eclipse.cdt.debug.core.ICDebugConstants;
|
||||||
|
@ -205,8 +206,7 @@ public abstract class CVariable extends CDebugElement
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
fCDIVariable = new ErrorVariable( getCDIVariableObject(), e );
|
fCDIVariable = new ErrorVariable( getCDIVariableObject(), e );
|
||||||
setStatus( ICDebugElementErrorStatus.ERROR,
|
setStatus( ICDebugElementErrorStatus.ERROR, MessageFormat.format( CoreModelMessages.getString( "CVariable.0" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||||
CDebugCorePlugin.getFormattedString( "internal.core.model.CVariable.not_available", new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fCDIVariable;
|
return fCDIVariable;
|
||||||
|
@ -415,7 +415,7 @@ public abstract class CVariable extends CDebugElement
|
||||||
fShadow = null;
|
fShadow = null;
|
||||||
if ( cdiVariableObject instanceof ErrorVariable )
|
if ( cdiVariableObject instanceof ErrorVariable )
|
||||||
setStatus( ICDebugElementErrorStatus.ERROR,
|
setStatus( ICDebugElementErrorStatus.ERROR,
|
||||||
CDebugCorePlugin.getFormattedString( "internal.core.model.CVariable.not_available", new String[] { ((ErrorVariable)cdiVariableObject).getException().getMessage() } ) ); //$NON-NLS-1$
|
MessageFormat.format( CoreModelMessages.getString( "CVariable.1" ), new String[] { ((ErrorVariable)cdiVariableObject).getException().getMessage() } ) ); //$NON-NLS-1$
|
||||||
fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT );
|
fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT );
|
||||||
getCDISession().getEventManager().addEventListener( this );
|
getCDISession().getEventManager().addEventListener( this );
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ public abstract class CVariable extends CDebugElement
|
||||||
*/
|
*/
|
||||||
public void setValue( String expression ) throws DebugException
|
public void setValue( String expression ) throws DebugException
|
||||||
{
|
{
|
||||||
notSupported( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Value_modification_unsupported") ); //$NON-NLS-1$
|
notSupported( CoreModelMessages.getString( "CVariable.2" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -493,7 +493,7 @@ public abstract class CVariable extends CDebugElement
|
||||||
*/
|
*/
|
||||||
public void setValue( IValue value ) throws DebugException
|
public void setValue( IValue value ) throws DebugException
|
||||||
{
|
{
|
||||||
notSupported( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Value_modification_unsupported") ); //$NON-NLS-1$
|
notSupported( CoreModelMessages.getString( "CVariable.3" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -938,7 +938,7 @@ public abstract class CVariable extends CDebugElement
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Qualified_name_unavailable"), e ); //$NON-NLS-1$
|
requestFailed( CoreModelMessages.getString( "CVariable.4" ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -959,7 +959,7 @@ public abstract class CVariable extends CDebugElement
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
requestFailed( CDebugCorePlugin.getResourceString("internal.core.model.CVariable.Type_unavailable"), e ); //$NON-NLS-1$
|
requestFailed( CoreModelMessages.getString( "CVariable.5" ), e ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return type;
|
return type;
|
||||||
|
|
|
@ -11,20 +11,22 @@
|
||||||
package org.eclipse.cdt.debug.internal.core.model;
|
package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
import java.util.MissingResourceException;
|
import java.util.MissingResourceException;
|
||||||
import java.util.ResourceBundle;
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
|
//import java.util.ResourceBundle;
|
||||||
|
|
||||||
public class CoreModelMessages {
|
public class CoreModelMessages {
|
||||||
|
|
||||||
private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.core.model.CoreModelMessages"; //$NON-NLS-1$
|
// private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.core.model.CoreModelMessages"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
// private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
private CoreModelMessages() {
|
private CoreModelMessages() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getString( String key ) {
|
public static String getString( String key ) {
|
||||||
try {
|
try {
|
||||||
return RESOURCE_BUNDLE.getString( key );
|
return CDebugCorePlugin.getResourceString( key );
|
||||||
|
// return RESOURCE_BUNDLE.getString( key );
|
||||||
}
|
}
|
||||||
catch( MissingResourceException e ) {
|
catch( MissingResourceException e ) {
|
||||||
return '!' + key + '!';
|
return '!' + key + '!';
|
||||||
|
|
|
@ -1 +1,17 @@
|
||||||
CDebugTarget.Unable_to_get_globals_1=Unable to get globals. Reason:
|
CDebugTarget.Unable_to_get_globals_1=Unable to get globals. Reason:
|
||||||
|
CArrayPartition.0=Type is not available.
|
||||||
|
CArrayPartition.1=Qualified name is not available.
|
||||||
|
CDebugTarget.0=Session does not support 'disconnect'.
|
||||||
|
CDebugTarget.1=Execution is suspended because of error.
|
||||||
|
CModificationVariable.0=Unable to set value.
|
||||||
|
CModificationVariable.1=Unable to set value.
|
||||||
|
CStackFrame.0={0} at {1}: {2}
|
||||||
|
CThread.0=Stack is not available: {0}.
|
||||||
|
CThread.1=Stack is not available: {0}.
|
||||||
|
CValue.0=not available:
|
||||||
|
CVariable.0=not available: {0}
|
||||||
|
CVariable.1=not available: {0}
|
||||||
|
CVariable.2=Variable does not support value modification.
|
||||||
|
CVariable.3=Variable does not support value modification.
|
||||||
|
CVariable.4=Qualified name is not available.
|
||||||
|
CVariable.5=Type is not available.
|
||||||
|
|
|
@ -319,7 +319,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
|
||||||
{
|
{
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
abort( MessageFormat.format( CDebugCorePlugin.getResourceString( "internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_create_memento" ), new String[] { getDirectory().toOSString() } ), ex ); //$NON-NLS-1$
|
abort( MessageFormat.format( InternalSourceLookupMessages.getString( "CDirectorySourceLocation.0" ), new String[] { getDirectory().toOSString() } ), ex ); //$NON-NLS-1$
|
||||||
// execution will not reach here
|
// execution will not reach here
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -341,7 +341,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
|
||||||
String dir = root.getAttribute( ATTR_DIRECTORY );
|
String dir = root.getAttribute( ATTR_DIRECTORY );
|
||||||
if ( isEmpty( dir ) )
|
if ( isEmpty( dir ) )
|
||||||
{
|
{
|
||||||
abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_no_dir"), null ); //$NON-NLS-1$
|
abort( InternalSourceLookupMessages.getString( "CDirectorySourceLocation.1" ), null ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -352,7 +352,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
abort( MessageFormat.format( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CDirectorySourceLocation.Unable_to_initialize_src_location_invalid_dir"), new String[] { dir } ), null ); //$NON-NLS-1$
|
abort( MessageFormat.format( InternalSourceLookupMessages.getString( "CDirectorySourceLocation.2" ), new String[] { dir } ), null ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dir = root.getAttribute( ATTR_ASSOCIATION );
|
dir = root.getAttribute( ATTR_ASSOCIATION );
|
||||||
|
@ -387,7 +387,7 @@ public class CDirectorySourceLocation implements IDirectorySourceLocation
|
||||||
{
|
{
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CDirectorySourceLocation.Exception_initializing_src_location"), ex ); //$NON-NLS-1$
|
abort( InternalSourceLookupMessages.getString( "CDirectorySourceLocation.3" ), ex ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,6 +8,7 @@ package org.eclipse.cdt.debug.internal.core.sourcelookup;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
import java.text.MessageFormat;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -251,7 +252,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation
|
||||||
{
|
{
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
abort( CDebugCorePlugin.getFormattedString( "internal.core.sourcelookup.CProjectSourceLocation.Unable_to_create_memento_for_src_location", new String[] { getProject().getName() } ), ex ); //$NON-NLS-1$
|
abort( MessageFormat.format( InternalSourceLookupMessages.getString( "CProjectSourceLocation.0" ), new String[] { getProject().getName() } ), ex ); //$NON-NLS-1$
|
||||||
// execution will not reach here
|
// execution will not reach here
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -273,7 +274,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation
|
||||||
String name = root.getAttribute( ATTR_PROJECT );
|
String name = root.getAttribute( ATTR_PROJECT );
|
||||||
if ( isEmpty( name ) )
|
if ( isEmpty( name ) )
|
||||||
{
|
{
|
||||||
abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CProjectSourceLocation.Unable_to_initialize_src_location_no_project_name"), null ); //$NON-NLS-1$
|
abort( InternalSourceLookupMessages.getString( "CProjectSourceLocation.1" ), null ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -298,7 +299,7 @@ public class CProjectSourceLocation implements IProjectSourceLocation
|
||||||
{
|
{
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CProjectSourceLocation.Exception_intializing_src_location"), ex ); //$NON-NLS-1$
|
abort( InternalSourceLookupMessages.getString( "CProjectSourceLocation.2" ), ex ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.core.sourcelookup;
|
package org.eclipse.cdt.debug.internal.core.sourcelookup;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -49,21 +53,24 @@ import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* Default source locator.
|
* Default source locator.
|
||||||
*
|
|
||||||
* @since Aug 19, 2002
|
|
||||||
*/
|
*/
|
||||||
|
public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocator, IResourceChangeListener {
|
||||||
|
|
||||||
public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocator, IResourceChangeListener
|
|
||||||
{
|
|
||||||
private static final String SOURCE_LOCATOR_NAME = "cSourceLocator"; //$NON-NLS-1$
|
private static final String SOURCE_LOCATOR_NAME = "cSourceLocator"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String DISABLED_GENERIC_PROJECT_NAME = "disabledGenericProject"; //$NON-NLS-1$
|
private static final String DISABLED_GENERIC_PROJECT_NAME = "disabledGenericProject"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String ADDITIONAL_SOURCE_LOCATION_NAME = "additionalSourceLocation"; //$NON-NLS-1$
|
private static final String ADDITIONAL_SOURCE_LOCATION_NAME = "additionalSourceLocation"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String SOURCE_LOCATION_NAME = "cSourceLocation"; //$NON-NLS-1$
|
private static final String SOURCE_LOCATION_NAME = "cSourceLocation"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
|
private static final String ATTR_CLASS = "class"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String ATTR_MEMENTO = "memento"; //$NON-NLS-1$
|
private static final String ATTR_MEMENTO = "memento"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String ATTR_PROJECT_NAME = "projectName"; //$NON-NLS-1$
|
private static final String ATTR_PROJECT_NAME = "projectName"; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String ATTR_DUPLICATE_FILES = "duplicateFiles"; //$NON-NLS-1$
|
private static final String ATTR_DUPLICATE_FILES = "duplicateFiles"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,62 +89,54 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
private List fReferencedProjects = new ArrayList( 10 );
|
private List fReferencedProjects = new ArrayList( 10 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The flag specifies whether to search for all source elements,
|
* The flag specifies whether to search for all source elements, or just the first match.
|
||||||
* or just the first match.
|
|
||||||
*/
|
*/
|
||||||
private boolean fDuplicateFiles = false;
|
private boolean fDuplicateFiles = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CSourceLocator.
|
* Constructor for CSourceLocator.
|
||||||
*/
|
*/
|
||||||
public CSourceLocator( IProject project )
|
public CSourceLocator( IProject project ) {
|
||||||
{
|
|
||||||
setProject( project );
|
setProject( project );
|
||||||
setReferencedProjects();
|
setReferencedProjects();
|
||||||
setSourceLocations( getDefaultSourceLocations() );
|
setSourceLocations( getDefaultSourceLocations() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(IStackFrame)
|
* @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(IStackFrame)
|
||||||
*/
|
*/
|
||||||
public Object getSourceElement( IStackFrame stackFrame )
|
public Object getSourceElement( IStackFrame stackFrame ) {
|
||||||
{
|
|
||||||
return getInput( stackFrame );
|
return getInput( stackFrame );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.ICSourceLocator#getLineNumber(IStackFrameInfo)
|
* @see org.eclipse.cdt.debug.core.ICSourceLocator#getLineNumber(IStackFrameInfo)
|
||||||
*/
|
*/
|
||||||
public int getLineNumber( IStackFrame frame )
|
public int getLineNumber( IStackFrame frame ) {
|
||||||
{
|
return (frame instanceof ICStackFrame) ? ((ICStackFrame)frame).getFrameLineNumber() : 0;
|
||||||
return ( frame instanceof ICStackFrame ) ? ((ICStackFrame)frame).getFrameLineNumber() : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Object getInput( IStackFrame f )
|
protected Object getInput( IStackFrame f ) {
|
||||||
{
|
if ( f instanceof ICStackFrame ) {
|
||||||
if ( f instanceof ICStackFrame )
|
|
||||||
{
|
|
||||||
ICStackFrame frame = (ICStackFrame)f;
|
ICStackFrame frame = (ICStackFrame)f;
|
||||||
LinkedList list = new LinkedList();
|
LinkedList list = new LinkedList();
|
||||||
if ( frame != null )
|
if ( frame != null ) {
|
||||||
{
|
|
||||||
Object result = null;
|
Object result = null;
|
||||||
String fileName = frame.getFile();
|
String fileName = frame.getFile();
|
||||||
if ( fileName != null && fileName.length() > 0 )
|
if ( fileName != null && fileName.length() > 0 ) {
|
||||||
{
|
|
||||||
ICSourceLocation[] locations = getSourceLocations();
|
ICSourceLocation[] locations = getSourceLocations();
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i ) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
result = locations[i].findSourceElement( fileName );
|
result = locations[i].findSourceElement( fileName );
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
if ( result != null )
|
if ( result != null ) {
|
||||||
{
|
|
||||||
if ( result instanceof List )
|
if ( result instanceof List )
|
||||||
list.addAll( (List)result );
|
list.addAll( (List)result );
|
||||||
else
|
else
|
||||||
|
@ -147,135 +146,117 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ( list.size() > 0 ) ? ( ( list.size() == 1 ) ? list.getFirst() : list ) : null;
|
return (list.size() > 0) ? ((list.size() == 1) ? list.getFirst() : list) : null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.ICSourceLocator#contains(IResource)
|
* @see org.eclipse.cdt.debug.core.ICSourceLocator#contains(IResource)
|
||||||
*/
|
*/
|
||||||
public boolean contains( IResource resource )
|
public boolean contains( IResource resource ) {
|
||||||
{
|
|
||||||
ICSourceLocation[] locations = getSourceLocations();
|
ICSourceLocation[] locations = getSourceLocations();
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i ) {
|
||||||
{
|
if ( resource instanceof IProject ) {
|
||||||
if ( resource instanceof IProject )
|
if ( locations[i] instanceof CProjectSourceLocation && ((CProjectSourceLocation)locations[i]).getProject().equals( resource ) ) {
|
||||||
{
|
|
||||||
if ( locations[i] instanceof CProjectSourceLocation &&
|
|
||||||
((CProjectSourceLocation)locations[i]).getProject().equals( resource ) )
|
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( resource instanceof IFile )
|
if ( resource instanceof IFile ) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Object result = locations[i].findSourceElement( resource.getLocation().toOSString() );
|
Object result = locations[i].findSourceElement( resource.getLocation().toOSString() );
|
||||||
if ( result instanceof IFile && ((IFile)result).equals( resource ) )
|
if ( result instanceof IFile && ((IFile)result).equals( resource ) )
|
||||||
return true;
|
return true;
|
||||||
if ( result instanceof List && ((List)result).contains( resource ) )
|
if ( result instanceof List && ((List)result).contains( resource ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getSourceLocations()
|
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getSourceLocations()
|
||||||
*/
|
*/
|
||||||
public ICSourceLocation[] getSourceLocations()
|
public ICSourceLocation[] getSourceLocations() {
|
||||||
{
|
|
||||||
return fSourceLocations;
|
return fSourceLocations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#setSourceLocations(ICSourceLocation[])
|
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#setSourceLocations(ICSourceLocation[])
|
||||||
*/
|
*/
|
||||||
public void setSourceLocations( ICSourceLocation[] locations )
|
public void setSourceLocations( ICSourceLocation[] locations ) {
|
||||||
{
|
|
||||||
fSourceLocations = locations;
|
fSourceLocations = locations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a default collection of source locations for
|
* Returns a default collection of source locations for the given project. Default source locations consist of the given project and all of its referenced
|
||||||
* the given project. Default source locations consist
|
* projects.
|
||||||
* of the given project and all of its referenced projects.
|
|
||||||
*
|
*
|
||||||
* @param project a project
|
* @param project
|
||||||
* @return a collection of source locations for all required
|
* a project
|
||||||
* projects
|
* @return a collection of source locations for all required projects
|
||||||
* @exception CoreException
|
* @exception CoreException
|
||||||
*/
|
*/
|
||||||
public static ICSourceLocation[] getDefaultSourceLocations( IProject project )
|
public static ICSourceLocation[] getDefaultSourceLocations( IProject project ) {
|
||||||
{
|
|
||||||
ArrayList list = new ArrayList();
|
ArrayList list = new ArrayList();
|
||||||
if ( project != null && project.exists() )
|
if ( project != null && project.exists() ) {
|
||||||
{
|
|
||||||
list.add( SourceLookupFactory.createProjectSourceLocation( project ) );
|
list.add( SourceLookupFactory.createProjectSourceLocation( project ) );
|
||||||
addReferencedSourceLocations( list, project );
|
addReferencedSourceLocations( list, project );
|
||||||
}
|
}
|
||||||
return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] );
|
return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addReferencedSourceLocations( List list, IProject project )
|
private static void addReferencedSourceLocations( List list, IProject project ) {
|
||||||
{
|
if ( project != null ) {
|
||||||
if ( project != null )
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
IProject[] projects = project.getReferencedProjects();
|
IProject[] projects = project.getReferencedProjects();
|
||||||
for ( int i = 0; i < projects.length; i++ )
|
for( int i = 0; i < projects.length; i++ ) {
|
||||||
{
|
if ( projects[i].exists() && !containsProject( list, projects[i] ) ) {
|
||||||
if ( projects[i].exists() && !containsProject( list, projects[i] ) )
|
|
||||||
{
|
|
||||||
list.add( SourceLookupFactory.createProjectSourceLocation( projects[i] ) );
|
list.add( SourceLookupFactory.createProjectSourceLocation( projects[i] ) );
|
||||||
addReferencedSourceLocations( list, projects[i] );
|
addReferencedSourceLocations( list, projects[i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean containsProject( List list, IProject project )
|
private static boolean containsProject( List list, IProject project ) {
|
||||||
{
|
|
||||||
Iterator it = list.iterator();
|
Iterator it = list.iterator();
|
||||||
while( it.hasNext() )
|
while( it.hasNext() ) {
|
||||||
{
|
|
||||||
CProjectSourceLocation location = (CProjectSourceLocation)it.next();
|
CProjectSourceLocation location = (CProjectSourceLocation)it.next();
|
||||||
if ( project.equals( location.getProject() ) )
|
if ( project.equals( location.getProject() ) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#findSourceElement(String)
|
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#findSourceElement(String)
|
||||||
*/
|
*/
|
||||||
public Object findSourceElement( String fileName )
|
public Object findSourceElement( String fileName ) {
|
||||||
{
|
|
||||||
Object result = null;
|
Object result = null;
|
||||||
if ( fileName != null && fileName.length() > 0 )
|
if ( fileName != null && fileName.length() > 0 ) {
|
||||||
{
|
|
||||||
ICSourceLocation[] locations = getSourceLocations();
|
ICSourceLocation[] locations = getSourceLocations();
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i ) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
result = locations[i].findSourceElement( fileName );
|
result = locations[i].findSourceElement( fileName );
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
if ( result != null )
|
if ( result != null )
|
||||||
|
@ -285,117 +266,100 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento()
|
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento()
|
||||||
*/
|
*/
|
||||||
public String getMemento() throws CoreException
|
public String getMemento() throws CoreException {
|
||||||
{
|
Document document = null;
|
||||||
Document document = null;
|
Throwable ex = null;
|
||||||
Throwable ex = null;
|
try {
|
||||||
try
|
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
||||||
{
|
Element node = document.createElement( SOURCE_LOCATOR_NAME );
|
||||||
document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
|
document.appendChild( node );
|
||||||
Element node = document.createElement( SOURCE_LOCATOR_NAME );
|
ICSourceLocation[] locations = getSourceLocations();
|
||||||
document.appendChild( node );
|
saveDisabledGenericSourceLocations( locations, document, node );
|
||||||
ICSourceLocation[] locations = getSourceLocations();
|
saveAdditionalSourceLocations( locations, document, node );
|
||||||
saveDisabledGenericSourceLocations( locations, document, node );
|
node.setAttribute( ATTR_DUPLICATE_FILES, new Boolean( searchForDuplicateFiles() ).toString() );
|
||||||
saveAdditionalSourceLocations( locations, document, node );
|
|
||||||
node.setAttribute( ATTR_DUPLICATE_FILES, new Boolean( searchForDuplicateFiles() ).toString() );
|
|
||||||
return CDebugUtils.serializeDocument( document );
|
return CDebugUtils.serializeDocument( document );
|
||||||
}
|
}
|
||||||
catch( ParserConfigurationException e )
|
catch( ParserConfigurationException e ) {
|
||||||
{
|
|
||||||
ex = e;
|
|
||||||
}
|
|
||||||
catch( IOException e )
|
|
||||||
{
|
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
catch( TransformerException e )
|
catch( IOException e ) {
|
||||||
{
|
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
abort( CDebugCorePlugin.getResourceString( "internal.core.sourcelookup.CSourceLocator.Unable_to_create_memento" ), ex ); //$NON-NLS-1$
|
catch( TransformerException e ) {
|
||||||
|
ex = e;
|
||||||
|
}
|
||||||
|
abort( InternalSourceLookupMessages.getString( "CSourceLocator.0" ), ex ); //$NON-NLS-1$
|
||||||
// execution will not reach here
|
// execution will not reach here
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration)
|
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration)
|
||||||
*/
|
*/
|
||||||
public void initializeDefaults( ILaunchConfiguration configuration ) throws CoreException
|
public void initializeDefaults( ILaunchConfiguration configuration ) throws CoreException {
|
||||||
{
|
|
||||||
setSourceLocations( getDefaultSourceLocations() );
|
setSourceLocations( getDefaultSourceLocations() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(java.lang.String)
|
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(java.lang.String)
|
||||||
*/
|
*/
|
||||||
public void initializeFromMemento( String memento ) throws CoreException
|
public void initializeFromMemento( String memento ) throws CoreException {
|
||||||
{
|
|
||||||
Exception ex = null;
|
Exception ex = null;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
Element root = null;
|
Element root = null;
|
||||||
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
|
||||||
StringReader reader = new StringReader( memento );
|
StringReader reader = new StringReader( memento );
|
||||||
InputSource source = new InputSource( reader );
|
InputSource source = new InputSource( reader );
|
||||||
root = parser.parse( source ).getDocumentElement();
|
root = parser.parse( source ).getDocumentElement();
|
||||||
|
if ( !root.getNodeName().equalsIgnoreCase( SOURCE_LOCATOR_NAME ) ) {
|
||||||
if ( !root.getNodeName().equalsIgnoreCase( SOURCE_LOCATOR_NAME ) )
|
abort( InternalSourceLookupMessages.getString( "CSourceLocator.1" ) , null ); //$NON-NLS-1$
|
||||||
{
|
|
||||||
abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CSourceLocator.Unable_to_restore_src_locator"), null ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List sourceLocations = new ArrayList();
|
List sourceLocations = new ArrayList();
|
||||||
|
|
||||||
// Add locations based on referenced projects
|
// Add locations based on referenced projects
|
||||||
IProject project = getProject();
|
IProject project = getProject();
|
||||||
if ( project != null && project.exists() && project.isOpen() )
|
if ( project != null && project.exists() && project.isOpen() )
|
||||||
sourceLocations.addAll( Arrays.asList( getDefaultSourceLocations() ) );
|
sourceLocations.addAll( Arrays.asList( getDefaultSourceLocations() ) );
|
||||||
|
|
||||||
removeDisabledLocations( root, sourceLocations );
|
removeDisabledLocations( root, sourceLocations );
|
||||||
addAdditionalLocations( root, sourceLocations );
|
addAdditionalLocations( root, sourceLocations );
|
||||||
// To support old launch configuration
|
// To support old launch configuration
|
||||||
addOldLocations( root, sourceLocations );
|
addOldLocations( root, sourceLocations );
|
||||||
setSourceLocations( (ICSourceLocation[])sourceLocations.toArray( new ICSourceLocation[sourceLocations.size()] ) );
|
setSourceLocations( (ICSourceLocation[])sourceLocations.toArray( new ICSourceLocation[sourceLocations.size()] ) );
|
||||||
|
|
||||||
setSearchForDuplicateFiles( Boolean.valueOf( root.getAttribute( ATTR_DUPLICATE_FILES ) ).booleanValue() );
|
setSearchForDuplicateFiles( Boolean.valueOf( root.getAttribute( ATTR_DUPLICATE_FILES ) ).booleanValue() );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
catch( ParserConfigurationException e )
|
catch( ParserConfigurationException e ) {
|
||||||
{
|
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
catch( SAXException e )
|
catch( SAXException e ) {
|
||||||
{
|
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
catch( IOException e )
|
catch( IOException e ) {
|
||||||
{
|
|
||||||
ex = e;
|
ex = e;
|
||||||
}
|
}
|
||||||
abort( CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CSourceLocator.Exception_initializing_src_locator"), ex ); //$NON-NLS-1$
|
abort( InternalSourceLookupMessages.getString( "CSourceLocator.2" ), ex ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeDisabledLocations( Element root, List sourceLocations )
|
private void removeDisabledLocations( Element root, List sourceLocations ) {
|
||||||
{
|
|
||||||
NodeList list = root.getChildNodes();
|
NodeList list = root.getChildNodes();
|
||||||
int length = list.getLength();
|
int length = list.getLength();
|
||||||
HashSet disabledProjects = new HashSet( length );
|
HashSet disabledProjects = new HashSet( length );
|
||||||
for ( int i = 0; i < length; ++i )
|
for( int i = 0; i < length; ++i ) {
|
||||||
{
|
|
||||||
Node node = list.item( i );
|
Node node = list.item( i );
|
||||||
short type = node.getNodeType();
|
short type = node.getNodeType();
|
||||||
if ( type == Node.ELEMENT_NODE )
|
if ( type == Node.ELEMENT_NODE ) {
|
||||||
{
|
|
||||||
Element entry = (Element)node;
|
Element entry = (Element)node;
|
||||||
if ( entry.getNodeName().equalsIgnoreCase( DISABLED_GENERIC_PROJECT_NAME ) )
|
if ( entry.getNodeName().equalsIgnoreCase( DISABLED_GENERIC_PROJECT_NAME ) ) {
|
||||||
{
|
|
||||||
String projectName = entry.getAttribute( ATTR_PROJECT_NAME );
|
String projectName = entry.getAttribute( ATTR_PROJECT_NAME );
|
||||||
if ( isEmpty( projectName ) )
|
if ( isEmpty( projectName ) ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
|
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
disabledProjects.add( projectName.trim() );
|
disabledProjects.add( projectName.trim() );
|
||||||
|
@ -403,74 +367,55 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Iterator it = sourceLocations.iterator();
|
Iterator it = sourceLocations.iterator();
|
||||||
while( it.hasNext() )
|
while( it.hasNext() ) {
|
||||||
{
|
|
||||||
ICSourceLocation location = (ICSourceLocation)it.next();
|
ICSourceLocation location = (ICSourceLocation)it.next();
|
||||||
if ( location instanceof IProjectSourceLocation &&
|
if ( location instanceof IProjectSourceLocation && disabledProjects.contains( ((IProjectSourceLocation)location).getProject().getName() ) )
|
||||||
disabledProjects.contains( ((IProjectSourceLocation)location).getProject().getName() ) )
|
it.remove();
|
||||||
it.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAdditionalLocations( Element root, List sourceLocations ) throws CoreException
|
private void addAdditionalLocations( Element root, List sourceLocations ) throws CoreException {
|
||||||
{
|
|
||||||
Bundle bundle = CDebugCorePlugin.getDefault().getBundle();
|
Bundle bundle = CDebugCorePlugin.getDefault().getBundle();
|
||||||
|
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(), CDebugCorePlugin.INTERNAL_ERROR, InternalSourceLookupMessages.getString( "CSourceLocator.3" ), null ); //$NON-NLS-1$
|
||||||
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(),
|
|
||||||
CDebugCorePlugin.INTERNAL_ERROR,
|
|
||||||
CDebugCorePlugin.getResourceString("internal.core.sourcelookup.CSourceLocator.Error_initializing_src_location"), //$NON-NLS-1$
|
|
||||||
null );
|
|
||||||
NodeList list = root.getChildNodes();
|
NodeList list = root.getChildNodes();
|
||||||
int length = list.getLength();
|
int length = list.getLength();
|
||||||
for ( int i = 0; i < length; ++i )
|
for( int i = 0; i < length; ++i ) {
|
||||||
{
|
|
||||||
Node node = list.item( i );
|
Node node = list.item( i );
|
||||||
short type = node.getNodeType();
|
short type = node.getNodeType();
|
||||||
if ( type == Node.ELEMENT_NODE )
|
if ( type == Node.ELEMENT_NODE ) {
|
||||||
{
|
|
||||||
Element entry = (Element)node;
|
Element entry = (Element)node;
|
||||||
if ( entry.getNodeName().equalsIgnoreCase( ADDITIONAL_SOURCE_LOCATION_NAME ) )
|
if ( entry.getNodeName().equalsIgnoreCase( ADDITIONAL_SOURCE_LOCATION_NAME ) ) {
|
||||||
{
|
|
||||||
String className = entry.getAttribute( ATTR_CLASS );
|
String className = entry.getAttribute( ATTR_CLASS );
|
||||||
String data = entry.getAttribute( ATTR_MEMENTO );
|
String data = entry.getAttribute( ATTR_MEMENTO );
|
||||||
if ( isEmpty( className ) )
|
if ( isEmpty( className ) ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
|
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Class clazz = null;
|
Class clazz = null;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
clazz = bundle.loadClass( className );
|
clazz = bundle.loadClass( className );
|
||||||
}
|
}
|
||||||
catch( ClassNotFoundException e )
|
catch( ClassNotFoundException e ) {
|
||||||
{
|
CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[]{ className } ) ); //$NON-NLS-1$
|
||||||
CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); //$NON-NLS-1$
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ICSourceLocation location = null;
|
ICSourceLocation location = null;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
location = (ICSourceLocation)clazz.newInstance();
|
location = (ICSourceLocation)clazz.newInstance();
|
||||||
}
|
}
|
||||||
catch( IllegalAccessException e )
|
catch( IllegalAccessException e ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
catch( InstantiationException e )
|
catch( InstantiationException e ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
location.initializeFrom( data );
|
location.initializeFrom( data );
|
||||||
sourceLocations.add( location );
|
sourceLocations.add( location );
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
status.addAll( e.getStatus() );
|
status.addAll( e.getStatus() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -480,57 +425,44 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
throw new CoreException( status );
|
throw new CoreException( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addOldLocations( Element root, List sourceLocations ) throws CoreException
|
private void addOldLocations( Element root, List sourceLocations ) throws CoreException {
|
||||||
{
|
|
||||||
Bundle bundle = CDebugCorePlugin.getDefault().getBundle();
|
Bundle bundle = CDebugCorePlugin.getDefault().getBundle();
|
||||||
|
|
||||||
NodeList list = root.getChildNodes();
|
NodeList list = root.getChildNodes();
|
||||||
int length = list.getLength();
|
int length = list.getLength();
|
||||||
for ( int i = 0; i < length; ++i )
|
for( int i = 0; i < length; ++i ) {
|
||||||
{
|
|
||||||
Node node = list.item( i );
|
Node node = list.item( i );
|
||||||
short type = node.getNodeType();
|
short type = node.getNodeType();
|
||||||
if ( type == Node.ELEMENT_NODE )
|
if ( type == Node.ELEMENT_NODE ) {
|
||||||
{
|
|
||||||
Element entry = (Element)node;
|
Element entry = (Element)node;
|
||||||
if ( entry.getNodeName().equalsIgnoreCase( SOURCE_LOCATION_NAME ) )
|
if ( entry.getNodeName().equalsIgnoreCase( SOURCE_LOCATION_NAME ) ) {
|
||||||
{
|
|
||||||
String className = entry.getAttribute( ATTR_CLASS );
|
String className = entry.getAttribute( ATTR_CLASS );
|
||||||
String data = entry.getAttribute( ATTR_MEMENTO );
|
String data = entry.getAttribute( ATTR_MEMENTO );
|
||||||
if ( isEmpty( className ) )
|
if ( isEmpty( className ) ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
|
CDebugCorePlugin.log( "Unable to restore C/C++ source locator - invalid format." ); //$NON-NLS-1$
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Class clazz = null;
|
Class clazz = null;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
clazz = bundle.loadClass( className );
|
clazz = bundle.loadClass( className );
|
||||||
}
|
}
|
||||||
catch( ClassNotFoundException e )
|
catch( ClassNotFoundException e ) {
|
||||||
{
|
CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[]{ className } ) ); //$NON-NLS-1$
|
||||||
CDebugCorePlugin.log( MessageFormat.format( "Unable to restore source location - class not found {0}", new String[] { className } ) ); //$NON-NLS-1$
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ICSourceLocation location = null;
|
ICSourceLocation location = null;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
location = (ICSourceLocation)clazz.newInstance();
|
location = (ICSourceLocation)clazz.newInstance();
|
||||||
}
|
}
|
||||||
catch( IllegalAccessException e )
|
catch( IllegalAccessException e ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
catch( InstantiationException e )
|
catch( InstantiationException e ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
CDebugCorePlugin.log( "Unable to restore source location." ); //$NON-NLS-1$
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
location.initializeFrom( data );
|
location.initializeFrom( data );
|
||||||
if ( !sourceLocations.contains( location ) )
|
if ( !sourceLocations.contains( location ) ) {
|
||||||
{
|
|
||||||
if ( location instanceof CProjectSourceLocation )
|
if ( location instanceof CProjectSourceLocation )
|
||||||
((CProjectSourceLocation)location).setGenerated( isReferencedProject( ((CProjectSourceLocation)location).getProject() ) );
|
((CProjectSourceLocation)location).setGenerated( isReferencedProject( ((CProjectSourceLocation)location).getProject() ) );
|
||||||
sourceLocations.add( location );
|
sourceLocations.add( location );
|
||||||
|
@ -543,31 +475,21 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
/**
|
/**
|
||||||
* Throws an internal error exception
|
* Throws an internal error exception
|
||||||
*/
|
*/
|
||||||
private void abort( String message, Throwable e ) throws CoreException
|
private void abort( String message, Throwable e ) throws CoreException {
|
||||||
{
|
IStatus s = new Status( IStatus.ERROR, CDebugCorePlugin.getUniqueIdentifier(), CDebugCorePlugin.INTERNAL_ERROR, message, e );
|
||||||
IStatus s = new Status( IStatus.ERROR,
|
|
||||||
CDebugCorePlugin.getUniqueIdentifier(),
|
|
||||||
CDebugCorePlugin.INTERNAL_ERROR,
|
|
||||||
message,
|
|
||||||
e );
|
|
||||||
throw new CoreException( s );
|
throw new CoreException( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isEmpty( String string ) {
|
||||||
private boolean isEmpty( String string )
|
|
||||||
{
|
|
||||||
return string == null || string.trim().length() == 0;
|
return string == null || string.trim().length() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resourceChanged( IResourceChangeEvent event )
|
public void resourceChanged( IResourceChangeEvent event ) {
|
||||||
{
|
if ( event.getSource() instanceof IWorkspace && event.getDelta() != null ) {
|
||||||
if ( event.getSource() instanceof IWorkspace && event.getDelta() != null )
|
|
||||||
{
|
|
||||||
IResourceDelta[] deltas = event.getDelta().getAffectedChildren();
|
IResourceDelta[] deltas = event.getDelta().getAffectedChildren();
|
||||||
if ( deltas != null )
|
if ( deltas != null ) {
|
||||||
{
|
|
||||||
ArrayList list = new ArrayList( deltas.length );
|
ArrayList list = new ArrayList( deltas.length );
|
||||||
for ( int i = 0; i < deltas.length; ++i )
|
for( int i = 0; i < deltas.length; ++i )
|
||||||
if ( deltas[i].getResource() instanceof IProject )
|
if ( deltas[i].getResource() instanceof IProject )
|
||||||
list.add( deltas[i].getResource() );
|
list.add( deltas[i].getResource() );
|
||||||
resetSourceLocations( list );
|
resetSourceLocations( list );
|
||||||
|
@ -575,27 +497,21 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveDisabledGenericSourceLocations( ICSourceLocation[] locations, Document doc, Element node )
|
private void saveDisabledGenericSourceLocations( ICSourceLocation[] locations, Document doc, Element node ) {
|
||||||
{
|
|
||||||
IProject project = getProject();
|
IProject project = getProject();
|
||||||
if ( project != null && project.exists() && project.isOpen() )
|
if ( project != null && project.exists() && project.isOpen() ) {
|
||||||
{
|
|
||||||
List list = CDebugUtils.getReferencedProjects( project );
|
List list = CDebugUtils.getReferencedProjects( project );
|
||||||
HashSet names = new HashSet( list.size() + 1 );
|
HashSet names = new HashSet( list.size() + 1 );
|
||||||
names.add( project.getName() );
|
names.add( project.getName() );
|
||||||
Iterator it = list.iterator();
|
Iterator it = list.iterator();
|
||||||
while( it.hasNext() )
|
while( it.hasNext() ) {
|
||||||
{
|
|
||||||
names.add( ((IProject)it.next()).getName() );
|
names.add( ((IProject)it.next()).getName() );
|
||||||
}
|
}
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i )
|
||||||
if ( locations[i] instanceof IProjectSourceLocation &&
|
if ( locations[i] instanceof IProjectSourceLocation && ((IProjectSourceLocation)locations[i]).isGeneric() )
|
||||||
((IProjectSourceLocation)locations[i]).isGeneric() )
|
names.remove( ((IProjectSourceLocation)locations[i]).getProject().getName() );
|
||||||
names.remove( ((IProjectSourceLocation)locations[i]).getProject().getName() );
|
|
||||||
|
|
||||||
it = names.iterator();
|
it = names.iterator();
|
||||||
while ( it.hasNext() )
|
while( it.hasNext() ) {
|
||||||
{
|
|
||||||
Element child = doc.createElement( DISABLED_GENERIC_PROJECT_NAME );
|
Element child = doc.createElement( DISABLED_GENERIC_PROJECT_NAME );
|
||||||
child.setAttribute( ATTR_PROJECT_NAME, (String)it.next() );
|
child.setAttribute( ATTR_PROJECT_NAME, (String)it.next() );
|
||||||
node.appendChild( child );
|
node.appendChild( child );
|
||||||
|
@ -603,21 +519,16 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveAdditionalSourceLocations( ICSourceLocation[] locations, Document doc, Element node )
|
private void saveAdditionalSourceLocations( ICSourceLocation[] locations, Document doc, Element node ) {
|
||||||
{
|
for( int i = 0; i < locations.length; i++ ) {
|
||||||
for ( int i = 0; i < locations.length; i++ )
|
if ( locations[i] instanceof IProjectSourceLocation && ((IProjectSourceLocation)locations[i]).isGeneric() )
|
||||||
{
|
|
||||||
if ( locations[i] instanceof IProjectSourceLocation &&
|
|
||||||
((IProjectSourceLocation)locations[i]).isGeneric() )
|
|
||||||
continue;
|
continue;
|
||||||
Element child = doc.createElement( ADDITIONAL_SOURCE_LOCATION_NAME );
|
Element child = doc.createElement( ADDITIONAL_SOURCE_LOCATION_NAME );
|
||||||
child.setAttribute( ATTR_CLASS, locations[i].getClass().getName() );
|
child.setAttribute( ATTR_CLASS, locations[i].getClass().getName() );
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
child.setAttribute( ATTR_MEMENTO, locations[i].getMemento() );
|
child.setAttribute( ATTR_MEMENTO, locations[i].getMemento() );
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( e );
|
CDebugCorePlugin.log( e );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -625,49 +536,42 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getProject()
|
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#getProject()
|
||||||
*/
|
*/
|
||||||
public IProject getProject()
|
public IProject getProject() {
|
||||||
{
|
|
||||||
return fProject;
|
return fProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setProject( IProject project )
|
protected void setProject( IProject project ) {
|
||||||
{
|
|
||||||
fProject = project;
|
fProject = project;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isReferencedProject( IProject ref )
|
private boolean isReferencedProject( IProject ref ) {
|
||||||
{
|
if ( getProject() != null ) {
|
||||||
if ( getProject() != null )
|
try {
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
return Arrays.asList( getProject().getReferencedProjects() ).contains( ref );
|
return Arrays.asList( getProject().getReferencedProjects() ).contains( ref );
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
CDebugCorePlugin.log( e );
|
CDebugCorePlugin.log( e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setReferencedProjects()
|
private void setReferencedProjects() {
|
||||||
{
|
fReferencedProjects.clear();
|
||||||
fReferencedProjects.clear();
|
|
||||||
fReferencedProjects = CDebugUtils.getReferencedProjects( getProject() );
|
fReferencedProjects = CDebugUtils.getReferencedProjects( getProject() );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICSourceLocation[] getDefaultSourceLocations()
|
protected ICSourceLocation[] getDefaultSourceLocations() {
|
||||||
{
|
|
||||||
Iterator it = fReferencedProjects.iterator();
|
Iterator it = fReferencedProjects.iterator();
|
||||||
ArrayList list = new ArrayList( fReferencedProjects.size() );
|
ArrayList list = new ArrayList( fReferencedProjects.size() );
|
||||||
if ( getProject() != null && getProject().exists() && getProject().isOpen() )
|
if ( getProject() != null && getProject().exists() && getProject().isOpen() )
|
||||||
list.add( SourceLookupFactory.createProjectSourceLocation( getProject() ) );
|
list.add( SourceLookupFactory.createProjectSourceLocation( getProject() ) );
|
||||||
while( it.hasNext() )
|
while( it.hasNext() ) {
|
||||||
{
|
|
||||||
IProject project = (IProject)it.next();
|
IProject project = (IProject)it.next();
|
||||||
if ( project != null && project.exists() && project.isOpen() )
|
if ( project != null && project.exists() && project.isOpen() )
|
||||||
list.add( SourceLookupFactory.createProjectSourceLocation( project ) );
|
list.add( SourceLookupFactory.createProjectSourceLocation( project ) );
|
||||||
|
@ -675,50 +579,39 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] );
|
return (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetSourceLocations( List affectedProjects )
|
private void resetSourceLocations( List affectedProjects ) {
|
||||||
{
|
if ( affectedProjects.size() != 0 && getProject() != null ) {
|
||||||
if ( affectedProjects.size() != 0 && getProject() != null )
|
if ( !getProject().exists() || !getProject().isOpen() ) {
|
||||||
{
|
|
||||||
if ( !getProject().exists() || !getProject().isOpen() )
|
|
||||||
{
|
|
||||||
removeGenericSourceLocations();
|
removeGenericSourceLocations();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
updateGenericSourceLocations( affectedProjects );
|
updateGenericSourceLocations( affectedProjects );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeGenericSourceLocations()
|
private void removeGenericSourceLocations() {
|
||||||
{
|
|
||||||
fReferencedProjects.clear();
|
fReferencedProjects.clear();
|
||||||
ICSourceLocation[] locations = getSourceLocations();
|
ICSourceLocation[] locations = getSourceLocations();
|
||||||
ArrayList newLocations = new ArrayList( locations.length );
|
ArrayList newLocations = new ArrayList( locations.length );
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i )
|
||||||
if ( !(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation)locations[i]).isGeneric() )
|
if ( !(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation)locations[i]).isGeneric() )
|
||||||
newLocations.add( locations[i] );
|
newLocations.add( locations[i] );
|
||||||
setSourceLocations( (ICSourceLocation[])newLocations.toArray( new ICSourceLocation[newLocations.size()] ) );
|
setSourceLocations( (ICSourceLocation[])newLocations.toArray( new ICSourceLocation[newLocations.size()] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateGenericSourceLocations( List affectedProjects )
|
private void updateGenericSourceLocations( List affectedProjects ) {
|
||||||
{
|
|
||||||
List newRefs = CDebugUtils.getReferencedProjects( getProject() );
|
List newRefs = CDebugUtils.getReferencedProjects( getProject() );
|
||||||
ICSourceLocation[] locations = getSourceLocations();
|
ICSourceLocation[] locations = getSourceLocations();
|
||||||
ArrayList newLocations = new ArrayList( locations.length );
|
ArrayList newLocations = new ArrayList( locations.length );
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i ) {
|
||||||
{
|
if ( !(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation)locations[i]).isGeneric() ) {
|
||||||
if ( !(locations[i] instanceof IProjectSourceLocation) || !((IProjectSourceLocation)locations[i]).isGeneric() )
|
|
||||||
{
|
|
||||||
newLocations.add( locations[i] );
|
newLocations.add( locations[i] );
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
IProject project = ((IProjectSourceLocation)locations[i]).getProject();
|
IProject project = ((IProjectSourceLocation)locations[i]).getProject();
|
||||||
if ( project.exists() && project.isOpen() )
|
if ( project.exists() && project.isOpen() ) {
|
||||||
{
|
if ( newRefs.contains( project ) || project.equals( getProject() ) ) {
|
||||||
if ( newRefs.contains( project ) || project.equals( getProject() ) )
|
|
||||||
{
|
|
||||||
newLocations.add( locations[i] );
|
newLocations.add( locations[i] );
|
||||||
newRefs.remove( project );
|
newRefs.remove( project );
|
||||||
}
|
}
|
||||||
|
@ -726,8 +619,7 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Iterator it = newRefs.iterator();
|
Iterator it = newRefs.iterator();
|
||||||
while( it.hasNext() )
|
while( it.hasNext() ) {
|
||||||
{
|
|
||||||
IProject project = (IProject)it.next();
|
IProject project = (IProject)it.next();
|
||||||
if ( !fReferencedProjects.contains( project ) )
|
if ( !fReferencedProjects.contains( project ) )
|
||||||
newLocations.add( SourceLookupFactory.createProjectSourceLocation( project ) );
|
newLocations.add( SourceLookupFactory.createProjectSourceLocation( project ) );
|
||||||
|
@ -736,19 +628,19 @@ public class CSourceLocator implements ICSourceLocator, IPersistableSourceLocato
|
||||||
setSourceLocations( (ICSourceLocation[])newLocations.toArray( new ICSourceLocation[newLocations.size()] ) );
|
setSourceLocations( (ICSourceLocation[])newLocations.toArray( new ICSourceLocation[newLocations.size()] ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#searchForDuplicateFiles()
|
* @see org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator#searchForDuplicateFiles()
|
||||||
*/
|
*/
|
||||||
public boolean searchForDuplicateFiles()
|
public boolean searchForDuplicateFiles() {
|
||||||
{
|
|
||||||
return fDuplicateFiles;
|
return fDuplicateFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSearchForDuplicateFiles( boolean search )
|
public void setSearchForDuplicateFiles( boolean search ) {
|
||||||
{
|
|
||||||
fDuplicateFiles = search;
|
fDuplicateFiles = search;
|
||||||
ICSourceLocation[] locations = getSourceLocations();
|
ICSourceLocation[] locations = getSourceLocations();
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i )
|
||||||
locations[i].setSearchForDuplicateFiles( search );
|
locations[i].setSearchForDuplicateFiles( search );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.internal.core.sourcelookup;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
|
//import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
public class InternalSourceLookupMessages {
|
||||||
|
|
||||||
|
// private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.core.sourcelookup.InternalSourceLookupMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
// private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private InternalSourceLookupMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
try {
|
||||||
|
return CDebugCorePlugin.getResourceString( key );
|
||||||
|
// return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
CDirectorySourceLocation.0=Unable to create memento for C/C++ directory source location {0}.
|
||||||
|
CDirectorySourceLocation.1=Unable to initialize source location - missing directory path.
|
||||||
|
CDirectorySourceLocation.2=Unable to initialize source location - invalid directory path {0}.
|
||||||
|
CDirectorySourceLocation.3=Exception occurred initializing source location.
|
||||||
|
CProjectSourceLocation.0=Unable to create memento for C/C++ project source location {0}.
|
||||||
|
CProjectSourceLocation.1=Unable to initialize source location - missing project name
|
||||||
|
CProjectSourceLocation.2=Exception occurred initializing source location.
|
||||||
|
CSourceLocator.0=Unable to create memento for C/C++ source locator.
|
||||||
|
CSourceLocator.1=Unable to restore C/C++ source locator - invalid format.
|
||||||
|
CSourceLocator.2=Exception occurred initializing source locator.
|
||||||
|
CSourceLocator.3=Error initializing directory source location.
|
|
@ -5,14 +5,12 @@
|
||||||
package org.eclipse.cdt.debug.mi.internal.ui;
|
package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
|
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
|
|
||||||
public class CygwinDebuggerPage extends GDBDebuggerPage
|
public class CygwinDebuggerPage extends GDBDebuggerPage
|
||||||
{
|
{
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return MIUIPlugin.getResourceString("internal.ui.CygwinDebuggerPage.Cygwin_GDB_Debugger_Options"); //$NON-NLS-1$
|
return MIUIMessages.getString( "CygwinDebuggerPage.0" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|
|
@ -7,13 +7,13 @@ package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
import java.util.Observer;
|
import java.util.Observer;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||||
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
|
||||||
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
||||||
|
import org.eclipse.debug.ui.ILaunchConfigurationTab;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
import org.eclipse.swt.events.ModifyListener;
|
||||||
|
@ -29,7 +29,6 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.TabFolder;
|
import org.eclipse.swt.widgets.TabFolder;
|
||||||
import org.eclipse.swt.widgets.TabItem;
|
import org.eclipse.swt.widgets.TabItem;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements Observer
|
public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements Observer
|
||||||
{
|
{
|
||||||
|
@ -74,7 +73,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Debugger_exec_must_be_specified") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "GDBDebuggerPage.0" ) ); //$NON-NLS-1$
|
||||||
setMessage( null );
|
setMessage( null );
|
||||||
}
|
}
|
||||||
return valid;
|
return valid;
|
||||||
|
@ -112,7 +111,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
|
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_Debugger_Options"); //$NON-NLS-1$
|
return MIUIMessages.getString( "GDBDebuggerPage.1" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +154,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
public void createMainTab( TabFolder tabFolder )
|
public void createMainTab( TabFolder tabFolder )
|
||||||
{
|
{
|
||||||
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
||||||
tabItem.setText( MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Main") ); //$NON-NLS-1$
|
tabItem.setText( MIUIMessages.getString( "GDBDebuggerPage.2" ) ); //$NON-NLS-1$
|
||||||
|
|
||||||
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
|
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
|
||||||
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
|
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
|
||||||
|
@ -164,7 +163,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL );
|
Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL );
|
||||||
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
|
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
|
||||||
|
|
||||||
Label label = ControlFactory.createLabel( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_debugger")+':' ); //$NON-NLS-1$
|
Label label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBDebuggerPage.3" ) ); //$NON-NLS-1$
|
||||||
GridData gd = new GridData();
|
GridData gd = new GridData();
|
||||||
// gd.horizontalSpan = 2;
|
// gd.horizontalSpan = 2;
|
||||||
label.setLayoutData( gd );
|
label.setLayoutData( gd );
|
||||||
|
@ -179,7 +178,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
Button button = createPushButton( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Browse"), null ); //$NON-NLS-1$
|
Button button = createPushButton( subComp, MIUIMessages.getString( "GDBDebuggerPage.4" ), null ); //$NON-NLS-1$
|
||||||
button.addSelectionListener(
|
button.addSelectionListener(
|
||||||
new SelectionAdapter()
|
new SelectionAdapter()
|
||||||
{
|
{
|
||||||
|
@ -192,7 +191,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
private void handleGDBButtonSelected()
|
private void handleGDBButtonSelected()
|
||||||
{
|
{
|
||||||
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
||||||
dialog.setText( MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_Debugger") ); //$NON-NLS-1$
|
dialog.setText( MIUIMessages.getString( "GDBDebuggerPage.5" ) ); //$NON-NLS-1$
|
||||||
String gdbCommand = fGDBCommandText.getText().trim();
|
String gdbCommand = fGDBCommandText.getText().trim();
|
||||||
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
||||||
if ( lastSeparatorIndex != -1 )
|
if ( lastSeparatorIndex != -1 )
|
||||||
|
@ -208,7 +207,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
label = ControlFactory.createLabel( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_command_file")+':' ); //$NON-NLS-1$
|
label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBDebuggerPage.6" ) ); //$NON-NLS-1$
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
// gd.horizontalSpan = 2;
|
// gd.horizontalSpan = 2;
|
||||||
label.setLayoutData( gd );
|
label.setLayoutData( gd );
|
||||||
|
@ -223,7 +222,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
updateLaunchConfigurationDialog();
|
updateLaunchConfigurationDialog();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
button = createPushButton( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Browse"), null ); //$NON-NLS-1$
|
button = createPushButton( subComp, MIUIMessages.getString( "GDBDebuggerPage.7" ), null ); //$NON-NLS-1$
|
||||||
button.addSelectionListener(
|
button.addSelectionListener(
|
||||||
new SelectionAdapter()
|
new SelectionAdapter()
|
||||||
{
|
{
|
||||||
|
@ -236,7 +235,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
private void handleGDBInitButtonSelected()
|
private void handleGDBInitButtonSelected()
|
||||||
{
|
{
|
||||||
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
||||||
dialog.setText( MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_Command_File") ); //$NON-NLS-1$
|
dialog.setText( MIUIMessages.getString( "GDBDebuggerPage.8" ) ); //$NON-NLS-1$
|
||||||
String gdbCommand = fGDBInitText.getText().trim();
|
String gdbCommand = fGDBInitText.getText().trim();
|
||||||
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
||||||
if ( lastSeparatorIndex != -1 )
|
if ( lastSeparatorIndex != -1 )
|
||||||
|
@ -253,7 +252,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
} );
|
} );
|
||||||
|
|
||||||
label = ControlFactory.createLabel( comp,
|
label = ControlFactory.createLabel( comp,
|
||||||
MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Warning_startup_operation_interference"), //$NON-NLS-1$
|
MIUIMessages.getString( "GDBDebuggerPage.9" ), //$NON-NLS-1$
|
||||||
200,
|
200,
|
||||||
SWT.DEFAULT,
|
SWT.DEFAULT,
|
||||||
SWT.WRAP );
|
SWT.WRAP );
|
||||||
|
@ -266,7 +265,7 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
public void createSolibTab( TabFolder tabFolder )
|
public void createSolibTab( TabFolder tabFolder )
|
||||||
{
|
{
|
||||||
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
||||||
tabItem.setText( MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Shared_libraries") ); //$NON-NLS-1$
|
tabItem.setText( MIUIMessages.getString( "GDBDebuggerPage.10" ) ); //$NON-NLS-1$
|
||||||
|
|
||||||
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
|
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
|
||||||
tabItem.setControl( comp );
|
tabItem.setControl( comp );
|
||||||
|
@ -287,3 +286,4 @@ public class GDBDebuggerPage extends AbstractLaunchConfigurationTab implements O
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
package org.eclipse.cdt.debug.mi.internal.ui;
|
package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ComboDialogField;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ComboDialogField;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
||||||
|
@ -31,7 +30,6 @@ import org.eclipse.swt.widgets.FileDialog;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.TabFolder;
|
import org.eclipse.swt.widgets.TabFolder;
|
||||||
import org.eclipse.swt.widgets.TabItem;
|
import org.eclipse.swt.widgets.TabItem;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
|
@ -40,8 +38,8 @@ import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
||||||
*/
|
*/
|
||||||
public class GDBServerDebuggerPage extends GDBDebuggerPage
|
public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
{
|
{
|
||||||
private final static String CONNECTION_TCP = MIUIPlugin.getResourceString("internal.ui.GDBServerDebuggerPage.TCP"); //$NON-NLS-1$
|
private final static String CONNECTION_TCP = MIUIMessages.getString( "GDBServerDebuggerPage.0" ); //$NON-NLS-1$
|
||||||
private final static String CONNECTION_SERIAL = MIUIPlugin.getResourceString("internal.ui.GDBServerDebuggerPage.Serial"); //$NON-NLS-1$
|
private final static String CONNECTION_SERIAL = MIUIMessages.getString( "GDBServerDebuggerPage.1" ); //$NON-NLS-1$
|
||||||
|
|
||||||
private ComboDialogField fConnectionField;
|
private ComboDialogField fConnectionField;
|
||||||
|
|
||||||
|
@ -63,7 +61,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
public void createMainTab( TabFolder tabFolder )
|
public void createMainTab( TabFolder tabFolder )
|
||||||
{
|
{
|
||||||
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
|
||||||
tabItem.setText( MIUIPlugin.getResourceString("internal.ui.GDBServerDebuggerPage.Main") ); //$NON-NLS-1$
|
tabItem.setText( MIUIMessages.getString( "GDBServerDebuggerPage.2" ) ); //$NON-NLS-1$
|
||||||
|
|
||||||
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
|
Composite comp = ControlFactory.createCompositeEx( fTabFolder, 1, GridData.FILL_BOTH );
|
||||||
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
|
((GridLayout)comp.getLayout()).makeColumnsEqualWidth = false;
|
||||||
|
@ -72,7 +70,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL );
|
Composite subComp = ControlFactory.createCompositeEx( comp, 3, GridData.FILL_HORIZONTAL );
|
||||||
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
|
((GridLayout)subComp.getLayout()).makeColumnsEqualWidth = false;
|
||||||
|
|
||||||
Label label = ControlFactory.createLabel( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_debugger") ); //$NON-NLS-1$
|
Label label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.3" ) ); //$NON-NLS-1$
|
||||||
GridData gd = new GridData();
|
GridData gd = new GridData();
|
||||||
// gd.horizontalSpan = 2;
|
// gd.horizontalSpan = 2;
|
||||||
label.setLayoutData( gd );
|
label.setLayoutData( gd );
|
||||||
|
@ -87,7 +85,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
Button button = createPushButton( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Browse"), null ); //$NON-NLS-1$
|
Button button = createPushButton( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.4" ), null ); //$NON-NLS-1$
|
||||||
button.addSelectionListener(
|
button.addSelectionListener(
|
||||||
new SelectionAdapter()
|
new SelectionAdapter()
|
||||||
{
|
{
|
||||||
|
@ -100,7 +98,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
private void handleGDBButtonSelected()
|
private void handleGDBButtonSelected()
|
||||||
{
|
{
|
||||||
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
||||||
dialog.setText( MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_Debugger") ); //$NON-NLS-1$
|
dialog.setText( MIUIMessages.getString( "GDBServerDebuggerPage.5" ) ); //$NON-NLS-1$
|
||||||
String gdbCommand = fGDBCommandText.getText().trim();
|
String gdbCommand = fGDBCommandText.getText().trim();
|
||||||
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
||||||
if ( lastSeparatorIndex != -1 )
|
if ( lastSeparatorIndex != -1 )
|
||||||
|
@ -116,7 +114,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
label = ControlFactory.createLabel( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_command_file")+':' ); //$NON-NLS-1$
|
label = ControlFactory.createLabel( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.6" ) ); //$NON-NLS-1$
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
// gd.horizontalSpan = 2;
|
// gd.horizontalSpan = 2;
|
||||||
label.setLayoutData( gd );
|
label.setLayoutData( gd );
|
||||||
|
@ -131,7 +129,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
updateLaunchConfigurationDialog();
|
updateLaunchConfigurationDialog();
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
button = createPushButton( subComp, MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.Browse"), null ); //$NON-NLS-1$
|
button = createPushButton( subComp, MIUIMessages.getString( "GDBServerDebuggerPage.7" ), null ); //$NON-NLS-1$
|
||||||
button.addSelectionListener(
|
button.addSelectionListener(
|
||||||
new SelectionAdapter()
|
new SelectionAdapter()
|
||||||
{
|
{
|
||||||
|
@ -144,7 +142,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
private void handleGDBInitButtonSelected()
|
private void handleGDBInitButtonSelected()
|
||||||
{
|
{
|
||||||
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
FileDialog dialog = new FileDialog( getShell(), SWT.NONE );
|
||||||
dialog.setText( MIUIPlugin.getResourceString("internal.ui.GDBDebuggerPage.GDB_Command_File") ); //$NON-NLS-1$
|
dialog.setText( MIUIMessages.getString( "GDBServerDebuggerPage.8" ) ); //$NON-NLS-1$
|
||||||
String gdbCommand = fGDBInitText.getText().trim();
|
String gdbCommand = fGDBInitText.getText().trim();
|
||||||
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
int lastSeparatorIndex = gdbCommand.lastIndexOf( File.separator );
|
||||||
if ( lastSeparatorIndex != -1 )
|
if ( lastSeparatorIndex != -1 )
|
||||||
|
@ -188,7 +186,7 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
private ComboDialogField createConnectionField()
|
private ComboDialogField createConnectionField()
|
||||||
{
|
{
|
||||||
ComboDialogField field = new ComboDialogField( SWT.DROP_DOWN | SWT.READ_ONLY );
|
ComboDialogField field = new ComboDialogField( SWT.DROP_DOWN | SWT.READ_ONLY );
|
||||||
field.setLabelText( MIUIPlugin.getResourceString("internal.ui.GDBServerDebuggerPage.Connection"));//$NON-NLS-1$
|
field.setLabelText( MIUIMessages.getString( "GDBServerDebuggerPage.9" ) ); //$NON-NLS-1$
|
||||||
field.setItems( fConnections );
|
field.setItems( fConnections );
|
||||||
field.setDialogFieldListener(
|
field.setDialogFieldListener(
|
||||||
new IDialogFieldListener()
|
new IDialogFieldListener()
|
||||||
|
@ -286,3 +284,4 @@ public class GDBServerDebuggerPage extends GDBDebuggerPage
|
||||||
fSerialBlock.setDefaults( configuration );
|
fSerialBlock.setDefaults( configuration );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
import java.util.Observer;
|
import java.util.Observer;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
import org.eclipse.cdt.utils.ui.controls.ControlFactory;
|
||||||
|
@ -21,7 +20,6 @@ import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
|
@ -56,7 +54,7 @@ public class GDBSolibBlock extends Observable implements Observer
|
||||||
|
|
||||||
if ( autoSolib )
|
if ( autoSolib )
|
||||||
{
|
{
|
||||||
fAutoSoLibButton = ControlFactory.createCheckBox( subComp, MIUIPlugin.getResourceString("mi.internal.ui.GDBSolibBlock.Load_shared_lib_symbols_automatically") ); //$NON-NLS-1$
|
fAutoSoLibButton = ControlFactory.createCheckBox( subComp, MIUIMessages.getString( "GDBSolibBlock.0" ) ); //$NON-NLS-1$
|
||||||
fAutoSoLibButton.addSelectionListener(
|
fAutoSoLibButton.addSelectionListener(
|
||||||
new SelectionAdapter()
|
new SelectionAdapter()
|
||||||
{
|
{
|
||||||
|
@ -70,7 +68,7 @@ public class GDBSolibBlock extends Observable implements Observer
|
||||||
|
|
||||||
if ( stopOnSolibEvents )
|
if ( stopOnSolibEvents )
|
||||||
{
|
{
|
||||||
fStopOnSolibEventsButton = ControlFactory.createCheckBox( subComp, MIUIPlugin.getResourceString("mi.internal.ui.GDBSolibBlock.Stop_on_shared_lib_events") ); //$NON-NLS-1$
|
fStopOnSolibEventsButton = ControlFactory.createCheckBox( subComp, MIUIMessages.getString( "GDBSolibBlock.1" ) ); //$NON-NLS-1$
|
||||||
fStopOnSolibEventsButton.addSelectionListener(
|
fStopOnSolibEventsButton.addSelectionListener(
|
||||||
new SelectionAdapter()
|
new SelectionAdapter()
|
||||||
{
|
{
|
||||||
|
@ -192,3 +190,4 @@ public class GDBSolibBlock extends Observable implements Observer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
//import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
public class MIUIMessages {
|
||||||
|
|
||||||
|
// private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.internal.ui.MIUIMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
// private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private MIUIMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
try {
|
||||||
|
return MIUIPlugin.getResourceString( key );
|
||||||
|
// return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
CygwinDebuggerPage.0=Cygwin GDB Debugger Options
|
||||||
|
GDBDebuggerPage.0=Debugger executable must be specified.
|
||||||
|
GDBDebuggerPage.1=GDB Debugger Options
|
||||||
|
GDBDebuggerPage.2=Main
|
||||||
|
GDBDebuggerPage.3=GDB debugger:
|
||||||
|
GDBDebuggerPage.4=&Browse...
|
||||||
|
GDBDebuggerPage.5=GDB Debugger
|
||||||
|
GDBDebuggerPage.6=GDB command file:
|
||||||
|
GDBDebuggerPage.7=&Browse...
|
||||||
|
GDBDebuggerPage.8=GDB Command File
|
||||||
|
GDBDebuggerPage.9=(Warning: Some commands in this file may interfere with the startup operation of the debugger, for example "run".)
|
||||||
|
GDBDebuggerPage.10=Shared Libraries
|
||||||
|
GDBServerDebuggerPage.0=TCP
|
||||||
|
GDBServerDebuggerPage.1=Serial
|
||||||
|
GDBServerDebuggerPage.2=Main
|
||||||
|
GDBServerDebuggerPage.3=GDB debugger
|
||||||
|
GDBServerDebuggerPage.4=&Browse...
|
||||||
|
GDBServerDebuggerPage.5=GDB Debugger
|
||||||
|
GDBServerDebuggerPage.6=GDB command file:
|
||||||
|
GDBServerDebuggerPage.7=&Browse...
|
||||||
|
GDBServerDebuggerPage.8=GDB Command File
|
||||||
|
GDBServerDebuggerPage.9=Connection:
|
||||||
|
GDBSolibBlock.0=Load shared library symbols automatically
|
||||||
|
GDBSolibBlock.1=Stop on shared library events
|
||||||
|
SerialPortSettingsBlock.0=Device:
|
||||||
|
SerialPortSettingsBlock.1=Speed:
|
||||||
|
SerialPortSettingsBlock.2=Device must be specified.
|
||||||
|
SerialPortSettingsBlock.3=Invalid device.
|
||||||
|
SerialPortSettingsBlock.4=Speed must be specified.
|
||||||
|
SolibSearchPathBlock.0=Add...
|
||||||
|
SolibSearchPathBlock.1=Up
|
||||||
|
SolibSearchPathBlock.2=Down
|
||||||
|
SolibSearchPathBlock.3=Remove
|
||||||
|
SolibSearchPathBlock.4=Directories:
|
||||||
|
SolibSearchPathBlock.5=Select directory that contains shared library.
|
||||||
|
TCPSettingsBlock.0=Host name or IP address:
|
||||||
|
TCPSettingsBlock.1=Port number:
|
||||||
|
TCPSettingsBlock.2=Host name or IP address must be specified.
|
||||||
|
TCPSettingsBlock.3=Invalid host name or IP address.
|
||||||
|
TCPSettingsBlock.4=Port number must be specified.
|
||||||
|
TCPSettingsBlock.5=Invalid port number.
|
|
@ -1,41 +1,48 @@
|
||||||
mi.internal.ui.GDBSolibBlock.Load_shared_lib_symbols_automatically=Load shared library symbols automatically
|
CygwinDebuggerPage.0=Cygwin GDB Debugger Options
|
||||||
mi.internal.ui.GDBSolibBlock.Stop_on_shared_lib_events=Stop on shared library events
|
GDBDebuggerPage.0=Debugger executable must be specified.
|
||||||
mi.internal.ui.SerialPortSettingsBlock.Device=Device:
|
GDBDebuggerPage.1=GDB Debugger Options
|
||||||
mi.internal.ui.SerialPortSettingsBlock.Speed=Speed:
|
GDBDebuggerPage.2=Main
|
||||||
mi.internal.ui.SerialPortSettingsBlock.Device_must_be_specified=Device must be specified.
|
GDBDebuggerPage.3=GDB debugger:
|
||||||
mi.internal.ui.SerialPortSettingsBlock.Invalid_device=Invalid device.
|
GDBDebuggerPage.4=&Browse...
|
||||||
mi.internal.ui.SerialPortSettingsBlock.Speed_must_be_specified=Speed must be specified.
|
GDBDebuggerPage.5=GDB Debugger
|
||||||
TCPSettingsBlock.Host_or_IP=Host name or IP address:
|
GDBDebuggerPage.6=GDB command file:
|
||||||
TCPSettingsBlock.Port=Port number:
|
GDBDebuggerPage.7=&Browse...
|
||||||
TCPSettingsBlock.Host_or_IP_must_be_specified=Host name or IP address must be specified.
|
GDBDebuggerPage.8=GDB Command File
|
||||||
TCPSettingsBlock.Invalid_host_or_IP=Invalid host name or IP address.
|
GDBDebuggerPage.9=(Warning: Some commands in this file may interfere with the startup operation of the debugger, for example "run".)
|
||||||
TCPSettingsBlock.Port_must_be_specified=Port number must be specified.
|
GDBDebuggerPage.10=Shared Libraries
|
||||||
TCPSettingsBlock.Invalid_port=Invalid port number.
|
GDBServerDebuggerPage.0=TCP
|
||||||
internal.ui.GDBDebuggerPage.Debugger_exec_must_be_specified=Debugger executable must be specified
|
GDBServerDebuggerPage.1=Serial
|
||||||
internal.ui.GDBDebuggerPage.GDB_Debugger_Options=GDB Debugger Options
|
GDBServerDebuggerPage.2=Main
|
||||||
internal.ui.GDBDebuggerPage.Main=Main
|
GDBServerDebuggerPage.3=GDB debugger
|
||||||
internal.ui.GDBDebuggerPage.GDB_debugger=GDB debugger
|
GDBServerDebuggerPage.4=&Browse...
|
||||||
internal.ui.GDBDebuggerPage.GDB_Debugger=GDB Debugger
|
GDBServerDebuggerPage.5=GDB Debugger
|
||||||
internal.ui.GDBDebuggerPage.Browse=&Browse...
|
GDBServerDebuggerPage.6=GDB command file:
|
||||||
internal.ui.GDBDebuggerPage.GDB_Command_File=GDB Command File
|
GDBServerDebuggerPage.7=&Browse...
|
||||||
internal.ui.GDBDebuggerPage.GDB_command_file=GDB command file
|
GDBServerDebuggerPage.8=GDB Command File
|
||||||
internal.ui.GDBDebuggerPage.Warning_startup_operation_interference=(Warning: Some commands in this file may interfere with the startup operation of the debugger, for example "run".)
|
GDBServerDebuggerPage.9=Connection:
|
||||||
internal.ui.GDBDebuggerPage.Shared_libraries=Shared Libraries
|
GDBSolibBlock.0=Load shared library symbols automatically
|
||||||
internal.ui.SolibSearchPathBlock.Add=Add...
|
GDBSolibBlock.1=Stop on shared library events
|
||||||
internal.ui.SolibSearchPathBlock.Up=Up
|
SerialPortSettingsBlock.0=Device:
|
||||||
internal.ui.SolibSearchPathBlock.Down=Down
|
SerialPortSettingsBlock.1=Speed:
|
||||||
internal.ui.SolibSearchPathBlock.Remove=Remove
|
SerialPortSettingsBlock.2=Device must be specified.
|
||||||
internal.ui.SolibSearchPathBlock.Directories=Directories:
|
SerialPortSettingsBlock.3=Invalid device.
|
||||||
internal.ui.SolibSearchPathBlock.Select_directory_with_shared_lib=Select directory that contains shared library.
|
SerialPortSettingsBlock.4=Speed must be specified.
|
||||||
internal.ui.GDBServerDebuggerPage.TCP=TCP
|
SolibSearchPathBlock.0=Add...
|
||||||
internal.ui.GDBServerDebuggerPage.Serial=Serial
|
SolibSearchPathBlock.1=Up
|
||||||
internal.ui.GDBServerDebuggerPage.Main=Main
|
SolibSearchPathBlock.2=Down
|
||||||
internal.ui.GDBServerDebuggerPage.Connection=Connection:
|
SolibSearchPathBlock.3=Remove
|
||||||
internal.ui.CygwinDebuggerPage.Cygwin_GDB_Debugger_Options=Cygwin GDB Debugger Options
|
SolibSearchPathBlock.4=Directories:
|
||||||
internal.ui.actions.SetAutoSolibActionDelegate.Exception_set_automatically_load_symbols=Exceptions occurred attempting to set 'Automatically Load Symbols' mode.
|
SolibSearchPathBlock.5=Select directory that contains shared library.
|
||||||
internal.ui.actions.SetAutoSolibActionDelegate.Set_automatically_load_symbols_failed=Set 'Automatically Load Symbols' mode failed.
|
TCPSettingsBlock.0=Host name or IP address:
|
||||||
internal.ui.preferences.MIPreferencePage.General_GDBMI_settings=General settings for GDB MI.
|
TCPSettingsBlock.1=Port number:
|
||||||
internal.ui.preferences.MIPreferencePage.Communication=Communication
|
TCPSettingsBlock.2=Host name or IP address must be specified.
|
||||||
internal.ui.preferences.MIPreferencePage.Debugger_timeout=&Debugger timeout (ms):
|
TCPSettingsBlock.3=Invalid host name or IP address.
|
||||||
internal.ui.preferences.MIPreferencePage.Launch_timeout=&Launch timeout (ms):
|
TCPSettingsBlock.4=Port number must be specified.
|
||||||
internal.ui.preferences.MIPreferencePage.Error_Request_timeout_range=The valid value range is [{0},{1}].
|
TCPSettingsBlock.5=Invalid port number.
|
||||||
|
SetAutoSolibActionDelegate.0=Exceptions occurred attempting to set 'Automatically Load Symbols' mode.
|
||||||
|
SetAutoSolibActionDelegate.1=Set 'Automatically Load Symbols' mode failed.
|
||||||
|
MIPreferencePage.0=General settings for GDB MI.
|
||||||
|
MIPreferencePage.1=Communication
|
||||||
|
MIPreferencePage.2=&Debugger timeout (ms):
|
||||||
|
MIPreferencePage.3=&Launch timeout (ms):
|
||||||
|
MIPreferencePage.4=The valid value range is [{0},{1}].
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
package org.eclipse.cdt.debug.mi.internal.ui;
|
package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
|
|
||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ComboDialogField;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.ComboDialogField;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
||||||
|
@ -25,7 +24,6 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
|
@ -110,7 +108,7 @@ public class SerialPortSettingsBlock extends Observable
|
||||||
private StringDialogField createDeviceField()
|
private StringDialogField createDeviceField()
|
||||||
{
|
{
|
||||||
StringDialogField field = new StringDialogField();
|
StringDialogField field = new StringDialogField();
|
||||||
field.setLabelText( MIUIPlugin.getResourceString("mi.internal.ui.SerialPortSettingsBlock.Device") ); //$NON-NLS-1$
|
field.setLabelText( MIUIMessages.getString( "SerialPortSettingsBlock.0" ) ); //$NON-NLS-1$
|
||||||
field.setDialogFieldListener(
|
field.setDialogFieldListener(
|
||||||
new IDialogFieldListener()
|
new IDialogFieldListener()
|
||||||
{
|
{
|
||||||
|
@ -125,7 +123,7 @@ public class SerialPortSettingsBlock extends Observable
|
||||||
private ComboDialogField createSpeedField()
|
private ComboDialogField createSpeedField()
|
||||||
{
|
{
|
||||||
ComboDialogField field = new ComboDialogField( SWT.DROP_DOWN | SWT.READ_ONLY );
|
ComboDialogField field = new ComboDialogField( SWT.DROP_DOWN | SWT.READ_ONLY );
|
||||||
field.setLabelText( MIUIPlugin.getResourceString("mi.internal.ui.SerialPortSettingsBlock.Speed") ); //$NON-NLS-1$
|
field.setLabelText( MIUIMessages.getString( "SerialPortSettingsBlock.1" ) ); //$NON-NLS-1$
|
||||||
field.setItems( fSpeedChoices );
|
field.setItems( fSpeedChoices );
|
||||||
field.setDialogFieldListener(
|
field.setDialogFieldListener(
|
||||||
new IDialogFieldListener()
|
new IDialogFieldListener()
|
||||||
|
@ -217,11 +215,11 @@ public class SerialPortSettingsBlock extends Observable
|
||||||
if ( fDeviceField != null && fSpeedField != null )
|
if ( fDeviceField != null && fSpeedField != null )
|
||||||
{
|
{
|
||||||
if ( fDeviceField.getText().trim().length() == 0 )
|
if ( fDeviceField.getText().trim().length() == 0 )
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("mi.internal.ui.SerialPortSettingsBlock.Device_must_be_specified") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "SerialPortSettingsBlock.2" ) ); //$NON-NLS-1$
|
||||||
else if ( !deviceIsValid( fDeviceField.getText().trim() ) )
|
else if ( !deviceIsValid( fDeviceField.getText().trim() ) )
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("mi.internal.ui.SerialPortSettingsBlock.Invalid_device") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "SerialPortSettingsBlock.3" ) ); //$NON-NLS-1$
|
||||||
else if ( fSpeedField.getSelectionIndex() < 0 )
|
else if ( fSpeedField.getSelectionIndex() < 0 )
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("mi.internal.ui.SerialPortSettingsBlock.Speed_must_be_specified") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "SerialPortSettingsBlock.4" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,3 +238,4 @@ public class SerialPortSettingsBlock extends Observable
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IListAdapter;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IListAdapter;
|
||||||
|
@ -26,7 +25,6 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.DirectoryDialog;
|
import org.eclipse.swt.widgets.DirectoryDialog;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
|
@ -64,12 +62,12 @@ public class SolibSearchPathBlock extends Observable
|
||||||
|
|
||||||
String[] buttonLabels = new String[]
|
String[] buttonLabels = new String[]
|
||||||
{
|
{
|
||||||
/* 0 */ MIUIPlugin.getResourceString("internal.ui.SolibSearchPathBlock.Add"), //$NON-NLS-1$
|
/* 0 */ MIUIMessages.getString( "SolibSearchPathBlock.0" ), //$NON-NLS-1$
|
||||||
/* 1 */ null,
|
/* 1 */ null,
|
||||||
/* 2 */ MIUIPlugin.getResourceString("internal.ui.SolibSearchPathBlock.Up"), //$NON-NLS-1$
|
/* 2 */ MIUIMessages.getString( "SolibSearchPathBlock.1" ), //$NON-NLS-1$
|
||||||
/* 3 */ MIUIPlugin.getResourceString("internal.ui.SolibSearchPathBlock.Down"), //$NON-NLS-1$
|
/* 3 */ MIUIMessages.getString( "SolibSearchPathBlock.2" ), //$NON-NLS-1$
|
||||||
/* 4 */ null,
|
/* 4 */ null,
|
||||||
/* 5 */ MIUIPlugin.getResourceString("internal.ui.SolibSearchPathBlock.Remove"), //$NON-NLS-1$
|
/* 5 */ MIUIMessages.getString( "SolibSearchPathBlock.3" ), //$NON-NLS-1$
|
||||||
};
|
};
|
||||||
|
|
||||||
IListAdapter listAdapter = new IListAdapter()
|
IListAdapter listAdapter = new IListAdapter()
|
||||||
|
@ -85,7 +83,7 @@ public class SolibSearchPathBlock extends Observable
|
||||||
};
|
};
|
||||||
|
|
||||||
fDirList = new SolibSearchPathListDialogField( listAdapter, buttonLabels, new LabelProvider() );
|
fDirList = new SolibSearchPathListDialogField( listAdapter, buttonLabels, new LabelProvider() );
|
||||||
fDirList.setLabelText( MIUIPlugin.getResourceString("internal.ui.SolibSearchPathBlock.Directories") ); //$NON-NLS-1$
|
fDirList.setLabelText( MIUIMessages.getString( "SolibSearchPathBlock.4" ) ); //$NON-NLS-1$
|
||||||
fDirList.setUpButtonIndex( 2 );
|
fDirList.setUpButtonIndex( 2 );
|
||||||
fDirList.setDownButtonIndex( 3 );
|
fDirList.setDownButtonIndex( 3 );
|
||||||
fDirList.setRemoveButtonIndex( 5 );
|
fDirList.setRemoveButtonIndex( 5 );
|
||||||
|
@ -151,7 +149,7 @@ public class SolibSearchPathBlock extends Observable
|
||||||
private void addDirectory()
|
private void addDirectory()
|
||||||
{
|
{
|
||||||
DirectoryDialog dialog = new DirectoryDialog( getShell() );
|
DirectoryDialog dialog = new DirectoryDialog( getShell() );
|
||||||
dialog.setMessage( MIUIPlugin.getResourceString("internal.ui.SolibSearchPathBlock.Select_directory_with_shared_lib") ); //$NON-NLS-1$
|
dialog.setMessage( MIUIMessages.getString( "SolibSearchPathBlock.5" ) ); //$NON-NLS-1$
|
||||||
String res = dialog.open();
|
String res = dialog.open();
|
||||||
if ( res != null )
|
if ( res != null )
|
||||||
fDirList.addElement( res );
|
fDirList.addElement( res );
|
||||||
|
@ -162,3 +160,4 @@ public class SolibSearchPathBlock extends Observable
|
||||||
deleteObservers();
|
deleteObservers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
package org.eclipse.cdt.debug.mi.internal.ui;
|
package org.eclipse.cdt.debug.mi.internal.ui;
|
||||||
|
|
||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
|
import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.DialogField;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IDialogFieldListener;
|
import org.eclipse.cdt.debug.mi.internal.ui.dialogfields.IDialogFieldListener;
|
||||||
|
@ -23,7 +22,6 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
|
@ -104,7 +102,7 @@ public class TCPSettingsBlock extends Observable
|
||||||
private StringDialogField createHostNameField()
|
private StringDialogField createHostNameField()
|
||||||
{
|
{
|
||||||
StringDialogField field = new StringDialogField();
|
StringDialogField field = new StringDialogField();
|
||||||
field.setLabelText( MIUIPlugin.getResourceString("TCPSettingsBlock.Host_or_IP") ); //$NON-NLS-1$
|
field.setLabelText( MIUIMessages.getString( "TCPSettingsBlock.0" ) ); //$NON-NLS-1$
|
||||||
field.setDialogFieldListener(
|
field.setDialogFieldListener(
|
||||||
new IDialogFieldListener()
|
new IDialogFieldListener()
|
||||||
{
|
{
|
||||||
|
@ -119,7 +117,7 @@ public class TCPSettingsBlock extends Observable
|
||||||
private StringDialogField createPortNumberField()
|
private StringDialogField createPortNumberField()
|
||||||
{
|
{
|
||||||
StringDialogField field = new StringDialogField();
|
StringDialogField field = new StringDialogField();
|
||||||
field.setLabelText( MIUIPlugin.getResourceString("TCPSettingsBlock.Port") ); //$NON-NLS-1$
|
field.setLabelText( MIUIMessages.getString( "TCPSettingsBlock.1" ) ); //$NON-NLS-1$
|
||||||
field.setDialogFieldListener(
|
field.setDialogFieldListener(
|
||||||
new IDialogFieldListener()
|
new IDialogFieldListener()
|
||||||
{
|
{
|
||||||
|
@ -195,13 +193,13 @@ public class TCPSettingsBlock extends Observable
|
||||||
if ( fHostNameField != null && fPortNumberField != null )
|
if ( fHostNameField != null && fPortNumberField != null )
|
||||||
{
|
{
|
||||||
if ( fHostNameField.getText().trim().length() == 0 )
|
if ( fHostNameField.getText().trim().length() == 0 )
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("TCPSettingsBlock.Host_or_IP_must_be_specified") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "TCPSettingsBlock.2" ) ); //$NON-NLS-1$
|
||||||
else if ( !hostNameIsValid( fHostNameField.getText().trim() ) )
|
else if ( !hostNameIsValid( fHostNameField.getText().trim() ) )
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("TCPSettingsBlock.Invalid_host_or_IP") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "TCPSettingsBlock.3" ) ); //$NON-NLS-1$
|
||||||
else if ( fPortNumberField.getText().trim().length() == 0 )
|
else if ( fPortNumberField.getText().trim().length() == 0 )
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("TCPSettingsBlock.Port_must_be_specified") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "TCPSettingsBlock.4" ) ); //$NON-NLS-1$
|
||||||
else if ( !portNumberIsValid( fPortNumberField.getText().trim() ) )
|
else if ( !portNumberIsValid( fPortNumberField.getText().trim() ) )
|
||||||
setErrorMessage( MIUIPlugin.getResourceString("TCPSettingsBlock.Invalid_port") ); //$NON-NLS-1$
|
setErrorMessage( MIUIMessages.getString( "TCPSettingsBlock.5" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,3 +233,4 @@ public class TCPSettingsBlock extends Observable
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.mi.internal.ui.actions;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
||||||
|
//import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
public class ActionMessages {
|
||||||
|
|
||||||
|
// private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.internal.ui.actions.ActionMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
// private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private ActionMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
try {
|
||||||
|
return MIUIPlugin.getResourceString( key );
|
||||||
|
// return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
SetAutoSolibActionDelegate.0=Exceptions occurred attempting to set 'Automatically Load Symbols' mode.
|
||||||
|
SetAutoSolibActionDelegate.1=Set 'Automatically Load Symbols' mode failed.
|
|
@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.mi.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDISession;
|
import org.eclipse.cdt.debug.core.cdi.ICDISession;
|
||||||
|
import org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate;
|
||||||
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
import org.eclipse.cdt.debug.mi.core.cdi.Session;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager;
|
import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager;
|
||||||
|
@ -28,7 +29,6 @@ import org.eclipse.ui.IViewActionDelegate;
|
||||||
import org.eclipse.ui.IViewPart;
|
import org.eclipse.ui.IViewPart;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
|
@ -223,7 +223,7 @@ public class SetAutoSolibActionDelegate implements IViewActionDelegate,
|
||||||
|
|
||||||
protected String getStatusMessage()
|
protected String getStatusMessage()
|
||||||
{
|
{
|
||||||
return MIUIPlugin.getResourceString("internal.ui.actions.SetAutoSolibActionDelegate.Exception_set_automatically_load_symbols"); //$NON-NLS-1$
|
return ActionMessages.getString( "SetAutoSolibActionDelegate.0" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -231,7 +231,7 @@ public class SetAutoSolibActionDelegate implements IViewActionDelegate,
|
||||||
*/
|
*/
|
||||||
protected String getErrorDialogMessage()
|
protected String getErrorDialogMessage()
|
||||||
{
|
{
|
||||||
return MIUIPlugin.getResourceString("internal.ui.actions.SetAutoSolibActionDelegate.Set_automatically_load_symbols_failed"); //$NON-NLS-1$
|
return ActionMessages.getString( "SetAutoSolibActionDelegate.1" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setStatus( IStatus status )
|
protected void setStatus( IStatus status )
|
||||||
|
@ -278,3 +278,4 @@ public class SetAutoSolibActionDelegate implements IViewActionDelegate,
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
setPreferenceStore( MIUIPlugin.getDefault().getPreferenceStore() );
|
setPreferenceStore( MIUIPlugin.getDefault().getPreferenceStore() );
|
||||||
setDescription( MIUIPlugin.getResourceString("internal.ui.preferences.MIPreferencePage.General_GDBMI_settings") ); //$NON-NLS-1$
|
setDescription( PreferenceMessages.getString( "MIPreferencePage.0" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -149,7 +149,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
||||||
|
|
||||||
private void createCommunicationPreferences( Composite composite )
|
private void createCommunicationPreferences( Composite composite )
|
||||||
{
|
{
|
||||||
Composite comp = createGroupComposite( composite, 1, MIUIPlugin.getResourceString("internal.ui.preferences.MIPreferencePage.Communication") ); //$NON-NLS-1$
|
Composite comp = createGroupComposite( composite, 1, PreferenceMessages.getString( "MIPreferencePage.1" ) ); //$NON-NLS-1$
|
||||||
//Add in an intermediate composite to allow for spacing
|
//Add in an intermediate composite to allow for spacing
|
||||||
Composite spacingComposite = new Composite( comp, SWT.NONE );
|
Composite spacingComposite = new Composite( comp, SWT.NONE );
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
|
@ -158,7 +158,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
||||||
data.horizontalSpan = 2;
|
data.horizontalSpan = 2;
|
||||||
spacingComposite.setLayoutData( data );
|
spacingComposite.setLayoutData( data );
|
||||||
|
|
||||||
fDebugTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_TIMEOUT, MIUIPlugin.getResourceString("internal.ui.preferences.MIPreferencePage.Debugger_timeout"), spacingComposite ); //$NON-NLS-1$
|
fDebugTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_TIMEOUT, PreferenceMessages.getString( "MIPreferencePage.2" ), spacingComposite ); //$NON-NLS-1$
|
||||||
fDebugTimeoutText.setPropertyChangeListener(
|
fDebugTimeoutText.setPropertyChangeListener(
|
||||||
new IPropertyChangeListener()
|
new IPropertyChangeListener()
|
||||||
{
|
{
|
||||||
|
@ -169,7 +169,7 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
fLaunchTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, MIUIPlugin.getResourceString("internal.ui.preferences.MIPreferencePage.Launch_timeout"), spacingComposite ); //$NON-NLS-1$
|
fLaunchTimeoutText = createTimeoutField( IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, PreferenceMessages.getString( "MIPreferencePage.3" ), spacingComposite ); //$NON-NLS-1$
|
||||||
fLaunchTimeoutText.setPropertyChangeListener(
|
fLaunchTimeoutText.setPropertyChangeListener(
|
||||||
new IPropertyChangeListener()
|
new IPropertyChangeListener()
|
||||||
{
|
{
|
||||||
|
@ -203,8 +203,9 @@ public class MIPreferencePage extends PreferencePage implements IWorkbenchPrefer
|
||||||
toText.setValidRange( IMIConstants.MIN_REQUEST_TIMEOUT, IMIConstants.MAX_REQUEST_TIMEOUT );
|
toText.setValidRange( IMIConstants.MIN_REQUEST_TIMEOUT, IMIConstants.MAX_REQUEST_TIMEOUT );
|
||||||
String minValue = Integer.toString( IMIConstants.MIN_REQUEST_TIMEOUT );
|
String minValue = Integer.toString( IMIConstants.MIN_REQUEST_TIMEOUT );
|
||||||
String maxValue = Integer.toString( IMIConstants.MAX_REQUEST_TIMEOUT );
|
String maxValue = Integer.toString( IMIConstants.MAX_REQUEST_TIMEOUT );
|
||||||
toText.setErrorMessage( MessageFormat.format( MIUIPlugin.getResourceString("internal.ui.preferences.MIPreferencePage.Error_Request_timeout_range"), new String[]{ minValue, maxValue } ) ); //$NON-NLS-1$
|
toText.setErrorMessage( MessageFormat.format( PreferenceMessages.getString( "MIPreferencePage.4" ), new String[]{ minValue, maxValue } ) ); //$NON-NLS-1$
|
||||||
toText.load();
|
toText.load();
|
||||||
return toText;
|
return toText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.mi.internal.ui.preferences;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
import org.eclipse.cdt.debug.mi.internal.ui.MIUIPlugin;
|
||||||
|
//import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
public class PreferenceMessages {
|
||||||
|
|
||||||
|
// private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.mi.internal.ui.preferences.PreferenceMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
// private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private PreferenceMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
try {
|
||||||
|
return MIUIPlugin.getResourceString( key );
|
||||||
|
// return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
MIPreferencePage.0=General settings for GDB MI.
|
||||||
|
MIPreferencePage.1=Communication
|
||||||
|
MIPreferencePage.2=&Debugger timeout (ms):
|
||||||
|
MIPreferencePage.3=&Launch timeout (ms):
|
||||||
|
MIPreferencePage.4=The valid value range is [{0},{1}].
|
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 343 B |
BIN
debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/disabled_co.gif
Normal file
After Width: | Height: | Size: 145 B |
BIN
debug/org.eclipse.cdt.debug.ui/icons/full/dlcl16/enabled_co.gif
Normal file
After Width: | Height: | Size: 222 B |
BIN
debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/disabled_co.gif
Normal file
After Width: | Height: | Size: 148 B |
BIN
debug/org.eclipse.cdt.debug.ui/icons/full/elcl16/enabled_co.gif
Normal file
After Width: | Height: | Size: 343 B |
|
@ -10,6 +10,11 @@ SignalPropertiesDialog.Title_1=Properties for signal ''{0}''
|
||||||
SignalPropertiesDialog.Description_label_1=Signal description: {0}.
|
SignalPropertiesDialog.Description_label_1=Signal description: {0}.
|
||||||
SignalPropertiesDialog.Stop_label_1=Suspend the program when this signal happens.
|
SignalPropertiesDialog.Stop_label_1=Suspend the program when this signal happens.
|
||||||
SignalPropertiesDialog.Pass_label_1=Pass this signal to the program.
|
SignalPropertiesDialog.Pass_label_1=Pass this signal to the program.
|
||||||
|
SignalZeroWorkbenchActionDelegate.0=Exceptions occurred attempting to resume without signal.
|
||||||
|
SignalZeroWorkbenchActionDelegate.1=Resume without signal failed.
|
||||||
|
SignalZeroWorkbenchActionDelegate.2=Resume Without Signal
|
||||||
|
SignalZeroObjectActionDelegate.0=Unable to resume ignoring the signal.
|
||||||
|
SignalZeroObjectActionDelegate.1=Operation failed.
|
||||||
SignalPropertiesActionDelegate.Unable_to_change_signal_properties_1=Unable to change signal properties.
|
SignalPropertiesActionDelegate.Unable_to_change_signal_properties_1=Unable to change signal properties.
|
||||||
SignalPropertiesActionDelegate.Operation_failed_1=Operation failed.
|
SignalPropertiesActionDelegate.Operation_failed_1=Operation failed.
|
||||||
RunToLineActionDelegate.Error_1=Error
|
RunToLineActionDelegate.Error_1=Error
|
||||||
|
@ -36,6 +41,7 @@ ToggleBreakpointRulerAction.Error_1=Error
|
||||||
ToggleBreakpointRulerAction.Operation_failed_1=Operation failed
|
ToggleBreakpointRulerAction.Operation_failed_1=Operation failed
|
||||||
CBreakpointPropertiesRulerAction.Breakpoint_Properties=Breakpoint &Properties...
|
CBreakpointPropertiesRulerAction.Breakpoint_Properties=Breakpoint &Properties...
|
||||||
ResumeAtLineActionDelegate.Error_1=Error
|
ResumeAtLineActionDelegate.Error_1=Error
|
||||||
|
RestoreDefaultTypeActionDelegate.0=Unable to restore the default type.
|
||||||
ResumeAtLineActionDelegate.Operation_failed_1=Operation failed.
|
ResumeAtLineActionDelegate.Operation_failed_1=Operation failed.
|
||||||
ResumeAtLineActionDelegate.Missing_document=Missing document
|
ResumeAtLineActionDelegate.Missing_document=Missing document
|
||||||
ResumeAtLineActionDelegate.Empty_editor_1=Empty editor
|
ResumeAtLineActionDelegate.Empty_editor_1=Empty editor
|
||||||
|
@ -45,3 +51,71 @@ AbstractRefreshActionDelegate.Error_1=Error
|
||||||
AbstractRefreshActionDelegate.Error(s)_occurred_refreshing_the_view_1=Error(s) occurred refreshing the view.
|
AbstractRefreshActionDelegate.Error(s)_occurred_refreshing_the_view_1=Error(s) occurred refreshing the view.
|
||||||
ManageFunctionBreakpointActionDelegate.Error_1=Error
|
ManageFunctionBreakpointActionDelegate.Error_1=Error
|
||||||
ManageFunctionBreakpointActionDelegate.Operation_failed_1=Operation failed.
|
ManageFunctionBreakpointActionDelegate.Operation_failed_1=Operation failed.
|
||||||
|
SignalActionDelegate.0=Unable to deliver the signal to the target.
|
||||||
|
SignalActionDelegate.1=Operation failed.
|
||||||
|
AutoRefreshMemoryAction.0=Auto-Refresh
|
||||||
|
AutoRefreshMemoryAction.1=Turns on/off the auto-refresh mode.
|
||||||
|
AutoRefreshMemoryAction.2=Auto-Refresh Mode
|
||||||
|
RestartActionDelegate.0=Exception(s) occurred attempting to restart.
|
||||||
|
RestartActionDelegate.1=Restart failed.
|
||||||
|
RestartActionDelegate.2=Restart
|
||||||
|
ShowAsciiAction.0=Show ASCII
|
||||||
|
ShowAsciiAction.1=Displays the ASCII presentation of the memory.
|
||||||
|
ShowAsciiAction.2=Show the ASCII presentation
|
||||||
|
AddGlobalsActionDelegate.0=Select Variables:
|
||||||
|
AddGlobalsActionDelegate.1=Add global variables failed.
|
||||||
|
VariableFormatActionDelegate.0=Unable to set format.
|
||||||
|
ExpressionDialog.0=Add Watch Expression
|
||||||
|
ExpressionDialog.1=Expression to watch:
|
||||||
|
CastToTypeActionDelegate.0=The 'Type' field must not be empty.
|
||||||
|
CastToTypeActionDelegate.1=Cast To Type
|
||||||
|
CastToTypeActionDelegate.2=Enter type:
|
||||||
|
CastToTypeActionDelegate.3=Unable to cast to type.
|
||||||
|
CastToArrayActionDelegate.0=Display As Array
|
||||||
|
CastToArrayActionDelegate.1=Start index:
|
||||||
|
CastToArrayActionDelegate.2=Length
|
||||||
|
CastToArrayActionDelegate.3=The 'First index' field must not be empty.
|
||||||
|
CastToArrayActionDelegate.4=Invalid first index.
|
||||||
|
CastToArrayActionDelegate.5=The 'Last index' field must not be empty.
|
||||||
|
CastToArrayActionDelegate.6=Invalid last index.
|
||||||
|
CastToArrayActionDelegate.7=The length must be greater than 0.
|
||||||
|
CastToArrayActionDelegate.8=Unable to display this variable as an array.
|
||||||
|
EnableVariablesActionDelegate.0=Exceptions occurred enabling the variable(s).
|
||||||
|
EnableVariablesActionDelegate.1=Enable variable(s) failed.
|
||||||
|
MemorySizeAction.0={0, number, integer} {0, choice, 1\#byte|2\#bytes}
|
||||||
|
MemorySizeAction.1=Unable to change memory unit size.
|
||||||
|
MemoryFormatAction.0=Unable to change the format.
|
||||||
|
MemoryFormatAction.1=Hexadecimal
|
||||||
|
MemoryFormatAction.2=Signed_Decimal
|
||||||
|
MemoryFormatAction.3=Unsigned_Decimal
|
||||||
|
MemoryNumberOfColumnAction.0={0, number, integer} {0, choice, 0\#columns|1\#column|2\#columns}
|
||||||
|
MemoryNumberOfColumnAction.1=Unable to change the column number.
|
||||||
|
CBreakpointPreferencePage.0=Ignore count must be a positive integer
|
||||||
|
CBreakpointPreferencePage.1=Not available
|
||||||
|
CBreakpointPreferencePage.2=Function name:
|
||||||
|
CBreakpointPreferencePage.3=C/C++ Function Breakpoint Properties
|
||||||
|
CBreakpointPreferencePage.4=Not available
|
||||||
|
CBreakpointPreferencePage.5=Address:
|
||||||
|
CBreakpointPreferencePage.6=C/C++ Address Breakpoint Properties
|
||||||
|
CBreakpointPreferencePage.7=File:
|
||||||
|
CBreakpointPreferencePage.8=C/C++ Line Breakpoint Properties
|
||||||
|
CBreakpointPreferencePage.9=Line_Number:
|
||||||
|
CBreakpointPreferencePage.10=Project:
|
||||||
|
CBreakpointPreferencePage.11=C/C++ Read Watchpoint Properties
|
||||||
|
CBreakpointPreferencePage.12=C/C++ Watchpoint Properties
|
||||||
|
CBreakpointPreferencePage.13=C/C++ Access Watchpoint Properties
|
||||||
|
CBreakpointPreferencePage.14=Expression To Watch:
|
||||||
|
CBreakpointPreferencePage.15=&Condition
|
||||||
|
CBreakpointPreferencePage.16=Invalid_condition.
|
||||||
|
CBreakpointPreferencePage.17=&Ignore Count:
|
||||||
|
AddWatchpointActionDelegate.0=Cannot add watchpoint.
|
||||||
|
AddWatchpointDialog.0=Add Watchpoint
|
||||||
|
AddWatchpointDialog.1=Expression to watch:
|
||||||
|
AddWatchpointDialog.2=Access
|
||||||
|
AddWatchpointDialog.3=Write
|
||||||
|
AddWatchpointDialog.4=Read
|
||||||
|
ClearMemoryAction.0=Clear
|
||||||
|
ClearMemoryAction.1=Clears the current memory block
|
||||||
|
ClearMemoryAction.2=Clear
|
||||||
|
RefreshMemoryAction.0=Refreshs the current memory block.
|
||||||
|
RefreshMemoryAction.1=Refresh
|
||||||
|
|
|
@ -247,7 +247,7 @@ public class AddGlobalsActionDelegate extends ActionDelegate implements IViewAct
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, CDebugUIPlugin.getResourceString( "internal.ui.actions.AddGlobalsActionDelegate.Select_Variables" ) ); //$NON-NLS-1$
|
}, ActionMessages.getString( "AddGlobalsActionDelegate.0" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IGlobalVariableDescriptor[] getGlobals() {
|
protected IGlobalVariableDescriptor[] getGlobals() {
|
||||||
|
@ -276,7 +276,7 @@ public class AddGlobalsActionDelegate extends ActionDelegate implements IViewAct
|
||||||
* @see AbstractDebugActionDelegate#getErrorDialogMessage()
|
* @see AbstractDebugActionDelegate#getErrorDialogMessage()
|
||||||
*/
|
*/
|
||||||
protected String getErrorDialogMessage() {
|
protected String getErrorDialogMessage() {
|
||||||
return CDebugUIPlugin.getResourceString( "internal.ui.actions.AddGlobalsActionDelegate.Add_global_variables_failed" ); //$NON-NLS-1$
|
return ActionMessages.getString( "AddGlobalsActionDelegate.1" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setStatus( IStatus status ) {
|
protected void setStatus( IStatus status ) {
|
||||||
|
@ -298,4 +298,4 @@ public class AddGlobalsActionDelegate extends ActionDelegate implements IViewAct
|
||||||
setSelection( (element != null) ? new StructuredSelection( element ) : new StructuredSelection() );
|
setSelection( (element != null) ? new StructuredSelection( element ) : new StructuredSelection() );
|
||||||
update( action );
|
update( action );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -188,7 +188,7 @@ public class AddWatchpointActionDelegate extends ActionDelegate implements IWork
|
||||||
CDIDebugModel.createWatchpoint( getSourceHandle(), getResource(), write, read, expression, true, 0, "", true ); //$NON-NLS-1$
|
CDIDebugModel.createWatchpoint( getSourceHandle(), getResource(), write, read, expression, true, 0, "", true ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
catch( CoreException ce ) {
|
catch( CoreException ce ) {
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString( "internal.ui.actions.AddWatchpointActionDelegate.Cannot_add_watchpoint" ), ce ); //$NON-NLS-1$
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "AddWatchpointActionDelegate.0" ), ce ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
||||||
|
@ -22,168 +27,150 @@ import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The "Add Watchpoint" dialog of the "Toggle watchpoint" action.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Sep 4, 2002
|
|
||||||
*/
|
*/
|
||||||
public class AddWatchpointDialog extends Dialog
|
public class AddWatchpointDialog extends Dialog {
|
||||||
{
|
|
||||||
private Button fBtnOk = null;
|
private Button fBtnOk = null;
|
||||||
|
|
||||||
private Text fTextExpression;
|
private Text fTextExpression;
|
||||||
|
|
||||||
private Button fChkBtnWrite;
|
private Button fChkBtnWrite;
|
||||||
|
|
||||||
private Button fChkBtnRead;
|
private Button fChkBtnRead;
|
||||||
|
|
||||||
private boolean fWrite = true;
|
private boolean fWrite = true;
|
||||||
|
|
||||||
private boolean fRead = false;
|
private boolean fRead = false;
|
||||||
|
|
||||||
private String fExpression = ""; //$NON-NLS-1$
|
private String fExpression = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddWatchpointDialog.
|
* Constructor for AddWatchpointDialog.
|
||||||
|
*
|
||||||
* @param parentShell
|
* @param parentShell
|
||||||
*/
|
*/
|
||||||
public AddWatchpointDialog( Shell parentShell, boolean write, boolean read, String expression )
|
public AddWatchpointDialog( Shell parentShell, boolean write, boolean read, String expression ) {
|
||||||
{
|
|
||||||
super( parentShell );
|
super( parentShell );
|
||||||
fWrite = write;
|
fWrite = write;
|
||||||
fRead = read;
|
fRead = read;
|
||||||
if ( expression != null )
|
if ( expression != null )
|
||||||
fExpression = expression;
|
fExpression = expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void configureShell( Shell shell )
|
protected void configureShell( Shell shell ) {
|
||||||
{
|
|
||||||
super.configureShell( shell );
|
super.configureShell( shell );
|
||||||
shell.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.AddWatchpointDialog.Add_C_C++_Watchpoint") ); //$NON-NLS-1$
|
shell.setText( ActionMessages.getString( "AddWatchpointDialog.0" ) ); //$NON-NLS-1$
|
||||||
shell.setImage( CDebugImages.get( CDebugImages.IMG_OBJS_WATCHPOINT_ENABLED ) );
|
shell.setImage( CDebugImages.get( CDebugImages.IMG_OBJS_WATCHPOINT_ENABLED ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Control createContents( Composite parent )
|
protected Control createContents( Composite parent ) {
|
||||||
{
|
|
||||||
Control control = super.createContents( parent );
|
Control control = super.createContents( parent );
|
||||||
setOkButtonState();
|
setOkButtonState();
|
||||||
return control;
|
return control;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Control createDialogArea( Composite parent )
|
protected Control createDialogArea( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NONE );
|
Composite composite = new Composite( parent, SWT.NONE );
|
||||||
composite.setLayout( new GridLayout() );
|
composite.setLayout( new GridLayout() );
|
||||||
((GridLayout)composite.getLayout()).marginWidth = 10;
|
((GridLayout)composite.getLayout()).marginWidth = 10;
|
||||||
composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
|
composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
|
||||||
createDataWidgets( composite );
|
createDataWidgets( composite );
|
||||||
initializeDataWidgets();
|
initializeDataWidgets();
|
||||||
return composite;
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createButtonsForButtonBar( Composite parent )
|
protected void createButtonsForButtonBar( Composite parent ) {
|
||||||
{
|
|
||||||
fBtnOk = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
|
fBtnOk = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
|
||||||
createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
|
createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createDataWidgets( Composite parent )
|
private void createDataWidgets( Composite parent ) {
|
||||||
{
|
fTextExpression = createExpressionText( parent );
|
||||||
fTextExpression = createExpressionText( parent );
|
|
||||||
createAccessWidgets( parent );
|
createAccessWidgets( parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeDataWidgets()
|
private void initializeDataWidgets() {
|
||||||
{
|
|
||||||
fTextExpression.setText( fExpression );
|
fTextExpression.setText( fExpression );
|
||||||
fChkBtnRead.setSelection( fRead );
|
fChkBtnRead.setSelection( fRead );
|
||||||
fChkBtnWrite.setSelection( fWrite );
|
fChkBtnWrite.setSelection( fWrite );
|
||||||
setOkButtonState();
|
setOkButtonState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Text createExpressionText( Composite parent )
|
private Text createExpressionText( Composite parent ) {
|
||||||
{
|
|
||||||
Label label = new Label( parent, SWT.RIGHT );
|
Label label = new Label( parent, SWT.RIGHT );
|
||||||
label.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.AddWatchpointDialog.Expression_to_watch") ); //$NON-NLS-1$
|
label.setText( ActionMessages.getString( "AddWatchpointDialog.1" ) ); //$NON-NLS-1$
|
||||||
final Text text = new Text( parent, SWT.BORDER );
|
final Text text = new Text( parent, SWT.BORDER );
|
||||||
GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
|
GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
|
||||||
gridData.widthHint = 300;
|
gridData.widthHint = 300;
|
||||||
text.setLayoutData( gridData );
|
text.setLayoutData( gridData );
|
||||||
addModifyListener( text );
|
addModifyListener( text );
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createAccessWidgets( Composite parent )
|
private void createAccessWidgets( Composite parent ) {
|
||||||
{
|
|
||||||
Group group = new Group( parent, SWT.NONE );
|
Group group = new Group( parent, SWT.NONE );
|
||||||
group.setLayout( new GridLayout() );
|
group.setLayout( new GridLayout() );
|
||||||
group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
||||||
group.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.AddWatchpointDialog.Access") ); //$NON-NLS-1$
|
group.setText( ActionMessages.getString( "AddWatchpointDialog.2" ) ); //$NON-NLS-1$
|
||||||
fChkBtnWrite = new Button( group, SWT.CHECK );
|
fChkBtnWrite = new Button( group, SWT.CHECK );
|
||||||
fChkBtnWrite.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.AddWatchpointDialog.Write") ); //$NON-NLS-1$
|
fChkBtnWrite.setText( ActionMessages.getString( "AddWatchpointDialog.3" ) ); //$NON-NLS-1$
|
||||||
addSelectionListener( fChkBtnWrite );
|
addSelectionListener( fChkBtnWrite );
|
||||||
fChkBtnRead = new Button( group, SWT.CHECK );
|
fChkBtnRead = new Button( group, SWT.CHECK );
|
||||||
fChkBtnRead.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.AddWatchpointDialog.Read") ); //$NON-NLS-1$
|
fChkBtnRead.setText( ActionMessages.getString( "AddWatchpointDialog.4" ) ); //$NON-NLS-1$
|
||||||
addSelectionListener( fChkBtnRead );
|
addSelectionListener( fChkBtnRead );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSelectionListener( Button button )
|
private void addSelectionListener( Button button ) {
|
||||||
{
|
button.addSelectionListener( new SelectionAdapter() {
|
||||||
button.addSelectionListener(
|
|
||||||
new SelectionAdapter()
|
public void widgetSelected( SelectionEvent e ) {
|
||||||
{
|
setOkButtonState();
|
||||||
public void widgetSelected( SelectionEvent e )
|
}
|
||||||
{
|
} );
|
||||||
setOkButtonState();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setOkButtonState()
|
protected void setOkButtonState() {
|
||||||
{
|
|
||||||
if ( fBtnOk == null )
|
if ( fBtnOk == null )
|
||||||
return;
|
return;
|
||||||
fBtnOk.setEnabled( (fChkBtnRead.getSelection() || fChkBtnWrite.getSelection()) &&
|
fBtnOk.setEnabled( (fChkBtnRead.getSelection() || fChkBtnWrite.getSelection()) && fTextExpression.getText().trim().length() > 0 );
|
||||||
fTextExpression.getText().trim().length() > 0 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void storeData()
|
private void storeData() {
|
||||||
{
|
|
||||||
fExpression = fTextExpression.getText().trim();
|
fExpression = fTextExpression.getText().trim();
|
||||||
fRead = fChkBtnRead.getSelection();
|
fRead = fChkBtnRead.getSelection();
|
||||||
fWrite = fChkBtnWrite.getSelection();
|
fWrite = fChkBtnWrite.getSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addModifyListener( Text text )
|
private void addModifyListener( Text text ) {
|
||||||
{
|
text.addModifyListener( new ModifyListener() {
|
||||||
text.addModifyListener(
|
|
||||||
new ModifyListener()
|
public void modifyText( ModifyEvent e ) {
|
||||||
{
|
setOkButtonState();
|
||||||
public void modifyText( ModifyEvent e )
|
}
|
||||||
{
|
} );
|
||||||
setOkButtonState();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExpression()
|
public String getExpression() {
|
||||||
{
|
|
||||||
return fExpression;
|
return fExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getWriteAccess()
|
public boolean getWriteAccess() {
|
||||||
{
|
|
||||||
return fWrite;
|
return fWrite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getReadAccess()
|
public boolean getReadAccess() {
|
||||||
{
|
|
||||||
return fRead;
|
return fRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
|
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
|
||||||
*/
|
*/
|
||||||
protected void okPressed()
|
protected void okPressed() {
|
||||||
{
|
|
||||||
storeData();
|
storeData();
|
||||||
super.okPressed();
|
super.okPressed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
||||||
|
@ -11,46 +16,42 @@ import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
||||||
import org.eclipse.ui.actions.SelectionProviderAction;
|
import org.eclipse.ui.actions.SelectionProviderAction;
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
import org.eclipse.ui.help.WorkbenchHelp;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The "Auto-Refresh" action of the Memory View.
|
||||||
*
|
|
||||||
* @since: Oct 21, 2002
|
|
||||||
*/
|
*/
|
||||||
public class AutoRefreshMemoryAction extends SelectionProviderAction implements IUpdate
|
public class AutoRefreshMemoryAction extends SelectionProviderAction implements IUpdate {
|
||||||
{
|
|
||||||
private MemoryViewer fMemoryViewer;
|
private MemoryViewer fMemoryViewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AutoRefreshMemoryAction.
|
* Constructor for AutoRefreshMemoryAction.
|
||||||
* @param provider
|
|
||||||
* @param text
|
|
||||||
*/
|
*/
|
||||||
public AutoRefreshMemoryAction( MemoryViewer viewer )
|
public AutoRefreshMemoryAction( MemoryViewer viewer ) {
|
||||||
{
|
super( viewer, ActionMessages.getString( "AutoRefreshMemoryAction.0" ) ); //$NON-NLS-1$
|
||||||
super( viewer, CDebugUIPlugin.getResourceString("internal.ui.actions.AutoRefreshMemoryAction.Auto-Refresh") ); //$NON-NLS-1$
|
|
||||||
fMemoryViewer = viewer;
|
fMemoryViewer = viewer;
|
||||||
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_AUTO_REFRESH );
|
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_AUTO_REFRESH );
|
||||||
setDescription( CDebugUIPlugin.getResourceString("internal.ui.actions.AutoRefreshMemoryAction.Automatically_Refresh_Memory_Block") ); //$NON-NLS-1$
|
setDescription( ActionMessages.getString( "AutoRefreshMemoryAction.1" ) ); //$NON-NLS-1$
|
||||||
setToolTipText( CDebugUIPlugin.getResourceString("internal.ui.actions.AutoRefreshMemoryAction.Auto-Refresh") ); //$NON-NLS-1$
|
setToolTipText( ActionMessages.getString( "AutoRefreshMemoryAction.2" ) ); //$NON-NLS-1$
|
||||||
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.AUTO_REFRESH_MEMORY_ACTION );
|
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.AUTO_REFRESH_MEMORY_ACTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
setEnabled( fMemoryViewer.canUpdate() );
|
setEnabled( fMemoryViewer.canUpdate() );
|
||||||
setChecked( !fMemoryViewer.isFrozen() );
|
setChecked( !fMemoryViewer.isFrozen() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.action.IAction#run()
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run() {
|
||||||
{
|
|
||||||
fMemoryViewer.setFrozen( !isChecked() );
|
fMemoryViewer.setFrozen( !isChecked() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.CDebugUtils;
|
import org.eclipse.cdt.debug.core.CDebugUtils;
|
||||||
|
@ -26,31 +31,24 @@ import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The preference page used to present the properties of a breakpoint as preferences. A CBreakpointPreferenceStore is used to interface between this page and
|
||||||
* The preference page that is used to present the properties of a breakpoint as
|
* the breakpoint.
|
||||||
* preferences. A CBreakpointPreferenceStore is used to interface between this
|
|
||||||
* page and the breakpoint.
|
|
||||||
*
|
|
||||||
* @since Aug 27, 2002
|
|
||||||
*/
|
*/
|
||||||
public class CBreakpointPreferencePage extends FieldEditorPreferencePage
|
public class CBreakpointPreferencePage extends FieldEditorPreferencePage {
|
||||||
{
|
|
||||||
class BreakpointIntegerFieldEditor extends IntegerFieldEditor
|
class BreakpointIntegerFieldEditor extends IntegerFieldEditor {
|
||||||
{
|
|
||||||
public BreakpointIntegerFieldEditor( String name, String labelText, Composite parent )
|
public BreakpointIntegerFieldEditor( String name, String labelText, Composite parent ) {
|
||||||
{
|
|
||||||
super( name, labelText, parent );
|
super( name, labelText, parent );
|
||||||
setErrorMessage( CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Ignore_count_must_be_positive_integer") ); //$NON-NLS-1$
|
setErrorMessage( ActionMessages.getString( "CBreakpointPreferencePage.0" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see IntegerFieldEditor#checkState()
|
* @see IntegerFieldEditor#checkState()
|
||||||
*/
|
*/
|
||||||
protected boolean checkState()
|
protected boolean checkState() {
|
||||||
{
|
|
||||||
Text control = getTextControl();
|
Text control = getTextControl();
|
||||||
if ( !control.isEnabled() )
|
if ( !control.isEnabled() ) {
|
||||||
{
|
|
||||||
clearErrorMessage();
|
clearErrorMessage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -60,73 +58,61 @@ public class CBreakpointPreferencePage extends FieldEditorPreferencePage
|
||||||
/**
|
/**
|
||||||
* Overrode here to be package visible.
|
* Overrode here to be package visible.
|
||||||
*/
|
*/
|
||||||
protected void refreshValidState()
|
protected void refreshValidState() {
|
||||||
{
|
|
||||||
super.refreshValidState();
|
super.refreshValidState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only store if the text control is enabled
|
* Only store if the text control is enabled
|
||||||
|
*
|
||||||
* @see FieldEditor#doStore()
|
* @see FieldEditor#doStore()
|
||||||
*/
|
*/
|
||||||
protected void doStore()
|
protected void doStore() {
|
||||||
{
|
|
||||||
Text text = getTextControl();
|
Text text = getTextControl();
|
||||||
if ( text.isEnabled() )
|
if ( text.isEnabled() ) {
|
||||||
{
|
|
||||||
super.doStore();
|
super.doStore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the error message from the message line if the error
|
* Clears the error message from the message line if the error message is the error message from this field editor.
|
||||||
* message is the error message from this field editor.
|
|
||||||
*/
|
*/
|
||||||
protected void clearErrorMessage()
|
protected void clearErrorMessage() {
|
||||||
{
|
if ( getPreferencePage() != null ) {
|
||||||
if ( getPreferencePage() != null )
|
|
||||||
{
|
|
||||||
String message = getPreferencePage().getErrorMessage();
|
String message = getPreferencePage().getErrorMessage();
|
||||||
if ( message != null )
|
if ( message != null ) {
|
||||||
{
|
if ( getErrorMessage().equals( message ) ) {
|
||||||
if ( getErrorMessage().equals( message ) )
|
|
||||||
{
|
|
||||||
super.clearErrorMessage();
|
super.clearErrorMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
super.clearErrorMessage();
|
super.clearErrorMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class BreakpointStringFieldEditor extends StringFieldEditor
|
class BreakpointStringFieldEditor extends StringFieldEditor {
|
||||||
{
|
|
||||||
public BreakpointStringFieldEditor( String name, String labelText, Composite parent )
|
public BreakpointStringFieldEditor( String name, String labelText, Composite parent ) {
|
||||||
{
|
|
||||||
super( name, labelText, parent );
|
super( name, labelText, parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see StringFieldEditor#checkState()
|
* @see StringFieldEditor#checkState()
|
||||||
*/
|
*/
|
||||||
protected boolean checkState()
|
protected boolean checkState() {
|
||||||
{
|
|
||||||
Text control = getTextControl();
|
Text control = getTextControl();
|
||||||
if ( !control.isEnabled() )
|
if ( !control.isEnabled() ) {
|
||||||
{
|
|
||||||
clearErrorMessage();
|
clearErrorMessage();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return super.checkState();
|
return super.checkState();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doStore()
|
protected void doStore() {
|
||||||
{
|
|
||||||
Text text = getTextControl();
|
Text text = getTextControl();
|
||||||
if ( text.isEnabled() )
|
if ( text.isEnabled() ) {
|
||||||
{
|
|
||||||
super.doStore();
|
super.doStore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,59 +120,52 @@ public class CBreakpointPreferencePage extends FieldEditorPreferencePage
|
||||||
/**
|
/**
|
||||||
* @see FieldEditor#refreshValidState()
|
* @see FieldEditor#refreshValidState()
|
||||||
*/
|
*/
|
||||||
protected void refreshValidState()
|
protected void refreshValidState() {
|
||||||
{
|
|
||||||
super.refreshValidState();
|
super.refreshValidState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the error message from the message line if the error
|
* Clears the error message from the message line if the error message is the error message from this field editor.
|
||||||
* message is the error message from this field editor.
|
|
||||||
*/
|
*/
|
||||||
protected void clearErrorMessage()
|
protected void clearErrorMessage() {
|
||||||
{
|
if ( getPreferencePage() != null ) {
|
||||||
if ( getPreferencePage() != null )
|
|
||||||
{
|
|
||||||
String message = getPreferencePage().getErrorMessage();
|
String message = getPreferencePage().getErrorMessage();
|
||||||
if ( message != null )
|
if ( message != null ) {
|
||||||
{
|
if ( getErrorMessage().equals( message ) ) {
|
||||||
if ( getErrorMessage().equals( message ) )
|
|
||||||
{
|
|
||||||
super.clearErrorMessage();
|
super.clearErrorMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
super.clearErrorMessage();
|
super.clearErrorMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LabelFieldEditor extends FieldEditor
|
class LabelFieldEditor extends FieldEditor {
|
||||||
{
|
|
||||||
private Label fTitleLabel;
|
private Label fTitleLabel;
|
||||||
|
|
||||||
private Label fValueLabel;
|
private Label fValueLabel;
|
||||||
|
|
||||||
private Composite fBasicComposite;
|
private Composite fBasicComposite;
|
||||||
|
|
||||||
private String fValue;
|
private String fValue;
|
||||||
|
|
||||||
private String fTitle;
|
private String fTitle;
|
||||||
|
|
||||||
public LabelFieldEditor( Composite parent, String title, String value )
|
public LabelFieldEditor( Composite parent, String title, String value ) {
|
||||||
{
|
|
||||||
fValue = value;
|
fValue = value;
|
||||||
fTitle = title;
|
fTitle = title;
|
||||||
this.createControl( parent );
|
this.createControl( parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void adjustForNumColumns( int numColumns )
|
protected void adjustForNumColumns( int numColumns ) {
|
||||||
{
|
|
||||||
((GridData)fBasicComposite.getLayoutData()).horizontalSpan = numColumns;
|
((GridData)fBasicComposite.getLayoutData()).horizontalSpan = numColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doFillIntoGrid( Composite parent, int numColumns )
|
protected void doFillIntoGrid( Composite parent, int numColumns ) {
|
||||||
{
|
fBasicComposite = new Composite( parent, SWT.NULL );
|
||||||
fBasicComposite = new Composite(parent, SWT.NULL);
|
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
layout.marginWidth = 0;
|
layout.marginWidth = 0;
|
||||||
layout.marginHeight = 0;
|
layout.marginHeight = 0;
|
||||||
|
@ -196,231 +175,190 @@ public class CBreakpointPreferencePage extends FieldEditorPreferencePage
|
||||||
data.verticalAlignment = GridData.FILL;
|
data.verticalAlignment = GridData.FILL;
|
||||||
data.horizontalAlignment = GridData.FILL;
|
data.horizontalAlignment = GridData.FILL;
|
||||||
fBasicComposite.setLayoutData( data );
|
fBasicComposite.setLayoutData( data );
|
||||||
|
|
||||||
fTitleLabel = new Label( fBasicComposite, SWT.NONE );
|
fTitleLabel = new Label( fBasicComposite, SWT.NONE );
|
||||||
fTitleLabel.setText( fTitle );
|
fTitleLabel.setText( fTitle );
|
||||||
GridData gd = new GridData();
|
GridData gd = new GridData();
|
||||||
gd.verticalAlignment = SWT.TOP;
|
gd.verticalAlignment = SWT.TOP;
|
||||||
fTitleLabel.setLayoutData( gd );
|
fTitleLabel.setLayoutData( gd );
|
||||||
|
|
||||||
fValueLabel = new Label( fBasicComposite, SWT.WRAP );
|
fValueLabel = new Label( fBasicComposite, SWT.WRAP );
|
||||||
fValueLabel.setText( fValue );
|
fValueLabel.setText( fValue );
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
fValueLabel.setLayoutData( gd );
|
fValueLabel.setLayoutData( gd );
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getNumberOfControls()
|
public int getNumberOfControls() {
|
||||||
{
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The label field editor is only used to present a text label
|
* The label field editor is only used to present a text label on a preference page.
|
||||||
* on a preference page.
|
|
||||||
*/
|
*/
|
||||||
protected void doLoad()
|
protected void doLoad() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doLoadDefault()
|
protected void doLoadDefault() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doStore()
|
protected void doStore() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BreakpointStringFieldEditor fCondition;
|
private BreakpointStringFieldEditor fCondition;
|
||||||
|
|
||||||
private Text fIgnoreCountTextControl;
|
private Text fIgnoreCountTextControl;
|
||||||
|
|
||||||
private BreakpointIntegerFieldEditor fIgnoreCount;
|
private BreakpointIntegerFieldEditor fIgnoreCount;
|
||||||
|
|
||||||
private ICBreakpoint fBreakpoint;
|
private ICBreakpoint fBreakpoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for CBreakpointPreferencePage.
|
* Constructor for CBreakpointPreferencePage.
|
||||||
|
*
|
||||||
* @param breakpoint
|
* @param breakpoint
|
||||||
*/
|
*/
|
||||||
public CBreakpointPreferencePage( ICBreakpoint breakpoint )
|
public CBreakpointPreferencePage( ICBreakpoint breakpoint ) {
|
||||||
{
|
|
||||||
super( GRID );
|
super( GRID );
|
||||||
setBreakpoint( breakpoint );
|
setBreakpoint( breakpoint );
|
||||||
noDefaultAndApplyButton();
|
noDefaultAndApplyButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
||||||
*/
|
*/
|
||||||
protected void createFieldEditors()
|
protected void createFieldEditors() {
|
||||||
{
|
|
||||||
ICBreakpoint breakpoint = getBreakpoint();
|
ICBreakpoint breakpoint = getBreakpoint();
|
||||||
|
|
||||||
createTypeSpecificLabelFieldEditors( breakpoint );
|
createTypeSpecificLabelFieldEditors( breakpoint );
|
||||||
|
|
||||||
IPreferenceStore store = getPreferenceStore();
|
IPreferenceStore store = getPreferenceStore();
|
||||||
|
try {
|
||||||
try
|
String condition = breakpoint.getCondition();
|
||||||
{
|
if ( condition == null ) {
|
||||||
String condition= breakpoint.getCondition();
|
|
||||||
if ( condition == null )
|
|
||||||
{
|
|
||||||
condition = ""; //$NON-NLS-1$
|
condition = ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
store.setValue( CBreakpointPreferenceStore.CONDITION, condition );
|
store.setValue( CBreakpointPreferenceStore.CONDITION, condition );
|
||||||
|
|
||||||
createConditionEditor( getFieldEditorParent() );
|
createConditionEditor( getFieldEditorParent() );
|
||||||
|
|
||||||
store.setValue( CBreakpointPreferenceStore.ENABLED, breakpoint.isEnabled() );
|
store.setValue( CBreakpointPreferenceStore.ENABLED, breakpoint.isEnabled() );
|
||||||
int ignoreCount = breakpoint.getIgnoreCount();
|
int ignoreCount = breakpoint.getIgnoreCount();
|
||||||
store.setValue( CBreakpointPreferenceStore.IGNORE_COUNT, ( ignoreCount >= 0 ) ? ignoreCount : 0 );
|
store.setValue( CBreakpointPreferenceStore.IGNORE_COUNT, (ignoreCount >= 0) ? ignoreCount : 0 );
|
||||||
|
|
||||||
createIgnoreCountEditor( getFieldEditorParent() );
|
createIgnoreCountEditor( getFieldEditorParent() );
|
||||||
}
|
}
|
||||||
catch( CoreException ce )
|
catch( CoreException ce ) {
|
||||||
{
|
|
||||||
CDebugUIPlugin.log( ce );
|
CDebugUIPlugin.log( ce );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method createTypeSpecificLabelFieldEditors.
|
* Method createTypeSpecificLabelFieldEditors.
|
||||||
|
*
|
||||||
* @param breakpoint
|
* @param breakpoint
|
||||||
*/
|
*/
|
||||||
private void createTypeSpecificLabelFieldEditors( ICBreakpoint breakpoint )
|
private void createTypeSpecificLabelFieldEditors( ICBreakpoint breakpoint ) {
|
||||||
{
|
if ( breakpoint instanceof ICFunctionBreakpoint ) {
|
||||||
if ( breakpoint instanceof ICFunctionBreakpoint )
|
|
||||||
{
|
|
||||||
ICFunctionBreakpoint fbrkpt = (ICFunctionBreakpoint)breakpoint;
|
ICFunctionBreakpoint fbrkpt = (ICFunctionBreakpoint)breakpoint;
|
||||||
String function = CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Not_available"); //$NON-NLS-1$
|
String function = ActionMessages.getString( "CBreakpointPreferencePage.1" ); //$NON-NLS-1$
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
function = fbrkpt.getFunction();
|
function = fbrkpt.getFunction();
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e )
|
catch( NumberFormatException e ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
if ( function != null )
|
if ( function != null ) {
|
||||||
{
|
addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPreferencePage.2" ), function ) ); //$NON-NLS-1$
|
||||||
addField( createLabelEditor( getFieldEditorParent(), CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Function_name"), function ) ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
setTitle( CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Function_Breakpoint_Properties") ); //$NON-NLS-1$
|
setTitle( ActionMessages.getString( "CBreakpointPreferencePage.3" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
else if ( breakpoint instanceof ICAddressBreakpoint )
|
else if ( breakpoint instanceof ICAddressBreakpoint ) {
|
||||||
{
|
|
||||||
ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint;
|
ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint;
|
||||||
String address = CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Not_available"); //$NON-NLS-1$
|
String address = ActionMessages.getString( "CBreakpointPreferencePage.4" ); //$NON-NLS-1$
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
address = CDebugUtils.toHexAddressString( Long.parseLong( abrkpt.getAddress() ) );
|
address = CDebugUtils.toHexAddressString( Long.parseLong( abrkpt.getAddress() ) );
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e )
|
catch( NumberFormatException e ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
if ( address != null )
|
if ( address != null ) {
|
||||||
{
|
addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPreferencePage.5" ), address ) ); //$NON-NLS-1$
|
||||||
addField( createLabelEditor( getFieldEditorParent(), CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Address"), address ) ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
setTitle( CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Address_Breakpoint_Properties") ); //$NON-NLS-1$
|
setTitle( ActionMessages.getString( "CBreakpointPreferencePage.6" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
else if ( breakpoint instanceof ILineBreakpoint )
|
else if ( breakpoint instanceof ILineBreakpoint ) {
|
||||||
{
|
|
||||||
String fileName = breakpoint.getMarker().getResource().getLocation().toOSString();
|
String fileName = breakpoint.getMarker().getResource().getLocation().toOSString();
|
||||||
if ( fileName != null )
|
if ( fileName != null ) {
|
||||||
{
|
addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPreferencePage.7" ), fileName ) ); //$NON-NLS-1$
|
||||||
addField( createLabelEditor( getFieldEditorParent(), CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.File"), fileName ) ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
setTitle( CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Line_Breakpoint_Properties") ); //$NON-NLS-1$
|
setTitle( ActionMessages.getString( "CBreakpointPreferencePage.8" ) ); //$NON-NLS-1$
|
||||||
ILineBreakpoint lBreakpoint = (ILineBreakpoint)breakpoint;
|
ILineBreakpoint lBreakpoint = (ILineBreakpoint)breakpoint;
|
||||||
StringBuffer lineNumber = new StringBuffer( 4 );
|
StringBuffer lineNumber = new StringBuffer( 4 );
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
int lNumber = lBreakpoint.getLineNumber();
|
int lNumber = lBreakpoint.getLineNumber();
|
||||||
if ( lNumber > 0 )
|
if ( lNumber > 0 ) {
|
||||||
{
|
|
||||||
lineNumber.append( lNumber );
|
lineNumber.append( lNumber );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( CoreException ce )
|
catch( CoreException ce ) {
|
||||||
{
|
|
||||||
CDebugUIPlugin.log( ce );
|
CDebugUIPlugin.log( ce );
|
||||||
}
|
}
|
||||||
if ( lineNumber.length() > 0 )
|
if ( lineNumber.length() > 0 ) {
|
||||||
{
|
addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPreferencePage.9" ), lineNumber.toString() ) ); //$NON-NLS-1$
|
||||||
addField( createLabelEditor( getFieldEditorParent(), CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Line_Number"), lineNumber.toString() ) ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( breakpoint instanceof ICWatchpoint )
|
else if ( breakpoint instanceof ICWatchpoint ) {
|
||||||
{
|
|
||||||
String projectName = breakpoint.getMarker().getResource().getLocation().toOSString();
|
String projectName = breakpoint.getMarker().getResource().getLocation().toOSString();
|
||||||
if ( projectName != null )
|
if ( projectName != null ) {
|
||||||
{
|
addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPreferencePage.10" ), projectName ) ); //$NON-NLS-1$
|
||||||
addField( createLabelEditor( getFieldEditorParent(), CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Project"), projectName ) ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
ICWatchpoint watchpoint = (ICWatchpoint)breakpoint;
|
ICWatchpoint watchpoint = (ICWatchpoint)breakpoint;
|
||||||
String title = ""; //$NON-NLS-1$
|
String title = ""; //$NON-NLS-1$
|
||||||
String expression = ""; //$NON-NLS-1$
|
String expression = ""; //$NON-NLS-1$
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
if ( watchpoint.isReadType() && !watchpoint.isWriteType() )
|
if ( watchpoint.isReadType() && !watchpoint.isWriteType() )
|
||||||
title = CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Read_Watchpoint_Properties"); //$NON-NLS-1$
|
title = ActionMessages.getString( "CBreakpointPreferencePage.11" ); //$NON-NLS-1$
|
||||||
else if ( !watchpoint.isReadType() && watchpoint.isWriteType() )
|
else if ( !watchpoint.isReadType() && watchpoint.isWriteType() )
|
||||||
title = CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Watchpoint_Properties"); //$NON-NLS-1$
|
title = ActionMessages.getString( "CBreakpointPreferencePage.12" ); //$NON-NLS-1$
|
||||||
else
|
else
|
||||||
title = CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Access_Watchpoint_Properties"); //$NON-NLS-1$
|
title = ActionMessages.getString( "CBreakpointPreferencePage.13" ); //$NON-NLS-1$
|
||||||
expression = watchpoint.getExpression();
|
expression = watchpoint.getExpression();
|
||||||
}
|
}
|
||||||
catch( CoreException ce )
|
catch( CoreException ce ) {
|
||||||
{
|
|
||||||
CDebugUIPlugin.log( ce );
|
CDebugUIPlugin.log( ce );
|
||||||
}
|
}
|
||||||
setTitle( title );
|
setTitle( title );
|
||||||
addField( createLabelEditor( getFieldEditorParent(), CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Expression_To_Watch"), expression ) ); //$NON-NLS-1$
|
addField( createLabelEditor( getFieldEditorParent(), ActionMessages.getString( "CBreakpointPreferencePage.14" ), expression ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createConditionEditor( Composite parent )
|
protected void createConditionEditor( Composite parent ) {
|
||||||
{
|
fCondition = new BreakpointStringFieldEditor( CBreakpointPreferenceStore.CONDITION, ActionMessages.getString( "CBreakpointPreferencePage.15" ), parent ); //$NON-NLS-1$
|
||||||
fCondition = new BreakpointStringFieldEditor( CBreakpointPreferenceStore.CONDITION, CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Condition"), parent ); //$NON-NLS-1$
|
|
||||||
fCondition.setEmptyStringAllowed( true );
|
fCondition.setEmptyStringAllowed( true );
|
||||||
fCondition.setErrorMessage( CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Invalid_condition") ); //$NON-NLS-1$
|
fCondition.setErrorMessage( ActionMessages.getString( "CBreakpointPreferencePage.16" ) ); //$NON-NLS-1$
|
||||||
addField( fCondition );
|
addField( fCondition );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createIgnoreCountEditor( Composite parent )
|
protected void createIgnoreCountEditor( Composite parent ) {
|
||||||
{
|
fIgnoreCount = new BreakpointIntegerFieldEditor( CBreakpointPreferenceStore.IGNORE_COUNT, ActionMessages.getString( "CBreakpointPreferencePage.17" ), parent ); //$NON-NLS-1$
|
||||||
fIgnoreCount = new BreakpointIntegerFieldEditor( CBreakpointPreferenceStore.IGNORE_COUNT, CDebugUIPlugin.getResourceString("internal.ui.actions.CBreakpointPreferencePage.Ignore_Count"), parent ); //$NON-NLS-1$
|
|
||||||
fIgnoreCount.setValidRange( 0, Integer.MAX_VALUE );
|
fIgnoreCount.setValidRange( 0, Integer.MAX_VALUE );
|
||||||
fIgnoreCountTextControl = fIgnoreCount.getTextControl( parent );
|
fIgnoreCountTextControl = fIgnoreCount.getTextControl( parent );
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
fIgnoreCountTextControl.setEnabled( getBreakpoint().getIgnoreCount() >= 0 );
|
fIgnoreCountTextControl.setEnabled( getBreakpoint().getIgnoreCount() >= 0 );
|
||||||
}
|
}
|
||||||
catch (CoreException ce)
|
catch( CoreException ce ) {
|
||||||
{
|
|
||||||
CDebugUIPlugin.log( ce );
|
CDebugUIPlugin.log( ce );
|
||||||
}
|
}
|
||||||
addField( fIgnoreCount );
|
addField( fIgnoreCount );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected FieldEditor createLabelEditor( Composite parent, String title, String value )
|
protected FieldEditor createLabelEditor( Composite parent, String title, String value ) {
|
||||||
{
|
|
||||||
return new LabelFieldEditor( parent, title, value );
|
return new LabelFieldEditor( parent, title, value );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICBreakpoint getBreakpoint()
|
protected ICBreakpoint getBreakpoint() {
|
||||||
{
|
|
||||||
return fBreakpoint;
|
return fBreakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setBreakpoint( ICBreakpoint breakpoint )
|
protected void setBreakpoint( ICBreakpoint breakpoint ) {
|
||||||
{
|
|
||||||
fBreakpoint = breakpoint;
|
fBreakpoint = breakpoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICastToArray;
|
import org.eclipse.cdt.debug.core.model.ICastToArray;
|
||||||
|
@ -40,176 +44,149 @@ import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.actions.ActionDelegate;
|
import org.eclipse.ui.actions.ActionDelegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The delegate of the "Display As Array" action.
|
||||||
*
|
|
||||||
* @since Mar 10, 2003
|
|
||||||
*/
|
*/
|
||||||
public class CastToArrayActionDelegate extends ActionDelegate implements IObjectActionDelegate
|
public class CastToArrayActionDelegate extends ActionDelegate implements IObjectActionDelegate {
|
||||||
{
|
|
||||||
protected class CastToArrayDialog extends Dialog
|
protected class CastToArrayDialog extends Dialog {
|
||||||
{
|
|
||||||
private String fType = ""; //$NON-NLS-1$
|
private String fType = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
private int fFirstIndex = 0;
|
private int fFirstIndex = 0;
|
||||||
|
|
||||||
private int fLength = 0;
|
private int fLength = 0;
|
||||||
|
|
||||||
private Button fOkButton;
|
private Button fOkButton;
|
||||||
|
|
||||||
private Label fErrorMessageLabel;
|
private Label fErrorMessageLabel;
|
||||||
|
|
||||||
private Text fFirstIndexText;
|
private Text fFirstIndexText;
|
||||||
|
|
||||||
private Text fLengthText;
|
private Text fLengthText;
|
||||||
|
|
||||||
public CastToArrayDialog( Shell parentShell, String initialType, int initialStart, int initialLength )
|
public CastToArrayDialog( Shell parentShell, String initialType, int initialStart, int initialLength ) {
|
||||||
{
|
|
||||||
super( parentShell );
|
super( parentShell );
|
||||||
fType = ( initialType == null ) ? "" : initialType; //$NON-NLS-1$
|
fType = (initialType == null) ? "" : initialType; //$NON-NLS-1$
|
||||||
fFirstIndex = initialStart;
|
fFirstIndex = initialStart;
|
||||||
fLength = initialLength;
|
fLength = initialLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getType()
|
protected String getType() {
|
||||||
{
|
|
||||||
return fType;
|
return fType;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getFirstIndex()
|
protected int getFirstIndex() {
|
||||||
{
|
|
||||||
return fFirstIndex;
|
return fFirstIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getLength()
|
protected int getLength() {
|
||||||
{
|
|
||||||
return fLength;
|
return fLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
||||||
*/
|
*/
|
||||||
protected void configureShell( Shell newShell )
|
protected void configureShell( Shell newShell ) {
|
||||||
{
|
|
||||||
super.configureShell( newShell );
|
super.configureShell( newShell );
|
||||||
newShell.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.Shell_Display_As_Array") ); //$NON-NLS-1$
|
newShell.setText( ActionMessages.getString( "CastToArrayActionDelegate.0" ) ); //$NON-NLS-1$
|
||||||
newShell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_DISPLAY_AS_ARRAY ) );
|
newShell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_DISPLAY_AS_ARRAY ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
protected void createButtonsForButtonBar( Composite parent )
|
protected void createButtonsForButtonBar( Composite parent ) {
|
||||||
{
|
|
||||||
// create OK and Cancel buttons by default
|
// create OK and Cancel buttons by default
|
||||||
fOkButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
|
fOkButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
|
||||||
createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
|
createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
|
||||||
|
|
||||||
//do this here because setting the text will set enablement on the ok button
|
//do this here because setting the text will set enablement on the ok button
|
||||||
/*
|
/*
|
||||||
fTypeText.setFocus();
|
* fTypeText.setFocus(); if ( fType != null ) { fTypeText.setText( fType ); fTypeText.selectAll(); fFirstIndexText.setText( String.valueOf(
|
||||||
if ( fType != null )
|
* fFirstIndex ) ); fLengthText.setText( String.valueOf( fLength ) ); }
|
||||||
{
|
*/
|
||||||
fTypeText.setText( fType );
|
|
||||||
fTypeText.selectAll();
|
|
||||||
fFirstIndexText.setText( String.valueOf( fFirstIndex ) );
|
|
||||||
fLengthText.setText( String.valueOf( fLength ) );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
fFirstIndexText.setText( String.valueOf( fFirstIndex ) );
|
fFirstIndexText.setText( String.valueOf( fFirstIndex ) );
|
||||||
fLengthText.setText( String.valueOf( fLength ) );
|
fLengthText.setText( String.valueOf( fLength ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Label getErrorMessageLabel()
|
protected Label getErrorMessageLabel() {
|
||||||
{
|
|
||||||
return fErrorMessageLabel;
|
return fErrorMessageLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
protected Control createDialogArea( Composite parent )
|
protected Control createDialogArea( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = (Composite)super.createDialogArea( parent );
|
Composite composite = (Composite)super.createDialogArea( parent );
|
||||||
|
|
||||||
createDialogFields( composite );
|
createDialogFields( composite );
|
||||||
|
|
||||||
fErrorMessageLabel = new Label( composite, SWT.NONE );
|
fErrorMessageLabel = new Label( composite, SWT.NONE );
|
||||||
fErrorMessageLabel.setLayoutData( new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL ) );
|
fErrorMessageLabel.setLayoutData( new GridData( GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL ) );
|
||||||
fErrorMessageLabel.setFont(parent.getFont());
|
fErrorMessageLabel.setFont( parent.getFont() );
|
||||||
return composite;
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createDialogFields( Composite parent )
|
private void createDialogFields( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = ControlFactory.createComposite( parent, 4 );
|
Composite composite = ControlFactory.createComposite( parent, 4 );
|
||||||
((GridData)composite.getLayoutData()).widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
|
((GridData)composite.getLayoutData()).widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
|
||||||
((GridLayout)composite.getLayout()).makeColumnsEqualWidth = true;
|
((GridLayout)composite.getLayout()).makeColumnsEqualWidth = true;
|
||||||
|
Label label = ControlFactory.createLabel( composite, ActionMessages.getString( "CastToArrayActionDelegate.1" ) ); //$NON-NLS-1$
|
||||||
Label label = ControlFactory.createLabel( composite, CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.Start_index") ); //$NON-NLS-1$
|
|
||||||
((GridData)label.getLayoutData()).horizontalSpan = 3;
|
((GridData)label.getLayoutData()).horizontalSpan = 3;
|
||||||
fFirstIndexText = ControlFactory.createTextField( composite );
|
fFirstIndexText = ControlFactory.createTextField( composite );
|
||||||
fFirstIndexText.addModifyListener(
|
fFirstIndexText.addModifyListener( new ModifyListener() {
|
||||||
new ModifyListener()
|
|
||||||
{
|
|
||||||
public void modifyText( ModifyEvent e )
|
|
||||||
{
|
|
||||||
validateInput();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
label = ControlFactory.createLabel( composite, CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.Length") ); //$NON-NLS-1$
|
public void modifyText( ModifyEvent e ) {
|
||||||
|
validateInput();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
label = ControlFactory.createLabel( composite, ActionMessages.getString( "CastToArrayActionDelegate.2" ) ); //$NON-NLS-1$
|
||||||
((GridData)label.getLayoutData()).horizontalSpan = 3;
|
((GridData)label.getLayoutData()).horizontalSpan = 3;
|
||||||
fLengthText = ControlFactory.createTextField( composite );
|
fLengthText = ControlFactory.createTextField( composite );
|
||||||
fLengthText.addModifyListener(
|
fLengthText.addModifyListener( new ModifyListener() {
|
||||||
new ModifyListener()
|
|
||||||
{
|
public void modifyText( ModifyEvent e ) {
|
||||||
public void modifyText( ModifyEvent e )
|
validateInput();
|
||||||
{
|
}
|
||||||
validateInput();
|
} );
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void validateInput()
|
protected void validateInput() {
|
||||||
{
|
|
||||||
boolean enabled = true;
|
boolean enabled = true;
|
||||||
String message = ""; //$NON-NLS-1$
|
String message = ""; //$NON-NLS-1$
|
||||||
String firstIndex = fFirstIndexText.getText().trim();
|
String firstIndex = fFirstIndexText.getText().trim();
|
||||||
if ( firstIndex.length() == 0 )
|
if ( firstIndex.length() == 0 ) {
|
||||||
{
|
message = ActionMessages.getString( "CastToArrayActionDelegate.3" ); //$NON-NLS-1$
|
||||||
message = CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.First_index_field_must_not_be_empty"); //$NON-NLS-1$
|
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
Integer.parseInt( firstIndex );
|
Integer.parseInt( firstIndex );
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e )
|
catch( NumberFormatException e ) {
|
||||||
{
|
message = ActionMessages.getString( "CastToArrayActionDelegate.4" ); //$NON-NLS-1$
|
||||||
message = CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.Invalid_first_index"); //$NON-NLS-1$
|
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
if ( enabled )
|
if ( enabled ) {
|
||||||
{
|
|
||||||
String lengthText = fLengthText.getText().trim();
|
String lengthText = fLengthText.getText().trim();
|
||||||
if ( lengthText.length() == 0 )
|
if ( lengthText.length() == 0 ) {
|
||||||
{
|
message = ActionMessages.getString( "CastToArrayActionDelegate.5" ); //$NON-NLS-1$
|
||||||
message = CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.Empty_last_index"); //$NON-NLS-1$
|
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
int length = -1;
|
int length = -1;
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
length = Integer.parseInt( lengthText );
|
length = Integer.parseInt( lengthText );
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e )
|
catch( NumberFormatException e ) {
|
||||||
{
|
message = ActionMessages.getString( "CastToArrayActionDelegate.6" ); //$NON-NLS-1$
|
||||||
message = CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.Invalid_last_index."); //$NON-NLS-1$
|
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
if ( enabled && length < 1 )
|
if ( enabled && length < 1 ) {
|
||||||
{
|
message = ActionMessages.getString( "CastToArrayActionDelegate.7" ); //$NON-NLS-1$
|
||||||
message = CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.The_length_must_be_greater_than_0"); //$NON-NLS-1$
|
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -219,28 +196,25 @@ public class CastToArrayActionDelegate extends ActionDelegate implements IObject
|
||||||
getErrorMessageLabel().setText( message );
|
getErrorMessageLabel().setText( message );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
|
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
|
||||||
*/
|
*/
|
||||||
protected void buttonPressed( int buttonId )
|
protected void buttonPressed( int buttonId ) {
|
||||||
{
|
if ( buttonId == IDialogConstants.OK_ID ) {
|
||||||
if ( buttonId == IDialogConstants.OK_ID )
|
|
||||||
{
|
|
||||||
String firstIndex = fFirstIndexText.getText().trim();
|
String firstIndex = fFirstIndexText.getText().trim();
|
||||||
String lengthText = fLengthText.getText().trim();
|
String lengthText = fLengthText.getText().trim();
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
fFirstIndex = Integer.parseInt( firstIndex );
|
fFirstIndex = Integer.parseInt( firstIndex );
|
||||||
fLength = Integer.parseInt( lengthText );
|
fLength = Integer.parseInt( lengthText );
|
||||||
}
|
}
|
||||||
catch( NumberFormatException e )
|
catch( NumberFormatException e ) {
|
||||||
{
|
|
||||||
fFirstIndex = 0;
|
fFirstIndex = 0;
|
||||||
fLength = 0;
|
fLength = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
fType = null;
|
fType = null;
|
||||||
}
|
}
|
||||||
super.buttonPressed( buttonId );
|
super.buttonPressed( buttonId );
|
||||||
|
@ -248,73 +222,67 @@ public class CastToArrayActionDelegate extends ActionDelegate implements IObject
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICastToArray fCastToArray = null;
|
private ICastToArray fCastToArray = null;
|
||||||
|
|
||||||
private IStatus fStatus = null;
|
private IStatus fStatus = null;
|
||||||
|
|
||||||
private IWorkbenchPart fTargetPart = null;
|
private IWorkbenchPart fTargetPart = null;
|
||||||
|
|
||||||
public CastToArrayActionDelegate()
|
public CastToArrayActionDelegate() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
|
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
|
||||||
*/
|
*/
|
||||||
public void setActivePart( IAction action, IWorkbenchPart targetPart )
|
public void setActivePart( IAction action, IWorkbenchPart targetPart ) {
|
||||||
{
|
|
||||||
fTargetPart = targetPart;
|
fTargetPart = targetPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||||
*/
|
*/
|
||||||
public void run( IAction action )
|
public void run( IAction action ) {
|
||||||
{
|
|
||||||
if ( getCastToArray() == null )
|
if ( getCastToArray() == null )
|
||||||
return;
|
return;
|
||||||
BusyIndicator.showWhile( Display.getCurrent(),
|
BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
|
||||||
new Runnable()
|
|
||||||
{
|
public void run() {
|
||||||
public void run()
|
try {
|
||||||
{
|
doAction( getCastToArray() );
|
||||||
try
|
setStatus( null );
|
||||||
{
|
}
|
||||||
doAction( getCastToArray() );
|
catch( DebugException e ) {
|
||||||
setStatus( null );
|
setStatus( e.getStatus() );
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
}
|
||||||
{
|
} );
|
||||||
setStatus( e.getStatus() );
|
if ( getStatus() != null && !getStatus().isOK() ) {
|
||||||
}
|
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
||||||
}
|
if ( window != null ) {
|
||||||
} );
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "CastToArrayActionDelegate.8" ), getStatus() ); //$NON-NLS-1$
|
||||||
if ( getStatus() != null && !getStatus().isOK() )
|
}
|
||||||
{
|
else {
|
||||||
IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow();
|
|
||||||
if ( window != null )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.CastToArrayActionDelegate.Unable_to_display_this_variable_as_an_array"), getStatus() ); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.log( getStatus() );
|
CDebugUIPlugin.log( getStatus() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
public void selectionChanged( IAction action, ISelection selection ) {
|
||||||
{
|
if ( selection instanceof IStructuredSelection ) {
|
||||||
if ( selection instanceof IStructuredSelection )
|
|
||||||
{
|
|
||||||
Object element = ((IStructuredSelection)selection).getFirstElement();
|
Object element = ((IStructuredSelection)selection).getFirstElement();
|
||||||
if ( element instanceof ICastToArray )
|
if ( element instanceof ICastToArray ) {
|
||||||
{
|
|
||||||
boolean enabled = ((ICastToArray)element).supportsCastToArray();
|
boolean enabled = ((ICastToArray)element).supportsCastToArray();
|
||||||
action.setEnabled( enabled );
|
action.setEnabled( enabled );
|
||||||
if ( enabled )
|
if ( enabled ) {
|
||||||
{
|
|
||||||
setCastToArray( (ICastToArray)element );
|
setCastToArray( (ICastToArray)element );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -324,32 +292,26 @@ public class CastToArrayActionDelegate extends ActionDelegate implements IObject
|
||||||
setCastToArray( null );
|
setCastToArray( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICastToArray getCastToArray()
|
protected ICastToArray getCastToArray() {
|
||||||
{
|
|
||||||
return fCastToArray;
|
return fCastToArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setCastToArray( ICastToArray castToArray )
|
protected void setCastToArray( ICastToArray castToArray ) {
|
||||||
{
|
|
||||||
fCastToArray = castToArray;
|
fCastToArray = castToArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IStatus getStatus()
|
public IStatus getStatus() {
|
||||||
{
|
|
||||||
return fStatus;
|
return fStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus( IStatus status )
|
public void setStatus( IStatus status ) {
|
||||||
{
|
|
||||||
fStatus = status;
|
fStatus = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doAction( ICastToArray castToArray ) throws DebugException
|
protected void doAction( ICastToArray castToArray ) throws DebugException {
|
||||||
{
|
|
||||||
String currentType = castToArray.getCurrentType().trim();
|
String currentType = castToArray.getCurrentType().trim();
|
||||||
CastToArrayDialog dialog = new CastToArrayDialog( CDebugUIPlugin.getActiveWorkbenchShell(), currentType, 0, 1 );
|
CastToArrayDialog dialog = new CastToArrayDialog( CDebugUIPlugin.getActiveWorkbenchShell(), currentType, 0, 1 );
|
||||||
if ( dialog.open() == Window.OK )
|
if ( dialog.open() == Window.OK ) {
|
||||||
{
|
|
||||||
int firstIndex = dialog.getFirstIndex();
|
int firstIndex = dialog.getFirstIndex();
|
||||||
int lastIndex = dialog.getLength();
|
int lastIndex = dialog.getLength();
|
||||||
castToArray.castToArray( firstIndex, lastIndex );
|
castToArray.castToArray( firstIndex, lastIndex );
|
||||||
|
@ -358,8 +320,7 @@ public class CastToArrayActionDelegate extends ActionDelegate implements IObject
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ISelectionProvider getSelectionProvider()
|
private ISelectionProvider getSelectionProvider() {
|
||||||
{
|
return (fTargetPart instanceof IDebugView) ? ((IDebugView)fTargetPart).getViewer() : null;
|
||||||
return ( fTargetPart instanceof IDebugView ) ? ((IDebugView)fTargetPart).getViewer() : null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICastToType;
|
import org.eclipse.cdt.debug.core.model.ICastToType;
|
||||||
|
@ -29,119 +33,105 @@ import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.actions.ActionDelegate;
|
import org.eclipse.ui.actions.ActionDelegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The delegate of the "Cast To Type" action.
|
||||||
*
|
|
||||||
* @since Mar 7, 2003
|
|
||||||
*/
|
*/
|
||||||
public class CastToTypeActionDelegate extends ActionDelegate
|
public class CastToTypeActionDelegate extends ActionDelegate implements IObjectActionDelegate {
|
||||||
implements IObjectActionDelegate
|
|
||||||
{
|
static protected class CastToTypeInputValidator implements IInputValidator {
|
||||||
static protected class CastToTypeInputValidator implements IInputValidator
|
|
||||||
{
|
public CastToTypeInputValidator() {
|
||||||
public CastToTypeInputValidator()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String isValid( String newText )
|
public String isValid( String newText ) {
|
||||||
{
|
if ( newText.trim().length() == 0 ) {
|
||||||
if ( newText.trim().length() == 0 )
|
return ActionMessages.getString( "CastToTypeActionDelegate.0" ); //$NON-NLS-1$
|
||||||
{
|
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.actions.CastToTypeActionDelegate.Type_field_must_not_be_empty"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class CastToTypeDialog extends InputDialog
|
protected class CastToTypeDialog extends InputDialog {
|
||||||
{
|
|
||||||
public CastToTypeDialog( Shell parentShell, String initialValue )
|
public CastToTypeDialog( Shell parentShell, String initialValue ) {
|
||||||
{
|
super( parentShell, ActionMessages.getString( "CastToTypeActionDelegate.1" ), //$NON-NLS-1$
|
||||||
super( parentShell,
|
ActionMessages.getString( "CastToTypeActionDelegate.2" ), //$NON-NLS-1$
|
||||||
CDebugUIPlugin.getResourceString("internal.ui.actions.CastToTypeActionDelegate.Cast_To_Type"), //$NON-NLS-1$
|
initialValue,
|
||||||
CDebugUIPlugin.getResourceString("internal.ui.actions.CastToTypeActionDelegate.Enter_type"), //$NON-NLS-1$
|
new CastToTypeInputValidator() );
|
||||||
initialValue, new CastToTypeInputValidator() ); //$NON-NLS-1$ //$NON-NLS-2$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
||||||
*/
|
*/
|
||||||
protected void configureShell( Shell shell )
|
protected void configureShell( Shell shell ) {
|
||||||
{
|
|
||||||
super.configureShell( shell );
|
super.configureShell( shell );
|
||||||
shell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_CAST_TO_TYPE ) );
|
shell.setImage( CDebugImages.get( CDebugImages.IMG_LCL_CAST_TO_TYPE ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICastToType fCastToType = null;
|
private ICastToType fCastToType = null;
|
||||||
|
|
||||||
private IStatus fStatus = null;
|
private IStatus fStatus = null;
|
||||||
|
|
||||||
private IWorkbenchPart fTargetPart = null;
|
private IWorkbenchPart fTargetPart = null;
|
||||||
|
|
||||||
public CastToTypeActionDelegate()
|
public CastToTypeActionDelegate() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
|
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
|
||||||
*/
|
*/
|
||||||
public void setActivePart( IAction action, IWorkbenchPart targetPart )
|
public void setActivePart( IAction action, IWorkbenchPart targetPart ) {
|
||||||
{
|
|
||||||
fTargetPart = targetPart;
|
fTargetPart = targetPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||||
*/
|
*/
|
||||||
public void run( IAction action )
|
public void run( IAction action ) {
|
||||||
{
|
|
||||||
if ( getCastToType() == null )
|
if ( getCastToType() == null )
|
||||||
return;
|
return;
|
||||||
BusyIndicator.showWhile( Display.getCurrent(),
|
BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
|
||||||
new Runnable()
|
|
||||||
{
|
public void run() {
|
||||||
public void run()
|
try {
|
||||||
{
|
doAction( getCastToType() );
|
||||||
try
|
setStatus( null );
|
||||||
{
|
}
|
||||||
doAction( getCastToType() );
|
catch( DebugException e ) {
|
||||||
setStatus( null );
|
setStatus( e.getStatus() );
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
}
|
||||||
{
|
} );
|
||||||
setStatus( e.getStatus() );
|
if ( getStatus() != null && !getStatus().isOK() ) {
|
||||||
}
|
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
||||||
}
|
if ( window != null ) {
|
||||||
} );
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "CastToTypeActionDelegate.3" ), getStatus() ); //$NON-NLS-1$
|
||||||
if ( getStatus() != null && !getStatus().isOK() )
|
}
|
||||||
{
|
else {
|
||||||
IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow();
|
|
||||||
if ( window != null )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.CastToTypeActionDelegate.Unable_to_cast_to_type."), getStatus() ); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.log( getStatus() );
|
CDebugUIPlugin.log( getStatus() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
public void selectionChanged( IAction action, ISelection selection ) {
|
||||||
{
|
if ( selection instanceof IStructuredSelection ) {
|
||||||
if ( selection instanceof IStructuredSelection )
|
|
||||||
{
|
|
||||||
Object element = ((IStructuredSelection)selection).getFirstElement();
|
Object element = ((IStructuredSelection)selection).getFirstElement();
|
||||||
if ( element instanceof ICastToType )
|
if ( element instanceof ICastToType ) {
|
||||||
{
|
|
||||||
boolean enabled = ((ICastToType)element).supportsCasting();
|
boolean enabled = ((ICastToType)element).supportsCasting();
|
||||||
action.setEnabled( enabled );
|
action.setEnabled( enabled );
|
||||||
if ( enabled )
|
if ( enabled ) {
|
||||||
{
|
|
||||||
setCastToType( (ICastToType)element );
|
setCastToType( (ICastToType)element );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -151,32 +141,26 @@ public class CastToTypeActionDelegate extends ActionDelegate
|
||||||
setCastToType( null );
|
setCastToType( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICastToType getCastToType()
|
protected ICastToType getCastToType() {
|
||||||
{
|
|
||||||
return fCastToType;
|
return fCastToType;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setCastToType( ICastToType castToType )
|
protected void setCastToType( ICastToType castToType ) {
|
||||||
{
|
|
||||||
fCastToType = castToType;
|
fCastToType = castToType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IStatus getStatus()
|
public IStatus getStatus() {
|
||||||
{
|
|
||||||
return fStatus;
|
return fStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus( IStatus status )
|
public void setStatus( IStatus status ) {
|
||||||
{
|
|
||||||
fStatus = status;
|
fStatus = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doAction( ICastToType castToType ) throws DebugException
|
protected void doAction( ICastToType castToType ) throws DebugException {
|
||||||
{
|
|
||||||
String currentType = castToType.getCurrentType().trim();
|
String currentType = castToType.getCurrentType().trim();
|
||||||
CastToTypeDialog dialog = new CastToTypeDialog( CDebugUIPlugin.getActiveWorkbenchShell(), currentType );
|
CastToTypeDialog dialog = new CastToTypeDialog( CDebugUIPlugin.getActiveWorkbenchShell(), currentType );
|
||||||
if ( dialog.open() == Window.OK )
|
if ( dialog.open() == Window.OK ) {
|
||||||
{
|
|
||||||
String newType = dialog.getValue().trim();
|
String newType = dialog.getValue().trim();
|
||||||
castToType.cast( newType );
|
castToType.cast( newType );
|
||||||
if ( getSelectionProvider() != null )
|
if ( getSelectionProvider() != null )
|
||||||
|
@ -184,8 +168,7 @@ public class CastToTypeActionDelegate extends ActionDelegate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private ISelectionProvider getSelectionProvider()
|
private ISelectionProvider getSelectionProvider() {
|
||||||
{
|
return (fTargetPart instanceof IDebugView) ? ((IDebugView)fTargetPart).getViewer() : null;
|
||||||
return ( fTargetPart instanceof IDebugView ) ? ((IDebugView)fTargetPart).getViewer() : null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,273 +0,0 @@
|
||||||
/*
|
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
|
||||||
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
import org.eclipse.debug.core.DebugException;
|
|
||||||
import org.eclipse.debug.core.model.IValueModification;
|
|
||||||
import org.eclipse.debug.core.model.IVariable;
|
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
|
||||||
import org.eclipse.jface.viewers.TreeViewer;
|
|
||||||
import org.eclipse.jface.viewers.Viewer;
|
|
||||||
import org.eclipse.swt.SWT;
|
|
||||||
import org.eclipse.swt.custom.TreeEditor;
|
|
||||||
import org.eclipse.swt.events.FocusAdapter;
|
|
||||||
import org.eclipse.swt.events.FocusEvent;
|
|
||||||
import org.eclipse.swt.events.KeyAdapter;
|
|
||||||
import org.eclipse.swt.events.KeyEvent;
|
|
||||||
import org.eclipse.swt.layout.GridData;
|
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
|
||||||
import org.eclipse.swt.widgets.Composite;
|
|
||||||
import org.eclipse.swt.widgets.Label;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
|
||||||
import org.eclipse.swt.widgets.Text;
|
|
||||||
import org.eclipse.swt.widgets.Tree;
|
|
||||||
import org.eclipse.swt.widgets.TreeItem;
|
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
|
||||||
import org.eclipse.ui.actions.SelectionProviderAction;
|
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Sep 16, 2002
|
|
||||||
*/
|
|
||||||
public class ChangeRegisterValueAction extends SelectionProviderAction
|
|
||||||
{
|
|
||||||
protected Tree fTree;
|
|
||||||
protected TreeEditor fTreeEditor;
|
|
||||||
protected Composite fComposite;
|
|
||||||
protected Label fEditorLabel;
|
|
||||||
protected Text fEditorText;
|
|
||||||
protected IVariable fVariable;
|
|
||||||
protected boolean fKeyReleased = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor for ChangeRegisterValueAction.
|
|
||||||
* @param provider
|
|
||||||
* @param text
|
|
||||||
*/
|
|
||||||
public ChangeRegisterValueAction( Viewer viewer )
|
|
||||||
{
|
|
||||||
super( viewer, CDebugUIPlugin.getResourceString("internal.ui.actions.ChangeRegisterValueAction.Change_Register_Value") ); //$NON-NLS-1$
|
|
||||||
setDescription( CDebugUIPlugin.getResourceString("internal.ui.actions.ChangeRegisterValueAction.Change_Register_Value") ); //$NON-NLS-1$
|
|
||||||
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_CHANGE_REGISTER_VALUE );
|
|
||||||
fTree = ((TreeViewer)viewer).getTree();
|
|
||||||
fTreeEditor = new TreeEditor( fTree );
|
|
||||||
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.CHANGE_REGISTER_VALUE_ACTION );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Edit the variable value with an inline text editor.
|
|
||||||
*/
|
|
||||||
protected void doActionPerformed( final IVariable variable )
|
|
||||||
{
|
|
||||||
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
|
||||||
if ( window == null )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Shell activeShell = window.getShell();
|
|
||||||
|
|
||||||
// If a previous edit is still in progress, finish it
|
|
||||||
if ( fEditorText != null )
|
|
||||||
{
|
|
||||||
saveChangesAndCleanup( fVariable, activeShell );
|
|
||||||
}
|
|
||||||
fVariable = variable;
|
|
||||||
|
|
||||||
// Use a Composite containing a Label and a Text. This allows us to edit just
|
|
||||||
// the value, while still showing the variable name.
|
|
||||||
fComposite = new Composite( fTree, SWT.NONE );
|
|
||||||
fComposite.setBackground( fTree.getBackground() );
|
|
||||||
GridLayout layout = new GridLayout();
|
|
||||||
layout.numColumns = 2;
|
|
||||||
layout.marginHeight = 0;
|
|
||||||
layout.marginWidth = 0;
|
|
||||||
fComposite.setLayout( layout );
|
|
||||||
|
|
||||||
fEditorLabel = new Label( fComposite, SWT.LEFT );
|
|
||||||
fEditorLabel.setLayoutData( new GridData( GridData.FILL_VERTICAL ) );
|
|
||||||
|
|
||||||
// Fix for bug 1766. Border behavior on Windows & Linux for text
|
|
||||||
// fields is different. On Linux, you always get a border, on Windows,
|
|
||||||
// you don't. Specifying a border on Linux results in the characters
|
|
||||||
// getting pushed down so that only there very tops are visible. Thus,
|
|
||||||
// we have to specify different style constants for the different platforms.
|
|
||||||
int textStyles = SWT.SINGLE | SWT.LEFT;
|
|
||||||
if ( SWT.getPlatform().equals( "win32" ) ) //$NON-NLS-1$
|
|
||||||
{ //$NON-NLS-1$
|
|
||||||
textStyles |= SWT.BORDER;
|
|
||||||
}
|
|
||||||
fEditorText = new Text( fComposite, textStyles );
|
|
||||||
fEditorText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL ) );
|
|
||||||
String valueString = ""; //$NON-NLS-1$
|
|
||||||
try
|
|
||||||
{
|
|
||||||
valueString = fVariable.getValue().getValueString();
|
|
||||||
}
|
|
||||||
catch( DebugException de )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.ChangeRegisterValueAction.Setting_the_register_value_failed"), de ); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
TreeItem[] selectedItems = fTree.getSelection();
|
|
||||||
fTreeEditor.horizontalAlignment = SWT.LEFT;
|
|
||||||
fTreeEditor.grabHorizontal = true;
|
|
||||||
fTreeEditor.setEditor( fComposite, selectedItems[0] );
|
|
||||||
|
|
||||||
// There is no API on the model presentation to get just the variable name,
|
|
||||||
// so we have to make do with just calling IVariable.getName()
|
|
||||||
String varName = ""; //$NON-NLS-1$
|
|
||||||
try
|
|
||||||
{
|
|
||||||
varName = fVariable.getName();
|
|
||||||
}
|
|
||||||
catch (DebugException de)
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.ChangeRegisterValueAction.Setting_register_value_failed"), de ); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
fEditorLabel.setText( varName + "=" ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
fEditorText.setText( valueString );
|
|
||||||
fEditorText.selectAll();
|
|
||||||
|
|
||||||
fComposite.layout( true );
|
|
||||||
fComposite.setVisible( true );
|
|
||||||
fEditorText.setFocus();
|
|
||||||
|
|
||||||
// CR means commit the changes, ESC means abort changing the value
|
|
||||||
fEditorText.addKeyListener(
|
|
||||||
new KeyAdapter()
|
|
||||||
{
|
|
||||||
public void keyReleased( KeyEvent event )
|
|
||||||
{
|
|
||||||
if ( event.character == SWT.CR )
|
|
||||||
{
|
|
||||||
if ( fKeyReleased )
|
|
||||||
{
|
|
||||||
saveChangesAndCleanup( fVariable, activeShell );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cleanup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( event.character == SWT.ESC )
|
|
||||||
{
|
|
||||||
cleanup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
fKeyReleased = true;
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
// If the focus is lost, then act as if user hit CR and commit changes
|
|
||||||
fEditorText.addFocusListener(
|
|
||||||
new FocusAdapter()
|
|
||||||
{
|
|
||||||
public void focusLost( FocusEvent fe )
|
|
||||||
{
|
|
||||||
if ( fKeyReleased )
|
|
||||||
{
|
|
||||||
saveChangesAndCleanup( fVariable, activeShell );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If the new value validates, save it, and dispose the text widget,
|
|
||||||
* otherwise sound the system bell and leave the user in the editor.
|
|
||||||
*/
|
|
||||||
protected void saveChangesAndCleanup( IVariable variable, Shell shell )
|
|
||||||
{
|
|
||||||
String newValue = fEditorText.getText();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( !variable.verifyValue( newValue ) )
|
|
||||||
{
|
|
||||||
shell.getDisplay().beep();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
variable.setValue( newValue );
|
|
||||||
}
|
|
||||||
catch( DebugException de )
|
|
||||||
{
|
|
||||||
cleanup();
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.ChangeRegisterValueAction.Setting_register_value_failed"), de ); //$NON-NLS-1$
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tidy up the widgets that were used
|
|
||||||
*/
|
|
||||||
protected void cleanup()
|
|
||||||
{
|
|
||||||
fKeyReleased = false;
|
|
||||||
if ( fEditorText != null )
|
|
||||||
{
|
|
||||||
fEditorText.dispose();
|
|
||||||
fEditorText = null;
|
|
||||||
fVariable = null;
|
|
||||||
fTreeEditor.setEditor( null, null );
|
|
||||||
fComposite.setVisible( false );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Updates the enabled state of this action based
|
|
||||||
* on the selection
|
|
||||||
*/
|
|
||||||
protected void update( IStructuredSelection sel )
|
|
||||||
{
|
|
||||||
Iterator iter = sel.iterator();
|
|
||||||
if (iter.hasNext())
|
|
||||||
{
|
|
||||||
Object object = iter.next();
|
|
||||||
if ( object instanceof IValueModification )
|
|
||||||
{
|
|
||||||
IValueModification varMod = (IValueModification)object;
|
|
||||||
if ( !varMod.supportsValueModification() )
|
|
||||||
{
|
|
||||||
setEnabled( false );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setEnabled( !iter.hasNext() );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setEnabled( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see Action
|
|
||||||
*/
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
Iterator iterator = getStructuredSelection().iterator();
|
|
||||||
doActionPerformed( (IVariable)iterator.next() );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see SelectionProviderAction
|
|
||||||
*/
|
|
||||||
public void selectionChanged( IStructuredSelection sel )
|
|
||||||
{
|
|
||||||
update( sel );
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
||||||
|
@ -11,45 +16,41 @@ import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
||||||
import org.eclipse.ui.actions.SelectionProviderAction;
|
import org.eclipse.ui.actions.SelectionProviderAction;
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
import org.eclipse.ui.help.WorkbenchHelp;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The "Clear" action of the Memory view.
|
||||||
*
|
|
||||||
* @since: Oct 21, 2002
|
|
||||||
*/
|
*/
|
||||||
public class ClearMemoryAction extends SelectionProviderAction implements IUpdate
|
public class ClearMemoryAction extends SelectionProviderAction implements IUpdate {
|
||||||
{
|
|
||||||
private MemoryViewer fMemoryViewer;
|
private MemoryViewer fMemoryViewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for ClearMemoryAction.
|
* Constructor for ClearMemoryAction.
|
||||||
* @param provider
|
|
||||||
* @param text
|
|
||||||
*/
|
*/
|
||||||
public ClearMemoryAction( MemoryViewer viewer )
|
public ClearMemoryAction( MemoryViewer viewer ) {
|
||||||
{
|
super( viewer, ActionMessages.getString( "ClearMemoryAction.0" ) ); //$NON-NLS-1$
|
||||||
super( viewer, CDebugUIPlugin.getResourceString("internal.ui.actions.ClearMemoryAction.Clear") ); //$NON-NLS-1$
|
|
||||||
fMemoryViewer = viewer;
|
fMemoryViewer = viewer;
|
||||||
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_MEMORY_CLEAR );
|
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_MEMORY_CLEAR );
|
||||||
setDescription( CDebugUIPlugin.getResourceString("internal.ui.actions.ClearMemoryAction.Clear_Memory_Block") ); //$NON-NLS-1$
|
setDescription( ActionMessages.getString( "ClearMemoryAction.1" ) ); //$NON-NLS-1$
|
||||||
setToolTipText( CDebugUIPlugin.getResourceString("internal.ui.actions.ClearMemoryAction.Clear") ); //$NON-NLS-1$
|
setToolTipText( ActionMessages.getString( "ClearMemoryAction.2" ) ); //$NON-NLS-1$
|
||||||
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.MEMORY_CLEAR_ACTION );
|
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.MEMORY_CLEAR_ACTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
setEnabled( fMemoryViewer.canUpdate() );
|
setEnabled( fMemoryViewer.canUpdate() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.action.IAction#run()
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run() {
|
||||||
{
|
|
||||||
fMemoryViewer.clear();
|
fMemoryViewer.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICVariable;
|
import org.eclipse.cdt.debug.core.model.ICVariable;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.core.runtime.MultiStatus;
|
import org.eclipse.core.runtime.MultiStatus;
|
||||||
|
@ -21,122 +24,105 @@ import org.eclipse.ui.IViewActionDelegate;
|
||||||
import org.eclipse.ui.IViewPart;
|
import org.eclipse.ui.IViewPart;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The delegate of the "Enable" action contribution to the "IVariable" objects.
|
||||||
*
|
|
||||||
* @since Jun 19, 2003
|
|
||||||
*/
|
*/
|
||||||
public class EnableVariablesActionDelegate implements IViewActionDelegate
|
public class EnableVariablesActionDelegate implements IViewActionDelegate {
|
||||||
{
|
|
||||||
private IViewPart fView;
|
private IViewPart fView;
|
||||||
|
|
||||||
private IAction fAction;
|
private IAction fAction;
|
||||||
|
|
||||||
public EnableVariablesActionDelegate()
|
public EnableVariablesActionDelegate() {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IViewPart getView()
|
protected IViewPart getView() {
|
||||||
{
|
|
||||||
return fView;
|
return fView;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setView( IViewPart view )
|
protected void setView( IViewPart view ) {
|
||||||
{
|
|
||||||
fView = view;
|
fView = view;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IAction getAction()
|
protected IAction getAction() {
|
||||||
{
|
|
||||||
return fAction;
|
return fAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setAction( IAction action )
|
protected void setAction( IAction action ) {
|
||||||
{
|
|
||||||
fAction = action;
|
fAction = action;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This action enables variables.
|
* This action enables variables.
|
||||||
*/
|
*/
|
||||||
protected boolean isEnableAction()
|
protected boolean isEnableAction() {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
|
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
|
||||||
*/
|
*/
|
||||||
public void init( IViewPart view )
|
public void init( IViewPart view ) {
|
||||||
{
|
setView( view );
|
||||||
setView(view);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||||
*/
|
*/
|
||||||
public void run( IAction action )
|
public void run( IAction action ) {
|
||||||
{
|
|
||||||
IStructuredSelection selection = getSelection();
|
IStructuredSelection selection = getSelection();
|
||||||
final int size = selection.size();
|
final int size = selection.size();
|
||||||
if ( size == 0 )
|
if ( size == 0 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
final Iterator enum = selection.iterator();
|
final Iterator enum = selection.iterator();
|
||||||
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, CDebugUIPlugin.getResourceString("internal.ui.actions.EnableVariablesActionDelegate.Exceptions_occurred_enabling_the_variables"), null ); //$NON-NLS-1$
|
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString( "EnableVariablesActionDelegate.0" ), null ); //$NON-NLS-1$
|
||||||
BusyIndicator.showWhile(
|
BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
|
||||||
Display.getCurrent(),
|
|
||||||
new Runnable()
|
|
||||||
{
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
while( enum.hasNext() )
|
|
||||||
{
|
|
||||||
ICVariable var = (ICVariable)enum.next();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( size > 1 )
|
|
||||||
{
|
|
||||||
if ( isEnableAction() )
|
|
||||||
var.setEnabled( true );
|
|
||||||
else
|
|
||||||
var.setEnabled( false );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
var.setEnabled( !var.isEnabled() );
|
|
||||||
}
|
|
||||||
catch( DebugException e )
|
|
||||||
{
|
|
||||||
ms.merge( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
if ( !ms.isOK() )
|
public void run() {
|
||||||
{
|
while( enum.hasNext() ) {
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.EnableVariablesActionDelegate.Enable_variables_failed."), ms ); //$NON-NLS-1$
|
ICVariable var = (ICVariable)enum.next();
|
||||||
|
try {
|
||||||
|
if ( size > 1 ) {
|
||||||
|
if ( isEnableAction() )
|
||||||
|
var.setEnabled( true );
|
||||||
|
else
|
||||||
|
var.setEnabled( false );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
var.setEnabled( !var.isEnabled() );
|
||||||
|
}
|
||||||
|
catch( DebugException e ) {
|
||||||
|
ms.merge( e.getStatus() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
if ( !ms.isOK() ) {
|
||||||
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "EnableVariablesActionDelegate.1" ), ms ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
public void selectionChanged( IAction action, ISelection selection ) {
|
||||||
{
|
|
||||||
setAction( action );
|
setAction( action );
|
||||||
if ( !( selection instanceof IStructuredSelection ) )
|
if ( !(selection instanceof IStructuredSelection) )
|
||||||
return;
|
return;
|
||||||
IStructuredSelection sel = (IStructuredSelection)selection;
|
IStructuredSelection sel = (IStructuredSelection)selection;
|
||||||
Object o = sel.getFirstElement();
|
Object o = sel.getFirstElement();
|
||||||
if ( !( o instanceof ICVariable ) )
|
if ( !(o instanceof ICVariable) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Iterator enum = sel.iterator();
|
Iterator enum = sel.iterator();
|
||||||
boolean allEnabled = true;
|
boolean allEnabled = true;
|
||||||
boolean allDisabled = true;
|
boolean allDisabled = true;
|
||||||
while( enum.hasNext() )
|
while( enum.hasNext() ) {
|
||||||
{
|
|
||||||
ICVariable var = (ICVariable)enum.next();
|
ICVariable var = (ICVariable)enum.next();
|
||||||
if ( !var.canEnableDisable() )
|
if ( !var.canEnableDisable() )
|
||||||
continue;
|
continue;
|
||||||
|
@ -145,20 +131,17 @@ public class EnableVariablesActionDelegate implements IViewActionDelegate
|
||||||
else
|
else
|
||||||
allEnabled = false;
|
allEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isEnableAction() )
|
if ( isEnableAction() )
|
||||||
action.setEnabled( !allEnabled );
|
action.setEnabled( !allEnabled );
|
||||||
else
|
else
|
||||||
action.setEnabled( !allDisabled );
|
action.setEnabled( !allDisabled );
|
||||||
}
|
}
|
||||||
|
|
||||||
private IStructuredSelection getSelection()
|
private IStructuredSelection getSelection() {
|
||||||
{
|
|
||||||
return (IStructuredSelection)getView().getViewSite().getSelectionProvider().getSelection();
|
return (IStructuredSelection)getView().getViewSite().getSelectionProvider().getSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void update()
|
protected void update() {
|
||||||
{
|
|
||||||
getView().getViewSite().getSelectionProvider().setSelection( getView().getViewSite().getSelectionProvider().getSelection() );
|
getView().getViewSite().getSelectionProvider().setSelection( getView().getViewSite().getSelectionProvider().getSelection() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.debug.internal.ui.DebugPluginImages;
|
import org.eclipse.debug.internal.ui.DebugPluginImages;
|
||||||
|
@ -20,122 +25,107 @@ import org.eclipse.swt.widgets.Control;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The "Add Expression" dialog.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Sep 17, 2002
|
|
||||||
*/
|
*/
|
||||||
public class ExpressionDialog extends Dialog
|
public class ExpressionDialog extends Dialog {
|
||||||
{
|
|
||||||
private Button fBtnOk = null;
|
private Button fBtnOk = null;
|
||||||
|
|
||||||
private Text fTextExpression;
|
private Text fTextExpression;
|
||||||
|
|
||||||
private String fExpression = ""; //$NON-NLS-1$
|
private String fExpression = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for ExpressionDialog.
|
* Constructor for ExpressionDialog.
|
||||||
|
*
|
||||||
* @param parentShell
|
* @param parentShell
|
||||||
*/
|
*/
|
||||||
public ExpressionDialog( Shell parentShell, String expression )
|
public ExpressionDialog( Shell parentShell, String expression ) {
|
||||||
{
|
|
||||||
super( parentShell );
|
super( parentShell );
|
||||||
if ( expression != null )
|
if ( expression != null )
|
||||||
fExpression = expression;
|
fExpression = expression;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void configureShell( Shell shell )
|
protected void configureShell( Shell shell ) {
|
||||||
{
|
|
||||||
super.configureShell( shell );
|
super.configureShell( shell );
|
||||||
shell.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.ExpressionDialog.Add_Expression") ); //$NON-NLS-1$
|
shell.setText( ActionMessages.getString( "ExpressionDialog.0" ) ); //$NON-NLS-1$
|
||||||
shell.setImage( DebugPluginImages.getImage( IDebugUIConstants.IMG_OBJS_EXPRESSION ) );
|
shell.setImage( DebugPluginImages.getImage( IDebugUIConstants.IMG_OBJS_EXPRESSION ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Control createContents( Composite parent )
|
protected Control createContents( Composite parent ) {
|
||||||
{
|
|
||||||
Control control = super.createContents( parent );
|
Control control = super.createContents( parent );
|
||||||
setOkButtonState();
|
setOkButtonState();
|
||||||
return control;
|
return control;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Control createDialogArea( Composite parent )
|
protected Control createDialogArea( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NONE );
|
Composite composite = new Composite( parent, SWT.NONE );
|
||||||
composite.setLayout( new GridLayout() );
|
composite.setLayout( new GridLayout() );
|
||||||
((GridLayout)composite.getLayout()).marginWidth = 10;
|
((GridLayout)composite.getLayout()).marginWidth = 10;
|
||||||
composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
|
composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
|
||||||
createDataWidgets( composite );
|
createDataWidgets( composite );
|
||||||
initializeDataWidgets();
|
initializeDataWidgets();
|
||||||
return composite;
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createButtonsForButtonBar( Composite parent )
|
protected void createButtonsForButtonBar( Composite parent ) {
|
||||||
{
|
|
||||||
fBtnOk = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
|
fBtnOk = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true );
|
||||||
createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
|
createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createDataWidgets( Composite parent )
|
private void createDataWidgets( Composite parent ) {
|
||||||
{
|
fTextExpression = createExpressionText( parent );
|
||||||
fTextExpression = createExpressionText( parent );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeDataWidgets()
|
private void initializeDataWidgets() {
|
||||||
{
|
|
||||||
fTextExpression.setText( fExpression );
|
fTextExpression.setText( fExpression );
|
||||||
fTextExpression.setSelection( fExpression.length() );
|
fTextExpression.setSelection( fExpression.length() );
|
||||||
fTextExpression.selectAll();
|
fTextExpression.selectAll();
|
||||||
setOkButtonState();
|
setOkButtonState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Text createExpressionText( Composite parent )
|
private Text createExpressionText( Composite parent ) {
|
||||||
{
|
|
||||||
Label label = new Label( parent, SWT.RIGHT );
|
Label label = new Label( parent, SWT.RIGHT );
|
||||||
label.setText( CDebugUIPlugin.getResourceString("internal.ui.actions.ExpressionDialog.Expression_to_add") ); //$NON-NLS-1$
|
label.setText( ActionMessages.getString( "ExpressionDialog.1" ) ); //$NON-NLS-1$
|
||||||
final Text text = new Text( parent, SWT.BORDER );
|
final Text text = new Text( parent, SWT.BORDER );
|
||||||
GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
|
GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
|
||||||
gridData.widthHint = 300;
|
gridData.widthHint = 300;
|
||||||
text.setLayoutData( gridData );
|
text.setLayoutData( gridData );
|
||||||
addModifyListener( text );
|
addModifyListener( text );
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setOkButtonState()
|
protected void setOkButtonState() {
|
||||||
{
|
|
||||||
if ( fBtnOk == null )
|
if ( fBtnOk == null )
|
||||||
return;
|
return;
|
||||||
fBtnOk.setEnabled( fTextExpression.getText().trim().length() > 0 );
|
fBtnOk.setEnabled( fTextExpression.getText().trim().length() > 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void storeData()
|
private void storeData() {
|
||||||
{
|
|
||||||
fExpression = fTextExpression.getText().trim();
|
fExpression = fTextExpression.getText().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addModifyListener( Text text )
|
private void addModifyListener( Text text ) {
|
||||||
{
|
text.addModifyListener( new ModifyListener() {
|
||||||
text.addModifyListener(
|
|
||||||
new ModifyListener()
|
public void modifyText( ModifyEvent e ) {
|
||||||
{
|
setOkButtonState();
|
||||||
public void modifyText( ModifyEvent e )
|
}
|
||||||
{
|
} );
|
||||||
setOkButtonState();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExpression()
|
public String getExpression() {
|
||||||
{
|
|
||||||
return fExpression;
|
return fExpression;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
|
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
|
||||||
*/
|
*/
|
||||||
protected void okPressed()
|
protected void okPressed() {
|
||||||
{
|
|
||||||
storeData();
|
storeData();
|
||||||
super.okPressed();
|
super.okPressed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
|
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
|
||||||
|
@ -14,24 +19,20 @@ import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The "Format" action of the Memory view.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Nov 3, 2002
|
|
||||||
*/
|
*/
|
||||||
public class MemoryFormatAction extends Action implements IUpdate
|
public class MemoryFormatAction extends Action implements IUpdate {
|
||||||
{
|
|
||||||
private MemoryActionSelectionGroup fGroup;
|
private MemoryActionSelectionGroup fGroup;
|
||||||
|
|
||||||
private MemoryViewer fMemoryViewer;
|
private MemoryViewer fMemoryViewer;
|
||||||
|
|
||||||
private int fFormat = 0;
|
private int fFormat = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for MemoryFormatAction.
|
* Constructor for MemoryFormatAction.
|
||||||
*/
|
*/
|
||||||
public MemoryFormatAction( MemoryActionSelectionGroup group,
|
public MemoryFormatAction( MemoryActionSelectionGroup group, MemoryViewer viewer, int format ) {
|
||||||
MemoryViewer viewer,
|
|
||||||
int format )
|
|
||||||
{
|
|
||||||
super( getLabel( format ), IAction.AS_CHECK_BOX );
|
super( getLabel( format ), IAction.AS_CHECK_BOX );
|
||||||
fGroup = group;
|
fGroup = group;
|
||||||
fMemoryViewer = viewer;
|
fMemoryViewer = viewer;
|
||||||
|
@ -41,49 +42,44 @@ public class MemoryFormatAction extends Action implements IUpdate
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
setEnabled( fMemoryViewer.canChangeFormat( fFormat ) );
|
setEnabled( fMemoryViewer.canChangeFormat( fFormat ) );
|
||||||
setChecked( fMemoryViewer.getCurrentFormat() == fFormat );
|
setChecked( fMemoryViewer.getCurrentFormat() == fFormat );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.action.IAction#run()
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
fMemoryViewer.setFormat( fFormat );
|
fMemoryViewer.setFormat( fFormat );
|
||||||
fGroup.setCurrentSelection( this );
|
fGroup.setCurrentSelection( this );
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
catch( DebugException e ) {
|
||||||
{
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "MemoryFormatAction.0" ), e.getStatus() ); //$NON-NLS-1$
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.MemoryFormatAction.Unable_to_change_format"), e.getStatus() ); //$NON-NLS-1$
|
|
||||||
setChecked( false );
|
setChecked( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getLabel( int id )
|
private static String getLabel( int id ) {
|
||||||
{
|
|
||||||
String label = ""; //$NON-NLS-1$
|
String label = ""; //$NON-NLS-1$
|
||||||
switch( id )
|
switch( id ) {
|
||||||
{
|
case (IFormattedMemoryBlock.MEMORY_FORMAT_HEX ):
|
||||||
case( IFormattedMemoryBlock.MEMORY_FORMAT_HEX ):
|
label = ActionMessages.getString( "MemoryFormatAction.1" ); //$NON-NLS-1$
|
||||||
label = CDebugUIPlugin.getResourceString("internal.ui.actions.MemoryFormatAction.Hexadecimal"); //$NON-NLS-1$
|
|
||||||
break;
|
break;
|
||||||
case( IFormattedMemoryBlock.MEMORY_FORMAT_SIGNED_DECIMAL ):
|
case (IFormattedMemoryBlock.MEMORY_FORMAT_SIGNED_DECIMAL ):
|
||||||
label = CDebugUIPlugin.getResourceString("internal.ui.actions.MemoryFormatAction.Signed_Decimal"); //$NON-NLS-1$
|
label = ActionMessages.getString( "MemoryFormatAction.2" ); //$NON-NLS-1$
|
||||||
break;
|
break;
|
||||||
case( IFormattedMemoryBlock.MEMORY_FORMAT_UNSIGNED_DECIMAL ):
|
case (IFormattedMemoryBlock.MEMORY_FORMAT_UNSIGNED_DECIMAL ):
|
||||||
label = CDebugUIPlugin.getResourceString("internal.ui.actions.MemoryFormatAction.Unsigned_Decimal"); //$NON-NLS-1$
|
label = ActionMessages.getString( "MemoryFormatAction.3" ); //$NON-NLS-1$
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getActionId()
|
public String getActionId() {
|
||||||
{
|
|
||||||
return "MemoryFormat" + fFormat; //$NON-NLS-1$
|
return "MemoryFormat" + fFormat; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
||||||
|
@ -13,66 +18,57 @@ import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The "Number Of Memory View Coulumns" action.
|
||||||
*
|
|
||||||
* @since: Oct 25, 2002
|
|
||||||
*/
|
*/
|
||||||
public class MemoryNumberOfColumnAction extends Action implements IUpdate
|
public class MemoryNumberOfColumnAction extends Action implements IUpdate {
|
||||||
{
|
|
||||||
private MemoryActionSelectionGroup fGroup;
|
private MemoryActionSelectionGroup fGroup;
|
||||||
|
|
||||||
private MemoryViewer fMemoryViewer;
|
private MemoryViewer fMemoryViewer;
|
||||||
|
|
||||||
private int fNumberOfColumns = 0;
|
private int fNumberOfColumns = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for MemoryNumberOfColumnAction.
|
* Constructor for MemoryNumberOfColumnAction.
|
||||||
*/
|
*/
|
||||||
public MemoryNumberOfColumnAction( MemoryActionSelectionGroup group,
|
public MemoryNumberOfColumnAction( MemoryActionSelectionGroup group, MemoryViewer viewer, int numberOfColumns ) {
|
||||||
MemoryViewer viewer,
|
|
||||||
int numberOfColumns )
|
|
||||||
{
|
|
||||||
super( getLabel( numberOfColumns ), IAction.AS_CHECK_BOX );
|
super( getLabel( numberOfColumns ), IAction.AS_CHECK_BOX );
|
||||||
fGroup = group;
|
fGroup = group;
|
||||||
fMemoryViewer = viewer;
|
fMemoryViewer = viewer;
|
||||||
fNumberOfColumns = numberOfColumns;
|
fNumberOfColumns = numberOfColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getLabel( int numberOfColumns )
|
private static String getLabel( int numberOfColumns ) {
|
||||||
{
|
return CDebugUIPlugin.getFormattedString( ActionMessages.getString( "MemoryNumberOfColumnAction.0" ), new Integer( numberOfColumns ) ); //$NON-NLS-1$
|
||||||
//String col = CDebugUIPlugin.getResourceString("internal.ui.actions.MemoryNumberOfColumnsAction.column");
|
|
||||||
//String cols = CDebugUIPlugin.getResourceString("internal.ui.actions.MemoryNumberOfColumnsAction.columns");
|
|
||||||
//ChoiceFormat myform = new ChoiceFormat("0# "+cols+"|1# "+col+"|2# "+cols);
|
|
||||||
//return Integer.toString( numberOfColumns) + myform.format(numberOfColumns);
|
|
||||||
return CDebugUIPlugin.getFormattedString("internal.ui.actions.MemoryNumberOfColumnsAction.number_of_columns", new Integer(numberOfColumns)); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
setEnabled( fMemoryViewer.canUpdate() );
|
setEnabled( fMemoryViewer.canUpdate() );
|
||||||
setChecked( fMemoryViewer.getCurrentNumberOfColumns() == fNumberOfColumns );
|
setChecked( fMemoryViewer.getCurrentNumberOfColumns() == fNumberOfColumns );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.action.IAction#run()
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
fMemoryViewer.setNumberOfColumns( fNumberOfColumns );
|
fMemoryViewer.setNumberOfColumns( fNumberOfColumns );
|
||||||
fGroup.setCurrentSelection( this );
|
fGroup.setCurrentSelection( this );
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
catch( DebugException e ) {
|
||||||
{
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "MemoryNumberOfColumnAction.1" ), e.getStatus() ); //$NON-NLS-1$
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.MemoryNumberOfColumnAction.Unable_to_change_the_column_number."), e.getStatus() ); //$NON-NLS-1$
|
|
||||||
setChecked( false );
|
setChecked( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getActionId()
|
public String getActionId() {
|
||||||
{
|
|
||||||
return "MemoryNumberOfColumns" + fNumberOfColumns; //$NON-NLS-1$
|
return "MemoryNumberOfColumns" + fNumberOfColumns; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
|
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
|
||||||
|
@ -14,75 +19,69 @@ import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The "Memory Unit Size" action.
|
||||||
*
|
|
||||||
* @since: Oct 22, 2002
|
|
||||||
*/
|
*/
|
||||||
public class MemorySizeAction extends Action implements IUpdate
|
public class MemorySizeAction extends Action implements IUpdate {
|
||||||
{
|
|
||||||
private MemoryActionSelectionGroup fGroup;
|
private MemoryActionSelectionGroup fGroup;
|
||||||
|
|
||||||
private MemoryViewer fMemoryViewer;
|
private MemoryViewer fMemoryViewer;
|
||||||
|
|
||||||
private int fId = 0;
|
private int fId = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for MemorySizeAction.
|
* Constructor for MemorySizeAction.
|
||||||
*/
|
*/
|
||||||
public MemorySizeAction( MemoryActionSelectionGroup group,
|
public MemorySizeAction( MemoryActionSelectionGroup group, MemoryViewer viewer, int id ) {
|
||||||
MemoryViewer viewer,
|
|
||||||
int id )
|
|
||||||
{
|
|
||||||
super( getLabel( id ), IAction.AS_CHECK_BOX );
|
super( getLabel( id ), IAction.AS_CHECK_BOX );
|
||||||
fGroup = group;
|
fGroup = group;
|
||||||
fMemoryViewer = viewer;
|
fMemoryViewer = viewer;
|
||||||
fId = id;
|
fId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
setEnabled( fMemoryViewer.canUpdate() );
|
setEnabled( fMemoryViewer.canUpdate() );
|
||||||
setChecked( fMemoryViewer.getCurrentWordSize() == fId );
|
setChecked( fMemoryViewer.getCurrentWordSize() == fId );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getLabel( int id )
|
private static String getLabel( int id ) {
|
||||||
{
|
|
||||||
String label = ""; //$NON-NLS-1$
|
String label = ""; //$NON-NLS-1$
|
||||||
|
switch( id ) {
|
||||||
switch( id )
|
case IFormattedMemoryBlock.MEMORY_SIZE_BYTE:
|
||||||
{
|
case IFormattedMemoryBlock.MEMORY_SIZE_HALF_WORD:
|
||||||
case( IFormattedMemoryBlock.MEMORY_SIZE_BYTE ):
|
case IFormattedMemoryBlock.MEMORY_SIZE_WORD:
|
||||||
case( IFormattedMemoryBlock.MEMORY_SIZE_HALF_WORD ):
|
case IFormattedMemoryBlock.MEMORY_SIZE_DOUBLE_WORD:
|
||||||
case( IFormattedMemoryBlock.MEMORY_SIZE_WORD ):
|
// Examples of the display for the following value are "1 byte" and "8 bytes".
|
||||||
case( IFormattedMemoryBlock.MEMORY_SIZE_DOUBLE_WORD ):
|
// Normally placeholders in {} are not translated, except when they are choice forms,
|
||||||
// English value of key is "{0, number} {0, choice, 1#byte|2#bytes}"
|
// where the strings after each "#" are to be translated.
|
||||||
label = CDebugUIPlugin.getFormattedString("internal.ui.actions.MemorySizeAction.byte_bytes", new Integer(id)); //$NON-NLS-1$
|
label = CDebugUIPlugin.getFormattedString( ActionMessages.getString( "MemorySizeAction.0" ), new Integer( id ) ); //$NON-NLS-1$
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.action.IAction#run()
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run() {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
fMemoryViewer.setWordSize( fId );
|
fMemoryViewer.setWordSize( fId );
|
||||||
fGroup.setCurrentSelection( this );
|
fGroup.setCurrentSelection( this );
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
catch( DebugException e ) {
|
||||||
{
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "MemorySizeAction.1" ), e.getStatus() ); //$NON-NLS-1$
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("MemorySizeAction.Unable_to_change_memory_unit_size"), e.getStatus() ); //$NON-NLS-1$
|
|
||||||
setChecked( false );
|
setChecked( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getActionId()
|
public String getActionId() {
|
||||||
{
|
|
||||||
return "MemorySize" + fId; //$NON-NLS-1$
|
return "MemorySize" + fId; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
||||||
|
@ -11,45 +16,41 @@ import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
||||||
import org.eclipse.ui.actions.SelectionProviderAction;
|
import org.eclipse.ui.actions.SelectionProviderAction;
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
import org.eclipse.ui.help.WorkbenchHelp;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The "Refresh" action of the Memory view.
|
||||||
*
|
|
||||||
* @since: Oct 18, 2002
|
|
||||||
*/
|
*/
|
||||||
public class RefreshMemoryAction extends SelectionProviderAction implements IUpdate
|
public class RefreshMemoryAction extends SelectionProviderAction implements IUpdate {
|
||||||
{
|
|
||||||
private MemoryViewer fMemoryViewer;
|
private MemoryViewer fMemoryViewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for RefreshMemoryAction.
|
* Constructor for RefreshMemoryAction.
|
||||||
* @param provider
|
|
||||||
* @param text
|
|
||||||
*/
|
*/
|
||||||
public RefreshMemoryAction( MemoryViewer viewer )
|
public RefreshMemoryAction( MemoryViewer viewer ) {
|
||||||
{
|
|
||||||
super( viewer, "Refresh" ); //$NON-NLS-1$
|
super( viewer, "Refresh" ); //$NON-NLS-1$
|
||||||
fMemoryViewer = viewer;
|
fMemoryViewer = viewer;
|
||||||
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_REFRESH );
|
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_REFRESH );
|
||||||
setDescription( CDebugUIPlugin.getResourceString("internal.ui.actions.RefreshMemoryAction.Refresh_Memory_Block") ); //$NON-NLS-1$
|
setDescription( ActionMessages.getString( "RefreshMemoryAction.0" ) ); //$NON-NLS-1$
|
||||||
setToolTipText( CDebugUIPlugin.getResourceString("internal.ui.actions.RefreshMemoryAction.Refresh") ); //$NON-NLS-1$
|
setToolTipText( ActionMessages.getString( "RefreshMemoryAction.1" ) ); //$NON-NLS-1$
|
||||||
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.REFRESH_MEMORY_ACTION );
|
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.REFRESH_MEMORY_ACTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
setEnabled( fMemoryViewer.canUpdate() );
|
setEnabled( fMemoryViewer.canUpdate() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.action.IAction#run()
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run() {
|
||||||
{
|
|
||||||
fMemoryViewer.refreshMemoryBlock();
|
fMemoryViewer.refreshMemoryBlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,79 +1,75 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.IRestart;
|
import org.eclipse.cdt.debug.core.model.IRestart;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The delegate of the "Restart" action.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Aug 23, 2002
|
|
||||||
*/
|
*/
|
||||||
public class RestartActionDelegate extends AbstractListenerActionDelegate
|
public class RestartActionDelegate extends AbstractListenerActionDelegate {
|
||||||
{
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(Object)
|
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(Object)
|
||||||
*/
|
*/
|
||||||
protected void doAction( Object element ) throws DebugException
|
protected void doAction( Object element ) throws DebugException {
|
||||||
{
|
if ( element instanceof IRestart ) {
|
||||||
if ( element instanceof IRestart )
|
|
||||||
{
|
|
||||||
((IRestart)element).restart();
|
((IRestart)element).restart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(Object)
|
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(Object)
|
||||||
*/
|
*/
|
||||||
protected boolean isEnabledFor( Object element )
|
protected boolean isEnabledFor( Object element ) {
|
||||||
{
|
if ( element instanceof IRestart ) {
|
||||||
if ( element instanceof IRestart )
|
|
||||||
{
|
|
||||||
return checkCapability( (IRestart)element );
|
return checkCapability( (IRestart)element );
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean checkCapability( IRestart element )
|
protected boolean checkCapability( IRestart element ) {
|
||||||
{
|
|
||||||
return element.canRestart();
|
return element.canRestart();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractDebugActionDelegate#enableForMultiSelection()
|
* @see AbstractDebugActionDelegate#enableForMultiSelection()
|
||||||
*/
|
*/
|
||||||
protected boolean enableForMultiSelection()
|
protected boolean enableForMultiSelection() {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractDebugActionDelegate#getStatusMessage()
|
* @see AbstractDebugActionDelegate#getStatusMessage()
|
||||||
*/
|
*/
|
||||||
protected String getStatusMessage()
|
protected String getStatusMessage() {
|
||||||
{
|
return ActionMessages.getString( "RestartActionDelegate.0" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.actions.RestartActionDelegate.Exceptions_occurred_attempting_to_restart"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractDebugActionDelegate#getErrorDialogMessage()
|
* @see AbstractDebugActionDelegate#getErrorDialogMessage()
|
||||||
*/
|
*/
|
||||||
protected String getErrorDialogMessage()
|
protected String getErrorDialogMessage() {
|
||||||
{
|
return ActionMessages.getString( "RestartActionDelegate.1" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.actions.RestartActionDelegate.Restart_failed"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractDebugActionDelegate#getErrorDialogTitle()
|
* @see AbstractDebugActionDelegate#getErrorDialogTitle()
|
||||||
*/
|
*/
|
||||||
protected String getErrorDialogTitle()
|
protected String getErrorDialogTitle() {
|
||||||
{
|
return ActionMessages.getString( "RestartActionDelegate.2" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.actions.RestartActionDelegate.Restart"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICastToType;
|
import org.eclipse.cdt.debug.core.model.ICastToType;
|
||||||
|
@ -21,92 +25,73 @@ import org.eclipse.ui.IWorkbenchWindow;
|
||||||
import org.eclipse.ui.actions.ActionDelegate;
|
import org.eclipse.ui.actions.ActionDelegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The delegate of the "Restore Default Type" action.
|
||||||
*
|
|
||||||
* @since Mar 9, 2003
|
|
||||||
*/
|
*/
|
||||||
public class RestoreDefaultTypeActionDelegate extends ActionDelegate
|
public class RestoreDefaultTypeActionDelegate extends ActionDelegate implements IObjectActionDelegate {
|
||||||
implements IObjectActionDelegate
|
|
||||||
{
|
|
||||||
private ICastToType fCastToType = null;
|
private ICastToType fCastToType = null;
|
||||||
|
|
||||||
private IStatus fStatus = null;
|
private IStatus fStatus = null;
|
||||||
|
|
||||||
/**
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
*/
|
|
||||||
public RestoreDefaultTypeActionDelegate()
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
|
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
|
||||||
*/
|
*/
|
||||||
public void setActivePart( IAction action, IWorkbenchPart targetPart )
|
public void setActivePart( IAction action, IWorkbenchPart targetPart ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICastToType getCastToType()
|
protected ICastToType getCastToType() {
|
||||||
{
|
|
||||||
return fCastToType;
|
return fCastToType;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setCastToType( ICastToType castToType )
|
protected void setCastToType( ICastToType castToType ) {
|
||||||
{
|
|
||||||
fCastToType = castToType;
|
fCastToType = castToType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||||
*/
|
*/
|
||||||
public void run( IAction action )
|
public void run( IAction action ) {
|
||||||
{
|
|
||||||
if ( getCastToType() == null )
|
if ( getCastToType() == null )
|
||||||
return;
|
return;
|
||||||
BusyIndicator.showWhile( Display.getCurrent(),
|
BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
|
||||||
new Runnable()
|
|
||||||
{
|
public void run() {
|
||||||
public void run()
|
try {
|
||||||
{
|
doAction( getCastToType() );
|
||||||
try
|
setStatus( null );
|
||||||
{
|
}
|
||||||
doAction( getCastToType() );
|
catch( DebugException e ) {
|
||||||
setStatus( null );
|
setStatus( e.getStatus() );
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
}
|
||||||
{
|
} );
|
||||||
setStatus( e.getStatus() );
|
if ( getStatus() != null && !getStatus().isOK() ) {
|
||||||
}
|
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
||||||
}
|
if ( window != null ) {
|
||||||
} );
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "RestoreDefaultTypeActionDelegate.0" ), getStatus() ); //$NON-NLS-1$
|
||||||
if ( getStatus() != null && !getStatus().isOK() )
|
}
|
||||||
{
|
else {
|
||||||
IWorkbenchWindow window= CDebugUIPlugin.getActiveWorkbenchWindow();
|
|
||||||
if ( window != null )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.RestoreDefaultTypeActionDelegate.Unable_to_cast_type"), getStatus() ); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.log( getStatus() );
|
CDebugUIPlugin.log( getStatus() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
public void selectionChanged( IAction action, ISelection selection ) {
|
||||||
{
|
if ( selection instanceof IStructuredSelection ) {
|
||||||
if ( selection instanceof IStructuredSelection )
|
|
||||||
{
|
|
||||||
Object element = ((IStructuredSelection)selection).getFirstElement();
|
Object element = ((IStructuredSelection)selection).getFirstElement();
|
||||||
if ( element instanceof ICastToType )
|
if ( element instanceof ICastToType ) {
|
||||||
{
|
|
||||||
boolean enabled = ((ICastToType)element).isCasted();
|
boolean enabled = ((ICastToType)element).isCasted();
|
||||||
action.setEnabled( enabled );
|
action.setEnabled( enabled );
|
||||||
if ( enabled )
|
if ( enabled ) {
|
||||||
{
|
|
||||||
setCastToType( (ICastToType)element );
|
setCastToType( (ICastToType)element );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -116,18 +101,15 @@ public class RestoreDefaultTypeActionDelegate extends ActionDelegate
|
||||||
setCastToType( null );
|
setCastToType( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
public IStatus getStatus()
|
public IStatus getStatus() {
|
||||||
{
|
|
||||||
return fStatus;
|
return fStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStatus( IStatus status )
|
public void setStatus( IStatus status ) {
|
||||||
{
|
|
||||||
fStatus = status;
|
fStatus = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doAction( ICastToType castToType ) throws DebugException
|
protected void doAction( ICastToType castToType ) throws DebugException {
|
||||||
{
|
|
||||||
castToType.restoreDefault();
|
castToType.restoreDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
||||||
|
@ -11,46 +16,47 @@ import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
||||||
import org.eclipse.ui.actions.SelectionProviderAction;
|
import org.eclipse.ui.actions.SelectionProviderAction;
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
import org.eclipse.ui.help.WorkbenchHelp;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* Enter type comment.
|
||||||
*
|
*
|
||||||
* @since: Oct 21, 2002
|
* @since: Oct 21, 2002
|
||||||
*/
|
*/
|
||||||
public class ShowAsciiAction extends SelectionProviderAction implements IUpdate
|
public class ShowAsciiAction extends SelectionProviderAction implements IUpdate {
|
||||||
{
|
|
||||||
private MemoryViewer fMemoryViewer;
|
private MemoryViewer fMemoryViewer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for ShowAsciiAction.
|
* Constructor for ShowAsciiAction.
|
||||||
|
*
|
||||||
* @param provider
|
* @param provider
|
||||||
* @param text
|
* @param text
|
||||||
*/
|
*/
|
||||||
public ShowAsciiAction( MemoryViewer viewer )
|
public ShowAsciiAction( MemoryViewer viewer ) {
|
||||||
{
|
super( viewer, ActionMessages.getString( "ShowAsciiAction.0" ) ); //$NON-NLS-1$
|
||||||
super( viewer, CDebugUIPlugin.getResourceString("internal.ui.actions.ShowAsciiAction.Show_ASCII") ); //$NON-NLS-1$
|
|
||||||
fMemoryViewer = viewer;
|
fMemoryViewer = viewer;
|
||||||
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_SHOW_ASCII );
|
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_SHOW_ASCII );
|
||||||
setDescription( CDebugUIPlugin.getResourceString("internal.ui.actions.ShowAsciiAction.Show_ASCII") ); //$NON-NLS-1$
|
setDescription( ActionMessages.getString( "ShowAsciiAction.1" ) ); //$NON-NLS-1$
|
||||||
setToolTipText( CDebugUIPlugin.getResourceString("internal.ui.actions.ShowAsciiAction.Show_ASCII") ); //$NON-NLS-1$
|
setToolTipText( ActionMessages.getString( "ShowAsciiAction.2" ) ); //$NON-NLS-1$
|
||||||
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.MEMORY_SHOW_ASCII_ACTION );
|
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.MEMORY_SHOW_ASCII_ACTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
public void update()
|
public void update() {
|
||||||
{
|
|
||||||
setEnabled( fMemoryViewer.canShowAscii() );
|
setEnabled( fMemoryViewer.canShowAscii() );
|
||||||
setChecked( fMemoryViewer.showAscii() );
|
setChecked( fMemoryViewer.showAscii() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.action.IAction#run()
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
*/
|
*/
|
||||||
public void run()
|
public void run() {
|
||||||
{
|
|
||||||
fMemoryViewer.setShowAscii( isChecked() );
|
fMemoryViewer.setShowAscii( isChecked() );
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,97 +0,0 @@
|
||||||
/*
|
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
|
||||||
* All Rights Reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
import org.eclipse.debug.ui.IDebugModelPresentation;
|
|
||||||
import org.eclipse.debug.ui.IDebugView;
|
|
||||||
import org.eclipse.jface.action.Action;
|
|
||||||
import org.eclipse.jface.action.IAction;
|
|
||||||
import org.eclipse.jface.viewers.StructuredViewer;
|
|
||||||
import org.eclipse.swt.custom.BusyIndicator;
|
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* An action that toggles the state of a viewer to show/hide type names
|
|
||||||
* of registers.
|
|
||||||
*
|
|
||||||
* @since Sep 16, 2002
|
|
||||||
*/
|
|
||||||
public class ShowRegisterTypesAction extends Action
|
|
||||||
{
|
|
||||||
private IDebugView fView;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor for ShowRegisterTypesAction.
|
|
||||||
*/
|
|
||||||
public ShowRegisterTypesAction( IDebugView view )
|
|
||||||
{
|
|
||||||
super( CDebugUIPlugin.getResourceString("internal.ui.actions.ShowRegisterTypesAction.Show_Type_Names_checkbox"), IAction.AS_CHECK_BOX ); //$NON-NLS-1$
|
|
||||||
setView( view );
|
|
||||||
setToolTipText( CDebugUIPlugin.getResourceString("internal.ui.actions.ShowRegisterTypesAction.Show_Type_Names_tooltip") ); //$NON-NLS-1$
|
|
||||||
CDebugImages.setLocalImageDescriptors( this, CDebugImages.IMG_LCL_TYPE_NAMES );
|
|
||||||
setId( CDebugUIPlugin.getUniqueIdentifier() + ".ShowTypesAction" ); //$NON-NLS-1$
|
|
||||||
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.SHOW_TYPES_ACTION );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see Action#run()
|
|
||||||
*/
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
valueChanged( isChecked() );
|
|
||||||
}
|
|
||||||
|
|
||||||
private void valueChanged( boolean on )
|
|
||||||
{
|
|
||||||
if ( getViewer().getControl().isDisposed() )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
IDebugModelPresentation debugLabelProvider = (IDebugModelPresentation)getView().getAdapter( IDebugModelPresentation.class );
|
|
||||||
if ( debugLabelProvider != null )
|
|
||||||
{
|
|
||||||
debugLabelProvider.setAttribute( IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, ( on ? Boolean.TRUE : Boolean.FALSE ) );
|
|
||||||
BusyIndicator.showWhile( getViewer().getControl().getDisplay(),
|
|
||||||
new Runnable()
|
|
||||||
{
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
getViewer().refresh();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see Action#setChecked(boolean)
|
|
||||||
*/
|
|
||||||
public void setChecked( boolean value )
|
|
||||||
{
|
|
||||||
super.setChecked( value );
|
|
||||||
valueChanged( value );
|
|
||||||
}
|
|
||||||
|
|
||||||
protected StructuredViewer getViewer()
|
|
||||||
{
|
|
||||||
if ( getView() != null && getView().getViewer() instanceof StructuredViewer )
|
|
||||||
return (StructuredViewer)getView().getViewer();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IDebugView getView()
|
|
||||||
{
|
|
||||||
return fView;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setView( IDebugView view )
|
|
||||||
{
|
|
||||||
fView = view;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/*******************************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2000, 2003 IBM Corporation and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* IBM Corporation - initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICSignal;
|
import org.eclipse.cdt.debug.core.model.ICSignal;
|
||||||
|
@ -17,85 +22,66 @@ import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.ui.IObjectActionDelegate;
|
import org.eclipse.ui.IObjectActionDelegate;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
|
import org.eclipse.ui.actions.ActionDelegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The delegate of the "Resume With Signal" action.
|
||||||
*
|
|
||||||
* @since: Jan 31, 2003
|
|
||||||
*/
|
*/
|
||||||
public class SignalActionDelegate implements IObjectActionDelegate
|
public class SignalActionDelegate extends ActionDelegate implements IObjectActionDelegate {
|
||||||
{
|
|
||||||
private ICSignal fSignal = null;
|
private ICSignal fSignal = null;
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Constructor for SignalActionDelegate.
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public SignalActionDelegate()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
|
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
|
||||||
*/
|
*/
|
||||||
public void setActivePart( IAction action, IWorkbenchPart targetPart )
|
public void setActivePart( IAction action, IWorkbenchPart targetPart ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(IAction)
|
||||||
*/
|
*/
|
||||||
public void run( IAction action )
|
public void run( IAction action ) {
|
||||||
{
|
if ( getSignal() != null ) {
|
||||||
if ( getSignal() != null )
|
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString( "SignalActionDelegate.0" ), null ); //$NON-NLS-1$
|
||||||
{
|
BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
|
||||||
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(),
|
|
||||||
DebugException.REQUEST_FAILED,
|
public void run() {
|
||||||
CDebugUIPlugin.getResourceString( "internal.ui.actions.SignalActionDelegate.Unable_to_deliver_signal_to_target" ), //$NON-NLS-1$
|
try {
|
||||||
null );
|
doAction( getSignal() );
|
||||||
BusyIndicator.showWhile( Display.getCurrent(),
|
}
|
||||||
new Runnable()
|
catch( DebugException e ) {
|
||||||
{
|
ms.merge( e.getStatus() );
|
||||||
public void run()
|
}
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
doAction( getSignal() );
|
|
||||||
}
|
|
||||||
catch( DebugException e )
|
|
||||||
{
|
|
||||||
ms.merge( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
if ( !ms.isOK() )
|
|
||||||
{
|
|
||||||
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
|
||||||
if ( window != null )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.SignalActionDelegate.Operation_failed"), ms ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
else
|
} );
|
||||||
{
|
if ( !ms.isOK() ) {
|
||||||
|
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
||||||
|
if ( window != null ) {
|
||||||
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "SignalActionDelegate.1" ), ms ); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
else {
|
||||||
CDebugUIPlugin.log( ms );
|
CDebugUIPlugin.log( ms );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
|
* @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
public void selectionChanged( IAction action, ISelection selection ) {
|
||||||
{
|
if ( selection instanceof IStructuredSelection ) {
|
||||||
if ( selection instanceof IStructuredSelection )
|
|
||||||
{
|
|
||||||
Object element = ((IStructuredSelection)selection).getFirstElement();
|
Object element = ((IStructuredSelection)selection).getFirstElement();
|
||||||
if ( element instanceof ICSignal )
|
if ( element instanceof ICSignal ) {
|
||||||
{
|
|
||||||
boolean enabled = enablesFor( (ICSignal)element );
|
boolean enabled = enablesFor( (ICSignal)element );
|
||||||
action.setEnabled( enabled );
|
action.setEnabled( enabled );
|
||||||
if ( enabled )
|
if ( enabled ) {
|
||||||
{
|
|
||||||
setSignal( (ICSignal)element );
|
setSignal( (ICSignal)element );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -105,23 +91,19 @@ public class SignalActionDelegate implements IObjectActionDelegate
|
||||||
setSignal( null );
|
setSignal( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doAction( ICSignal signal ) throws DebugException
|
protected void doAction( ICSignal signal ) throws DebugException {
|
||||||
{
|
|
||||||
signal.signal();
|
signal.signal();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean enablesFor( ICSignal signal )
|
private boolean enablesFor( ICSignal signal ) {
|
||||||
{
|
return (signal != null && signal.getDebugTarget().isSuspended());
|
||||||
return ( signal != null && signal.getDebugTarget().isSuspended() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSignal( ICSignal signal )
|
private void setSignal( ICSignal signal ) {
|
||||||
{
|
|
||||||
fSignal = signal;
|
fSignal = signal;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICSignal getSignal()
|
protected ICSignal getSignal() {
|
||||||
{
|
|
||||||
return fSignal;
|
return fSignal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal;
|
import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal;
|
||||||
|
@ -17,86 +22,66 @@ import org.eclipse.swt.widgets.Display;
|
||||||
import org.eclipse.ui.IObjectActionDelegate;
|
import org.eclipse.ui.IObjectActionDelegate;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
|
import org.eclipse.ui.actions.ActionDelegate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The object contribution delegate of the "Resume Without Signal" action.
|
||||||
*
|
|
||||||
* @since: Feb 4, 2003
|
|
||||||
*/
|
*/
|
||||||
public class SignalZeroObjectActionDelegate implements IObjectActionDelegate
|
public class SignalZeroObjectActionDelegate extends ActionDelegate implements IObjectActionDelegate {
|
||||||
{
|
|
||||||
private IResumeWithoutSignal fTarget = null;
|
private IResumeWithoutSignal fTarget = null;
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Constructor for SignalZeroObjectActionDelegate.
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public SignalZeroObjectActionDelegate()
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
|
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
|
||||||
*/
|
*/
|
||||||
public void setActivePart( IAction action, IWorkbenchPart targetPart )
|
public void setActivePart( IAction action, IWorkbenchPart targetPart ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(IAction)
|
||||||
*/
|
*/
|
||||||
public void run( IAction action )
|
public void run( IAction action ) {
|
||||||
{
|
if ( getTarget() != null ) {
|
||||||
if ( getTarget() != null )
|
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.getString( "SignalZeroObjectActionDelegate.0" ), null ); //$NON-NLS-1$
|
||||||
{
|
BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
|
||||||
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(),
|
|
||||||
DebugException.REQUEST_FAILED,
|
public void run() {
|
||||||
CDebugUIPlugin.getResourceString("internal.ui.actions.SignalZeroObjectActionDelegate.Unable_to_resume_ignoring_signal"), //$NON-NLS-1$
|
try {
|
||||||
null );
|
doAction( getTarget() );
|
||||||
BusyIndicator.showWhile( Display.getCurrent(),
|
}
|
||||||
new Runnable()
|
catch( DebugException e ) {
|
||||||
{
|
ms.merge( e.getStatus() );
|
||||||
public void run()
|
}
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
doAction( getTarget() );
|
|
||||||
}
|
|
||||||
catch( DebugException e )
|
|
||||||
{
|
|
||||||
ms.merge( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
if ( !ms.isOK() )
|
|
||||||
{
|
|
||||||
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
|
||||||
if ( window != null )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.SignalZeroObjectActionDelegate.Operation_failed"), ms ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
else
|
} );
|
||||||
{
|
if ( !ms.isOK() ) {
|
||||||
|
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
||||||
|
if ( window != null ) {
|
||||||
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "SignalZeroObjectActionDelegate.1" ), ms ); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
else {
|
||||||
CDebugUIPlugin.log( ms );
|
CDebugUIPlugin.log( ms );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
|
* @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
public void selectionChanged( IAction action, ISelection selection ) {
|
||||||
{
|
if ( selection instanceof IStructuredSelection ) {
|
||||||
if ( selection instanceof IStructuredSelection )
|
|
||||||
{
|
|
||||||
Object element = ((IStructuredSelection)selection).getFirstElement();
|
Object element = ((IStructuredSelection)selection).getFirstElement();
|
||||||
if ( element instanceof IResumeWithoutSignal )
|
if ( element instanceof IResumeWithoutSignal ) {
|
||||||
{
|
|
||||||
boolean enabled = ((IResumeWithoutSignal)element).canResumeWithoutSignal();
|
boolean enabled = ((IResumeWithoutSignal)element).canResumeWithoutSignal();
|
||||||
action.setEnabled( enabled );
|
action.setEnabled( enabled );
|
||||||
if ( enabled )
|
if ( enabled ) {
|
||||||
{
|
|
||||||
setTarget( (IResumeWithoutSignal)element );
|
setTarget( (IResumeWithoutSignal)element );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -106,18 +91,15 @@ public class SignalZeroObjectActionDelegate implements IObjectActionDelegate
|
||||||
setTarget( null );
|
setTarget( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doAction( IResumeWithoutSignal target ) throws DebugException
|
protected void doAction( IResumeWithoutSignal target ) throws DebugException {
|
||||||
{
|
|
||||||
target.resumeWithoutSignal();
|
target.resumeWithoutSignal();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IResumeWithoutSignal getTarget()
|
protected IResumeWithoutSignal getTarget() {
|
||||||
{
|
|
||||||
return fTarget;
|
return fTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setTarget( IResumeWithoutSignal target )
|
protected void setTarget( IResumeWithoutSignal target ) {
|
||||||
{
|
|
||||||
fTarget = target;
|
fTarget = target;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,39 +1,41 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal;
|
import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The workbench delegate of the "Resume Without Signal" action.
|
||||||
*
|
|
||||||
* @since: Feb 7, 2003
|
|
||||||
*/
|
*/
|
||||||
public class SignalZeroWorkbenchActionDelegate extends AbstractListenerActionDelegate
|
public class SignalZeroWorkbenchActionDelegate extends AbstractListenerActionDelegate {
|
||||||
{
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object)
|
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
protected void doAction( Object element ) throws DebugException
|
protected void doAction( Object element ) throws DebugException {
|
||||||
{
|
if ( element instanceof IResumeWithoutSignal ) {
|
||||||
if ( element instanceof IResumeWithoutSignal )
|
|
||||||
{
|
|
||||||
((IResumeWithoutSignal)element).resumeWithoutSignal();
|
((IResumeWithoutSignal)element).resumeWithoutSignal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(java.lang.Object)
|
* @see org.eclipse.cdt.debug.internal.ui.actions.AbstractDebugActionDelegate#isEnabledFor(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
protected boolean isEnabledFor( Object element )
|
protected boolean isEnabledFor( Object element ) {
|
||||||
{
|
if ( element instanceof IResumeWithoutSignal ) {
|
||||||
if ( element instanceof IResumeWithoutSignal )
|
|
||||||
{
|
|
||||||
return ((IResumeWithoutSignal)element).canResumeWithoutSignal();
|
return ((IResumeWithoutSignal)element).canResumeWithoutSignal();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -42,24 +44,21 @@ public class SignalZeroWorkbenchActionDelegate extends AbstractListenerActionDel
|
||||||
/**
|
/**
|
||||||
* @see AbstractDebugActionDelegate#getStatusMessage()
|
* @see AbstractDebugActionDelegate#getStatusMessage()
|
||||||
*/
|
*/
|
||||||
protected String getStatusMessage()
|
protected String getStatusMessage() {
|
||||||
{
|
return ActionMessages.getString( "SignalZeroWorkbenchActionDelegate.0" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.actions.SignalZeroWorkbenchActionDelegate.Exceptions_occurred_attempting_to_resume_without_signal"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractDebugActionDelegate#getErrorDialogMessage()
|
* @see AbstractDebugActionDelegate#getErrorDialogMessage()
|
||||||
*/
|
*/
|
||||||
protected String getErrorDialogMessage()
|
protected String getErrorDialogMessage() {
|
||||||
{
|
return ActionMessages.getString( "SignalZeroWorkbenchActionDelegate.1" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.actions.SignalZeroWorkbenchActionDelegate.ErrorMsg_Resume_without_signal_failed"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractDebugActionDelegate#getErrorDialogTitle()
|
* @see AbstractDebugActionDelegate#getErrorDialogTitle()
|
||||||
*/
|
*/
|
||||||
protected String getErrorDialogTitle()
|
protected String getErrorDialogTitle() {
|
||||||
{
|
return ActionMessages.getString( "SignalZeroWorkbenchActionDelegate.2" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.actions.SignalZeroWorkbenchActionDelegate.ErrorMsgTitle_Resume_Without_Signal"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDIFormat;
|
import org.eclipse.cdt.debug.core.cdi.ICDIFormat;
|
||||||
import org.eclipse.cdt.debug.core.model.ICVariable;
|
import org.eclipse.cdt.debug.core.model.ICVariable;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
|
@ -24,121 +28,96 @@ import org.eclipse.ui.IWorkbenchPart;
|
||||||
import org.eclipse.ui.IWorkbenchWindow;
|
import org.eclipse.ui.IWorkbenchWindow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The delegate of the "Format" action.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Dec 16, 2002
|
|
||||||
*/
|
*/
|
||||||
public class VariableFormatActionDelegate implements IObjectActionDelegate
|
public class VariableFormatActionDelegate implements IObjectActionDelegate {
|
||||||
{
|
|
||||||
private int fFormat = ICDIFormat.NATURAL;
|
private int fFormat = ICDIFormat.NATURAL;
|
||||||
|
|
||||||
private ICVariable[] fVariables = null;
|
private ICVariable[] fVariables = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for VariableFormatActionDelegate.
|
* Constructor for VariableFormatActionDelegate.
|
||||||
*/
|
*/
|
||||||
public VariableFormatActionDelegate( int format )
|
public VariableFormatActionDelegate( int format ) {
|
||||||
{
|
|
||||||
fFormat = format;
|
fFormat = format;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
|
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
|
||||||
*/
|
*/
|
||||||
public void setActivePart( IAction action, IWorkbenchPart targetPart )
|
public void setActivePart( IAction action, IWorkbenchPart targetPart ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(IAction)
|
||||||
*/
|
*/
|
||||||
public void run( IAction action )
|
public void run( IAction action ) {
|
||||||
{
|
|
||||||
ICVariable[] vars = getVariables();
|
ICVariable[] vars = getVariables();
|
||||||
if ( vars != null && vars.length > 0 )
|
if ( vars != null && vars.length > 0 ) {
|
||||||
{
|
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, "", null ); //$NON-NLS-1$
|
||||||
final MultiStatus ms = new MultiStatus( CDebugUIPlugin.getUniqueIdentifier(),
|
BusyIndicator.showWhile( Display.getCurrent(), new Runnable() {
|
||||||
DebugException.REQUEST_FAILED, "", null ); //$NON-NLS-1$
|
|
||||||
BusyIndicator.showWhile( Display.getCurrent(),
|
public void run() {
|
||||||
new Runnable()
|
try {
|
||||||
{
|
doAction( getVariables() );
|
||||||
public void run()
|
}
|
||||||
{
|
catch( DebugException e ) {
|
||||||
try
|
ms.merge( e.getStatus() );
|
||||||
{
|
}
|
||||||
doAction( getVariables() );
|
|
||||||
}
|
|
||||||
catch( DebugException e )
|
|
||||||
{
|
|
||||||
ms.merge( e.getStatus() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
if ( !ms.isOK() )
|
|
||||||
{
|
|
||||||
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
|
||||||
if ( window != null )
|
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( CDebugUIPlugin.getResourceString("internal.ui.actions.VariableFormatActionDelegate.Unable_to_set_format_of_variable"), ms ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
else
|
} );
|
||||||
{
|
if ( !ms.isOK() ) {
|
||||||
|
IWorkbenchWindow window = CDebugUIPlugin.getActiveWorkbenchWindow();
|
||||||
|
if ( window != null ) {
|
||||||
|
CDebugUIPlugin.errorDialog( ActionMessages.getString( "VariableFormatActionDelegate.0" ), ms ); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
else {
|
||||||
CDebugUIPlugin.log( ms );
|
CDebugUIPlugin.log( ms );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
|
* @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IAction action, ISelection selection )
|
public void selectionChanged( IAction action, ISelection selection ) {
|
||||||
{
|
if ( selection instanceof IStructuredSelection ) {
|
||||||
if ( selection instanceof IStructuredSelection )
|
|
||||||
{
|
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
IStructuredSelection ssel = (IStructuredSelection)selection;
|
IStructuredSelection ssel = (IStructuredSelection)selection;
|
||||||
Iterator i = ssel.iterator();
|
Iterator i = ssel.iterator();
|
||||||
while ( i.hasNext() )
|
while( i.hasNext() ) {
|
||||||
{
|
|
||||||
Object o = i.next();
|
Object o = i.next();
|
||||||
if ( o instanceof ICVariable )
|
if ( o instanceof ICVariable ) {
|
||||||
{
|
|
||||||
ICVariable var = (ICVariable)o;
|
ICVariable var = (ICVariable)o;
|
||||||
boolean enabled = var.isEditable();
|
boolean enabled = var.isEditable();
|
||||||
action.setEnabled( enabled );
|
action.setEnabled( enabled );
|
||||||
if ( enabled )
|
if ( enabled ) {
|
||||||
{
|
|
||||||
action.setChecked( var.getFormat() == fFormat );
|
action.setChecked( var.getFormat() == fFormat );
|
||||||
list.add(o);
|
list.add( o );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setVariables( (ICVariable[])list.toArray( new ICVariable[list.size()] ) );
|
setVariables( (ICVariable[])list.toArray( new ICVariable[list.size()] ) );
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
action.setChecked( false );
|
action.setChecked( false );
|
||||||
action.setEnabled( false );
|
action.setEnabled( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void doAction( ICVariable[] vars ) throws DebugException
|
protected void doAction( ICVariable[] vars ) throws DebugException {
|
||||||
{
|
for( int i = 0; i < vars.length; i++ ) {
|
||||||
for( int i = 0; i < vars.length; i++ )
|
|
||||||
{
|
|
||||||
vars[i].setFormat( fFormat );
|
vars[i].setFormat( fFormat );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ICVariable[] getVariables()
|
protected ICVariable[] getVariables() {
|
||||||
{
|
|
||||||
return fVariables;
|
return fVariables;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setVariables( ICVariable[] variables )
|
private void setVariables( ICVariable[] variables ) {
|
||||||
{
|
|
||||||
fVariables = variables;
|
fVariables = variables;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,7 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
|
|
||||||
import org.eclipse.debug.ui.IDebugView;
|
import org.eclipse.debug.ui.IDebugView;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.editors;
|
package org.eclipse.cdt.debug.internal.ui.editors;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
@ -10,7 +15,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.resources.FileStorage;
|
import org.eclipse.cdt.core.resources.FileStorage;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
|
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocator;
|
||||||
|
@ -64,151 +68,131 @@ import org.eclipse.ui.IViewPart;
|
||||||
import org.eclipse.ui.part.FileEditorInput;
|
import org.eclipse.ui.part.FileEditorInput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The Debugger specific extension fo the C editor.
|
||||||
*
|
|
||||||
* @since: Feb 26, 2003
|
|
||||||
*/
|
*/
|
||||||
public class CDebugEditor extends CEditor
|
public class CDebugEditor extends CEditor {
|
||||||
{
|
|
||||||
public class AttachSourceForm implements IPropertyChangeListener
|
public class AttachSourceForm implements IPropertyChangeListener {
|
||||||
{
|
|
||||||
/** The horizontal scroll increment. */
|
/** The horizontal scroll increment. */
|
||||||
private static final int HORIZONTAL_SCROLL_INCREMENT = 10;
|
private static final int HORIZONTAL_SCROLL_INCREMENT = 10;
|
||||||
|
|
||||||
/** The vertical scroll increment. */
|
/** The vertical scroll increment. */
|
||||||
private static final int VERTICAL_SCROLL_INCREMENT = 10;
|
private static final int VERTICAL_SCROLL_INCREMENT = 10;
|
||||||
|
|
||||||
/** The form's root widget */
|
/** The form's root widget */
|
||||||
private Font fFont;
|
private Font fFont;
|
||||||
|
|
||||||
/** The form's root widget */
|
/** The form's root widget */
|
||||||
private ScrolledComposite fScrolledComposite;
|
private ScrolledComposite fScrolledComposite;
|
||||||
|
|
||||||
/** The background color */
|
/** The background color */
|
||||||
private Color fBackgroundColor;
|
private Color fBackgroundColor;
|
||||||
|
|
||||||
/** The foreground color */
|
/** The foreground color */
|
||||||
private Color fForegroundColor;
|
private Color fForegroundColor;
|
||||||
|
|
||||||
/** The separator's color */
|
/** The separator's color */
|
||||||
private Color fSeparatorColor;
|
private Color fSeparatorColor;
|
||||||
|
|
||||||
/** The form headers */
|
/** The form headers */
|
||||||
private List fHeaderLabels = new ArrayList();
|
private List fHeaderLabels = new ArrayList();
|
||||||
|
|
||||||
/** The form banners */
|
/** The form banners */
|
||||||
private List fBannerLabels = new ArrayList();
|
private List fBannerLabels = new ArrayList();
|
||||||
|
|
||||||
/** The form text */
|
/** The form text */
|
||||||
private Label fInputLabel;
|
private Label fInputLabel;
|
||||||
|
|
||||||
/** The attach source button */
|
/** The attach source button */
|
||||||
private Button fAttachButton = null;
|
private Button fAttachButton = null;
|
||||||
/** The preference change listener */
|
|
||||||
// private IPropertyChangeListener fPropertyChangeListener;
|
|
||||||
|
|
||||||
|
/** The preference change listener */
|
||||||
|
// private IPropertyChangeListener fPropertyChangeListener;
|
||||||
private IEditorInput fInput = null;
|
private IEditorInput fInput = null;
|
||||||
|
|
||||||
public AttachSourceForm( Composite parent, IEditorInput input )
|
public AttachSourceForm( Composite parent, IEditorInput input ) {
|
||||||
{
|
|
||||||
Display display = parent.getDisplay();
|
Display display = parent.getDisplay();
|
||||||
fBackgroundColor = display.getSystemColor( SWT.COLOR_LIST_BACKGROUND );
|
fBackgroundColor = display.getSystemColor( SWT.COLOR_LIST_BACKGROUND );
|
||||||
fForegroundColor = display.getSystemColor( SWT.COLOR_LIST_FOREGROUND );
|
fForegroundColor = display.getSystemColor( SWT.COLOR_LIST_FOREGROUND );
|
||||||
fSeparatorColor = new Color( display, 152, 170, 203 );
|
fSeparatorColor = new Color( display, 152, 170, 203 );
|
||||||
|
|
||||||
JFaceResources.getFontRegistry().addListener( AttachSourceForm.this );
|
JFaceResources.getFontRegistry().addListener( AttachSourceForm.this );
|
||||||
|
|
||||||
fScrolledComposite = new ScrolledComposite( parent, SWT.H_SCROLL | SWT.V_SCROLL );
|
fScrolledComposite = new ScrolledComposite( parent, SWT.H_SCROLL | SWT.V_SCROLL );
|
||||||
fScrolledComposite.setAlwaysShowScrollBars( false );
|
fScrolledComposite.setAlwaysShowScrollBars( false );
|
||||||
fScrolledComposite.setExpandHorizontal( true );
|
fScrolledComposite.setExpandHorizontal( true );
|
||||||
fScrolledComposite.setExpandVertical( true );
|
fScrolledComposite.setExpandVertical( true );
|
||||||
fScrolledComposite.addDisposeListener(
|
fScrolledComposite.addDisposeListener( new DisposeListener() {
|
||||||
new DisposeListener()
|
|
||||||
{
|
|
||||||
public void widgetDisposed( DisposeEvent e )
|
|
||||||
{
|
|
||||||
JFaceResources.getFontRegistry().removeListener( AttachSourceForm.this );
|
|
||||||
setScrolledComposite( null );
|
|
||||||
getSeparatorColor().dispose();
|
|
||||||
setSeparatorColor( null );
|
|
||||||
getBannerLabels().clear();
|
|
||||||
getHeaderLabels().clear();
|
|
||||||
if ( getFont() != null )
|
|
||||||
{
|
|
||||||
getFont().dispose();
|
|
||||||
setFont( null );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
fScrolledComposite.addControlListener(
|
|
||||||
new ControlListener()
|
|
||||||
{
|
|
||||||
public void controlMoved( ControlEvent e )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void controlResized(ControlEvent e)
|
|
||||||
{
|
|
||||||
Rectangle clientArea = getScrolledComposite().getClientArea();
|
|
||||||
|
|
||||||
ScrollBar verticalBar = getScrolledComposite().getVerticalBar();
|
public void widgetDisposed( DisposeEvent e ) {
|
||||||
verticalBar.setIncrement( VERTICAL_SCROLL_INCREMENT );
|
JFaceResources.getFontRegistry().removeListener( AttachSourceForm.this );
|
||||||
verticalBar.setPageIncrement( clientArea.height - verticalBar.getIncrement() );
|
setScrolledComposite( null );
|
||||||
|
getSeparatorColor().dispose();
|
||||||
|
setSeparatorColor( null );
|
||||||
|
getBannerLabels().clear();
|
||||||
|
getHeaderLabels().clear();
|
||||||
|
if ( getFont() != null ) {
|
||||||
|
getFont().dispose();
|
||||||
|
setFont( null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
fScrolledComposite.addControlListener( new ControlListener() {
|
||||||
|
|
||||||
ScrollBar horizontalBar = getScrolledComposite().getHorizontalBar();
|
public void controlMoved( ControlEvent e ) {
|
||||||
horizontalBar.setIncrement( HORIZONTAL_SCROLL_INCREMENT );
|
}
|
||||||
horizontalBar.setPageIncrement( clientArea.width - horizontalBar.getIncrement() );
|
|
||||||
}
|
public void controlResized( ControlEvent e ) {
|
||||||
} );
|
Rectangle clientArea = getScrolledComposite().getClientArea();
|
||||||
|
ScrollBar verticalBar = getScrolledComposite().getVerticalBar();
|
||||||
|
verticalBar.setIncrement( VERTICAL_SCROLL_INCREMENT );
|
||||||
|
verticalBar.setPageIncrement( clientArea.height - verticalBar.getIncrement() );
|
||||||
|
ScrollBar horizontalBar = getScrolledComposite().getHorizontalBar();
|
||||||
|
horizontalBar.setIncrement( HORIZONTAL_SCROLL_INCREMENT );
|
||||||
|
horizontalBar.setPageIncrement( clientArea.width - horizontalBar.getIncrement() );
|
||||||
|
}
|
||||||
|
} );
|
||||||
Composite composite = createComposite( fScrolledComposite );
|
Composite composite = createComposite( fScrolledComposite );
|
||||||
composite.setLayout( new GridLayout() );
|
composite.setLayout( new GridLayout() );
|
||||||
|
createTitleLabel( composite, EditorMessages.getString( "CDebugEditor.0" ) ); //$NON-NLS-1$
|
||||||
createTitleLabel( composite, CDebugUIPlugin.getResourceString("internal.ui.editors.CDebugEditor.C_CPP_File_Editor") ); //$NON-NLS-1$
|
|
||||||
createLabel( composite, null );
|
createLabel( composite, null );
|
||||||
createLabel( composite, null );
|
createLabel( composite, null );
|
||||||
|
createHeadingLabel( composite, EditorMessages.getString( "CDebugEditor.1" ) ); //$NON-NLS-1$
|
||||||
createHeadingLabel( composite, CDebugUIPlugin.getResourceString("internal.ui.editors.CDebugEditor.Source_not_found") ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
Composite separator = createCompositeSeparator( composite );
|
Composite separator = createCompositeSeparator( composite );
|
||||||
GridData data = new GridData( GridData.FILL_HORIZONTAL );
|
GridData data = new GridData( GridData.FILL_HORIZONTAL );
|
||||||
data.heightHint = 2;
|
data.heightHint = 2;
|
||||||
separator.setLayoutData( data );
|
separator.setLayoutData( data );
|
||||||
|
|
||||||
fInputLabel = createLabel( composite, "" ); //$NON-NLS-1$
|
fInputLabel = createLabel( composite, "" ); //$NON-NLS-1$
|
||||||
createLabel( composite, CDebugUIPlugin.getResourceString("internal.ui.editors.CDebugEditor.attach_source_location_instructions") ); //$NON-NLS-1$
|
createLabel( composite, EditorMessages.getString( "CDebugEditor.2" ) ); //$NON-NLS-1$
|
||||||
createLabel( composite, null );
|
createLabel( composite, null );
|
||||||
|
fAttachButton = createButton( composite, EditorMessages.getString( "CDebugEditor.3" ) ); //$NON-NLS-1$
|
||||||
|
fAttachButton.addSelectionListener( new SelectionListener() {
|
||||||
|
|
||||||
fAttachButton = createButton( composite, CDebugUIPlugin.getResourceString("internal.ui.editors.CDebugEditor.Attach_Source_button") ); //$NON-NLS-1$
|
public void widgetSelected( SelectionEvent event ) {
|
||||||
fAttachButton.addSelectionListener(
|
attachSourceLocation();
|
||||||
new SelectionListener()
|
}
|
||||||
{
|
|
||||||
public void widgetSelected( SelectionEvent event )
|
|
||||||
{
|
|
||||||
attachSourceLocation();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void widgetDefaultSelected( SelectionEvent e )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
|
public void widgetDefaultSelected( SelectionEvent e ) {
|
||||||
|
}
|
||||||
|
} );
|
||||||
separator = createCompositeSeparator( composite );
|
separator = createCompositeSeparator( composite );
|
||||||
data = new GridData( GridData.FILL_HORIZONTAL );
|
data = new GridData( GridData.FILL_HORIZONTAL );
|
||||||
data.heightHint = 2;
|
data.heightHint = 2;
|
||||||
separator.setLayoutData( data );
|
separator.setLayoutData( data );
|
||||||
|
|
||||||
fScrolledComposite.setContent( composite );
|
fScrolledComposite.setContent( composite );
|
||||||
fScrolledComposite.setMinSize( composite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) );
|
fScrolledComposite.setMinSize( composite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) );
|
||||||
|
if ( getEditorInput() != null ) {
|
||||||
if ( getEditorInput() != null )
|
|
||||||
{
|
|
||||||
setInputLabelText( getEditorInput() );
|
setInputLabelText( getEditorInput() );
|
||||||
}
|
}
|
||||||
|
|
||||||
fInput = input;
|
fInput = input;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Composite createComposite( Composite parent )
|
private Composite createComposite( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NONE );
|
Composite composite = new Composite( parent, SWT.NONE );
|
||||||
composite.setBackground( fBackgroundColor );
|
composite.setBackground( fBackgroundColor );
|
||||||
return composite;
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Label createLabel( Composite parent, String text )
|
private Label createLabel( Composite parent, String text ) {
|
||||||
{
|
|
||||||
Label label = new Label( parent, SWT.NONE );
|
Label label = new Label( parent, SWT.NONE );
|
||||||
if ( text != null )
|
if ( text != null )
|
||||||
label.setText( text );
|
label.setText( text );
|
||||||
|
@ -217,8 +201,7 @@ public class CDebugEditor extends CEditor
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Label createTitleLabel( Composite parent, String text )
|
private Label createTitleLabel( Composite parent, String text ) {
|
||||||
{
|
|
||||||
Label label = new Label( parent, SWT.NONE );
|
Label label = new Label( parent, SWT.NONE );
|
||||||
if ( text != null )
|
if ( text != null )
|
||||||
label.setText( text );
|
label.setText( text );
|
||||||
|
@ -229,8 +212,7 @@ public class CDebugEditor extends CEditor
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Label createHeadingLabel( Composite parent, String text )
|
private Label createHeadingLabel( Composite parent, String text ) {
|
||||||
{
|
|
||||||
Label label = new Label( parent, SWT.NONE );
|
Label label = new Label( parent, SWT.NONE );
|
||||||
if ( text != null )
|
if ( text != null )
|
||||||
label.setText( text );
|
label.setText( text );
|
||||||
|
@ -241,15 +223,13 @@ public class CDebugEditor extends CEditor
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Composite createCompositeSeparator( Composite parent )
|
private Composite createCompositeSeparator( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NONE );
|
Composite composite = new Composite( parent, SWT.NONE );
|
||||||
composite.setBackground( fSeparatorColor );
|
composite.setBackground( fSeparatorColor );
|
||||||
return composite;
|
return composite;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Button createButton( Composite parent, String text )
|
private Button createButton( Composite parent, String text ) {
|
||||||
{
|
|
||||||
Button button = new Button( parent, SWT.FLAT );
|
Button button = new Button( parent, SWT.FLAT );
|
||||||
button.setBackground( fBackgroundColor );
|
button.setBackground( fBackgroundColor );
|
||||||
button.setForeground( fForegroundColor );
|
button.setForeground( fForegroundColor );
|
||||||
|
@ -258,95 +238,78 @@ public class CDebugEditor extends CEditor
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
|
||||||
*/
|
*/
|
||||||
public void propertyChange( PropertyChangeEvent event )
|
public void propertyChange( PropertyChangeEvent event ) {
|
||||||
{
|
for( Iterator iterator = fBannerLabels.iterator(); iterator.hasNext(); ) {
|
||||||
for ( Iterator iterator = fBannerLabels.iterator(); iterator.hasNext(); )
|
|
||||||
{
|
|
||||||
Label label = (Label)iterator.next();
|
Label label = (Label)iterator.next();
|
||||||
label.setFont( JFaceResources.getBannerFont() );
|
label.setFont( JFaceResources.getBannerFont() );
|
||||||
}
|
}
|
||||||
|
for( Iterator iterator = fHeaderLabels.iterator(); iterator.hasNext(); ) {
|
||||||
for ( Iterator iterator = fHeaderLabels.iterator(); iterator.hasNext(); )
|
|
||||||
{
|
|
||||||
Label label = (Label)iterator.next();
|
Label label = (Label)iterator.next();
|
||||||
label.setFont( JFaceResources.getHeaderFont() );
|
label.setFont( JFaceResources.getHeaderFont() );
|
||||||
}
|
}
|
||||||
|
|
||||||
Control control = fScrolledComposite.getContent();
|
Control control = fScrolledComposite.getContent();
|
||||||
fScrolledComposite.setMinSize( control.computeSize( SWT.DEFAULT, SWT.DEFAULT ) );
|
fScrolledComposite.setMinSize( control.computeSize( SWT.DEFAULT, SWT.DEFAULT ) );
|
||||||
fScrolledComposite.setContent( control );
|
fScrolledComposite.setContent( control );
|
||||||
|
|
||||||
fScrolledComposite.layout( true );
|
fScrolledComposite.layout( true );
|
||||||
fScrolledComposite.redraw();
|
fScrolledComposite.redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setInputLabelText( IEditorInput input )
|
private void setInputLabelText( IEditorInput input ) {
|
||||||
{
|
|
||||||
FileNotFoundElement element = (FileNotFoundElement)input.getAdapter( FileNotFoundElement.class );
|
FileNotFoundElement element = (FileNotFoundElement)input.getAdapter( FileNotFoundElement.class );
|
||||||
if ( element != null )
|
if ( element != null )
|
||||||
fInputLabel.setText( MessageFormat.format( CDebugUIPlugin.getResourceString("internal.ui.editors.CDebugEditor.Can_not_find_file"), new String[] { element.getFullPath().toOSString() } ) ); //$NON-NLS-1$
|
fInputLabel.setText( MessageFormat.format( EditorMessages.getString( "CDebugEditor.4" ), new String[]{ element.getFullPath().toOSString() } ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ScrolledComposite getScrolledComposite()
|
protected ScrolledComposite getScrolledComposite() {
|
||||||
{
|
|
||||||
return fScrolledComposite;
|
return fScrolledComposite;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setScrolledComposite( ScrolledComposite scrolledComposite )
|
protected void setScrolledComposite( ScrolledComposite scrolledComposite ) {
|
||||||
{
|
|
||||||
fScrolledComposite = scrolledComposite;
|
fScrolledComposite = scrolledComposite;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Color getSeparatorColor()
|
protected Color getSeparatorColor() {
|
||||||
{
|
|
||||||
return fSeparatorColor;
|
return fSeparatorColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setSeparatorColor( Color separatorColor )
|
protected void setSeparatorColor( Color separatorColor ) {
|
||||||
{
|
|
||||||
fSeparatorColor = separatorColor;
|
fSeparatorColor = separatorColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List getBannerLabels()
|
protected List getBannerLabels() {
|
||||||
{
|
|
||||||
return fBannerLabels;
|
return fBannerLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setBannerLabels( List bannerLabels )
|
protected void setBannerLabels( List bannerLabels ) {
|
||||||
{
|
|
||||||
fBannerLabels = bannerLabels;
|
fBannerLabels = bannerLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List getHeaderLabels()
|
protected List getHeaderLabels() {
|
||||||
{
|
|
||||||
return fHeaderLabels;
|
return fHeaderLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setHeaderLabels( List headerLabels )
|
protected void setHeaderLabels( List headerLabels ) {
|
||||||
{
|
|
||||||
fHeaderLabels = headerLabels;
|
fHeaderLabels = headerLabels;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Font getFont()
|
protected Font getFont() {
|
||||||
{
|
|
||||||
return fFont;
|
return fFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setFont( Font font )
|
protected void setFont( Font font ) {
|
||||||
{
|
|
||||||
fFont = font;
|
fFont = font;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Control getControl()
|
public Control getControl() {
|
||||||
{
|
|
||||||
return fScrolledComposite;
|
return fScrolledComposite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEditorInput getInput()
|
public IEditorInput getInput() {
|
||||||
{
|
|
||||||
return fInput;
|
return fInput;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -358,91 +321,78 @@ public class CDebugEditor extends CEditor
|
||||||
/**
|
/**
|
||||||
* Constructor for CDebugEditor.
|
* Constructor for CDebugEditor.
|
||||||
*/
|
*/
|
||||||
public CDebugEditor()
|
public CDebugEditor() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
setDocumentProvider( CUIPlugin.getDefault().getDocumentProvider() );
|
setDocumentProvider( CUIPlugin.getDefault().getDocumentProvider() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
public void createPartControl( Composite parent )
|
public void createPartControl( Composite parent ) {
|
||||||
{
|
|
||||||
super.createPartControl( parent );
|
super.createPartControl( parent );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.texteditor.AbstractTextEditor#doSetInput(org.eclipse.ui.IEditorInput)
|
* @see org.eclipse.ui.texteditor.AbstractTextEditor#doSetInput(org.eclipse.ui.IEditorInput)
|
||||||
*/
|
*/
|
||||||
protected void doSetInput( IEditorInput input ) throws CoreException
|
protected void doSetInput( IEditorInput input ) throws CoreException {
|
||||||
{
|
|
||||||
IEditorInput newInput = input;
|
IEditorInput newInput = input;
|
||||||
if ( input instanceof EditorInputDelegate && ((EditorInputDelegate)input).getDelegate() != null )
|
if ( input instanceof EditorInputDelegate && ((EditorInputDelegate)input).getDelegate() != null ) {
|
||||||
{
|
|
||||||
newInput = ((EditorInputDelegate)input).getDelegate();
|
newInput = ((EditorInputDelegate)input).getDelegate();
|
||||||
}
|
}
|
||||||
IEditorInput oldInput = getEditorInput();
|
IEditorInput oldInput = getEditorInput();
|
||||||
if ( oldInput instanceof EditorInputDelegate )
|
if ( oldInput instanceof EditorInputDelegate ) {
|
||||||
{
|
|
||||||
oldInput = ((EditorInputDelegate)oldInput).getDelegate();
|
oldInput = ((EditorInputDelegate)oldInput).getDelegate();
|
||||||
}
|
}
|
||||||
if (oldInput != null)
|
if ( oldInput != null ) {
|
||||||
{
|
CUIPlugin.getDefault().getWorkingCopyManager().disconnect( oldInput );
|
||||||
CUIPlugin.getDefault().getWorkingCopyManager().disconnect(oldInput);
|
|
||||||
}
|
}
|
||||||
super.doSetInput( newInput );
|
super.doSetInput( newInput );
|
||||||
// This hack should be after the super.doSetInput();
|
// This hack should be after the super.doSetInput();
|
||||||
CUIPlugin.getDefault().getWorkingCopyManager().connect(newInput);
|
CUIPlugin.getDefault().getWorkingCopyManager().connect( newInput );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void attachSourceLocation()
|
protected void attachSourceLocation() {
|
||||||
{
|
if ( getEditorInput() != null && getEditorInput().getAdapter( FileNotFoundElement.class ) != null ) {
|
||||||
if ( getEditorInput() != null && getEditorInput().getAdapter( FileNotFoundElement.class ) != null )
|
|
||||||
{
|
|
||||||
FileNotFoundElement element = (FileNotFoundElement)getEditorInput().getAdapter( FileNotFoundElement.class );
|
FileNotFoundElement element = (FileNotFoundElement)getEditorInput().getAdapter( FileNotFoundElement.class );
|
||||||
if ( element.getLaunch() != null && element.getLaunch().getSourceLocator() instanceof IAdaptable )
|
if ( element.getLaunch() != null && element.getLaunch().getSourceLocator() instanceof IAdaptable ) {
|
||||||
{
|
|
||||||
ILaunch launch = element.getLaunch();
|
ILaunch launch = element.getLaunch();
|
||||||
ICSourceLocator locator = (ICSourceLocator)((IAdaptable)element.getLaunch().getSourceLocator()).getAdapter( ICSourceLocator.class );
|
ICSourceLocator locator = (ICSourceLocator)((IAdaptable)element.getLaunch().getSourceLocator()).getAdapter( ICSourceLocator.class );
|
||||||
if ( locator != null )
|
if ( locator != null ) {
|
||||||
{
|
|
||||||
IPath path = element.getFullPath();
|
IPath path = element.getFullPath();
|
||||||
INewSourceLocationWizard wizard = null;
|
INewSourceLocationWizard wizard = null;
|
||||||
if ( path.isAbsolute() )
|
if ( path.isAbsolute() ) {
|
||||||
{
|
|
||||||
path = path.removeLastSegments( 1 );
|
path = path.removeLastSegments( 1 );
|
||||||
wizard = new AddDirectorySourceLocationWizard( path );
|
wizard = new AddDirectorySourceLocationWizard( path );
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
wizard = new AddSourceLocationWizard( locator.getSourceLocations() );
|
wizard = new AddSourceLocationWizard( locator.getSourceLocations() );
|
||||||
}
|
}
|
||||||
WizardDialog dialog = new WizardDialog( CDebugUIPlugin.getActiveWorkbenchShell(), wizard );
|
WizardDialog dialog = new WizardDialog( CDebugUIPlugin.getActiveWorkbenchShell(), wizard );
|
||||||
if ( dialog.open() == Window.OK )
|
if ( dialog.open() == Window.OK ) {
|
||||||
{
|
|
||||||
ICSourceLocation[] locations = locator.getSourceLocations();
|
ICSourceLocation[] locations = locator.getSourceLocations();
|
||||||
ArrayList list = new ArrayList( Arrays.asList( locations ) );
|
ArrayList list = new ArrayList( Arrays.asList( locations ) );
|
||||||
list.add( wizard.getSourceLocation() );
|
list.add( wizard.getSourceLocation() );
|
||||||
locator.setSourceLocations( (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ) );
|
locator.setSourceLocations( (ICSourceLocation[])list.toArray( new ICSourceLocation[list.size()] ) );
|
||||||
|
if ( locator instanceof IPersistableSourceLocator ) {
|
||||||
if ( locator instanceof IPersistableSourceLocator )
|
|
||||||
{
|
|
||||||
ILaunchConfiguration configuration = launch.getLaunchConfiguration();
|
ILaunchConfiguration configuration = launch.getLaunchConfiguration();
|
||||||
saveChanges( configuration, (IPersistableSourceLocator)launch.getSourceLocator() );
|
saveChanges( configuration, (IPersistableSourceLocator)launch.getSourceLocator() );
|
||||||
}
|
}
|
||||||
Object newElement = locator.getSourceElement( element.getStackFrame() );
|
Object newElement = locator.getSourceElement( element.getStackFrame() );
|
||||||
IEditorInput newInput = null;
|
IEditorInput newInput = null;
|
||||||
if ( newElement instanceof IFile )
|
if ( newElement instanceof IFile ) {
|
||||||
{
|
|
||||||
newInput = new FileEditorInput( (IFile)newElement );
|
newInput = new FileEditorInput( (IFile)newElement );
|
||||||
}
|
}
|
||||||
else if ( newElement instanceof FileStorage )
|
else if ( newElement instanceof FileStorage ) {
|
||||||
{
|
|
||||||
newInput = new ExternalEditorInput( (IStorage)newElement );
|
newInput = new ExternalEditorInput( (IStorage)newElement );
|
||||||
}
|
}
|
||||||
IEditorInput oldInput = ((EditorInputDelegate)getEditorInput()).getDelegate();
|
IEditorInput oldInput = ((EditorInputDelegate)getEditorInput()).getDelegate();
|
||||||
CUIPlugin.getDefault().getWorkingCopyManager().disconnect(oldInput);
|
CUIPlugin.getDefault().getWorkingCopyManager().disconnect( oldInput );
|
||||||
((EditorInputDelegate)getEditorInput()).setDelegate( newInput );
|
((EditorInputDelegate)getEditorInput()).setDelegate( newInput );
|
||||||
resetInput( element.getStackFrame() );
|
resetInput( element.getStackFrame() );
|
||||||
}
|
}
|
||||||
|
@ -450,27 +400,22 @@ public class CDebugEditor extends CEditor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetInput( IStackFrame frame )
|
private void resetInput( IStackFrame frame ) {
|
||||||
{
|
|
||||||
setInput( getEditorInput() );
|
setInput( getEditorInput() );
|
||||||
IViewPart view = CDebugUIPlugin.getActivePage().findView( IDebugUIConstants.ID_DEBUG_VIEW );
|
IViewPart view = CDebugUIPlugin.getActivePage().findView( IDebugUIConstants.ID_DEBUG_VIEW );
|
||||||
if ( view instanceof IDebugView )
|
if ( view instanceof IDebugView ) {
|
||||||
{
|
|
||||||
((IDebugView)view).getViewer().setSelection( new StructuredSelection( frame ) );
|
((IDebugView)view).getViewer().setSelection( new StructuredSelection( frame ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void saveChanges( ILaunchConfiguration configuration, IPersistableSourceLocator locator )
|
protected void saveChanges( ILaunchConfiguration configuration, IPersistableSourceLocator locator ) {
|
||||||
{
|
try {
|
||||||
try
|
|
||||||
{
|
|
||||||
ILaunchConfigurationWorkingCopy copy = configuration.copy( configuration.getName() );
|
ILaunchConfigurationWorkingCopy copy = configuration.copy( configuration.getName() );
|
||||||
copy.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, locator.getMemento() );
|
copy.setAttribute( ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, locator.getMemento() );
|
||||||
copy.doSave();
|
copy.doSave();
|
||||||
}
|
}
|
||||||
catch( CoreException e )
|
catch( CoreException e ) {
|
||||||
{
|
|
||||||
CDebugUIPlugin.errorDialog( e.getMessage(), (IStatus)null );
|
CDebugUIPlugin.errorDialog( e.getMessage(), (IStatus)null );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -478,8 +423,7 @@ public class CDebugEditor extends CEditor
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.ui.texteditor.StatusTextEditor#createStatusControl(Composite, IStatus)
|
* @see org.eclipse.ui.texteditor.StatusTextEditor#createStatusControl(Composite, IStatus)
|
||||||
*/
|
*/
|
||||||
protected Control createStatusControl( Composite parent, IStatus status )
|
protected Control createStatusControl( Composite parent, IStatus status ) {
|
||||||
{
|
|
||||||
fAttachSourceForm = new AttachSourceForm( parent, getEditorInput() );
|
fAttachSourceForm = new AttachSourceForm( parent, getEditorInput() );
|
||||||
return fAttachSourceForm.getControl();
|
return fAttachSourceForm.getControl();
|
||||||
}
|
}
|
||||||
|
@ -487,12 +431,9 @@ public class CDebugEditor extends CEditor
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.ui.texteditor.StatusTextEditor#updatePartControl(IEditorInput)
|
* @see org.eclipse.ui.texteditor.StatusTextEditor#updatePartControl(IEditorInput)
|
||||||
*/
|
*/
|
||||||
public void updatePartControl( IEditorInput input )
|
public void updatePartControl( IEditorInput input ) {
|
||||||
{
|
if ( fAttachSourceForm != null ) {
|
||||||
if ( fAttachSourceForm != null )
|
if ( fAttachSourceForm.getInput() != null && !fAttachSourceForm.getInput().equals( input ) ) {
|
||||||
{
|
|
||||||
if ( fAttachSourceForm.getInput() != null && !fAttachSourceForm.getInput().equals( input ) )
|
|
||||||
{
|
|
||||||
fAttachSourceForm = null;
|
fAttachSourceForm = null;
|
||||||
super.updatePartControl( input );
|
super.updatePartControl( input );
|
||||||
}
|
}
|
||||||
|
@ -501,18 +442,18 @@ public class CDebugEditor extends CEditor
|
||||||
super.updatePartControl( input );
|
super.updatePartControl( input );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IWorkbenchPart#dispose()
|
* @see org.eclipse.ui.IWorkbenchPart#dispose()
|
||||||
*/
|
*/
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
IEditorInput input = getEditorInput();
|
IEditorInput input = getEditorInput();
|
||||||
IEditorInput newInput = input;
|
IEditorInput newInput = input;
|
||||||
if ( input instanceof EditorInputDelegate && ((EditorInputDelegate)input).getDelegate() != null )
|
if ( input instanceof EditorInputDelegate && ((EditorInputDelegate)input).getDelegate() != null ) {
|
||||||
{
|
|
||||||
newInput = ((EditorInputDelegate)input).getDelegate();
|
newInput = ((EditorInputDelegate)input).getDelegate();
|
||||||
}
|
}
|
||||||
CUIPlugin.getDefault().getWorkingCopyManager().disconnect(newInput);
|
CUIPlugin.getDefault().getWorkingCopyManager().disconnect( newInput );
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.internal.ui.editors;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Comment for .
|
||||||
|
*/
|
||||||
|
public class EditorMessages {
|
||||||
|
|
||||||
|
private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.ui.editors.EditorMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private EditorMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
try {
|
||||||
|
return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
CDebugEditor.0=C/C++ File Editor
|
||||||
|
CDebugEditor.1=Source not found
|
||||||
|
CDebugEditor.2=You can attach a new source location by pressing the button below.
|
||||||
|
CDebugEditor.3=&Attach Source...
|
||||||
|
CDebugEditor.4=Can not find the file ''{0}'' in the specified source locations.
|
|
@ -77,7 +77,7 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
|
||||||
// Format constants
|
// Format constants
|
||||||
private static int[] fFormatIds = new int[]{ ICDIFormat.NATURAL, ICDIFormat.HEXADECIMAL, ICDIFormat.DECIMAL };
|
private static int[] fFormatIds = new int[]{ ICDIFormat.NATURAL, ICDIFormat.HEXADECIMAL, ICDIFormat.DECIMAL };
|
||||||
|
|
||||||
private static String[] fFormatLabels = new String[]{ CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.Natural" ), CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.Hexadecimal" ), CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.Decimal" ) }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
private static String[] fFormatLabels = new String[]{ PreferenceMessages.getString( "CDebugPreferencePage.0" ), PreferenceMessages.getString( "CDebugPreferencePage.1" ), PreferenceMessages.getString( "CDebugPreferencePage.2" ) }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
|
|
||||||
private PropertyChangeListener fPropertyChangeListener;
|
private PropertyChangeListener fPropertyChangeListener;
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
|
||||||
super();
|
super();
|
||||||
setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() );
|
setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() );
|
||||||
getPreferenceStore().addPropertyChangeListener( getPropertyChangeListener() );
|
getPreferenceStore().addPropertyChangeListener( getPropertyChangeListener() );
|
||||||
setDescription( CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.Preference_page_description" ) ); //$NON-NLS-1$
|
setDescription( PreferenceMessages.getString( "CDebugPreferencePage.3" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -205,29 +205,29 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
|
||||||
* Create the view setting preferences composite widget
|
* Create the view setting preferences composite widget
|
||||||
*/
|
*/
|
||||||
private void createViewSettingPreferences( Composite parent ) {
|
private void createViewSettingPreferences( Composite parent ) {
|
||||||
Composite comp = createGroupComposite( parent, 1, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.Opened_view_default_settings" ) ); //$NON-NLS-1$
|
Composite comp = createGroupComposite( parent, 1, PreferenceMessages.getString( "CDebugPreferencePage.4" ) ); //$NON-NLS-1$
|
||||||
fPathsButton = createCheckButton( comp, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.pathsButton" ) ); //$NON-NLS-1$
|
fPathsButton = createCheckButton( comp, PreferenceMessages.getString( "CDebugPreferencePage.5" ) ); //$NON-NLS-1$
|
||||||
fRefreshRegistersButton = createCheckButton( comp, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.autoRefreshRegistersButton" ) ); //$NON-NLS-1$
|
fRefreshRegistersButton = createCheckButton( comp, PreferenceMessages.getString( "CDebugPreferencePage.6" ) ); //$NON-NLS-1$
|
||||||
fRefreshSolibsButton = createCheckButton( comp, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.autoRefreshSolibsButton" ) ); //$NON-NLS-1$
|
fRefreshSolibsButton = createCheckButton( comp, PreferenceMessages.getString( "CDebugPreferencePage.7" ) ); //$NON-NLS-1$
|
||||||
Composite formatComposite = ControlFactory.createCompositeEx( comp, 2, 0 );
|
Composite formatComposite = ControlFactory.createCompositeEx( comp, 2, 0 );
|
||||||
((GridLayout)formatComposite.getLayout()).makeColumnsEqualWidth = true;
|
((GridLayout)formatComposite.getLayout()).makeColumnsEqualWidth = true;
|
||||||
fVariableFormatCombo = createComboBox( formatComposite, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.variableFormatCombo" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
|
fVariableFormatCombo = createComboBox( formatComposite, PreferenceMessages.getString( "CDebugPreferencePage.8" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
|
||||||
fExpressionFormatCombo = createComboBox( formatComposite, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.expressionFormatCombo" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
|
fExpressionFormatCombo = createComboBox( formatComposite, PreferenceMessages.getString( "CDebugPreferencePage.9" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
|
||||||
fRegisterFormatCombo = createComboBox( formatComposite, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.registerFormatCombo" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
|
fRegisterFormatCombo = createComboBox( formatComposite, PreferenceMessages.getString( "CDebugPreferencePage.10" ), fFormatLabels, fFormatLabels[0] ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the disassembly setting preferences composite widget
|
* Create the disassembly setting preferences composite widget
|
||||||
*/
|
*/
|
||||||
private void createDisassemblySettingPreferences( Composite parent ) {
|
private void createDisassemblySettingPreferences( Composite parent ) {
|
||||||
Composite group = createGroupComposite( parent, 1, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.Disassembly_options" ) ); //$NON-NLS-1$
|
Composite group = createGroupComposite( parent, 1, PreferenceMessages.getString( "CDebugPreferencePage.11" ) ); //$NON-NLS-1$
|
||||||
Composite comp = ControlFactory.createComposite( group, 2 );
|
Composite comp = ControlFactory.createComposite( group, 2 );
|
||||||
createMaxNumberOfInstructionsField( comp );
|
createMaxNumberOfInstructionsField( comp );
|
||||||
createDisassemblyColorsField( comp );
|
createDisassemblyColorsField( comp );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createMaxNumberOfInstructionsField( Composite parent ) {
|
private void createMaxNumberOfInstructionsField( Composite parent ) {
|
||||||
fMaxNumberOfInstructionsText = new IntegerFieldEditor( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS, CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.maxNumberOfInstructions" ), parent, NUMBER_OF_DIGITS ); //$NON-NLS-1$
|
fMaxNumberOfInstructionsText = new IntegerFieldEditor( ICDebugConstants.PREF_MAX_NUMBER_OF_INSTRUCTIONS, PreferenceMessages.getString( "CDebugPreferencePage.12" ), parent, NUMBER_OF_DIGITS ); //$NON-NLS-1$
|
||||||
GridData data = (GridData)fMaxNumberOfInstructionsText.getTextControl( parent ).getLayoutData();
|
GridData data = (GridData)fMaxNumberOfInstructionsText.getTextControl( parent ).getLayoutData();
|
||||||
data.horizontalAlignment = GridData.BEGINNING;
|
data.horizontalAlignment = GridData.BEGINNING;
|
||||||
data.widthHint = convertWidthInCharsToPixels( NUMBER_OF_DIGITS + 1 );
|
data.widthHint = convertWidthInCharsToPixels( NUMBER_OF_DIGITS + 1 );
|
||||||
|
@ -236,7 +236,7 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
|
||||||
fMaxNumberOfInstructionsText.setValidRange( ICDebugConstants.MIN_NUMBER_OF_INSTRUCTIONS, ICDebugConstants.MAX_NUMBER_OF_INSTRUCTIONS );
|
fMaxNumberOfInstructionsText.setValidRange( ICDebugConstants.MIN_NUMBER_OF_INSTRUCTIONS, ICDebugConstants.MAX_NUMBER_OF_INSTRUCTIONS );
|
||||||
String minValue = Integer.toString( ICDebugConstants.MIN_NUMBER_OF_INSTRUCTIONS );
|
String minValue = Integer.toString( ICDebugConstants.MIN_NUMBER_OF_INSTRUCTIONS );
|
||||||
String maxValue = Integer.toString( ICDebugConstants.MAX_NUMBER_OF_INSTRUCTIONS );
|
String maxValue = Integer.toString( ICDebugConstants.MAX_NUMBER_OF_INSTRUCTIONS );
|
||||||
fMaxNumberOfInstructionsText.setErrorMessage( MessageFormat.format( CDebugUIPlugin.getResourceString( "internal.ui.preferences.CDebugPreferencePage.ErrorMaxNumberOfInstructionsRange" ), new String[]{ minValue, maxValue } ) ); //$NON-NLS-1$
|
fMaxNumberOfInstructionsText.setErrorMessage( MessageFormat.format( PreferenceMessages.getString( "CDebugPreferencePage.13" ), new String[]{ minValue, maxValue } ) ); //$NON-NLS-1$
|
||||||
fMaxNumberOfInstructionsText.load();
|
fMaxNumberOfInstructionsText.load();
|
||||||
fMaxNumberOfInstructionsText.setPropertyChangeListener( new IPropertyChangeListener() {
|
fMaxNumberOfInstructionsText.setPropertyChangeListener( new IPropertyChangeListener() {
|
||||||
|
|
||||||
|
@ -389,4 +389,4 @@ public class CDebugPreferencePage extends PreferencePage implements IWorkbenchPr
|
||||||
private ColorFieldEditor getDisassemblySourceColor() {
|
private ColorFieldEditor getDisassemblySourceColor() {
|
||||||
return fDisassemblySourceColor;
|
return fDisassemblySourceColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.preferences;
|
package org.eclipse.cdt.debug.internal.ui.preferences;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
||||||
|
@ -23,80 +28,57 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
import org.eclipse.ui.help.WorkbenchHelp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The preference page of the Memory view.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Jul 25, 2002
|
|
||||||
*/
|
*/
|
||||||
public class MemoryViewPreferencePage extends FieldEditorPreferencePage
|
public class MemoryViewPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
|
||||||
implements IWorkbenchPreferencePage
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for MemoryViewPreferencePage.
|
* Constructor for MemoryViewPreferencePage.
|
||||||
* @param style
|
|
||||||
*/
|
*/
|
||||||
public MemoryViewPreferencePage()
|
public MemoryViewPreferencePage() {
|
||||||
{
|
|
||||||
super( GRID );
|
super( GRID );
|
||||||
setDescription( CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Description") ); //$NON-NLS-1$
|
setDescription( PreferenceMessages.getString( "MemoryViewPreferencePage.0" ) ); //$NON-NLS-1$
|
||||||
setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() );
|
setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see PreferencePage#createControl(Composite)
|
* @see PreferencePage#createControl(Composite)
|
||||||
*/
|
*/
|
||||||
public void createControl( Composite parent )
|
public void createControl( Composite parent ) {
|
||||||
{
|
|
||||||
super.createControl( parent );
|
super.createControl( parent );
|
||||||
WorkbenchHelp.setHelp( parent, ICDebugHelpContextIds.MEMORY_PREFERENCE_PAGE );
|
WorkbenchHelp.setHelp( parent, ICDebugHelpContextIds.MEMORY_PREFERENCE_PAGE );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
|
||||||
*/
|
*/
|
||||||
protected void createFieldEditors()
|
protected void createFieldEditors() {
|
||||||
{
|
/*
|
||||||
/*
|
* String[][] sizes = { { "Byte", "1" }, { "Half Word", "2" }, { "Word", "4" }, { "Double Word", "8" }, // { "Float", "8" }, // { "Double Float", "16" }, };
|
||||||
String[][] sizes = { { "Byte", "1" },
|
* addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_SIZE, "Size:", sizes, getFieldEditorParent() ) );
|
||||||
{ "Half Word", "2" },
|
*
|
||||||
{ "Word", "4" },
|
* String[][] formats = { { "Hexadecimal", "0" }, { "Binary", "1" }, // { "Octal", "2" }, // { "Signed Decimal", "3" }, // { "Unsigned Decimal", "4" }, };
|
||||||
{ "Double Word", "8" },
|
* addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_FORMAT, "Format:", formats, getFieldEditorParent() ) );
|
||||||
// { "Float", "8" },
|
*
|
||||||
// { "Double Float", "16" },
|
* String[][] bytesPerRow = { { "4", "4" }, { "8", "8" }, { "16", "16" }, { "32", "32" }, { "64", "64" }, { "128", "128" } }; addField( new
|
||||||
};
|
* ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_BYTES_PER_ROW, "Bytes Per Row:", bytesPerRow, getFieldEditorParent() ) );
|
||||||
addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_SIZE, "Size:", sizes, getFieldEditorParent() ) );
|
*
|
||||||
|
* addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_DISPLAY_ASCII, "Display ASCII", getFieldEditorParent() ) );
|
||||||
String[][] formats = { { "Hexadecimal", "0" },
|
*/
|
||||||
{ "Binary", "1" },
|
ColorFieldEditor foreground = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB, PreferenceMessages.getString( "MemoryViewPreferencePage.1" ), getFieldEditorParent() ); //$NON-NLS-1$
|
||||||
// { "Octal", "2" },
|
ColorFieldEditor background = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_BACKGROUND_RGB, PreferenceMessages.getString( "MemoryViewPreferencePage.2" ), getFieldEditorParent() ); //$NON-NLS-1$
|
||||||
// { "Signed Decimal", "3" },
|
ColorFieldEditor address = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_ADDRESS_RGB, PreferenceMessages.getString( "MemoryViewPreferencePage.3" ), getFieldEditorParent() ); //$NON-NLS-1$
|
||||||
// { "Unsigned Decimal", "4" },
|
ColorFieldEditor changed = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_CHANGED_RGB, PreferenceMessages.getString( "MemoryViewPreferencePage.4" ), getFieldEditorParent() ); //$NON-NLS-1$
|
||||||
};
|
|
||||||
addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_FORMAT, "Format:", formats, getFieldEditorParent() ) );
|
|
||||||
|
|
||||||
String[][] bytesPerRow = { { "4", "4" }, { "8", "8" },
|
|
||||||
{ "16", "16" }, { "32", "32" },
|
|
||||||
{ "64", "64" }, { "128", "128" } };
|
|
||||||
addField( new ComboFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_BYTES_PER_ROW, "Bytes Per Row:", bytesPerRow, getFieldEditorParent() ) );
|
|
||||||
|
|
||||||
addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_DISPLAY_ASCII, "Display ASCII", getFieldEditorParent() ) );
|
|
||||||
*/
|
|
||||||
ColorFieldEditor foreground = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Text_Color"), getFieldEditorParent() ); //$NON-NLS-1$
|
|
||||||
ColorFieldEditor background = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_BACKGROUND_RGB, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Background_Color"), getFieldEditorParent() ); //$NON-NLS-1$
|
|
||||||
ColorFieldEditor address = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_ADDRESS_RGB, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Address_Color"), getFieldEditorParent() ); //$NON-NLS-1$
|
|
||||||
ColorFieldEditor changed = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_CHANGED_RGB, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Changed_Value_Color"), getFieldEditorParent() ); //$NON-NLS-1$
|
|
||||||
// ColorFieldEditor dirty = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_DIRTY_RGB, "Modified Value Color:", getFieldEditorParent() );
|
// ColorFieldEditor dirty = new ColorFieldEditor( ICDebugPreferenceConstants.MEMORY_DIRTY_RGB, "Modified Value Color:", getFieldEditorParent() );
|
||||||
|
FontFieldEditor font = new FontFieldEditor( ICDebugPreferenceConstants.MEMORY_FONT, PreferenceMessages.getString( "MemoryViewPreferencePage.5" ), getFieldEditorParent() ); //$NON-NLS-1$
|
||||||
FontFieldEditor font = new FontFieldEditor( ICDebugPreferenceConstants.MEMORY_FONT, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Font"), getFieldEditorParent() ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
addField( foreground );
|
addField( foreground );
|
||||||
addField( background );
|
addField( background );
|
||||||
addField( address );
|
addField( address );
|
||||||
addField( changed );
|
addField( changed );
|
||||||
// addField( dirty );
|
// addField( dirty );
|
||||||
addField( font );
|
addField( font );
|
||||||
|
|
||||||
StringFieldEditor paddingChar = createPaddingCharacterField();
|
StringFieldEditor paddingChar = createPaddingCharacterField();
|
||||||
paddingChar.setTextLimit( 1 );
|
paddingChar.setTextLimit( 1 );
|
||||||
addField( paddingChar );
|
addField( paddingChar );
|
||||||
|
@ -104,25 +86,24 @@ public class MemoryViewPreferencePage extends FieldEditorPreferencePage
|
||||||
createDefaultSettingsFields();
|
createDefaultSettingsFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench)
|
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(IWorkbench)
|
||||||
*/
|
*/
|
||||||
public void init( IWorkbench workbench )
|
public void init( IWorkbench workbench ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createSpacer( Composite composite, int columnSpan )
|
protected void createSpacer( Composite composite, int columnSpan ) {
|
||||||
{
|
|
||||||
Label label = new Label( composite, SWT.NONE );
|
Label label = new Label( composite, SWT.NONE );
|
||||||
GridData gd = new GridData();
|
GridData gd = new GridData();
|
||||||
gd.horizontalSpan = columnSpan;
|
gd.horizontalSpan = columnSpan;
|
||||||
label.setLayoutData( gd );
|
label.setLayoutData( gd );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initDefaults( IPreferenceStore store )
|
public static void initDefaults( IPreferenceStore store ) {
|
||||||
{
|
store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, ICDebugPreferenceConstants.DEFAULT_MEMORY_PADDING_CHAR );
|
||||||
store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, ICDebugPreferenceConstants.DEFAULT_MEMORY_PADDING_CHAR );
|
store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH, true );
|
||||||
store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH, true );
|
|
||||||
store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII, true );
|
store.setDefault( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII, true );
|
||||||
PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_FONT, ICDebugPreferenceConstants.DEFAULT_MEMORY_FONT );
|
PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_FONT, ICDebugPreferenceConstants.DEFAULT_MEMORY_FONT );
|
||||||
PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB, ICDebugPreferenceConstants.DEFAULT_MEMORY_FOREGROUND_RGB );
|
PreferenceConverter.setDefault( store, ICDebugPreferenceConstants.MEMORY_FOREGROUND_RGB, ICDebugPreferenceConstants.DEFAULT_MEMORY_FOREGROUND_RGB );
|
||||||
|
@ -135,27 +116,24 @@ public class MemoryViewPreferencePage extends FieldEditorPreferencePage
|
||||||
/**
|
/**
|
||||||
* @see IPreferencePage#performOk()
|
* @see IPreferencePage#performOk()
|
||||||
*/
|
*/
|
||||||
public boolean performOk()
|
public boolean performOk() {
|
||||||
{
|
|
||||||
boolean ok = super.performOk();
|
boolean ok = super.performOk();
|
||||||
CDebugUIPlugin.getDefault().savePluginPreferences();
|
CDebugUIPlugin.getDefault().savePluginPreferences();
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
private StringFieldEditor createPaddingCharacterField()
|
private StringFieldEditor createPaddingCharacterField() {
|
||||||
{
|
return new StringFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, PreferenceMessages.getString( "MemoryViewPreferencePage.6" ), 1, getFieldEditorParent() ) //$NON-NLS-1$
|
||||||
return new StringFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Padding_Character"), 1, getFieldEditorParent() ) //$NON-NLS-1$
|
{
|
||||||
{
|
|
||||||
protected boolean doCheckState()
|
protected boolean doCheckState() {
|
||||||
{
|
return (getTextControl().getText().length() == 1);
|
||||||
return ( getTextControl().getText().length() == 1 );
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createDefaultSettingsFields()
|
private void createDefaultSettingsFields() {
|
||||||
{
|
addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH, PreferenceMessages.getString( "MemoryViewPreferencePage.7" ), SWT.NONE, getFieldEditorParent() ) ); //$NON-NLS-1$
|
||||||
addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_AUTO_REFRESH, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Auto_Refresh_by_default"), SWT.NONE, getFieldEditorParent() ) ); //$NON-NLS-1$
|
addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII, PreferenceMessages.getString( "MemoryViewPreferencePage.8" ), SWT.NONE, getFieldEditorParent() ) ); //$NON-NLS-1$
|
||||||
addField( new BooleanFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_SHOW_ASCII, CDebugUIPlugin.getResourceString("internal.ui.preferences.MemoryViewPreferencePage.Show_ascii_by_default"), SWT.NONE, getFieldEditorParent() ) ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1,27 @@
|
||||||
CDebugPreferencePage.Color_of_disassembly_source_lines_1=Color of source lines:
|
CDebugPreferencePage.Color_of_disassembly_source_lines_1=Color of source lines:
|
||||||
|
CDebugPreferencePage.0=Natural
|
||||||
|
CDebugPreferencePage.1=Hexadecimal
|
||||||
|
CDebugPreferencePage.2=Decimal
|
||||||
|
CDebugPreferencePage.3=General settings for C/C++ Debugging.
|
||||||
|
CDebugPreferencePage.4=Opened view default settings
|
||||||
|
CDebugPreferencePage.5=Show full &paths
|
||||||
|
CDebugPreferencePage.6=Automatically refresh registers
|
||||||
|
CDebugPreferencePage.7=Automatically refresh shared libraries
|
||||||
|
CDebugPreferencePage.8=Default variable format:
|
||||||
|
CDebugPreferencePage.9=Default expression format:
|
||||||
|
CDebugPreferencePage.10=Default register format:
|
||||||
|
CDebugPreferencePage.11=Disassembly options
|
||||||
|
CDebugPreferencePage.12=Maximum number of displayed instructions:
|
||||||
|
CDebugPreferencePage.13=The valid value range is [{0},{1}].
|
||||||
|
SourcePreferencePage.0=Common source lookup settings.
|
||||||
|
SourcePreferencePage.1=Source Locations
|
||||||
|
SourcePreferencePage.2=Search for duplicate source files
|
||||||
|
MemoryViewPreferencePage.0=The Memory view settings.
|
||||||
|
MemoryViewPreferencePage.1=Text Color:
|
||||||
|
MemoryViewPreferencePage.2=Background Color:
|
||||||
|
MemoryViewPreferencePage.3=Address Color:
|
||||||
|
MemoryViewPreferencePage.4=Changed Value Color:
|
||||||
|
MemoryViewPreferencePage.5=Font:
|
||||||
|
MemoryViewPreferencePage.6=Padding Character:
|
||||||
|
MemoryViewPreferencePage.7=Auto-Refresh by default
|
||||||
|
MemoryViewPreferencePage.8=Show ASCII by default
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.preferences;
|
package org.eclipse.cdt.debug.internal.ui.preferences;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Observable;
|
import java.util.Observable;
|
||||||
import java.util.Observer;
|
import java.util.Observer;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
|
||||||
import org.eclipse.cdt.debug.core.ICDebugConstants;
|
import org.eclipse.cdt.debug.core.ICDebugConstants;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||||
|
@ -37,34 +40,31 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
import org.eclipse.ui.help.WorkbenchHelp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The "Source Code Locations" preference page.
|
||||||
*
|
|
||||||
* @since Oct 22, 2003
|
|
||||||
*/
|
*/
|
||||||
public class SourcePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Observer
|
public class SourcePreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Observer {
|
||||||
{
|
|
||||||
private SourceListDialogField fSourceListField;
|
private SourceListDialogField fSourceListField;
|
||||||
|
|
||||||
private SelectionButtonDialogField fSearchForDuplicateFiles;
|
private SelectionButtonDialogField fSearchForDuplicateFiles;
|
||||||
|
|
||||||
private boolean fChanged = false;
|
private boolean fChanged = false;
|
||||||
|
|
||||||
public SourcePreferencePage()
|
public SourcePreferencePage() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() );
|
setPreferenceStore( CDebugUIPlugin.getDefault().getPreferenceStore() );
|
||||||
setDescription( CDebugUIPlugin.getResourceString("internal.ui.preferences.SourcePreferencePage.Description") ); //$NON-NLS-1$
|
setDescription( PreferenceMessages.getString( "SourcePreferencePage.0" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
|
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
|
||||||
*/
|
*/
|
||||||
protected Control createContents( Composite parent )
|
protected Control createContents( Composite parent ) {
|
||||||
{
|
|
||||||
WorkbenchHelp.setHelp( getControl(), ICDebugHelpContextIds.SOURCE_PREFERENCE_PAGE );
|
WorkbenchHelp.setHelp( getControl(), ICDebugHelpContextIds.SOURCE_PREFERENCE_PAGE );
|
||||||
|
|
||||||
fSourceListField = createSourceListField();
|
fSourceListField = createSourceListField();
|
||||||
fSearchForDuplicateFiles = createSearchForDuplicateFilesButton();
|
fSearchForDuplicateFiles = createSearchForDuplicateFilesButton();
|
||||||
|
|
||||||
Composite control = new Composite( parent, SWT.NONE );
|
Composite control = new Composite( parent, SWT.NONE );
|
||||||
GridLayout layout = new GridLayout();
|
GridLayout layout = new GridLayout();
|
||||||
layout.numColumns = 2;
|
layout.numColumns = 2;
|
||||||
|
@ -76,157 +76,138 @@ public class SourcePreferencePage extends PreferencePage implements IWorkbenchPr
|
||||||
data.horizontalAlignment = GridData.FILL;
|
data.horizontalAlignment = GridData.FILL;
|
||||||
control.setLayoutData( data );
|
control.setLayoutData( data );
|
||||||
control.setFont( JFaceResources.getDialogFont() );
|
control.setFont( JFaceResources.getDialogFont() );
|
||||||
|
|
||||||
PixelConverter converter = new PixelConverter( control );
|
PixelConverter converter = new PixelConverter( control );
|
||||||
|
|
||||||
fSourceListField.doFillIntoGrid( control, 3 );
|
fSourceListField.doFillIntoGrid( control, 3 );
|
||||||
LayoutUtil.setHorizontalSpan( fSourceListField.getLabelControl( null ), 2 );
|
LayoutUtil.setHorizontalSpan( fSourceListField.getLabelControl( null ), 2 );
|
||||||
LayoutUtil.setWidthHint( fSourceListField.getLabelControl( null ), converter.convertWidthInCharsToPixels( 40 ) );
|
LayoutUtil.setWidthHint( fSourceListField.getLabelControl( null ), converter.convertWidthInCharsToPixels( 40 ) );
|
||||||
LayoutUtil.setHorizontalGrabbing( fSourceListField.getListControl( null ) );
|
LayoutUtil.setHorizontalGrabbing( fSourceListField.getListControl( null ) );
|
||||||
fSearchForDuplicateFiles.doFillIntoGrid( control, 3 );
|
fSearchForDuplicateFiles.doFillIntoGrid( control, 3 );
|
||||||
|
|
||||||
setValues();
|
setValues();
|
||||||
|
|
||||||
return control;
|
return control;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
|
||||||
*/
|
*/
|
||||||
public void init( IWorkbench workbench )
|
public void init( IWorkbench workbench ) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see java.util.Observer#update(java.util.Observable, java.lang.Object)
|
* @see java.util.Observer#update(java.util.Observable, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public void update( Observable o, Object arg )
|
public void update( Observable o, Object arg ) {
|
||||||
{
|
|
||||||
setChanged( true );
|
setChanged( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
private SourceListDialogField createSourceListField()
|
private SourceListDialogField createSourceListField() {
|
||||||
{
|
SourceListDialogField field = new SourceListDialogField( PreferenceMessages.getString( "SourcePreferencePage.1" ), //$NON-NLS-1$
|
||||||
SourceListDialogField field =
|
new IListAdapter() {
|
||||||
new SourceListDialogField( CDebugUIPlugin.getResourceString("internal.ui.preferences.SourcePreferencePage.Source_locations"), //$NON-NLS-1$
|
|
||||||
new IListAdapter()
|
|
||||||
{
|
|
||||||
public void customButtonPressed( DialogField f, int index )
|
|
||||||
{
|
|
||||||
sourceButtonPressed( index );
|
|
||||||
}
|
|
||||||
|
|
||||||
public void selectionChanged(DialogField f)
|
public void customButtonPressed( DialogField f, int index ) {
|
||||||
{
|
sourceButtonPressed( index );
|
||||||
}
|
}
|
||||||
} );
|
|
||||||
|
public void selectionChanged( DialogField f ) {
|
||||||
|
}
|
||||||
|
} );
|
||||||
field.addObserver( this );
|
field.addObserver( this );
|
||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SelectionButtonDialogField createSearchForDuplicateFilesButton()
|
private SelectionButtonDialogField createSearchForDuplicateFilesButton() {
|
||||||
{
|
|
||||||
SelectionButtonDialogField button = new SelectionButtonDialogField( SWT.CHECK );
|
SelectionButtonDialogField button = new SelectionButtonDialogField( SWT.CHECK );
|
||||||
button.setLabelText( CDebugUIPlugin.getResourceString("internal.ui.preferences.SourcePreferencePage.Search_for_duplicate_source_files") ); //$NON-NLS-1$
|
button.setLabelText( PreferenceMessages.getString( "SourcePreferencePage.2" ) ); //$NON-NLS-1$
|
||||||
button.setDialogFieldListener(
|
button.setDialogFieldListener( new IDialogFieldListener() {
|
||||||
new IDialogFieldListener()
|
|
||||||
{
|
public void dialogFieldChanged( DialogField field ) {
|
||||||
public void dialogFieldChanged( DialogField field )
|
setChanged( true );
|
||||||
{
|
}
|
||||||
setChanged( true );
|
} );
|
||||||
}
|
|
||||||
} );
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void sourceButtonPressed( int index )
|
protected void sourceButtonPressed( int index ) {
|
||||||
{
|
switch( index ) {
|
||||||
switch( index )
|
case 0: // Add...
|
||||||
{
|
|
||||||
case 0: // Add...
|
|
||||||
if ( addSourceLocation() )
|
if ( addSourceLocation() )
|
||||||
setChanged( true );
|
setChanged( true );
|
||||||
break;
|
break;
|
||||||
case 2: // Up
|
case 2: // Up
|
||||||
case 3: // Down
|
case 3: // Down
|
||||||
case 5: // Remove
|
case 5: // Remove
|
||||||
setChanged( true );
|
setChanged( true );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isChanged()
|
protected boolean isChanged() {
|
||||||
{
|
|
||||||
return fChanged;
|
return fChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setChanged( boolean changed )
|
protected void setChanged( boolean changed ) {
|
||||||
{
|
|
||||||
fChanged = changed;
|
fChanged = changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean addSourceLocation()
|
private boolean addSourceLocation() {
|
||||||
{
|
|
||||||
AddSourceLocationWizard wizard = new AddSourceLocationWizard( getSourceLocations() );
|
AddSourceLocationWizard wizard = new AddSourceLocationWizard( getSourceLocations() );
|
||||||
WizardDialog dialog = new WizardDialog( getShell(), wizard );
|
WizardDialog dialog = new WizardDialog( getShell(), wizard );
|
||||||
if ( dialog.open() == Window.OK )
|
if ( dialog.open() == Window.OK ) {
|
||||||
{
|
|
||||||
fSourceListField.addElement( wizard.getSourceLocation() );
|
fSourceListField.addElement( wizard.getSourceLocation() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICSourceLocation[] getSourceLocations()
|
public ICSourceLocation[] getSourceLocations() {
|
||||||
{
|
return (fSourceListField != null) ? fSourceListField.getSourceLocations() : new ICSourceLocation[0];
|
||||||
return ( fSourceListField != null ) ? fSourceListField.getSourceLocations() : new ICSourceLocation[0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSourceLocations( ICSourceLocation[] locations )
|
public void setSourceLocations( ICSourceLocation[] locations ) {
|
||||||
{
|
if ( fSourceListField != null )
|
||||||
if ( fSourceListField != null )
|
|
||||||
fSourceListField.setElements( Arrays.asList( locations ) );
|
fSourceListField.setElements( Arrays.asList( locations ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
|
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
|
||||||
*/
|
*/
|
||||||
protected void performDefaults()
|
protected void performDefaults() {
|
||||||
{
|
|
||||||
setSourceLocations( new ICSourceLocation[0] );
|
setSourceLocations( new ICSourceLocation[0] );
|
||||||
setSearchForDuplicateFiles( false );
|
setSearchForDuplicateFiles( false );
|
||||||
super.performDefaults();
|
super.performDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
|
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
|
||||||
*/
|
*/
|
||||||
public boolean performOk()
|
public boolean performOk() {
|
||||||
{
|
|
||||||
storeValues();
|
storeValues();
|
||||||
CDebugCorePlugin.getDefault().savePluginPreferences();
|
CDebugCorePlugin.getDefault().savePluginPreferences();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean searchForDuplicateFiles()
|
private boolean searchForDuplicateFiles() {
|
||||||
{
|
return (fSearchForDuplicateFiles != null) ? fSearchForDuplicateFiles.isSelected() : false;
|
||||||
return ( fSearchForDuplicateFiles != null ) ? fSearchForDuplicateFiles.isSelected() : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSearchForDuplicateFiles( boolean search )
|
private void setSearchForDuplicateFiles( boolean search ) {
|
||||||
{
|
|
||||||
if ( fSearchForDuplicateFiles != null )
|
if ( fSearchForDuplicateFiles != null )
|
||||||
fSearchForDuplicateFiles.setSelection( search );
|
fSearchForDuplicateFiles.setSelection( search );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setValues()
|
private void setValues() {
|
||||||
{
|
|
||||||
setSourceLocations( CDebugCorePlugin.getDefault().getCommonSourceLocations() );
|
setSourceLocations( CDebugCorePlugin.getDefault().getCommonSourceLocations() );
|
||||||
setSearchForDuplicateFiles( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES ) );
|
setSearchForDuplicateFiles( CDebugCorePlugin.getDefault().getPluginPreferences().getBoolean( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void storeValues()
|
private void storeValues() {
|
||||||
{
|
|
||||||
CDebugCorePlugin.getDefault().saveCommonSourceLocations( getSourceLocations() );
|
CDebugCorePlugin.getDefault().saveCommonSourceLocations( getSourceLocations() );
|
||||||
CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES, searchForDuplicateFiles() );
|
CDebugCorePlugin.getDefault().getPluginPreferences().setValue( ICDebugConstants.PREF_SEARCH_DUPLICATE_FILES, searchForDuplicateFiles() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/*
|
/***************************************************************************************************************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others. All rights reserved. This program and the accompanying materials are made available under the terms of
|
||||||
* All Rights Reserved.
|
* the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors: QNX Software Systems - Initial API and implementation
|
||||||
|
**************************************************************************************************************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.wizards;
|
package org.eclipse.cdt.debug.internal.ui.wizards;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation;
|
||||||
|
@ -25,67 +26,58 @@ import org.eclipse.swt.widgets.DirectoryDialog;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
public class AddDirectorySourceLocationBlock {
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since: Dec 12, 2002
|
|
||||||
*/
|
|
||||||
public class AddDirectorySourceLocationBlock
|
|
||||||
{
|
|
||||||
private Composite fControl = null;
|
private Composite fControl = null;
|
||||||
|
|
||||||
private Text fLocationText = null;
|
private Text fLocationText = null;
|
||||||
|
|
||||||
private Text fAssociationText = null;
|
private Text fAssociationText = null;
|
||||||
|
|
||||||
private Button fAssocitedCheckButton = null;
|
private Button fAssocitedCheckButton = null;
|
||||||
|
|
||||||
private Button fSearchSubfoldersButton = null;
|
private Button fSearchSubfoldersButton = null;
|
||||||
|
|
||||||
private Shell fShell = null;
|
private Shell fShell = null;
|
||||||
|
|
||||||
private IPath fInitialAssosciationPath = null;
|
private IPath fInitialAssosciationPath = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddDirectorySourceLocationBlock.
|
* Constructor for AddDirectorySourceLocationBlock.
|
||||||
*/
|
*/
|
||||||
public AddDirectorySourceLocationBlock( IPath initialAssosciationPath )
|
public AddDirectorySourceLocationBlock( IPath initialAssosciationPath ) {
|
||||||
{
|
|
||||||
fInitialAssosciationPath = initialAssosciationPath;
|
fInitialAssosciationPath = initialAssosciationPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createControl( Composite parent )
|
public void createControl( Composite parent ) {
|
||||||
{
|
|
||||||
fShell = parent.getShell();
|
fShell = parent.getShell();
|
||||||
fControl = new Composite( parent, SWT.NONE );
|
fControl = new Composite( parent, SWT.NONE );
|
||||||
fControl.setLayout( new GridLayout() );
|
fControl.setLayout( new GridLayout() );
|
||||||
fControl.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
fControl.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
||||||
fControl.setFont( JFaceResources.getDialogFont() );
|
fControl.setFont( JFaceResources.getDialogFont() );
|
||||||
|
|
||||||
createLocationControls( fControl );
|
createLocationControls( fControl );
|
||||||
createAssociationControls( fControl );
|
createAssociationControls( fControl );
|
||||||
createSearchSubfoldersButton( fControl );
|
createSearchSubfoldersButton( fControl );
|
||||||
|
|
||||||
setInitialAssociationPath();
|
setInitialAssociationPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setInitialAssociationPath()
|
private void setInitialAssociationPath() {
|
||||||
{
|
fAssociationText.setEnabled( (fInitialAssosciationPath != null) );
|
||||||
fAssociationText.setEnabled( ( fInitialAssosciationPath != null ) );
|
fAssocitedCheckButton.setSelection( (fInitialAssosciationPath != null) );
|
||||||
fAssocitedCheckButton.setSelection( ( fInitialAssosciationPath != null ) );
|
if ( fInitialAssosciationPath != null ) {
|
||||||
if ( fInitialAssosciationPath != null )
|
|
||||||
{
|
|
||||||
fAssociationText.setText( fInitialAssosciationPath.toOSString() );
|
fAssociationText.setText( fInitialAssosciationPath.toOSString() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Control getControl()
|
public Control getControl() {
|
||||||
{
|
|
||||||
return fControl;
|
return fControl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createLocationControls( Composite parent )
|
protected void createLocationControls( Composite parent ) {
|
||||||
{
|
|
||||||
PixelConverter converter = new PixelConverter( parent );
|
PixelConverter converter = new PixelConverter( parent );
|
||||||
Label label = new Label( parent, SWT.NONE );
|
Label label = new Label( parent, SWT.NONE );
|
||||||
label.setText( CDebugUIPlugin.getResourceString("AddDirectorySourceLocationBlock.Select_location_directory") ); //$NON-NLS-1$
|
label.setText( WizardMessages.getString( "AddDirectorySourceLocationBlock.0" ) ); //$NON-NLS-1$
|
||||||
label.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ) );
|
label.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ) );
|
||||||
Composite composite = new Composite( parent, SWT.NONE );
|
Composite composite = new Composite( parent, SWT.NONE );
|
||||||
composite.setLayout( new GridLayout( 2, false ) );
|
composite.setLayout( new GridLayout( 2, false ) );
|
||||||
|
@ -94,159 +86,135 @@ public class AddDirectorySourceLocationBlock
|
||||||
composite.setLayoutData( data );
|
composite.setLayoutData( data );
|
||||||
fLocationText = new Text( composite, SWT.SINGLE | SWT.BORDER );
|
fLocationText = new Text( composite, SWT.SINGLE | SWT.BORDER );
|
||||||
fLocationText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ) );
|
fLocationText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL ) );
|
||||||
Button button = createButton( composite, CDebugUIPlugin.getResourceString("AddDirectorySourceLocationBlock.Browse") ); //$NON-NLS-1$
|
Button button = createButton( composite, WizardMessages.getString( "AddDirectorySourceLocationBlock.1" ) ); //$NON-NLS-1$
|
||||||
button.addSelectionListener( new SelectionAdapter()
|
button.addSelectionListener( new SelectionAdapter() {
|
||||||
{
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(SelectionEvent)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void widgetSelected( SelectionEvent e )
|
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(SelectionEvent)
|
||||||
{
|
*/
|
||||||
selectLocation();
|
public void widgetSelected( SelectionEvent e ) {
|
||||||
}
|
selectLocation();
|
||||||
} );
|
}
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void selectLocation()
|
protected void selectLocation() {
|
||||||
{
|
|
||||||
DirectoryDialog dialog = new DirectoryDialog( fShell );
|
DirectoryDialog dialog = new DirectoryDialog( fShell );
|
||||||
dialog.setMessage( CDebugUIPlugin.getResourceString("AddDirectorySourceLocationBlock.Select_Location_Directory") ); //$NON-NLS-1$
|
dialog.setMessage( WizardMessages.getString( "AddDirectorySourceLocationBlock.2" ) ); //$NON-NLS-1$
|
||||||
String result = dialog.open();
|
String result = dialog.open();
|
||||||
if ( result != null )
|
if ( result != null ) {
|
||||||
{
|
|
||||||
fLocationText.setText( result );
|
fLocationText.setText( result );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createAssociationControls( Composite parent )
|
protected void createAssociationControls( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NONE );
|
Composite composite = new Composite( parent, SWT.NONE );
|
||||||
composite.setLayout( new GridLayout() );
|
composite.setLayout( new GridLayout() );
|
||||||
GridData data = new GridData( GridData.FILL_BOTH );
|
GridData data = new GridData( GridData.FILL_BOTH );
|
||||||
composite.setLayoutData( data );
|
composite.setLayoutData( data );
|
||||||
fAssocitedCheckButton = new Button( composite, SWT.CHECK );
|
fAssocitedCheckButton = new Button( composite, SWT.CHECK );
|
||||||
fAssocitedCheckButton.setText( CDebugUIPlugin.getResourceString("AddDirectorySourceLocationBlock.Associate_with") ); //$NON-NLS-1$
|
fAssocitedCheckButton.setText( WizardMessages.getString( "AddDirectorySourceLocationBlock.3" ) ); //$NON-NLS-1$
|
||||||
fAssociationText = new Text( composite, SWT.SINGLE | SWT.BORDER );
|
fAssociationText = new Text( composite, SWT.SINGLE | SWT.BORDER );
|
||||||
fAssociationText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
fAssociationText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
||||||
fAssocitedCheckButton.addSelectionListener( new SelectionAdapter()
|
fAssocitedCheckButton.addSelectionListener( new SelectionAdapter() {
|
||||||
{
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(SelectionEvent)
|
|
||||||
*/
|
|
||||||
public void widgetSelected(SelectionEvent e)
|
|
||||||
{
|
|
||||||
associationSelectionChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
} );
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(SelectionEvent)
|
||||||
|
*/
|
||||||
|
public void widgetSelected( SelectionEvent e ) {
|
||||||
|
associationSelectionChanged();
|
||||||
|
}
|
||||||
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void associationSelectionChanged()
|
protected void associationSelectionChanged() {
|
||||||
{
|
|
||||||
boolean checked = fAssocitedCheckButton.getSelection();
|
boolean checked = fAssocitedCheckButton.getSelection();
|
||||||
fAssociationText.setEnabled( checked );
|
fAssociationText.setEnabled( checked );
|
||||||
if ( !checked )
|
if ( !checked )
|
||||||
fAssociationText.setText( "" ); //$NON-NLS-1$
|
fAssociationText.setText( "" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createSearchSubfoldersButton( Composite parent )
|
protected void createSearchSubfoldersButton( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NONE );
|
Composite composite = new Composite( parent, SWT.NONE );
|
||||||
composite.setLayout( new GridLayout() );
|
composite.setLayout( new GridLayout() );
|
||||||
GridData data = new GridData( GridData.FILL_BOTH );
|
GridData data = new GridData( GridData.FILL_BOTH );
|
||||||
composite.setLayoutData( data );
|
composite.setLayoutData( data );
|
||||||
fSearchSubfoldersButton = new Button( composite, SWT.CHECK );
|
fSearchSubfoldersButton = new Button( composite, SWT.CHECK );
|
||||||
fSearchSubfoldersButton.setText( CDebugUIPlugin.getResourceString("AddDirectorySourceLocationBlock.Search_subfolders") ); //$NON-NLS-1$
|
fSearchSubfoldersButton.setText( WizardMessages.getString( "AddDirectorySourceLocationBlock.4" ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Button createButton( Composite parent, String label )
|
protected Button createButton( Composite parent, String label ) {
|
||||||
{
|
|
||||||
Button button = new Button( parent, SWT.PUSH );
|
Button button = new Button( parent, SWT.PUSH );
|
||||||
button.setText( label );
|
button.setText( label );
|
||||||
GridData data = new GridData( GridData.END );
|
GridData data = new GridData( GridData.END );
|
||||||
button.setLayoutData( data );
|
button.setLayoutData( data );
|
||||||
SWTUtil.setButtonDimensionHint( button );
|
SWTUtil.setButtonDimensionHint( button );
|
||||||
button.setFont( parent.getFont() );
|
button.setFont( parent.getFont() );
|
||||||
|
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocationPath()
|
public String getLocationPath() {
|
||||||
{
|
|
||||||
return fLocationText.getText().trim();
|
return fLocationText.getText().trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAssociationPath()
|
public String getAssociationPath() {
|
||||||
{
|
if ( fAssocitedCheckButton.getSelection() ) {
|
||||||
if ( fAssocitedCheckButton.getSelection() )
|
|
||||||
{
|
|
||||||
return fAssociationText.getText().trim();
|
return fAssociationText.getText().trim();
|
||||||
}
|
}
|
||||||
return ""; //$NON-NLS-1$
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean searchSubfolders()
|
public boolean searchSubfolders() {
|
||||||
{
|
return (fSearchSubfoldersButton != null) ? fSearchSubfoldersButton.getSelection() : false;
|
||||||
return ( fSearchSubfoldersButton != null ) ? fSearchSubfoldersButton.getSelection() : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDirectorySourceLocation getSourceLocation()
|
public IDirectorySourceLocation getSourceLocation() {
|
||||||
{
|
if ( isLocationPathValid() ) {
|
||||||
if ( isLocationPathValid() )
|
Path association = (isAssociationPathValid()) ? new Path( getAssociationPath() ) : null;
|
||||||
{
|
|
||||||
Path association = ( isAssociationPathValid() ) ? new Path( getAssociationPath() ) : null;
|
|
||||||
return SourceLookupFactory.createDirectorySourceLocation( new Path( getLocationPath() ), association, searchSubfolders() );
|
return SourceLookupFactory.createDirectorySourceLocation( new Path( getLocationPath() ), association, searchSubfolders() );
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDirectoryModifyListener( ModifyListener listener )
|
public void addDirectoryModifyListener( ModifyListener listener ) {
|
||||||
{
|
if ( fLocationText != null ) {
|
||||||
if ( fLocationText != null )
|
|
||||||
{
|
|
||||||
fLocationText.addModifyListener( listener );
|
fLocationText.addModifyListener( listener );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addAssociationModifyListener( ModifyListener listener )
|
public void addAssociationModifyListener( ModifyListener listener ) {
|
||||||
{
|
if ( fAssociationText != null ) {
|
||||||
if ( fAssociationText != null )
|
|
||||||
{
|
|
||||||
fAssociationText.addModifyListener( listener );
|
fAssociationText.addModifyListener( listener );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeDirectoryModifyListener( ModifyListener listener )
|
public void removeDirectoryModifyListener( ModifyListener listener ) {
|
||||||
{
|
if ( fLocationText != null ) {
|
||||||
if ( fLocationText != null )
|
|
||||||
{
|
|
||||||
fLocationText.removeModifyListener( listener );
|
fLocationText.removeModifyListener( listener );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAssociationModifyListener( ModifyListener listener )
|
public void removeAssociationModifyListener( ModifyListener listener ) {
|
||||||
{
|
if ( fAssociationText != null ) {
|
||||||
if ( fAssociationText != null )
|
|
||||||
{
|
|
||||||
fAssociationText.removeModifyListener( listener );
|
fAssociationText.removeModifyListener( listener );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isLocationPathValid()
|
private boolean isLocationPathValid() {
|
||||||
{
|
if ( fLocationText != null && Path.EMPTY.isValidPath( fLocationText.getText().trim() ) ) {
|
||||||
if ( fLocationText != null && Path.EMPTY.isValidPath( fLocationText.getText().trim() ) )
|
|
||||||
{
|
|
||||||
Path path = new Path( fLocationText.getText().trim() );
|
Path path = new Path( fLocationText.getText().trim() );
|
||||||
return ( path.toFile().exists() && path.toFile().isAbsolute() );
|
return (path.toFile().exists() && path.toFile().isAbsolute());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAssociationPathValid()
|
public boolean isAssociationPathValid() {
|
||||||
{
|
|
||||||
String pathString = getAssociationPath();
|
String pathString = getAssociationPath();
|
||||||
if ( pathString.length() > 0 )
|
if ( pathString.length() > 0 ) {
|
||||||
{
|
|
||||||
return Path.EMPTY.isValidPath( pathString );
|
return Path.EMPTY.isValidPath( pathString );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,12 +1,16 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.wizards;
|
package org.eclipse.cdt.debug.internal.ui.wizards;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.IDirectorySourceLocation;
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
||||||
|
@ -23,36 +27,27 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The wizard to add a file system directory based source location to the source locator.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Dec 23, 2002
|
|
||||||
*/
|
*/
|
||||||
public class AddDirectorySourceLocationWizard extends Wizard implements INewSourceLocationWizard
|
public class AddDirectorySourceLocationWizard extends Wizard implements INewSourceLocationWizard {
|
||||||
{
|
|
||||||
protected static final String PAGE_NAME = "AddDirectorySourceLocationWizardPage"; //$NON-NLS-1$
|
protected static final String PAGE_NAME = "AddDirectorySourceLocationWizardPage"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
public class AddDirtectorySourceLocationWizardPage extends WizardPage {
|
||||||
*
|
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Dec 25, 2002
|
|
||||||
*/
|
|
||||||
public class AddDirtectorySourceLocationWizardPage extends WizardPage
|
|
||||||
{
|
|
||||||
private AddDirectorySourceLocationBlock fAttachBlock;
|
private AddDirectorySourceLocationBlock fAttachBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddDirtectorySourceLocationWizardPage.
|
* Constructor for AddDirtectorySourceLocationWizardPage.
|
||||||
|
*
|
||||||
* @param pageName
|
* @param pageName
|
||||||
* @param title
|
* @param title
|
||||||
* @param titleImage
|
* @param titleImage
|
||||||
*/
|
*/
|
||||||
public AddDirtectorySourceLocationWizardPage( AddDirectorySourceLocationWizard wizard, IPath initialAssociationPath )
|
public AddDirtectorySourceLocationWizardPage( AddDirectorySourceLocationWizard wizard, IPath initialAssociationPath ) {
|
||||||
{
|
super( PAGE_NAME, WizardMessages.getString( "AddDirectorySourceLocationWizard.0" ), CDebugImages.DESC_WIZBAN_ADD_DIR_SOURCE_LOCATION ); //$NON-NLS-1$
|
||||||
super( PAGE_NAME, CDebugUIPlugin.getResourceString("internal.ui.wizards.AddDirectorySourceLocationWizard.Select_Directory"), CDebugImages.DESC_WIZBAN_ADD_DIR_SOURCE_LOCATION ); //$NON-NLS-1$
|
setWindowTitle( WizardMessages.getString( "AddDirectorySourceLocationWizard.1" ) ); //$NON-NLS-1$
|
||||||
setWindowTitle( CDebugUIPlugin.getResourceString("internal.ui.wizards.AddDirectorySourceLocationWizard.WindowTitle") ); //$NON-NLS-1$
|
setMessage( WizardMessages.getString( "AddDirectorySourceLocationWizard.2" ) ); //$NON-NLS-1$
|
||||||
setMessage( CDebugUIPlugin.getResourceString("internal.ui.wizards.AddDirectorySourceLocationWizard.WindowMessage") ); //$NON-NLS-1$
|
|
||||||
setWizard( wizard );
|
setWizard( wizard );
|
||||||
fAttachBlock = new AddDirectorySourceLocationBlock( initialAssociationPath );
|
fAttachBlock = new AddDirectorySourceLocationBlock( initialAssociationPath );
|
||||||
}
|
}
|
||||||
|
@ -60,98 +55,82 @@ public class AddDirectorySourceLocationWizard extends Wizard implements INewSour
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
|
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
|
||||||
*/
|
*/
|
||||||
public void createControl( Composite parent )
|
public void createControl( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NULL );
|
Composite composite = new Composite( parent, SWT.NULL );
|
||||||
composite.setLayout( new GridLayout() );
|
composite.setLayout( new GridLayout() );
|
||||||
composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
||||||
|
|
||||||
fAttachBlock.createControl( composite );
|
fAttachBlock.createControl( composite );
|
||||||
fAttachBlock.addDirectoryModifyListener( new ModifyListener()
|
fAttachBlock.addDirectoryModifyListener( new ModifyListener() {
|
||||||
{
|
|
||||||
public void modifyText( ModifyEvent e )
|
|
||||||
{
|
|
||||||
directoryChanged();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
fAttachBlock.addAssociationModifyListener( new ModifyListener()
|
public void modifyText( ModifyEvent e ) {
|
||||||
{
|
directoryChanged();
|
||||||
public void modifyText( ModifyEvent e )
|
}
|
||||||
{
|
} );
|
||||||
associationChanged();
|
fAttachBlock.addAssociationModifyListener( new ModifyListener() {
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
|
public void modifyText( ModifyEvent e ) {
|
||||||
|
associationChanged();
|
||||||
|
}
|
||||||
|
} );
|
||||||
setControl( composite );
|
setControl( composite );
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void directoryChanged()
|
protected void directoryChanged() {
|
||||||
{
|
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void associationChanged()
|
protected void associationChanged() {
|
||||||
{
|
|
||||||
updateState();
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateState()
|
private void updateState() {
|
||||||
{
|
|
||||||
boolean complete = true;
|
boolean complete = true;
|
||||||
setErrorMessage( null );
|
setErrorMessage( null );
|
||||||
String dirText = fAttachBlock.getLocationPath();
|
String dirText = fAttachBlock.getLocationPath();
|
||||||
if ( dirText.length() == 0 )
|
if ( dirText.length() == 0 ) {
|
||||||
{
|
setErrorMessage( CDebugUIPlugin.getResourceString( "internal.ui.wizards.AddDirectorySourceLocationWizard.ErrorDirectoryEmpty" ) ); //$NON-NLS-1$
|
||||||
setErrorMessage( CDebugUIPlugin.getResourceString("internal.ui.wizards.AddDirectorySourceLocationWizard.ErrorDirectoryEmpty") ); //$NON-NLS-1$
|
|
||||||
complete = false;
|
complete = false;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
File file = new File( dirText );
|
File file = new File( dirText );
|
||||||
if ( !file.exists() || !file.isDirectory() )
|
if ( !file.exists() || !file.isDirectory() ) {
|
||||||
{
|
setErrorMessage( WizardMessages.getString( "AddDirectorySourceLocationWizard.3" ) ); //$NON-NLS-1$
|
||||||
setErrorMessage( CDebugUIPlugin.getResourceString("internal.ui.wizards.AddDirectorySourceLocationWizard.ErrorDirectoryDoesNotExist") ); //$NON-NLS-1$
|
|
||||||
complete = false;
|
complete = false;
|
||||||
}
|
}
|
||||||
else if ( !file.isAbsolute() )
|
else if ( !file.isAbsolute() ) {
|
||||||
{
|
setErrorMessage( WizardMessages.getString( "AddDirectorySourceLocationWizard.4" ) ); //$NON-NLS-1$
|
||||||
setErrorMessage( CDebugUIPlugin.getResourceString("internal.ui.wizards.AddDirectorySourceLocationWizard.ErrorDirectoryMustBeAbsolute") ); //$NON-NLS-1$
|
|
||||||
complete = false;
|
complete = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setPageComplete( complete );
|
setPageComplete( complete );
|
||||||
}
|
}
|
||||||
|
|
||||||
private IDirectorySourceLocation getSourceLocation()
|
private IDirectorySourceLocation getSourceLocation() {
|
||||||
{
|
|
||||||
return fAttachBlock.getSourceLocation();
|
return fAttachBlock.getSourceLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean finish()
|
protected boolean finish() {
|
||||||
{
|
|
||||||
fSourceLocation = getSourceLocation();
|
fSourceLocation = getSourceLocation();
|
||||||
return ( fSourceLocation != null );
|
return (fSourceLocation != null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IDirectorySourceLocation fSourceLocation = null;
|
protected IDirectorySourceLocation fSourceLocation = null;
|
||||||
|
|
||||||
private IPath fInitialAssociationPath = null;
|
private IPath fInitialAssociationPath = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddDirectorySourceLocationWizard.
|
* Constructor for AddDirectorySourceLocationWizard.
|
||||||
*/
|
*/
|
||||||
public AddDirectorySourceLocationWizard()
|
public AddDirectorySourceLocationWizard() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddDirectorySourceLocationWizard.
|
* Constructor for AddDirectorySourceLocationWizard.
|
||||||
*/
|
*/
|
||||||
public AddDirectorySourceLocationWizard( IPath initialAssociationPath )
|
public AddDirectorySourceLocationWizard( IPath initialAssociationPath ) {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
fInitialAssociationPath = initialAssociationPath;
|
fInitialAssociationPath = initialAssociationPath;
|
||||||
}
|
}
|
||||||
|
@ -159,11 +138,9 @@ public class AddDirectorySourceLocationWizard extends Wizard implements INewSour
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.wizard.IWizard#performFinish()
|
* @see org.eclipse.jface.wizard.IWizard#performFinish()
|
||||||
*/
|
*/
|
||||||
public boolean performFinish()
|
public boolean performFinish() {
|
||||||
{
|
|
||||||
AddDirtectorySourceLocationWizardPage page = (AddDirtectorySourceLocationWizardPage)getStartingPage();
|
AddDirtectorySourceLocationWizardPage page = (AddDirtectorySourceLocationWizardPage)getStartingPage();
|
||||||
if ( page != null )
|
if ( page != null ) {
|
||||||
{
|
|
||||||
return page.finish();
|
return page.finish();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -172,24 +149,21 @@ public class AddDirectorySourceLocationWizard extends Wizard implements INewSour
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription()
|
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription()
|
||||||
*/
|
*/
|
||||||
public String getDescription()
|
public String getDescription() {
|
||||||
{
|
return WizardMessages.getString( "AddDirectorySourceLocationWizard.5" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.wizards.AddDirectorySourceLocationWizard.Description"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.wizard.IWizard#addPages()
|
* @see org.eclipse.jface.wizard.IWizard#addPages()
|
||||||
*/
|
*/
|
||||||
public void addPages()
|
public void addPages() {
|
||||||
{
|
|
||||||
addPage( new AddDirtectorySourceLocationWizardPage( this, fInitialAssociationPath ) );
|
addPage( new AddDirtectorySourceLocationWizardPage( this, fInitialAssociationPath ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getSourceLocation()
|
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getSourceLocation()
|
||||||
*/
|
*/
|
||||||
public ICSourceLocation getSourceLocation()
|
public ICSourceLocation getSourceLocation() {
|
||||||
{
|
|
||||||
return fSourceLocation;
|
return fSourceLocation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.wizards;
|
package org.eclipse.cdt.debug.internal.ui.wizards;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||||
|
@ -20,42 +25,29 @@ import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The wizard to add a project based source location to the source locator.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Dec 23, 2002
|
|
||||||
*/
|
*/
|
||||||
public class AddProjectSourceLocationWizard extends Wizard implements INewSourceLocationWizard
|
public class AddProjectSourceLocationWizard extends Wizard implements INewSourceLocationWizard {
|
||||||
{
|
|
||||||
protected static final String PAGE_NAME = "AddProjectSourceLocationWizardPage"; //$NON-NLS-1$
|
protected static final String PAGE_NAME = "AddProjectSourceLocationWizardPage"; //$NON-NLS-1$
|
||||||
|
|
||||||
protected IProject[] fProjects = null;
|
protected IProject[] fProjects = null;
|
||||||
|
|
||||||
protected IProjectSourceLocation fSourceLocation = null;
|
protected IProjectSourceLocation fSourceLocation = null;
|
||||||
|
|
||||||
/**
|
public class AddProjectSourceLocationWizardPage extends WizardPage implements ISelectionChangedListener, IDoubleClickListener {
|
||||||
*
|
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Dec 27, 2002
|
|
||||||
*/
|
|
||||||
public class AddProjectSourceLocationWizardPage extends WizardPage
|
|
||||||
implements ISelectionChangedListener, IDoubleClickListener
|
|
||||||
{
|
|
||||||
private AddProjectSourceLocationBlock fBlock;
|
private AddProjectSourceLocationBlock fBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddProjectSourceLocationWizardPage.
|
* Constructor for AddProjectSourceLocationWizardPage.
|
||||||
* @param pageName
|
|
||||||
*/
|
*/
|
||||||
public AddProjectSourceLocationWizardPage( AddProjectSourceLocationWizard wizard )
|
public AddProjectSourceLocationWizardPage( AddProjectSourceLocationWizard wizard ) {
|
||||||
{
|
super( PAGE_NAME, WizardMessages.getString( "AddProjectSourceLocationWizard.0" ), CDebugImages.DESC_WIZBAN_ADD_PRJ_SOURCE_LOCATION ); //$NON-NLS-1$
|
||||||
super( PAGE_NAME, CDebugUIPlugin.getResourceString("internal.ui.wizards.AddProjectSourceLocationWizard.Select_Project"), CDebugImages.DESC_WIZBAN_ADD_PRJ_SOURCE_LOCATION ); //$NON-NLS-1$
|
setWindowTitle( WizardMessages.getString( "AddProjectSourceLocationWizard.1" ) ); //$NON-NLS-1$
|
||||||
setWindowTitle( CDebugUIPlugin.getResourceString("internal.ui.wizards.AddProjectSourceLocationWizard.WindowTitle") ); //$NON-NLS-1$
|
setMessage( WizardMessages.getString( "AddProjectSourceLocationWizard.2" ) ); //$NON-NLS-1$
|
||||||
setMessage( CDebugUIPlugin.getResourceString("internal.ui.wizards.AddProjectSourceLocationWizard.AddProjectLocationMessage") ); //$NON-NLS-1$
|
|
||||||
setWizard( wizard );
|
setWizard( wizard );
|
||||||
fBlock = new AddProjectSourceLocationBlock( fProjects );
|
fBlock = new AddProjectSourceLocationBlock( fProjects );
|
||||||
setPageComplete( false );
|
setPageComplete( false );
|
||||||
|
@ -64,49 +56,41 @@ public class AddProjectSourceLocationWizard extends Wizard implements INewSource
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
|
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
|
||||||
*/
|
*/
|
||||||
public void createControl( Composite parent )
|
public void createControl( Composite parent ) {
|
||||||
{
|
|
||||||
Composite composite = new Composite( parent, SWT.NULL );
|
Composite composite = new Composite( parent, SWT.NULL );
|
||||||
composite.setLayout( new GridLayout() );
|
composite.setLayout( new GridLayout() );
|
||||||
composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
|
||||||
|
|
||||||
fBlock.createControl( composite );
|
fBlock.createControl( composite );
|
||||||
fBlock.addDoubleClickListener( this );
|
fBlock.addDoubleClickListener( this );
|
||||||
fBlock.addSelectionChangedListener( this );
|
fBlock.addSelectionChangedListener( this );
|
||||||
|
|
||||||
setControl( composite );
|
setControl( composite );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
|
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( SelectionChangedEvent event )
|
public void selectionChanged( SelectionChangedEvent event ) {
|
||||||
{
|
|
||||||
setPageComplete( !event.getSelection().isEmpty() );
|
setPageComplete( !event.getSelection().isEmpty() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent)
|
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent)
|
||||||
*/
|
*/
|
||||||
public void doubleClick( DoubleClickEvent event )
|
public void doubleClick( DoubleClickEvent event ) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean finish()
|
protected boolean finish() {
|
||||||
{
|
if ( fBlock != null ) {
|
||||||
if ( fBlock != null )
|
|
||||||
{
|
|
||||||
fSourceLocation = fBlock.getSourceLocation();
|
fSourceLocation = fBlock.getSourceLocation();
|
||||||
}
|
}
|
||||||
return ( fSourceLocation != null );
|
return (fSourceLocation != null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddProjectSourceLocationWizard.
|
* Constructor for AddProjectSourceLocationWizard.
|
||||||
*/
|
*/
|
||||||
public AddProjectSourceLocationWizard( IProject[] projects )
|
public AddProjectSourceLocationWizard( IProject[] projects ) {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
fProjects = projects;
|
fProjects = projects;
|
||||||
}
|
}
|
||||||
|
@ -114,11 +98,9 @@ public class AddProjectSourceLocationWizard extends Wizard implements INewSource
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.wizard.IWizard#performFinish()
|
* @see org.eclipse.jface.wizard.IWizard#performFinish()
|
||||||
*/
|
*/
|
||||||
public boolean performFinish()
|
public boolean performFinish() {
|
||||||
{
|
|
||||||
AddProjectSourceLocationWizardPage page = (AddProjectSourceLocationWizardPage)getStartingPage();
|
AddProjectSourceLocationWizardPage page = (AddProjectSourceLocationWizardPage)getStartingPage();
|
||||||
if ( page != null )
|
if ( page != null ) {
|
||||||
{
|
|
||||||
return page.finish();
|
return page.finish();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -127,24 +109,21 @@ public class AddProjectSourceLocationWizard extends Wizard implements INewSource
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription()
|
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription()
|
||||||
*/
|
*/
|
||||||
public String getDescription()
|
public String getDescription() {
|
||||||
{
|
return WizardMessages.getString( "AddProjectSourceLocationWizard.3" ); //$NON-NLS-1$
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.wizards.AddProjectSourceLocationWizard.Description"); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getSourceLocation()
|
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getSourceLocation()
|
||||||
*/
|
*/
|
||||||
public ICSourceLocation getSourceLocation()
|
public ICSourceLocation getSourceLocation() {
|
||||||
{
|
|
||||||
return fSourceLocation;
|
return fSourceLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.wizard.IWizard#addPages()
|
* @see org.eclipse.jface.wizard.IWizard#addPages()
|
||||||
*/
|
*/
|
||||||
public void addPages()
|
public void addPages() {
|
||||||
{
|
|
||||||
addPage( new AddProjectSourceLocationWizardPage( this ) );
|
addPage( new AddProjectSourceLocationWizardPage( this ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,56 +1,57 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.wizards;
|
package org.eclipse.cdt.debug.internal.ui.wizards;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||||
import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard;
|
import org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard;
|
||||||
import org.eclipse.jface.wizard.Wizard;
|
import org.eclipse.jface.wizard.Wizard;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enter type comment.
|
* The wizard to add a source location to the source locator.
|
||||||
*
|
|
||||||
* @since: Dec 20, 2002
|
|
||||||
*/
|
*/
|
||||||
public class AddSourceLocationWizard extends Wizard implements INewSourceLocationWizard
|
public class AddSourceLocationWizard extends Wizard implements INewSourceLocationWizard {
|
||||||
{
|
|
||||||
private ICSourceLocation[] fLocations = null;
|
private ICSourceLocation[] fLocations = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for AddSourceLocationWizard.
|
* Constructor for AddSourceLocationWizard.
|
||||||
*/
|
*/
|
||||||
public AddSourceLocationWizard( ICSourceLocation[] locations )
|
public AddSourceLocationWizard( ICSourceLocation[] locations ) {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
setWindowTitle( CDebugUIPlugin.getResourceString("AddSourceLocationWizard.Window_Title") ); //$NON-NLS-1$
|
setWindowTitle( WizardMessages.getString( "AddSourceLocationWizard.0" ) ); //$NON-NLS-1$
|
||||||
setForcePreviousAndNextButtons( true );
|
setForcePreviousAndNextButtons( true );
|
||||||
fLocations = locations;
|
fLocations = locations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.wizard.IWizard#performFinish()
|
* @see org.eclipse.jface.wizard.IWizard#performFinish()
|
||||||
*/
|
*/
|
||||||
public boolean performFinish()
|
public boolean performFinish() {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.jface.wizard.Wizard#addPages()
|
* @see org.eclipse.jface.wizard.Wizard#addPages()
|
||||||
*/
|
*/
|
||||||
public void addPages()
|
public void addPages() {
|
||||||
{
|
|
||||||
addPage( new SourceLocationSelectionPage( fLocations ) );
|
addPage( new SourceLocationSelectionPage( fLocations ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICSourceLocation getSourceLocation()
|
public ICSourceLocation getSourceLocation() {
|
||||||
{
|
|
||||||
SourceLocationSelectionPage page = (SourceLocationSelectionPage)getStartingPage();
|
SourceLocationSelectionPage page = (SourceLocationSelectionPage)getStartingPage();
|
||||||
if ( page != null )
|
if ( page != null ) {
|
||||||
{
|
|
||||||
return page.getSourceLocation();
|
return page.getSourceLocation();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -59,8 +60,7 @@ public class AddSourceLocationWizard extends Wizard implements INewSourceLocatio
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription()
|
* @see org.eclipse.cdt.debug.ui.sourcelookup.INewSourceLocationWizard#getDescription()
|
||||||
*/
|
*/
|
||||||
public String getDescription()
|
public String getDescription() {
|
||||||
{
|
|
||||||
return ""; //$NON-NLS-1$
|
return ""; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,12 +1,16 @@
|
||||||
/*
|
/**********************************************************************
|
||||||
*(c) Copyright QNX Software Systems Ltd. 2002.
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
* All Rights Reserved.
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
*
|
*
|
||||||
*/
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.wizards;
|
package org.eclipse.cdt.debug.internal.ui.wizards;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.ICSourceLocation;
|
||||||
import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation;
|
import org.eclipse.cdt.debug.core.sourcelookup.IProjectSourceLocation;
|
||||||
|
@ -33,131 +37,107 @@ import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Table;
|
import org.eclipse.swt.widgets.Table;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The source lookup properties of debug sessions.
|
||||||
* Enter type comment.
|
|
||||||
*
|
|
||||||
* @since Dec 24, 2002
|
|
||||||
*/
|
*/
|
||||||
public class SourceLocationSelectionPage extends WizardSelectionPage
|
public class SourceLocationSelectionPage extends WizardSelectionPage implements ISelectionChangedListener, IDoubleClickListener {
|
||||||
implements ISelectionChangedListener,
|
|
||||||
IDoubleClickListener
|
private static final String PAGE_NAME = WizardMessages.getString( "SourceLocationSelectionPage.0" ); //$NON-NLS-1$
|
||||||
{
|
|
||||||
private static final String PAGE_NAME = CDebugUIPlugin.getResourceString("internal.ui.preferences.SourceLocationSelectionPage.Add_Source_Location"); //$NON-NLS-1$
|
|
||||||
private final static int SIZING_LISTS_HEIGHT = 200;
|
private final static int SIZING_LISTS_HEIGHT = 200;
|
||||||
|
|
||||||
private final static int SIZING_LISTS_WIDTH = 150;
|
private final static int SIZING_LISTS_WIDTH = 150;
|
||||||
|
|
||||||
protected TableViewer fWizardSelectionViewer;
|
protected TableViewer fWizardSelectionViewer;
|
||||||
|
|
||||||
protected Object[] fElements = null;
|
protected Object[] fElements = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for SourceLocationSelectionPage.
|
* Constructor for SourceLocationSelectionPage.
|
||||||
|
*
|
||||||
* @param pageName
|
* @param pageName
|
||||||
*/
|
*/
|
||||||
public SourceLocationSelectionPage( ICSourceLocation[] locations )
|
public SourceLocationSelectionPage( ICSourceLocation[] locations ) {
|
||||||
{
|
|
||||||
super( PAGE_NAME );
|
super( PAGE_NAME );
|
||||||
setTitle( CDebugUIPlugin.getResourceString("internal.ui.preferences.SourceLocationSelectionPage.WindowTitle") ); //$NON-NLS-1$
|
setTitle( WizardMessages.getString( "SourceLocationSelectionPage.1" ) ); //$NON-NLS-1$
|
||||||
setImageDescriptor( CDebugImages.DESC_WIZBAN_ADD_SOURCE_LOCATION );
|
setImageDescriptor( CDebugImages.DESC_WIZBAN_ADD_SOURCE_LOCATION );
|
||||||
fElements = new Object[] { new AddProjectSourceLocationWizard( getProjectList( locations ) ),
|
fElements = new Object[]{ new AddProjectSourceLocationWizard( getProjectList( locations ) ), new AddDirectorySourceLocationWizard() };
|
||||||
new AddDirectorySourceLocationWizard() };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
|
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(Composite)
|
||||||
*/
|
*/
|
||||||
public void createControl( Composite parent )
|
public void createControl( Composite parent ) {
|
||||||
{
|
|
||||||
// create composite for page.
|
// create composite for page.
|
||||||
Composite outerContainer = new Composite( parent, SWT.NONE );
|
Composite outerContainer = new Composite( parent, SWT.NONE );
|
||||||
outerContainer.setLayout( new GridLayout() );
|
outerContainer.setLayout( new GridLayout() );
|
||||||
outerContainer.setLayoutData( new GridData( GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL ) );
|
outerContainer.setLayoutData( new GridData( GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL ) );
|
||||||
|
new Label( outerContainer, SWT.NONE ).setText( WizardMessages.getString( "SourceLocationSelectionPage.2" ) ); //$NON-NLS-1$
|
||||||
new Label( outerContainer, SWT.NONE ).setText( CDebugUIPlugin.getResourceString("internal.ui.preferences.SourceLocationSelectionPage.Select_source_location_type") ); //$NON-NLS-1$
|
|
||||||
|
|
||||||
//Create a table for the list
|
//Create a table for the list
|
||||||
Table table = new Table( outerContainer, SWT.BORDER );
|
Table table = new Table( outerContainer, SWT.BORDER );
|
||||||
GridData data = new GridData( GridData.FILL_HORIZONTAL );
|
GridData data = new GridData( GridData.FILL_HORIZONTAL );
|
||||||
data.widthHint = SIZING_LISTS_WIDTH;
|
data.widthHint = SIZING_LISTS_WIDTH;
|
||||||
data.heightHint = SIZING_LISTS_HEIGHT;
|
data.heightHint = SIZING_LISTS_HEIGHT;
|
||||||
table.setLayoutData( data );
|
table.setLayoutData( data );
|
||||||
|
// the list viewer
|
||||||
// the list viewer
|
|
||||||
fWizardSelectionViewer = new TableViewer( table );
|
fWizardSelectionViewer = new TableViewer( table );
|
||||||
fWizardSelectionViewer.setContentProvider( new IStructuredContentProvider()
|
fWizardSelectionViewer.setContentProvider( new IStructuredContentProvider() {
|
||||||
{
|
|
||||||
public Object[] getElements( Object inputElement )
|
|
||||||
{
|
|
||||||
return fElements;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void inputChanged( Viewer viewer, Object oldInput, Object newInput )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public void dispose()
|
public Object[] getElements( Object inputElement ) {
|
||||||
{
|
return fElements;
|
||||||
}
|
}
|
||||||
} );
|
|
||||||
fWizardSelectionViewer.setLabelProvider( new LabelProvider()
|
|
||||||
{
|
|
||||||
public String getText( Object element )
|
|
||||||
{
|
|
||||||
if ( element instanceof AddProjectSourceLocationWizard )
|
|
||||||
{
|
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.preferences.SourceLocationSelectionPage.Existing_Project_Into_Workspace"); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
if ( element instanceof AddDirectorySourceLocationWizard )
|
|
||||||
{
|
|
||||||
return CDebugUIPlugin.getResourceString("internal.ui.preferences.SourceLocationSelectionPage.File_System_Directory"); //$NON-NLS-1$
|
|
||||||
}
|
|
||||||
return super.getText( element );
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public void inputChanged( Viewer viewer, Object oldInput, Object newInput ) {
|
||||||
* @see org.eclipse.jface.viewers.LabelProvider#getImage(Object)
|
}
|
||||||
*/
|
|
||||||
public Image getImage(Object element)
|
public void dispose() {
|
||||||
{
|
}
|
||||||
if ( element instanceof AddProjectSourceLocationWizard )
|
} );
|
||||||
{
|
fWizardSelectionViewer.setLabelProvider( new LabelProvider() {
|
||||||
return CDebugImages.get( CDebugImages.IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION );
|
|
||||||
}
|
public String getText( Object element ) {
|
||||||
if ( element instanceof AddDirectorySourceLocationWizard )
|
if ( element instanceof AddProjectSourceLocationWizard ) {
|
||||||
{
|
return WizardMessages.getString( "SourceLocationSelectionPage.3" ); //$NON-NLS-1$
|
||||||
return CDebugImages.get( CDebugImages.IMG_TOOLS_ADD_DIR_SOURCE_LOCATION );
|
}
|
||||||
}
|
if ( element instanceof AddDirectorySourceLocationWizard ) {
|
||||||
return super.getImage( element );
|
return WizardMessages.getString( "SourceLocationSelectionPage.4" ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
} );
|
return super.getText( element );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.eclipse.jface.viewers.LabelProvider#getImage(Object)
|
||||||
|
*/
|
||||||
|
public Image getImage( Object element ) {
|
||||||
|
if ( element instanceof AddProjectSourceLocationWizard ) {
|
||||||
|
return CDebugImages.get( CDebugImages.IMG_TOOLS_ADD_PRJ_SOURCE_LOCATION );
|
||||||
|
}
|
||||||
|
if ( element instanceof AddDirectorySourceLocationWizard ) {
|
||||||
|
return CDebugImages.get( CDebugImages.IMG_TOOLS_ADD_DIR_SOURCE_LOCATION );
|
||||||
|
}
|
||||||
|
return super.getImage( element );
|
||||||
|
}
|
||||||
|
} );
|
||||||
fWizardSelectionViewer.addSelectionChangedListener( this );
|
fWizardSelectionViewer.addSelectionChangedListener( this );
|
||||||
fWizardSelectionViewer.addDoubleClickListener( this );
|
fWizardSelectionViewer.addDoubleClickListener( this );
|
||||||
|
|
||||||
fWizardSelectionViewer.setInput( fElements );
|
fWizardSelectionViewer.setInput( fElements );
|
||||||
|
|
||||||
fWizardSelectionViewer.setSelection( new StructuredSelection( fElements[0] ) );
|
fWizardSelectionViewer.setSelection( new StructuredSelection( fElements[0] ) );
|
||||||
|
|
||||||
setControl( outerContainer );
|
setControl( outerContainer );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
|
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(SelectionChangedEvent)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( SelectionChangedEvent event )
|
public void selectionChanged( SelectionChangedEvent event ) {
|
||||||
{
|
|
||||||
setErrorMessage( null );
|
setErrorMessage( null );
|
||||||
IStructuredSelection selection = (IStructuredSelection)event.getSelection();
|
IStructuredSelection selection = (IStructuredSelection)event.getSelection();
|
||||||
INewSourceLocationWizard currentWizardSelection = (INewSourceLocationWizard)selection.getFirstElement();
|
INewSourceLocationWizard currentWizardSelection = (INewSourceLocationWizard)selection.getFirstElement();
|
||||||
if ( currentWizardSelection == null )
|
if ( currentWizardSelection == null ) {
|
||||||
{
|
|
||||||
setMessage( null );
|
setMessage( null );
|
||||||
setSelectedNode( null );
|
setSelectedNode( null );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setSelectedNode( createWizardNode( currentWizardSelection ) );
|
setSelectedNode( createWizardNode( currentWizardSelection ) );
|
||||||
setMessage( currentWizardSelection.getDescription() );
|
setMessage( currentWizardSelection.getDescription() );
|
||||||
}
|
}
|
||||||
|
@ -165,59 +145,46 @@ public class SourceLocationSelectionPage extends WizardSelectionPage
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent)
|
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent)
|
||||||
*/
|
*/
|
||||||
public void doubleClick( DoubleClickEvent event )
|
public void doubleClick( DoubleClickEvent event ) {
|
||||||
{
|
|
||||||
selectionChanged( new SelectionChangedEvent( fWizardSelectionViewer, fWizardSelectionViewer.getSelection() ) );
|
selectionChanged( new SelectionChangedEvent( fWizardSelectionViewer, fWizardSelectionViewer.getSelection() ) );
|
||||||
getContainer().showPage( getNextPage() );
|
getContainer().showPage( getNextPage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private IWizardNode createWizardNode( INewSourceLocationWizard wizard )
|
private IWizardNode createWizardNode( INewSourceLocationWizard wizard ) {
|
||||||
{
|
|
||||||
return new SourceLocationWizardNode( wizard );
|
return new SourceLocationWizardNode( wizard );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.jface.dialogs.IDialogPage#dispose()
|
* @see org.eclipse.jface.dialogs.IDialogPage#dispose()
|
||||||
*/
|
*/
|
||||||
public void dispose()
|
public void dispose() {
|
||||||
{
|
if ( fElements != null ) {
|
||||||
if ( fElements != null )
|
for( int i = 0; i < fElements.length; ++i ) {
|
||||||
{
|
|
||||||
for ( int i = 0; i < fElements.length; ++i )
|
|
||||||
{
|
|
||||||
((INewSourceLocationWizard)fElements[i]).dispose();
|
((INewSourceLocationWizard)fElements[i]).dispose();
|
||||||
}
|
}
|
||||||
fElements = null;
|
fElements = null;
|
||||||
}
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICSourceLocation getSourceLocation()
|
public ICSourceLocation getSourceLocation() {
|
||||||
{
|
|
||||||
return ((INewSourceLocationWizard)getSelectedNode().getWizard()).getSourceLocation();
|
return ((INewSourceLocationWizard)getSelectedNode().getWizard()).getSourceLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
private IProject[] getProjectList( ICSourceLocation[] locations )
|
private IProject[] getProjectList( ICSourceLocation[] locations ) {
|
||||||
{
|
|
||||||
ArrayList projects = new ArrayList( locations.length );
|
ArrayList projects = new ArrayList( locations.length );
|
||||||
for ( int i = 0; i < locations.length; ++i )
|
for( int i = 0; i < locations.length; ++i ) {
|
||||||
{
|
if ( locations[i] instanceof IProjectSourceLocation ) {
|
||||||
if ( locations[i] instanceof IProjectSourceLocation )
|
|
||||||
{
|
|
||||||
projects.add( ((IProjectSourceLocation)locations[i]).getProject() );
|
projects.add( ((IProjectSourceLocation)locations[i]).getProject() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
|
IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
|
||||||
ArrayList result = new ArrayList( allProjects.length );
|
ArrayList result = new ArrayList( allProjects.length );
|
||||||
for ( int i = 0; i < allProjects.length; ++i )
|
for( int i = 0; i < allProjects.length; ++i ) {
|
||||||
{
|
if ( (CoreModel.hasCNature( allProjects[i] ) || CoreModel.hasCCNature( allProjects[i] )) && allProjects[i].isOpen() && !projects.contains( allProjects[i] ) ) {
|
||||||
if ( ( CoreModel.hasCNature( allProjects[i] ) || CoreModel.hasCCNature( allProjects[i] ) ) &&
|
|
||||||
allProjects[i].isOpen() &&
|
|
||||||
!projects.contains( allProjects[i] ) )
|
|
||||||
{
|
|
||||||
result.add( allProjects[i] );
|
result.add( allProjects[i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (IProject[])result.toArray( new IProject[result.size()] );
|
return (IProject[])result.toArray( new IProject[result.size()] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
/**********************************************************************
|
||||||
|
* Copyright (c) 2004 QNX Software Systems and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Common Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/cpl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* QNX Software Systems - Initial API and implementation
|
||||||
|
***********************************************************************/
|
||||||
|
package org.eclipse.cdt.debug.internal.ui.wizards;
|
||||||
|
|
||||||
|
import java.util.MissingResourceException;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Comment for .
|
||||||
|
*/
|
||||||
|
public class WizardMessages {
|
||||||
|
|
||||||
|
private static final String BUNDLE_NAME = "org.eclipse.cdt.debug.internal.ui.wizards.WizardMessages";//$NON-NLS-1$
|
||||||
|
|
||||||
|
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
|
||||||
|
|
||||||
|
private WizardMessages() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString( String key ) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
try {
|
||||||
|
return RESOURCE_BUNDLE.getString( key );
|
||||||
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
|
return '!' + key + '!';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
AddProjectSourceLocationWizard.0=Select Project
|
||||||
|
AddProjectSourceLocationWizard.1=Add Project Source Location
|
||||||
|
AddProjectSourceLocationWizard.2=Add an existing workspace project to the source locations list.
|
||||||
|
AddProjectSourceLocationWizard.3=Add an existing project to the source locations list.
|
||||||
|
AddDirectorySourceLocationWizard.0=Select Directory
|
||||||
|
AddDirectorySourceLocationWizard.1=Add Directory Source Location
|
||||||
|
AddDirectorySourceLocationWizard.2=Add a local file system directory to the source locations list.
|
||||||
|
AddDirectorySourceLocationWizard.3=Directory does not exist.
|
||||||
|
AddDirectorySourceLocationWizard.4=Directory path must be absolute.
|
||||||
|
AddDirectorySourceLocationWizard.5=Add a local file system directory to the source locations list.
|
||||||
|
AddDirectorySourceLocationBlock.0=Select location directory:
|
||||||
|
AddDirectorySourceLocationBlock.1=&Browse...
|
||||||
|
AddDirectorySourceLocationBlock.2=Select Location Directory
|
||||||
|
AddDirectorySourceLocationBlock.3=&Associate with
|
||||||
|
AddDirectorySourceLocationBlock.4=Search sub&folders
|
||||||
|
AddSourceLocationWizard.0=Add Source Location
|
||||||
|
SourceLocationSelectionPage.0=Add Source Location
|
||||||
|
SourceLocationSelectionPage.1=Select
|
||||||
|
SourceLocationSelectionPage.2=Select source location type:
|
||||||
|
SourceLocationSelectionPage.3=Existing Project Into Workspace
|
||||||
|
SourceLocationSelectionPage.4=File System Directory
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
package org.eclipse.cdt.debug.ui;
|
package org.eclipse.cdt.debug.ui;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
|
@ -55,15 +55,16 @@ import org.osgi.framework.BundleContext;
|
||||||
/**
|
/**
|
||||||
* The main plugin class to be used in the desktop.
|
* The main plugin class to be used in the desktop.
|
||||||
*/
|
*/
|
||||||
public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListener
|
public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListener {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* The plug-in identifier (value <code>"org.eclipse.cdt.debug.ui"</code>).
|
* 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$
|
public static final String PLUGIN_ID = "org.eclipse.cdt.debug.ui"; //$NON-NLS-1$
|
||||||
|
|
||||||
//The shared instance.
|
//The shared instance.
|
||||||
private static CDebugUIPlugin plugin;
|
private static CDebugUIPlugin plugin;
|
||||||
|
|
||||||
//Resource bundle.
|
//Resource bundle.
|
||||||
private ResourceBundle resourceBundle;
|
private ResourceBundle resourceBundle;
|
||||||
|
|
||||||
|
@ -74,17 +75,13 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
/**
|
/**
|
||||||
* The constructor.
|
* The constructor.
|
||||||
*/
|
*/
|
||||||
public CDebugUIPlugin()
|
public CDebugUIPlugin() {
|
||||||
{
|
|
||||||
super();
|
super();
|
||||||
plugin = this;
|
plugin = this;
|
||||||
try
|
try {
|
||||||
{
|
resourceBundle = ResourceBundle.getBundle( "org.eclipse.cdt.debug.ui.CDebugUIPluginResources" ); //$NON-NLS-1$
|
||||||
resourceBundle =
|
|
||||||
ResourceBundle.getBundle( "org.eclipse.cdt.debug.ui.CDebugUIPluginResources" ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
catch( MissingResourceException x )
|
catch( MissingResourceException x ) {
|
||||||
{
|
|
||||||
resourceBundle = null;
|
resourceBundle = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,60 +89,57 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
/**
|
/**
|
||||||
* Returns the shared instance.
|
* Returns the shared instance.
|
||||||
*/
|
*/
|
||||||
public static CDebugUIPlugin getDefault()
|
public static CDebugUIPlugin getDefault() {
|
||||||
{
|
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the workspace instance.
|
* Returns the workspace instance.
|
||||||
*/
|
*/
|
||||||
public static IWorkspace getWorkspace()
|
public static IWorkspace getWorkspace() {
|
||||||
{
|
|
||||||
return ResourcesPlugin.getWorkspace();
|
return ResourcesPlugin.getWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the string from the plugin's resource bundle,
|
* Returns the string from the plugin's resource bundle, or 'key' if not found.
|
||||||
* or 'key' if not found.
|
|
||||||
*/
|
*/
|
||||||
public static String getResourceString(String key)
|
public static String getResourceString( String key ) {
|
||||||
{
|
|
||||||
ResourceBundle bundle = CDebugUIPlugin.getDefault().getResourceBundle();
|
ResourceBundle bundle = CDebugUIPlugin.getDefault().getResourceBundle();
|
||||||
try {
|
try {
|
||||||
return bundle.getString( key );
|
return bundle.getString( key );
|
||||||
} catch (MissingResourceException e) {
|
}
|
||||||
|
catch( MissingResourceException e ) {
|
||||||
return '!' + key + '!';
|
return '!' + key + '!';
|
||||||
} catch (NullPointerException e) {
|
}
|
||||||
|
catch( NullPointerException e ) {
|
||||||
return '#' + key + '#';
|
return '#' + key + '#';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static String getFormattedString(String key, String arg) {
|
|
||||||
return MessageFormat.format(getResourceString(key), new String[] { arg });
|
public static String getFormattedString( String key, String arg ) {
|
||||||
}
|
return MessageFormat.format( getResourceString( key ), new String[]{ arg } );
|
||||||
public static String getFormattedString(String key, Integer arg) {
|
|
||||||
return MessageFormat.format(getResourceString(key), new Object[] { arg });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFormattedString(String key, String[] args) {
|
public static String getFormattedString( String key, Integer arg ) {
|
||||||
return MessageFormat.format(getResourceString(key), args);
|
return MessageFormat.format( getResourceString( key ), new Object[]{ arg } );
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getFormattedString( String key, String[] args ) {
|
||||||
|
return MessageFormat.format( getResourceString( key ), args );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the plugin's resource bundle,
|
* Returns the plugin's resource bundle,
|
||||||
*/
|
*/
|
||||||
public ResourceBundle getResourceBundle()
|
public ResourceBundle getResourceBundle() {
|
||||||
{
|
|
||||||
return resourceBundle;
|
return resourceBundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience method which returns the unique identifier of this plugin.
|
* Convenience method which returns the unique identifier of this plugin.
|
||||||
*/
|
*/
|
||||||
public static String getUniqueIdentifier()
|
public static String getUniqueIdentifier() {
|
||||||
{
|
if ( getDefault() == null ) {
|
||||||
if ( getDefault() == null )
|
|
||||||
{
|
|
||||||
// If the default instance is not yet initialized,
|
// If the default instance is not yet initialized,
|
||||||
// return a static identifier. This identifier must
|
// return a static identifier. This identifier must
|
||||||
// match the plugin id defined in plugin.xml
|
// match the plugin id defined in plugin.xml
|
||||||
|
@ -155,67 +149,64 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the a color based on the type of output.
|
* Returns the a color based on the type of output. Valid types:
|
||||||
* Valid types:
|
|
||||||
* <li>CHANGED_REGISTER_RGB</li>
|
* <li>CHANGED_REGISTER_RGB</li>
|
||||||
*/
|
*/
|
||||||
public static Color getPreferenceColor( String type )
|
public static Color getPreferenceColor( String type ) {
|
||||||
{
|
return ColorManager.getDefault().getColor( PreferenceConverter.getColor( getDefault().getPreferenceStore(), type ) );
|
||||||
return ColorManager.getDefault().getColor(
|
|
||||||
PreferenceConverter.getColor( getDefault().getPreferenceStore(), type ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CDTDebugModelPresentation getDebugModelPresentation()
|
public static CDTDebugModelPresentation getDebugModelPresentation() {
|
||||||
{
|
|
||||||
return CDTDebugModelPresentation.getDefault();
|
return CDTDebugModelPresentation.getDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs the specified status with this plug-in's log.
|
* Logs the specified status with this plug-in's log.
|
||||||
*
|
*
|
||||||
* @param status status to log
|
* @param status
|
||||||
|
* status to log
|
||||||
*/
|
*/
|
||||||
public static void log( IStatus status )
|
public static void log( IStatus status ) {
|
||||||
{
|
|
||||||
getDefault().getLog().log( status );
|
getDefault().getLog().log( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs an internal error with the specified throwable
|
* Logs an internal error with the specified throwable
|
||||||
*
|
*
|
||||||
* @param e the exception to be logged
|
* @param e
|
||||||
*/
|
* the exception to be logged
|
||||||
public static void log( Throwable e )
|
*/
|
||||||
{
|
public static void log( Throwable e ) {
|
||||||
log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, "Internal Error", e ) ); //$NON-NLS-1$
|
log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, "Internal Error", e ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs an internal error with the specified message.
|
* Logs an internal error with the specified message.
|
||||||
*
|
*
|
||||||
* @param message the error message to log
|
* @param message
|
||||||
|
* the error message to log
|
||||||
*/
|
*/
|
||||||
public static void logErrorMessage( String message )
|
public static void logErrorMessage( String message ) {
|
||||||
{
|
|
||||||
log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, message, null ) );
|
log( new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, message, null ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public ILaunchConfigurationTab getDebuggerPage(String debuggerID) {
|
public ILaunchConfigurationTab getDebuggerPage( String debuggerID ) {
|
||||||
if (fDebuggerPageMap == null) {
|
if ( fDebuggerPageMap == null ) {
|
||||||
initializeDebuggerPageMap();
|
initializeDebuggerPageMap();
|
||||||
}
|
}
|
||||||
IConfigurationElement configElement = (IConfigurationElement) fDebuggerPageMap.get(debuggerID);
|
IConfigurationElement configElement = (IConfigurationElement)fDebuggerPageMap.get( debuggerID );
|
||||||
ILaunchConfigurationTab tab = null;
|
ILaunchConfigurationTab tab = null;
|
||||||
if (configElement != null) {
|
if ( configElement != null ) {
|
||||||
try {
|
try {
|
||||||
tab = (ILaunchConfigurationTab) configElement.createExecutableExtension("class"); //$NON-NLS-1$
|
tab = (ILaunchConfigurationTab)configElement.createExecutableExtension( "class" ); //$NON-NLS-1$
|
||||||
} catch(CoreException ce) {
|
}
|
||||||
log(new Status(IStatus.ERROR, getUniqueIdentifier(), 100, "An error occurred retrieving a C Debugger page", ce)); //$NON-NLS-1$
|
catch( CoreException ce ) {
|
||||||
|
log( new Status( IStatus.ERROR, getUniqueIdentifier(), 100, "An error occurred retrieving a C Debugger page", ce ) ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tab;
|
return tab;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initializeDebuggerPageMap() {
|
protected void initializeDebuggerPageMap() {
|
||||||
fDebuggerPageMap = new HashMap( 10 );
|
fDebuggerPageMap = new HashMap( 10 );
|
||||||
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint( PLUGIN_ID, "CDebuggerPage" ); //$NON-NLS-1$
|
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint( PLUGIN_ID, "CDebuggerPage" ); //$NON-NLS-1$
|
||||||
|
@ -226,24 +217,20 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void errorDialog( String message, IStatus status )
|
public static void errorDialog( String message, IStatus status ) {
|
||||||
{
|
|
||||||
log( status );
|
log( status );
|
||||||
Shell shell = getActiveWorkbenchShell();
|
Shell shell = getActiveWorkbenchShell();
|
||||||
if ( shell != null )
|
if ( shell != null ) {
|
||||||
{
|
ErrorDialog.openError( shell, CDebugUIPlugin.getResourceString( "ui.CDebugUIPlugin.Error" ), message, status ); //$NON-NLS-1$
|
||||||
ErrorDialog.openError( shell, CDebugUIPlugin.getResourceString("ui.CDebugUIPlugin.Error"), message, status ); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void errorDialog( String message, Throwable t )
|
public static void errorDialog( String message, Throwable t ) {
|
||||||
{
|
|
||||||
log( t );
|
log( t );
|
||||||
Shell shell = getActiveWorkbenchShell();
|
Shell shell = getActiveWorkbenchShell();
|
||||||
if ( shell != null )
|
if ( shell != null ) {
|
||||||
{
|
|
||||||
IStatus status = new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, t.getMessage(), null ); //$NON-NLS-1$
|
IStatus status = new Status( IStatus.ERROR, getUniqueIdentifier(), ICDebugUIConstants.INTERNAL_ERROR, t.getMessage(), null ); //$NON-NLS-1$
|
||||||
ErrorDialog.openError( shell, CDebugUIPlugin.getResourceString("ui.CDebugUIPlugin.Error"), message, status ); //$NON-NLS-1$
|
ErrorDialog.openError( shell, CDebugUIPlugin.getResourceString( "ui.CDebugUIPlugin.Error" ), message, status ); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,16 +239,13 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
*
|
*
|
||||||
* @return the active workbench window
|
* @return the active workbench window
|
||||||
*/
|
*/
|
||||||
public static IWorkbenchWindow getActiveWorkbenchWindow()
|
public static IWorkbenchWindow getActiveWorkbenchWindow() {
|
||||||
{
|
|
||||||
return getDefault().getWorkbench().getActiveWorkbenchWindow();
|
return getDefault().getWorkbench().getActiveWorkbenchWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IWorkbenchPage getActivePage()
|
public static IWorkbenchPage getActivePage() {
|
||||||
{
|
|
||||||
IWorkbenchWindow w = getActiveWorkbenchWindow();
|
IWorkbenchWindow w = getActiveWorkbenchWindow();
|
||||||
if ( w != null )
|
if ( w != null ) {
|
||||||
{
|
|
||||||
return w.getActivePage();
|
return w.getActivePage();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -272,23 +256,19 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
*
|
*
|
||||||
* @return the active workbench shell or <code>null</code> if none
|
* @return the active workbench shell or <code>null</code> if none
|
||||||
*/
|
*/
|
||||||
public static Shell getActiveWorkbenchShell()
|
public static Shell getActiveWorkbenchShell() {
|
||||||
{
|
|
||||||
IWorkbenchWindow window = getActiveWorkbenchWindow();
|
IWorkbenchWindow window = getActiveWorkbenchWindow();
|
||||||
if ( window != null )
|
if ( window != null ) {
|
||||||
{
|
|
||||||
return window.getShell();
|
return window.getShell();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the standard display to be used. The method first checks, if
|
* Returns the standard display to be used. The method first checks, if the thread calling this method has an associated display. If so, this display is
|
||||||
* the thread calling this method has an associated display. If so, this
|
* returned. Otherwise the method returns the default display.
|
||||||
* display is returned. Otherwise the method returns the default display.
|
|
||||||
*/
|
*/
|
||||||
public static Display getStandardDisplay()
|
public static Display getStandardDisplay() {
|
||||||
{
|
|
||||||
Display display;
|
Display display;
|
||||||
display = Display.getCurrent();
|
display = Display.getCurrent();
|
||||||
if ( display == null )
|
if ( display == null )
|
||||||
|
@ -299,57 +279,44 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
/**
|
/**
|
||||||
* Returns the image descriptor registry used for this plugin.
|
* Returns the image descriptor registry used for this plugin.
|
||||||
*/
|
*/
|
||||||
public static CDebugImageDescriptorRegistry getImageDescriptorRegistry()
|
public static CDebugImageDescriptorRegistry getImageDescriptorRegistry() {
|
||||||
{
|
if ( getDefault().fImageDescriptorRegistry == null ) {
|
||||||
if ( getDefault().fImageDescriptorRegistry == null )
|
|
||||||
{
|
|
||||||
getDefault().fImageDescriptorRegistry = new CDebugImageDescriptorRegistry();
|
getDefault().fImageDescriptorRegistry = new CDebugImageDescriptorRegistry();
|
||||||
}
|
}
|
||||||
return getDefault().fImageDescriptorRegistry;
|
return getDefault().fImageDescriptorRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
|
* @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
|
||||||
*/
|
*/
|
||||||
public void selectionChanged( IWorkbenchPart part, ISelection selection )
|
public void selectionChanged( IWorkbenchPart part, ISelection selection ) {
|
||||||
{
|
if ( selection != null && selection instanceof IStructuredSelection ) {
|
||||||
if ( selection != null && selection instanceof IStructuredSelection )
|
if ( ((IStructuredSelection)selection).size() == 1 ) {
|
||||||
{
|
|
||||||
if ( ((IStructuredSelection)selection).size() == 1 )
|
|
||||||
{
|
|
||||||
Object element = ((IStructuredSelection)selection).getFirstElement();
|
Object element = ((IStructuredSelection)selection).getFirstElement();
|
||||||
if ( element != null && element instanceof IThread )
|
if ( element != null && element instanceof IThread ) {
|
||||||
{
|
if ( ((IThread)element).getDebugTarget() instanceof ISwitchToThread ) {
|
||||||
if ( ((IThread)element).getDebugTarget() instanceof ISwitchToThread )
|
try {
|
||||||
{
|
if ( !sameThread( (IDebugElement)element ) ) {
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( !sameThread( (IDebugElement)element ) )
|
|
||||||
{
|
|
||||||
((ISwitchToThread)((IThread)element).getDebugTarget()).setCurrentThread( (IThread)element );
|
((ISwitchToThread)((IThread)element).getDebugTarget()).setCurrentThread( (IThread)element );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
catch( DebugException e ) {
|
||||||
{
|
|
||||||
errorDialog( e.getMessage(), e );
|
errorDialog( e.getMessage(), e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( element != null && element instanceof IStackFrame )
|
else if ( element != null && element instanceof IStackFrame ) {
|
||||||
{
|
if ( ((IStackFrame)element).getThread() instanceof ISwitchToFrame ) {
|
||||||
if ( ((IStackFrame)element).getThread() instanceof ISwitchToFrame )
|
try {
|
||||||
{
|
if ( !sameThread( (IDebugElement)element ) ) {
|
||||||
try
|
|
||||||
{
|
|
||||||
if ( !sameThread( (IDebugElement)element ) )
|
|
||||||
{
|
|
||||||
((ISwitchToThread)((IStackFrame)element).getDebugTarget()).setCurrentThread( ((IStackFrame)element).getThread() );
|
((ISwitchToThread)((IStackFrame)element).getDebugTarget()).setCurrentThread( ((IStackFrame)element).getThread() );
|
||||||
}
|
}
|
||||||
((ISwitchToFrame)((IStackFrame)element).getThread()).switchToFrame( (IStackFrame)element );
|
((ISwitchToFrame)((IStackFrame)element).getThread()).switchToFrame( (IStackFrame)element );
|
||||||
}
|
}
|
||||||
catch( DebugException e )
|
catch( DebugException e ) {
|
||||||
{
|
// errorDialog( "Switch to stack frame failed.", e );
|
||||||
// errorDialog( "Switch to stack frame failed.", e );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -357,41 +324,36 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean sameThread( IDebugElement element ) throws DebugException
|
private boolean sameThread( IDebugElement element ) throws DebugException {
|
||||||
{
|
if ( element.getDebugTarget() instanceof ISwitchToThread ) {
|
||||||
if ( element.getDebugTarget() instanceof ISwitchToThread )
|
if ( element instanceof IThread ) {
|
||||||
{
|
|
||||||
if ( element instanceof IThread )
|
|
||||||
{
|
|
||||||
return ((IThread)element).equals( ((ISwitchToThread)element.getDebugTarget()).getCurrentThread() );
|
return ((IThread)element).equals( ((ISwitchToThread)element.getDebugTarget()).getCurrentThread() );
|
||||||
}
|
}
|
||||||
if ( element instanceof IStackFrame )
|
if ( element instanceof IStackFrame ) {
|
||||||
{
|
|
||||||
return ((IStackFrame)element).getThread().equals( ((ISwitchToThread)element.getDebugTarget()).getCurrentThread() );
|
return ((IStackFrame)element).getThread().equals( ((ISwitchToThread)element.getDebugTarget()).getCurrentThread() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IPersistableSourceLocator createDefaultSourceLocator()
|
public static IPersistableSourceLocator createDefaultSourceLocator() {
|
||||||
{
|
|
||||||
return new DefaultSourceLocator();
|
return new DefaultSourceLocator();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDefaultSourceLocatorID()
|
public static String getDefaultSourceLocatorID() {
|
||||||
{
|
|
||||||
return DefaultSourceLocator.ID_DEFAULT_SOURCE_LOCATOR;
|
return DefaultSourceLocator.ID_DEFAULT_SOURCE_LOCATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* to support old launch configurations
|
* to support old launch configurations
|
||||||
*/
|
*/
|
||||||
public static String getDefaultSourceLocatorOldID()
|
public static String getDefaultSourceLocatorOldID() {
|
||||||
{
|
|
||||||
return DefaultSourceLocator.ID_OLD_DEFAULT_SOURCE_LOCATOR;
|
return DefaultSourceLocator.ID_OLD_DEFAULT_SOURCE_LOCATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
|
||||||
*/
|
*/
|
||||||
public void start( BundleContext context ) throws Exception {
|
public void start( BundleContext context ) throws Exception {
|
||||||
|
@ -403,7 +365,9 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
|
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
|
||||||
*/
|
*/
|
||||||
public void stop( BundleContext context ) throws Exception {
|
public void stop( BundleContext context ) throws Exception {
|
||||||
|
@ -417,4 +381,4 @@ public class CDebugUIPlugin extends AbstractUIPlugin implements ISelectionListen
|
||||||
}
|
}
|
||||||
super.stop( context );
|
super.stop( context );
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,183 +1,3 @@
|
||||||
internal.ui.actions.SignalActionDelegate.Unable_to_deliver_signal_to_target=Unable to deliver the signal to the target.
|
|
||||||
internal.ui.actions.SignalActionDelegate.Operation_failed=Operation failed.
|
|
||||||
internal.ui.actions.ShowRegisterTypesAction.Show_Type_Names_checkbox=Show &Type Names
|
|
||||||
internal.ui.actions.ShowRegisterTypesAction.Show_Type_Names_tooltip=Show Type Names
|
|
||||||
internal.ui.actions.LoadSymbolsForAllAction.Load_Symbols_For_all=Load Symbols For All
|
|
||||||
internal.ui.actions.LoadSymbolsForAllAction.Load_symbols_for_all_shared_libraries.=Load symbols for all shared libraries.
|
|
||||||
internal.ui.actions.LoadSymbolsForAllAction.Load_Symbols_For_All=Load Symbols For All
|
|
||||||
internal.ui.actions.LoadSymbolsForAllAction.Unable_to_load_symbols.=Unable to load symbols.
|
|
||||||
internal.ui.actions.AutoRefreshMemoryAction.Auto-Refresh=Auto-Refresh
|
|
||||||
internal.ui.actions.AutoRefreshMemoryAction.Automatically_Refresh_Memory_Block=Automatically Refresh Memory Block
|
|
||||||
internal.ui.actions.AutoRefreshMemoryAction.Auto-Refresh=Auto-Refresh
|
|
||||||
internal.ui.actions.RestartActionDelegate.Exceptions_occurred_attempting_to_restart=Exceptions occurred attempting to restart.
|
|
||||||
internal.ui.actions.RestartActionDelegate.Restart_failed=Restart failed.
|
|
||||||
internal.ui.actions.RestartActionDelegate.Restart=Restart
|
|
||||||
internal.ui.actions.RestoreDefaultTypeActionDelegate.Unable_to_cast_type=Unable to cast to type.
|
|
||||||
internal.ui.actions.CBreakpointPropertiesRulerAction.Breakpoint_Properties=Breakpoint &Properties...
|
|
||||||
internal.ui.actions.ManageFunctionBreakpointActionDelegate.Cannot_add_breakpoint=Cannot add breakpoint
|
|
||||||
internal.ui.actions.SwitchToDisassemblyActionDelegate.Exceptions_occurred_attempting_to_switch_to_disassemblysource_mode.=Exceptions occurred attempting to switch to disassembly/source mode.
|
|
||||||
internal.ui.actions.SwitchToDisassemblyActionDelegate.1=Switch to disassembly/source mode failed.
|
|
||||||
internal.ui.actions.SwitchToDisassemblyActionDelegate.2=Switch to disassembly/source mode
|
|
||||||
internal.ui.actions.ShowAsciiAction.Show_ASCII=Show ASCII
|
|
||||||
internal.ui.actions.AddGlobalsActionDelegate.Select_Variables=Select Variables:
|
|
||||||
internal.ui.actions.AddGlobalsActionDelegate.Exceptions_occurred_attempting_to_add_global_variables.=Exceptions occurred attempting to add global variables.
|
|
||||||
internal.ui.actions.AddGlobalsActionDelegate.Add_global_variables_failed=Add global variables failed.
|
|
||||||
internal.ui.actions.EnableDisableBreakpointRulerAction.Enable_Breakpoint=&Enable Breakpoint
|
|
||||||
internal.ui.actions.EnableDisableBreakpointRulerAction.Enabling_disabling_breakpoints=Enabling/disabling breakpoints
|
|
||||||
internal.ui.actions.EnableDisableBreakpointRulerAction.Exceptions_occured_enabling_disabling_breakpoint=Exceptions occurred enabling or disabling the breakpoint
|
|
||||||
internal.ui.actions.EnableDisableBreakpointRulerAction.Disable_breakpoint=&Disable Breakpoint
|
|
||||||
internal.ui.actions.VariableFormatActionDelegate.Unable_to_set_format_of_variable=Unable to set format of variable.
|
|
||||||
internal.ui.actions.RefreshAction.Unable_to_refresh=Unable to refresh.
|
|
||||||
internal.ui.actions.ExpressionDialog.Add_Expression=Add Expression
|
|
||||||
internal.ui.actions.ExpressionDialog.Expression_to_add=Expression to add:
|
|
||||||
internal.ui.actions.CastToTypeActionDelegate.Type_field_must_not_be_empty=The 'Type' field must not be empty.
|
|
||||||
internal.ui.actions.CastToTypeActionDelegate.Cast_To_Type=Cast To Type
|
|
||||||
internal.ui.actions.CastToTypeActionDelegate.Enter_type=Enter type:
|
|
||||||
internal.ui.actions.CastToTypeActionDelegate.Unable_to_cast_to_type.=Unable to cast to type.
|
|
||||||
internal.ui.actions.EnableVariablesActionDelegate.Enable_variables_failed.=Enable variable(s) failed.
|
|
||||||
internal.ui.actions.EnableVariablesActionDelegate.Exceptions_occurred_enabling_the_variables=Exceptions occurred enabling the variable(s).
|
|
||||||
internal.ui.actions.MemorySizeAction.Unable_to_change_memory_unit_size=Unable to change memory unit size.
|
|
||||||
#
|
|
||||||
# Examples of the display for the following value are "1 byte" and "8 bytes".
|
|
||||||
# Normally placeholders in {} are not translated, except when they are choice forms,
|
|
||||||
# where the strings after each "#" are to be translated.
|
|
||||||
#
|
|
||||||
internal.ui.actions.MemorySizeAction.byte_bytes={0, number, integer} {0, choice, 1#byte|2#bytes}
|
|
||||||
internal.ui.actions.MemoryNumberOfColumnsAction.number_of_columns={0, number, integer} {0, choice, 0#columns|1#column|2#columns}
|
|
||||||
internal.ui.actions.SignalZeroWorkbenchActionDelegate.Exceptions_occurred_attempting_to_resume_without_signal=Exceptions occurred attempting to resume without signal.
|
|
||||||
internal.ui.actions.SignalZeroWorkbenchActionDelegate.ErrorMsg_Resume_without_signal_failed=Resume without signal failed.
|
|
||||||
internal.ui.actions.SignalZeroWorkbenchActionDelegate.ErrorMsgTitle_Resume_Without_Signal=Resume Without Signal
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.Shell_Display_As_Array=Display As Array
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.Start_index=Start index:
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.Length=Length:
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.First_index_field_must_not_be_empty=The 'First index' field must not be empty.
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.Invalid_first_index=Invalid first index.
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.Empty_last_index=The 'Last index' field must not be empty.
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.Invalid_last_index.=Invalid last index.
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.The_length_must_be_greater_than_0=The length must be greater than 0.
|
|
||||||
internal.ui.actions.CastToArrayActionDelegate.Unable_to_display_this_variable_as_an_array=Unable to display this variable as an array.
|
|
||||||
internal.ui.actions.SignalZeroObjectActionDelegate.Unable_to_resume_ignoring_signal=Unable to resume ignoring signal.
|
|
||||||
internal.ui.actions.SignalZeroObjectActionDelegate.Operation_failed=Operation failed.
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Ignore_count_must_be_positive_integer=Ignore count must be a positive integer
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Not_available=Not available
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Function_name=Function name:
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Function_Breakpoint_Properties=C/C++ Function Breakpoint Properties
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Address=Address:
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Address_Breakpoint_Properties=C/C++ Address Breakpoint Properties
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.File=File:
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Line_Breakpoint_Properties=C/C++ Line Breakpoint Properties
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Line_Number=Line Number:
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Project=Project:
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Read_Watchpoint_Properties=C/C++ Read Watchpoint Properties
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Watchpoint_Properties=C/C++ Watchpoint Properties
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Access_Watchpoint_Properties=C/C++ Access Watchpoint Properties
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Expression_To_Watch=Expression To Watch:
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Condition=&Condition
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Invalid_condition=Invalid_condition
|
|
||||||
internal.ui.actions.CBreakpointPreferencePage.Ignore_Count=&Ignore Count:
|
|
||||||
internal.ui.actions.AddWatchpointActionDelegate.Cannot_add_watchpoint=Cannot add watchpoint
|
|
||||||
internal.ui.actions.MemoryNumberOfColumnAction.Unable_to_change_the_column_number.=Unable to change the column number.
|
|
||||||
internal.ui.actions.RunToLineRulerAction.Run_To_Line=Run To Line
|
|
||||||
internal.ui.actions.AddAddressBreakpointActionDelegate.Invalid_address=Invalid address.
|
|
||||||
internal.ui.actions.AddAddressBreakpointActionDelegate.Address_can_not_be_0=Address can not be 0.
|
|
||||||
internal.ui.actions.AddAddressBreakpointActionDelegate.Add_Address_Breakpoint=Add Address Breakpoint
|
|
||||||
internal.ui.actions.AddAddressBreakpointActionDelegate.Enter_address=Enter address:
|
|
||||||
internal.ui.actions.ClearMemoryAction.Clear=Clear
|
|
||||||
internal.ui.actions.ClearMemoryAction.Clear_Memory_Block=Clear Memory Block
|
|
||||||
internal.ui.actions.AddWatchpointDialog.Add_C_C++_Watchpoint=Add C/C++ Watchpoint
|
|
||||||
internal.ui.actions.AddWatchpointDialog.Expression_to_watch=Expression to watch:
|
|
||||||
internal.ui.actions.AddWatchpointDialog.Access=Access
|
|
||||||
internal.ui.actions.AddWatchpointDialog.Write=Write
|
|
||||||
internal.ui.actions.AddWatchpointDialog.Read=Read
|
|
||||||
internal.ui.actions.ManageBreakpointRulerAction.Add_Breakpoint=Add Breakpoint
|
|
||||||
internal.ui.actions.ManageBreakpointRulerAction.Remove_Breakpoint=Remove Breakpoint
|
|
||||||
internal.ui.actions.ManageBreakpointRulerAction.Cannot_add_breakpoint=Cannot add breakpoint
|
|
||||||
internal.ui.actions.ManageBreakpointRulerAction.Cannot_remove_breakpoint=Cannot remove breakpoint
|
|
||||||
internal.ui.actions.AddExpressionActionDelegate.Evaluation_of_expression_failed=Evaluation of expression failed.
|
|
||||||
internal.ui.actions.LoadSymbolsActionDelegate.Unable_to_load_symbols_of_shared_library=Unable to load symbols of shared library.
|
|
||||||
internal.ui.actions.LoadSymbolsActionDelegate.Operation_failed=Operation failed.
|
|
||||||
internal.ui.actions.ChangeRegisterValueAction.Change_Register_Value=Change Register Value
|
|
||||||
internal.ui.actions.ChangeRegisterValueAction.Setting_the_register_value_failed=Setting the register value failed.
|
|
||||||
internal.ui.actions.RefreshMemoryAction.Refresh_Memory_Block=Refresh Memory Block
|
|
||||||
internal.ui.actions.RefreshMemoryAction.Refresh=Refresh
|
|
||||||
internal.ui.actions.ManageBreakpointActionDelegate.Cannot_add_breakpoint=Cannot add breakpoint
|
|
||||||
internal.ui.actions.MemoryFormatAction.Unable_to_change_format=Unable to change format.
|
|
||||||
internal.ui.actions.MemoryFormatAction.Hexadecimal=Hexadecimal
|
|
||||||
internal.ui.actions.MemoryFormatAction.Signed_Decimal=Signed Decimal
|
|
||||||
internal.ui.actions.MemoryFormatAction.Unsigned_Decimal=Unsigned Decimal
|
|
||||||
internal.ui.actions.ManageFunctionBreakpointActionDelegate.Cannot_add_breakpoint=Cannot add breakpoint
|
|
||||||
internal.ui.actions.ChangeRegisterValueAction.Setting_register_value_failed=Setting the register value failed.
|
|
||||||
|
|
||||||
internal.ui.editors.DisassemblyMarkerAnnotationModel.Resource_Changed=Resource Changed
|
|
||||||
internal.ui.editors.CDebugEditor.C_CPP_File_Editor=C/C++ File Editor
|
|
||||||
internal.ui.editors.CDebugEditor.Source_not_found=Source not found
|
|
||||||
internal.ui.editors.CDebugEditor.attach_source_location_instructions=You can attach a new source location by pressing the button below:
|
|
||||||
internal.ui.editors.CDebugEditor.Attach_Source_button=&Attach Source...
|
|
||||||
internal.ui.editors.CDebugEditor.Can_not_find_file=Can not find the file ''{0}'' in the specified source locations.
|
|
||||||
internal.ui.editors.DisassemblyEditorInput.Disassembly=Disassembly
|
|
||||||
|
|
||||||
internal.ui.preferences.SharedLibrariesViewPreferencePage.Shared_Libraries_View_Settings=Shared Libraries View Settings.
|
|
||||||
internal.ui.preferences.SharedLibrariesViewPreferencePage.Auto-Refresh_by_default=Auto-Refresh by default
|
|
||||||
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.Natural=Natural
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.Hexadecimal=Hexadecimal
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.Decimal=Decimal
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.Preference_page_description=General settings for C/C++ Debugging.
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.Opened_view_default_settings=Opened view default settings
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.pathsButton=Show full &paths
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.variableFormatCombo=Default variable format:
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.expressionFormatCombo=Default expression format:
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.registerFormatCombo=Default register format:
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.Disassembly_options=Disassembly options
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.autoDisassemblyButton=Automatically switch to &disassembly mode
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.maxNumberOfInstructions=Maximum number of instructions:
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.ErrorMaxNumberOfInstructionsRange=The valid value range is [{0},{1}].
|
|
||||||
internal.ui.preferences.SourcePreferencePage.Description=Common source lookup settings.
|
|
||||||
internal.ui.preferences.SourcePreferencePage.Source_locations=Source Locations
|
|
||||||
internal.ui.preferences.SourcePreferencePage.Search_for_duplicate_source_files=Search for duplicate source files
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.autoRefreshRegistersButton=Automatically refresh registers
|
|
||||||
internal.ui.preferences.CDebugPreferencePage.autoRefreshSolibsButton=Automatically refresh shared libraries
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Description=Memory View Settings.
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Text_Color=Text Color:
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Background_Color=Background Color:
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Address_Color=Address Color:
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Changed_Value_Color=Changed Value Color:
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Font=Font:
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Padding_Character=Padding Character:
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Auto_Refresh_by_default=Auto-Refresh by default
|
|
||||||
internal.ui.preferences.MemoryViewPreferencePage.Show_ascii_by_default=Show ASCII by default
|
|
||||||
internal.ui.wizards.AddProjectSourceLocationWizard.Select_Project=Select Project
|
|
||||||
internal.ui.wizards.AddProjectSourceLocationWizard.WindowTitle=Add Project Source Location
|
|
||||||
internal.ui.wizards.AddProjectSourceLocationWizard.AddProjectLocationMessage=Add an existing workspace project to the source locations list.
|
|
||||||
internal.ui.wizards.AddProjectSourceLocationWizard.Description=Add an existing project to the source locations list.
|
|
||||||
internal.ui.wizards.AddDirectorySourceLocationWizard.Select_Directory=Select Directory
|
|
||||||
internal.ui.wizards.AddDirectorySourceLocationWizard.WindowTitle=Add Directory Source Location
|
|
||||||
internal.ui.wizards.AddDirectorySourceLocationWizard.WindowMessage=Add a local file system directory to the source locations list.
|
|
||||||
internal.ui.wizards.AddDirectorySourceLocationWizard.ErrorDirectoryEmpty=Directory must not be empty.
|
|
||||||
internal.ui.wizards.AddDirectorySourceLocationWizard.ErrorDirectoryDoesNotExist=Directory does not exist.
|
|
||||||
internal.ui.wizards.AddDirectorySourceLocationWizard.ErrorDirectoryMustBeAbsolute=Directory must be absolute.
|
|
||||||
internal.ui.wizards.AddDirectorySourceLocationWizard.Description=Add a local file system directory to the source locations list.
|
|
||||||
AddSourceLocationWizard.Window_Title=Add Source Location
|
|
||||||
AddDirectorySourceLocationBlock.Select_location_directory=Select location directory:
|
|
||||||
AddDirectorySourceLocationBlock.Browse=&Browse...
|
|
||||||
AddDirectorySourceLocationBlock.Select_Location_Directory=Select Location Directory
|
|
||||||
AddDirectorySourceLocationBlock.Associate_with=&Associate with
|
|
||||||
AddDirectorySourceLocationBlock.Search_subfolders=Search sub&folders
|
|
||||||
internal.ui.preferences.SourceLocationSelectionPage.Add_Source_Location=Add Source Location
|
|
||||||
internal.ui.preferences.SourceLocationSelectionPage.WindowTitle=Select
|
|
||||||
internal.ui.preferences.SourceLocationSelectionPage.Select_source_location_type=Select source location type:
|
|
||||||
internal.ui.preferences.SourceLocationSelectionPage.Existing_Project_Into_Workspace=Existing Project Into Workspace
|
|
||||||
internal.ui.preferences.SourceLocationSelectionPage.File_System_Directory=File System Directory
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.yes=yes
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.no=no
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.Add=Add...
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.Up=Up
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.Down=Down
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.Remove=Remove
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.Location=Location
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.Association=Association
|
|
||||||
internal.ui.dialogfields.SourceListDialogField.Search_subfolders=Search subfolders
|
|
||||||
|
|
||||||
ui.sourcelookup.SourceListDialogField.yes=yes
|
ui.sourcelookup.SourceListDialogField.yes=yes
|
||||||
ui.sourcelookup.SourceListDialogField.no=no
|
ui.sourcelookup.SourceListDialogField.no=no
|
||||||
ui.sourcelookup.SourceListDialogField.Add=Add...
|
ui.sourcelookup.SourceListDialogField.Add=Add...
|
||||||
|
|