mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-05 08:46:02 +02:00
Bug 115601 Add -include option to built-in MBS GNU toolchain. Add Paths & Symbols property page for editing paths of kind ICSettingEntry#INCLUDE_FILE (hidden by default)
This commit is contained in:
parent
cacd81cb7e
commit
f6da41c466
10 changed files with 195 additions and 1 deletions
|
@ -100,7 +100,7 @@ ToolName.compiler.solaris.cpp = Solaris C++ Compiler
|
||||||
# Generic Category Names
|
# Generic Category Names
|
||||||
OptionCategory.Symbols = Symbols
|
OptionCategory.Symbols = Symbols
|
||||||
OptionCategory.Preproc = Preprocessor
|
OptionCategory.Preproc = Preprocessor
|
||||||
OptionCategory.Dirs = Directories
|
OptionCategory.Dirs = Includes
|
||||||
OptionCategory.General = General
|
OptionCategory.General = General
|
||||||
OptionCategory.Optimize=Optimization
|
OptionCategory.Optimize=Optimization
|
||||||
OptionCategory.Debug=Debugging
|
OptionCategory.Debug=Debugging
|
||||||
|
@ -117,6 +117,7 @@ Option.Posix.DefSym=Defined symbols (-D)
|
||||||
Option.Posix.UndefSym=Undefined symbols (-U)
|
Option.Posix.UndefSym=Undefined symbols (-U)
|
||||||
|
|
||||||
Option.Posix.InclPaths=Include paths (-I)
|
Option.Posix.InclPaths=Include paths (-I)
|
||||||
|
Option.Posix.InclFiles=Include files (-include)
|
||||||
|
|
||||||
Option.Posix.OptLevel=Optimization Level
|
Option.Posix.OptLevel=Optimization Level
|
||||||
Option.Posix.Optimize.None=None (-O0)
|
Option.Posix.Optimize.None=None (-O0)
|
||||||
|
|
|
@ -1011,6 +1011,14 @@
|
||||||
valueType="includePath"
|
valueType="includePath"
|
||||||
browseType="directory">
|
browseType="directory">
|
||||||
</option>
|
</option>
|
||||||
|
<option
|
||||||
|
browseType="file"
|
||||||
|
category="gnu.c.compiler.category.dirs"
|
||||||
|
command="-include"
|
||||||
|
id="gnu.c.compiler.option.include.files"
|
||||||
|
name="%Option.Posix.InclFiles"
|
||||||
|
valueType="includeFiles">
|
||||||
|
</option>
|
||||||
<optionCategory
|
<optionCategory
|
||||||
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
owner="cdt.managedbuild.tool.gnu.c.compiler"
|
||||||
name="%OptionCategory.Optimize"
|
name="%OptionCategory.Optimize"
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 353 B |
|
@ -79,6 +79,8 @@ Builder.settings=Builder Settings
|
||||||
WBB.settings=Behaviour
|
WBB.settings=Behaviour
|
||||||
Includes=Includes
|
Includes=Includes
|
||||||
Includes.tooltip=Includes list
|
Includes.tooltip=Includes list
|
||||||
|
IncludeFiles=Include Files
|
||||||
|
IncludeFiles.tooltip=Include Files list
|
||||||
Symbols=Symbols
|
Symbols=Symbols
|
||||||
Symbols.tooltip=Macros list
|
Symbols.tooltip=Macros list
|
||||||
Libraries=Libraries
|
Libraries=Libraries
|
||||||
|
|
|
@ -251,6 +251,14 @@
|
||||||
helpId="cdt_u_prop_pns_inc"
|
helpId="cdt_u_prop_pns_inc"
|
||||||
parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_PathAndSymb"
|
parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_PathAndSymb"
|
||||||
tooltip="%Includes.tooltip"/>
|
tooltip="%Includes.tooltip"/>
|
||||||
|
<tab
|
||||||
|
class="org.eclipse.cdt.ui.newui.IncludeFileTab"
|
||||||
|
icon="icons/obj16/h_file_obj.gif"
|
||||||
|
name="%IncludeFiles"
|
||||||
|
weight="015"
|
||||||
|
helpId="cdt_u_prop_pns_inc"
|
||||||
|
parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_PathAndSymb"
|
||||||
|
tooltip="%IncludeFiles.tooltip"/>
|
||||||
<tab
|
<tab
|
||||||
class="org.eclipse.cdt.ui.newui.SymbolTab"
|
class="org.eclipse.cdt.ui.newui.SymbolTab"
|
||||||
icon="icons/obj16/define_obj.gif"
|
icon="icons/obj16/define_obj.gif"
|
||||||
|
@ -333,6 +341,14 @@
|
||||||
helpId="cdt_u_prop_exp"
|
helpId="cdt_u_prop_exp"
|
||||||
parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_ExpPathAndSymb"
|
parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_ExpPathAndSymb"
|
||||||
tooltip="%Includes.tooltip"/>
|
tooltip="%Includes.tooltip"/>
|
||||||
|
<tab
|
||||||
|
class="org.eclipse.cdt.ui.newui.ExpIncludeFileTab"
|
||||||
|
icon="icons/obj16/h_file_obj.gif"
|
||||||
|
name="%IncludeFiles"
|
||||||
|
weight="015"
|
||||||
|
helpId="cdt_u_prop_exp"
|
||||||
|
parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_ExpPathAndSymb"
|
||||||
|
tooltip="%IncludeFiles.tooltip"/>
|
||||||
<tab
|
<tab
|
||||||
class="org.eclipse.cdt.ui.newui.ExpSymbolTab"
|
class="org.eclipse.cdt.ui.newui.ExpSymbolTab"
|
||||||
icon="icons/obj16/define_obj.gif"
|
icon="icons/obj16/define_obj.gif"
|
||||||
|
|
|
@ -34,6 +34,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
private static final int SPACING = 5; // for radio buttons layout
|
private static final int SPACING = 5; // for radio buttons layout
|
||||||
|
|
||||||
private Button show_tree;
|
private Button show_tree;
|
||||||
|
private Button show_inc_files;
|
||||||
private Button show_mng;
|
private Button show_mng;
|
||||||
private Button show_tool;
|
private Button show_tool;
|
||||||
private Button show_exp;
|
private Button show_exp;
|
||||||
|
@ -57,6 +58,10 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
show_mng.setText(UIMessages.getString("PropertyPageDefsTab.0")); //$NON-NLS-1$
|
show_mng.setText(UIMessages.getString("PropertyPageDefsTab.0")); //$NON-NLS-1$
|
||||||
show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
show_mng.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
|
show_inc_files = new Button(usercomp, SWT.CHECK);
|
||||||
|
show_inc_files.setText(UIMessages.getString("PropertyPageDefsTab.showIncludeFileTab")); //$NON-NLS-1$
|
||||||
|
show_inc_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
|
||||||
show_tree = new Button(usercomp, SWT.CHECK);
|
show_tree = new Button(usercomp, SWT.CHECK);
|
||||||
show_tree.setText(UIMessages.getString("PropertyPageDefsTab.1")); //$NON-NLS-1$
|
show_tree.setText(UIMessages.getString("PropertyPageDefsTab.1")); //$NON-NLS-1$
|
||||||
show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
show_tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||||
|
@ -107,6 +112,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
b_3 = new Button(discGrp, SWT.RADIO);
|
b_3 = new Button(discGrp, SWT.RADIO);
|
||||||
b_3.setText(UIMessages.getString("PropertyPageDefsTab.9")); //$NON-NLS-1$
|
b_3.setText(UIMessages.getString("PropertyPageDefsTab.9")); //$NON-NLS-1$
|
||||||
|
|
||||||
|
show_inc_files.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES));
|
||||||
show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
|
show_tree.setSelection(CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE));
|
||||||
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
|
show_mng.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOMNG));
|
||||||
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
|
show_tool.setSelection(!CDTPrefUtil.getBool(CDTPrefUtil.KEY_NOTOOLM));
|
||||||
|
@ -129,6 +135,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void performOK() {
|
protected void performOK() {
|
||||||
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_SHOW_INC_FILES, show_inc_files.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_DTREE, show_tree.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_DTREE, show_tree.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOMNG, !show_mng.getSelection());
|
||||||
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
|
CDTPrefUtil.setBool(CDTPrefUtil.KEY_NOTOOLM, !show_tool.getSelection());
|
||||||
|
@ -149,6 +156,7 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
||||||
@Override
|
@Override
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
show_tree.setSelection(false);
|
show_tree.setSelection(false);
|
||||||
|
show_inc_files.setSelection(false);
|
||||||
show_mng.setSelection(true);
|
show_mng.setSelection(true);
|
||||||
show_tool.setSelection(true);
|
show_tool.setSelection(true);
|
||||||
show_exp.setSelection(false);
|
show_exp.setSelection(false);
|
||||||
|
|
|
@ -37,6 +37,8 @@ public class CDTPrefUtil {
|
||||||
public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$
|
public static final String KEY_DTREE = "properties.data.hierarchy.enable"; //$NON-NLS-1$
|
||||||
public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$
|
public static final String KEY_NOTOOLM = "properties.toolchain.modification.disable"; //$NON-NLS-1$
|
||||||
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
public static final String KEY_EXPORT = "properties.export.page.enable"; //$NON-NLS-1$
|
||||||
|
/** @since 5.2 Show the "Include Files" settings entry tab */
|
||||||
|
public static final String KEY_SHOW_INC_FILES = "properties.includefiles.page.enable"; //$NON-NLS-1$
|
||||||
/** @since 5.2 */
|
/** @since 5.2 */
|
||||||
public static final String KEY_TIPBOX = "properties.option.tipbox.enable"; //$NON-NLS-1$
|
public static final String KEY_TIPBOX = "properties.option.tipbox.enable"; //$NON-NLS-1$
|
||||||
// string keys
|
// string keys
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2007, 2010 Intel Corporation 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:
|
||||||
|
* Intel Corporation - initial API and implementation
|
||||||
|
* Broadcom Corporation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.ui.newui;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.settings.model.CIncludeFileEntry;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
|
* @since 5.2
|
||||||
|
*/
|
||||||
|
public class ExpIncludeFileTab extends AbstractExportTab {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ICLanguageSettingEntry doAdd(String s1, String s2, boolean isWsp) {
|
||||||
|
int flags = isWsp ? ICSettingEntry.VALUE_WORKSPACE_PATH : 0;
|
||||||
|
return new CIncludeFileEntry(s2, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ICLanguageSettingEntry doEdit(String s1, String s2, boolean isWsp) {
|
||||||
|
return doAdd(s1, s2, isWsp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getKind() {
|
||||||
|
return ICSettingEntry.INCLUDE_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeVisible() {
|
||||||
|
if (!CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES))
|
||||||
|
return false;
|
||||||
|
return super.canBeVisible();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasValues() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2007, 2010 Intel Corporation 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:
|
||||||
|
* Intel Corporation - initial API and implementation
|
||||||
|
* IBM Corporation
|
||||||
|
* Broadcom Corporation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.ui.newui;
|
||||||
|
|
||||||
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.accessibility.AccessibleAdapter;
|
||||||
|
import org.eclipse.swt.accessibility.AccessibleEvent;
|
||||||
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
import org.eclipse.swt.widgets.TableColumn;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.settings.model.CIncludeFileEntry;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
|
||||||
|
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class provides UI for the {@link ICSettingEntry#INCLUDE_FILE}
|
||||||
|
* option type.
|
||||||
|
*<p>
|
||||||
|
* This tab is hidden by default and can be shown under: <br/>
|
||||||
|
* Window > Preferences > C/C++ > Property Page Settings > Show "Include Files" Tab
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
|
* @since 5.2
|
||||||
|
*/
|
||||||
|
public class IncludeFileTab extends AbstractLangsListTab {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void additionalTableSet() {
|
||||||
|
columnToFit = new TableColumn(table, SWT.NONE);
|
||||||
|
columnToFit.setText(UIMessages.getString("IncludeFileTab.0")); //$NON-NLS-1$
|
||||||
|
columnToFit.setToolTipText(UIMessages.getString("IncludeFileTab.0")); //$NON-NLS-1$
|
||||||
|
showBIButton.setSelection(true);
|
||||||
|
table.getAccessible().addAccessibleListener(new AccessibleAdapter() {
|
||||||
|
@Override
|
||||||
|
public void getName(AccessibleEvent e) {
|
||||||
|
e.result = UIMessages.getString("IncludeFileTab.0"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ICLanguageSettingEntry doAdd() {
|
||||||
|
IncludeDialog dlg = new IncludeDialog(usercomp.getShell(), IncludeDialog.NEW_FILE, UIMessages
|
||||||
|
.getString("IncludeFileTab.1"), //$NON-NLS-1$
|
||||||
|
EMPTY_STR, getResDesc().getConfiguration(), 0);
|
||||||
|
if (dlg.open() && dlg.text1.trim().length() > 0) {
|
||||||
|
toAllCfgs = dlg.check1;
|
||||||
|
toAllLang = dlg.check3;
|
||||||
|
int flags = 0;
|
||||||
|
if (dlg.check2) { // isWsp
|
||||||
|
flags = ICSettingEntry.VALUE_WORKSPACE_PATH;
|
||||||
|
}
|
||||||
|
return new CIncludeFileEntry(dlg.text1, flags);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ICLanguageSettingEntry doEdit(ICLanguageSettingEntry ent) {
|
||||||
|
IncludeDialog dlg = new IncludeDialog(usercomp.getShell(), IncludeDialog.OLD_FILE,
|
||||||
|
UIMessages.getString("IncludeFileTab.2"), //$NON-NLS-1$
|
||||||
|
ent.getValue(), getResDesc().getConfiguration(),
|
||||||
|
(ent.getFlags() & ICSettingEntry.VALUE_WORKSPACE_PATH));
|
||||||
|
if (dlg.open()) {
|
||||||
|
int flags = 0;
|
||||||
|
if (dlg.check2)
|
||||||
|
flags = ICSettingEntry.VALUE_WORKSPACE_PATH;
|
||||||
|
return new CIncludeFileEntry(dlg.text1, flags);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getKind() {
|
||||||
|
return ICSettingEntry.INCLUDE_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canBeVisible() {
|
||||||
|
if (!CDTPrefUtil.getBool(CDTPrefUtil.KEY_SHOW_INC_FILES))
|
||||||
|
return false;
|
||||||
|
return super.canBeVisible();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createControls(final Composite parent) {
|
||||||
|
super.createControls(parent);
|
||||||
|
ImportExportWizardButtons.addWizardLaunchButtons(usercomp, page.getElement());
|
||||||
|
}
|
||||||
|
}
|
|
@ -296,6 +296,7 @@ PropertyPageDefsTab.6=Show disc. page names if they are unique. Else names + pro
|
||||||
PropertyPageDefsTab.7=Show disc. page names if they are unique. Else show profile IDs.
|
PropertyPageDefsTab.7=Show disc. page names if they are unique. Else show profile IDs.
|
||||||
PropertyPageDefsTab.8=Always show names + profile IDs
|
PropertyPageDefsTab.8=Always show names + profile IDs
|
||||||
PropertyPageDefsTab.9=Always show profile IDs only
|
PropertyPageDefsTab.9=Always show profile IDs only
|
||||||
|
PropertyPageDefsTab.showIncludeFileTab=Display "Include Files" tab
|
||||||
ProjectConvert.convertersList=Converters List
|
ProjectConvert.convertersList=Converters List
|
||||||
|
|
||||||
ScannerConfigOptionsDialog.title=Discovery Options
|
ScannerConfigOptionsDialog.title=Discovery Options
|
||||||
|
@ -409,6 +410,9 @@ EnvironmentTab.9=Undefine
|
||||||
IncludeTab.0=Include directories
|
IncludeTab.0=Include directories
|
||||||
IncludeTab.1=Add directory path
|
IncludeTab.1=Add directory path
|
||||||
IncludeTab.2=Change directory path
|
IncludeTab.2=Change directory path
|
||||||
|
IncludeFileTab.0=Include files
|
||||||
|
IncludeFileTab.1=Add include file
|
||||||
|
IncludeFileTab.2=Change include file
|
||||||
IncludeDialog.0=Directory:
|
IncludeDialog.0=Directory:
|
||||||
IncludeDialog.1=File:
|
IncludeDialog.1=File:
|
||||||
IncludeDialog.2=Add to all configurations
|
IncludeDialog.2=Add to all configurations
|
||||||
|
|
Loading…
Add table
Reference in a new issue