Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/org.eclipse.pde.launching/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %name
Bundle-SymbolicName: org.eclipse.pde.launching;singleton:=true
Bundle-Version: 3.13.700.qualifier
Bundle-Version: 3.14.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-Vendor: %provider-name
Require-Bundle: org.eclipse.jdt.junit.core;bundle-version="[3.6.0,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2024 IBM Corporation and others.
* Copyright (c) 2005, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -158,6 +158,9 @@ public String[] getProgramArguments(ILaunchConfiguration configuration) throws C
programArgs.add(1, computeShowsplashArgument());
}
}
if (configuration.getAttribute(IPDELauncherConstants.ADD_CONSOLE, false)) {
programArgs.add("-console"); //$NON-NLS-1$
}
return programArgs.toArray(new String[programArgs.size()]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2022 IBM Corporation and others.
* Copyright (c) 2005, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -580,4 +580,14 @@ public interface IPDELauncherConstants {
* @since 3.6
*/
String ADDITIONAL_PLUGINS = "additional_plugins"; //$NON-NLS-1$
/**
* Launch configuration attribute key. The value is a boolean specifying whether
* the <code>-console</code> argument should be added when launching.
* When set to <code>true</code>, the application will be started with
* console support enabled.
* @since 3.14
*
*
*/
String ADD_CONSOLE = "add_console"; //$NON-NLS-1$
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2014, 2025 IBM Corporation and others.
* Copyright (c) 2014, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -40,6 +40,8 @@ public class PDEUIMessages extends NLS {

public static String AbstractTargetPage_setTarget;

public static String ProgramBlock_runWithConsoleOption;

public static String AbstractTargetPage_reloadTarget;

public static String AbstractTargetPage_openPreferences;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2005, 2015 IBM Corporation and others.
* Copyright (c) 2005, 2026 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -46,6 +46,7 @@ public class ProgramBlock {
private Button fProductButton;
private Combo fProductCombo;
private Button fApplicationButton;
private Button fRunAsConsoleSectionButton;
private final AbstractLauncherTab fTab;
private final Listener fListener = new Listener();
private ControlDecoration fProductComboDecoration;
Expand Down Expand Up @@ -109,6 +110,7 @@ public void createControl(Composite parent) {

createProductSection(group);
createApplicationSection(group);
createRunWithConsoleOption(group);
}

protected void createProductSection(Composite parent) {
Expand All @@ -135,16 +137,24 @@ protected void createApplicationSection(Composite parent) {
fApplicationCombo.addSelectionListener(fListener);
}

protected void createRunWithConsoleOption(Composite parent) {
fRunAsConsoleSectionButton = new Button(parent, SWT.CHECK);
fRunAsConsoleSectionButton.setText(PDEUIMessages.ProgramBlock_runWithConsoleOption);
fRunAsConsoleSectionButton.addSelectionListener(fListener);
}

public void initializeFrom(ILaunchConfiguration config) throws CoreException {
initializeProductSection(config);
initializeApplicationSection(config);

boolean useProduct = config.getAttribute(IPDELauncherConstants.USE_PRODUCT, false) && fProductCombo.getItemCount() > 0;
boolean addConsole = config.getAttribute(IPDELauncherConstants.ADD_CONSOLE, false);
fApplicationButton.setSelection(!useProduct);
fApplicationCombo.setEnabled(!useProduct);
fProductButton.setSelection(useProduct);
fProductButton.setEnabled(fProductCombo.getItemCount() > 0);
fProductCombo.setEnabled(useProduct);
fRunAsConsoleSectionButton.setSelection(addConsole);
}

protected void initializeProductSection(ILaunchConfiguration config) throws CoreException {
Expand Down Expand Up @@ -196,6 +206,8 @@ protected void initializeApplicationSection(ILaunchConfiguration config) throws
public void performApply(ILaunchConfigurationWorkingCopy config) {
saveApplicationSection(config);
saveProductSection(config);
saveConsoleSection(config);

}

protected void saveProductSection(ILaunchConfigurationWorkingCopy config) {
Expand All @@ -213,6 +225,18 @@ protected void saveApplicationSection(ILaunchConfigurationWorkingCopy config) {
}
}

protected void saveConsoleSection(ILaunchConfigurationWorkingCopy config) {
try {
boolean updatePreferences = false;
if (fRunAsConsoleSectionButton.getSelection()) {
updatePreferences = true;
}
config.setAttribute(IPDELauncherConstants.ADD_CONSOLE, updatePreferences);
config.doSave();
} catch (CoreException e) {
}
}

public void setDefaults(ILaunchConfigurationWorkingCopy config) {
String product = TargetPlatform.getDefaultProduct();
if (product != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2000, 2025 IBM Corporation and others.
# Copyright (c) 2000, 2026 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -536,6 +536,7 @@ ProgramBlock_runProduct=Run a &product:
ProgramBlock_productDecorationWarning0=A product with this name cannot be found in any required bundle. This launch may fail to start as expected unless there is an available IProductProvider that can supply this product.
ProgramBlock_programToRun=Program to Run
ProgramBlock_runApplication=Run an &application:
ProgramBlock_runWithConsoleOption = Enable OSGi Console
BasicLauncherTab_javaExec=Java executable:
BasicLauncherTab_unbound=unbound
BasicLauncherTab_ee=E&xecution environment:
Expand Down
Loading