Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7c6a7e4c490ec8db3c3098814ae1916ce45598c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*******************************************************************************
 * Copyright (c) 2000, 2011 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.internal.ui.views.launch;

import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.PlatformUI;

/**
 * Action that controls the preference for whether elements should be
 * automatically expanded in the breadcrumb drop down viewers.
 *
 * @since 3.5
 */
class BreadcrumbDropDownAutoExpandAction extends Action {

	private final LaunchView fLaunchView;

	/**
	 * Creates a new action to set the debug view mode.
	 *
	 * @param view Reference to the debug view.
     * in auto mode.
	 */
	public BreadcrumbDropDownAutoExpandAction(LaunchView view) {
		super(IInternalDebugCoreConstants.EMPTY_STRING, AS_CHECK_BOX);
		fLaunchView = view;

		setText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_label);
		setToolTipText(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_tooltip);
		setDescription(LaunchViewMessages.BreadcrumbDropDownAutoExpandAction_description);
		PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.DEBUG_VIEW_DROP_DOWN_AUTOEXPAND_ACTION);

		setChecked(fLaunchView.getBreadcrumbDropDownAutoExpand());
	}

	/* (non-Javadoc)
	 * @see org.eclipse.jface.action.IAction#run()
	 */
	@Override
	public void run() {
		fLaunchView.setBreadcrumbDropDownAutoExpand(isChecked());
	}
}

Back to the top