Skip to content

Commit 0490689

Browse files
committed
Add constant for "Open Terminal on Selection" command id
The "Open Terminal on Selection" command is referenced from another bundle by its string identifier. The new constant is introduced to put this String value under API control.
1 parent 8bedfd8 commit 0490689

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

debug/org.eclipse.debug.terminal/META-INF/MANIFEST.MF

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Bundle-SymbolicName: org.eclipse.debug.terminal;singleton:=true
55
Bundle-Vendor: %providerName
66
Bundle-Version: 1.0.0.qualifier
77
Import-Package: org.eclipse.terminal.connector;version="[1.0.0,2.0.0)",
8-
org.eclipse.terminal.control;version="[1.0.0,2.0.0)"
8+
org.eclipse.terminal.control;version="[1.0.0,2.0.0)",
9+
org.eclipse.terminal.view.ui;version="[1.0.0,2.0.0)"
910
Require-Bundle: org.eclipse.core.runtime,
1011
org.eclipse.debug.core;bundle-version="3.23.0",
1112
org.eclipse.cdt.core.native;bundle-version="[6.4.0,7.0.0)",

debug/org.eclipse.debug.terminal/src/org/eclipse/debug/terminal/ui/TerminalConsoleFactory.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*
1111
* Contributors:
1212
* Christoph Läubrich - initial API and implementation
13+
* Alexander Fedorov (ArSysOp) - further evolution
1314
*******************************************************************************/
1415
package org.eclipse.debug.terminal.ui;
1516

@@ -19,6 +20,7 @@
1920
import org.eclipse.core.commands.ParameterizedCommand;
2021
import org.eclipse.core.runtime.ILog;
2122
import org.eclipse.terminal.connector.ITerminalConnector;
23+
import org.eclipse.terminal.view.ui.CommandIds;
2224
import org.eclipse.ui.PlatformUI;
2325
import org.eclipse.ui.commands.ICommandService;
2426
import org.eclipse.ui.console.ConsolePlugin;
@@ -38,7 +40,7 @@ public void openConsole() {
3840
if (commandService == null || handlerService == null) {
3941
return;
4042
}
41-
Command command = commandService.getCommand("org.eclipse.terminal.view.ui.command.launchConsole");
43+
Command command = commandService.getCommand(CommandIds.COMMAND_LAUNCHCONSOLE);
4244
if (command == null) {
4345
return;
4446
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2025 ArSysOp 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+
* Alexander Fedorov (ArSysOp) - initial API and implementation
13+
*******************************************************************************/
14+
package org.eclipse.terminal.view.ui;
15+
16+
/**
17+
* Commands declared with "org.eclipse.ui.commands" extension point
18+
*/
19+
public interface CommandIds {
20+
21+
/**
22+
* "Open Terminal on Selection" command id
23+
*/
24+
String COMMAND_LAUNCHCONSOLE = "org.eclipse.terminal.view.ui.command.launchConsole"; //$NON-NLS-1$
25+
26+
}

0 commit comments

Comments
 (0)