Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a902f18efa64fba401fe1e718d14b6f3e91ad1d1 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*******************************************************************************
 * Copyright (c) 2015 Red Hat Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Red Hat Inc - modified to use in Docker UI
 *******************************************************************************/
package org.eclipse.linuxtools.internal.docker.ui;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleListener;

public class RunConsoleRemove extends Action
		implements IViewActionDelegate, IConsoleListener {

	private RunConsole console;

	public RunConsoleRemove(RunConsole console) {
		super(ConsoleMessages.getString("RunConsoleRemove.action")); //$NON-NLS-1$
		this.console = console;
		setToolTipText(ConsoleMessages.getString("RunConsoleRemove.tooltip")); //$NON-NLS-1$
		// PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
		// IDebugHelpContextIds.CONSOLE_REMOVE_LAUNCH);
		setImageDescriptor(SWTImagesFactory.DESC_REMOVE);
		ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this);
	}

	public void dispose() {
		ConsolePlugin.getDefault().getConsoleManager()
				.removeConsoleListener(this);
	}

	@Override
	public void run() {
		RunConsole.removeConsole(console);
	}

	@Override
	public void run(IAction action) {
		run();
	}

	@Override
	public void selectionChanged(IAction action, ISelection selection) {
		// nothing as of yet

	}

	@Override
	public void consolesAdded(IConsole[] consoles) {
		// nothing as of yet

	}

	@Override
	public void consolesRemoved(IConsole[] consoles) {
		// nothing as of yet

	}

	@Override
	public void init(IViewPart view) {
		// nothing as of yet

	}

}

Back to the top