1 /******************************************************************************* 2 * Copyright (c) 2000, 2015 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 package org.eclipse.jdt.internal.debug.ui.actions; 15 16 import org.eclipse.debug.core.DebugException; 17 import org.eclipse.jdt.debug.core.IJavaThread; 18 import org.eclipse.jdt.debug.ui.IJavaDebugUIConstants; 19 20 /** 21 * An action delegate that toggles the state of its viewer to 22 * show/hide System Threads. 23 */ 24 public class ShowSystemThreadsAction extends AbstractThreadsViewFilterAction { 25 26 @Override getPreferenceKey()27 protected String getPreferenceKey() { 28 return IJavaDebugUIConstants.PREF_SHOW_SYSTEM_THREADS; 29 } 30 31 @Override selectThread(IJavaThread thread)32 protected boolean selectThread(IJavaThread thread) throws DebugException { 33 // Show only non-system threads and suspended threads. 34 return !thread.isSystemThread() || thread.isSuspended(); 35 } 36 37 @Override isCandidateThread(IJavaThread thread)38 protected boolean isCandidateThread(IJavaThread thread) throws DebugException { 39 return thread.isSystemThread(); 40 } 41 } 42