diff options
Diffstat (limited to 'dsf')
5 files changed, 20 insertions, 55 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java index ad6f1c8e158..396c291b13b 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractThreadVMNode.java @@ -12,7 +12,6 @@ package org.eclipse.cdt.dsf.debug.ui.viewmodel.launch; import java.util.List; -import java.util.Map; import java.util.concurrent.RejectedExecutionException; import org.eclipse.cdt.dsf.concurrent.ConfinedToDsfExecutor; @@ -105,30 +104,9 @@ public abstract class AbstractThreadVMNode extends AbstractDMVMNode PROP_NAME, ExecutionContextLabelText.PROP_ID_KNOWN, ILaunchVMConstants.PROP_ID, - ExecutionContextLabelText.PROP_ID2_KNOWN, - ILaunchVMConstants.PROP_ID2, ILaunchVMConstants.PROP_IS_SUSPENDED, - ILaunchVMConstants.PROP_STATE_CHANGE_REASON }) - { - @Override - public boolean isEnabled(IStatus status, Map<String, Object> properties) { - String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON); - return - reason != null && reason.length() != 0 && - !StateChangeReason.UNKNOWN.equals(reason); - } - }, - // If no state change reason is available compose a string without it. - new ExecutionContextLabelText( - MessagesForLaunchVM.AbstractThreadVMNode_No_columns__No_reason__text_format, - new String[] { - ExecutionContextLabelText.PROP_NAME_KNOWN, - PROP_NAME, - ExecutionContextLabelText.PROP_ID_KNOWN, - ILaunchVMConstants.PROP_ID, - ExecutionContextLabelText.PROP_ID2_KNOWN, - ILaunchVMConstants.PROP_ID2, - ILaunchVMConstants.PROP_IS_SUSPENDED }), + ExecutionContextLabelText.PROP_STATE_CHANGE_REASON_KNOWN, + ILaunchVMConstants.PROP_STATE_CHANGE_REASON }), new LabelText(MessagesForLaunchVM.AbstractThreadVMNode_No_columns__Error__label, new String[0]), new LabelImage(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OBJS_THREAD_RUNNING)) { { setPropertyNames(new String[] { ILaunchVMConstants.PROP_IS_SUSPENDED }); } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java index c0a16cadd53..9cced262bd1 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ExecutionContextLabelText.java @@ -17,33 +17,34 @@ import org.eclipse.cdt.dsf.ui.viewmodel.properties.IElementPropertiesProvider; import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelText; import org.eclipse.core.runtime.IStatus; -class ExecutionContextLabelText extends LabelText { +/** + * @since 2.0 + */ +public class ExecutionContextLabelText extends LabelText { /** * Value <code>0</code> means it's not known. Value <code>1</code>, means it's known. */ - public static final String PROP_ID_KNOWN = "id_known"; //$NON-NLS-1$ + public static final String PROP_STATE_CHANGE_REASON_KNOWN = "state_change_reason_known"; //$NON-NLS-1$ /** - * A second ID, such as the OS Id for a thread. - * * Value <code>0</code> means it's not known. Value <code>1</code>, means it's known. */ - public static final String PROP_ID2_KNOWN = "id2_known"; //$NON-NLS-1$ + public static final String PROP_ID_KNOWN = "id_known"; //$NON-NLS-1$ /** * Value <code>0</code> means it's not known. Value <code>1</code>, means it's known. */ public static final String PROP_NAME_KNOWN = "name_known"; //$NON-NLS-1$ - protected ExecutionContextLabelText(String formatPattern, String[] propertyNames) { + public ExecutionContextLabelText(String formatPattern, String[] propertyNames) { super(formatPattern, propertyNames); } @Override protected Object getPropertyValue(String propertyName, IStatus status, Map<String, Object> properties) { if ( ILaunchVMConstants.PROP_STATE_CHANGE_REASON.equals(propertyName) ) { - String reason = (String)properties.get(propertyName); + String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON); String reasonLabel = "invalid reason"; //$NON-NLS-1$ if (StateChangeReason.BREAKPOINT.name().equals(reason)) { reasonLabel = MessagesForLaunchVM.State_change_reason__Breakpoint__label; @@ -70,6 +71,9 @@ class ExecutionContextLabelText extends LabelText { } else if ( ILaunchVMConstants.PROP_IS_SUSPENDED.equals(propertyName) ) { Boolean suspended = (Boolean)properties.get(propertyName); return suspended ? 1 : 0; + } else if ( PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) ) { + String reason = (String)properties.get(ILaunchVMConstants.PROP_STATE_CHANGE_REASON); + return (reason != null && !StateChangeReason.UNKNOWN.name().equals(reason)) ? 1 : 0; } else if (PROP_NAME_KNOWN.equals(propertyName)) { return properties.get(IElementPropertiesProvider.PROP_NAME) != null ? 1 : 0; } else if (IElementPropertiesProvider.PROP_NAME.equals(propertyName)) { @@ -77,14 +81,9 @@ class ExecutionContextLabelText extends LabelText { return val != null ? val : ""; //$NON-NLS-1$ } else if (PROP_ID_KNOWN.equals(propertyName)) { return properties.get(ILaunchVMConstants.PROP_ID) != null ? 1 : 0; - } else if (PROP_ID2_KNOWN.equals(propertyName)) { - return properties.get(ILaunchVMConstants.PROP_ID2) != null ? 1 : 0; } else if (ILaunchVMConstants.PROP_ID.equals(propertyName)) { Object val = properties.get(ILaunchVMConstants.PROP_ID); return val != null ? val : ""; //$NON-NLS-1$ - } else if (ILaunchVMConstants.PROP_ID2.equals(propertyName)) { - Object val = properties.get(ILaunchVMConstants.PROP_ID2); - return val != null ? val : ""; //$NON-NLS-1$ } return super.getPropertyValue(propertyName, status, properties); } @@ -93,10 +92,10 @@ class ExecutionContextLabelText extends LabelText { protected boolean checkProperty(String propertyName, IStatus status, Map<String, Object> properties) { if (PROP_NAME_KNOWN.equals(propertyName) || IElementPropertiesProvider.PROP_NAME.equals(propertyName) || + PROP_STATE_CHANGE_REASON_KNOWN.equals(propertyName) || + ILaunchVMConstants.PROP_STATE_CHANGE_REASON.equals(propertyName) || PROP_ID_KNOWN.equals(propertyName) || - ILaunchVMConstants.PROP_ID.equals(propertyName) || - PROP_ID2_KNOWN.equals(propertyName) || - ILaunchVMConstants.PROP_ID2.equals(propertyName)) + ILaunchVMConstants.PROP_ID.equals(propertyName)) { return true; } diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java index 55f12686632..9b43a6346c2 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/ILaunchVMConstants.java @@ -17,7 +17,6 @@ package org.eclipse.cdt.dsf.debug.ui.viewmodel.launch; public interface ILaunchVMConstants { public static final String PROP_ID = "id"; //$NON-NLS-1$ - public static final String PROP_ID2 = "id2"; //$NON-NLS-1$ public static final String PROP_IS_SUSPENDED = "is_suspended"; //$NON-NLS-1$ diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/MessagesForLaunchVM.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/MessagesForLaunchVM.java index a1f9a05687d..0a76995a03f 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/MessagesForLaunchVM.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/MessagesForLaunchVM.java @@ -38,7 +38,6 @@ public class MessagesForLaunchVM extends NLS { public static String AbstractContainerVMNode_No_columns__Error__label; public static String AbstractThreadVMNode_No_columns__text_format; - public static String AbstractThreadVMNode_No_columns__No_reason__text_format; public static String AbstractThreadVMNode_No_columns__Error__label; public static String State_change_reason__Unknown__label; diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties index e4e6c358b95..559aaf039ab 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/messages.properties @@ -47,20 +47,10 @@ AbstractContainerVMNode_No_columns__Error__label=<unavailable> # {1} - name # {2} - ID available, 0=not available/1=available # {3} - ID -# {4} - OS Thread ID available, 0=not available/1=available -# {5} - OS Thread ID -# {6} - 0=running/1=suspended -# {7} - state change reason -AbstractThreadVMNode_No_columns__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]}{4,choice,0#|1# {5}} ({6,choice,0#Running|1#Suspended} : {7}) - -# {0} - name available, 0=not available/1=available -# {1} - name -# {2} - ID available, 0=not available/1=available -# {3} - ID -# {4} - OS Thread ID available, 0=not available/1=available -# {5} - OS Thread ID -# {6} - 0=running/1=suspended -AbstractThreadVMNode_No_columns__No_reason__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]}{4,choice,0#|1# {5}} ({6,choice,0#Running|1#Suspended}) +# {4} - 0=running/1=suspended +# {5} - state change reason available, 0=not available/1=available +# {6} - state change reason +AbstractThreadVMNode_No_columns__text_format={0,choice,0#Thread|1#{1}}{2,choice,0#|1# [{3}]} ({4,choice,0#Running|1#Suspended}{5,choice,0#|1# : {6}}) AbstractThreadVMNode_No_columns__Error__label=<unavailable> |