From f6da41c4664fe391608f9397d40fe7c6937cb271 Mon Sep 17 00:00:00 2001 From: James Blackburn Date: Wed, 28 Apr 2010 13:23:39 +0000 Subject: [PATCH] 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) --- .../plugin.properties | 3 +- .../plugin.xml | 8 ++ .../icons/obj16/h_file_obj.gif | Bin 0 -> 353 bytes .../plugin.properties | 2 + .../plugin.xml | 16 +++ .../ui/preferences/PropertyPageDefsTab.java | 8 ++ .../org/eclipse/cdt/ui/newui/CDTPrefUtil.java | 2 + .../cdt/ui/newui/ExpIncludeFileTab.java | 52 +++++++++ .../eclipse/cdt/ui/newui/IncludeFileTab.java | 101 ++++++++++++++++++ .../cdt/ui/newui/PluginResources.properties | 4 + 10 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 build/org.eclipse.cdt.managedbuilder.ui/icons/obj16/h_file_obj.gif create mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/ExpIncludeFileTab.java create mode 100644 core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/IncludeFileTab.java diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties index 45ccc47f9c2..090238686c0 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.properties @@ -100,7 +100,7 @@ ToolName.compiler.solaris.cpp = Solaris C++ Compiler # Generic Category Names OptionCategory.Symbols = Symbols OptionCategory.Preproc = Preprocessor -OptionCategory.Dirs = Directories +OptionCategory.Dirs = Includes OptionCategory.General = General OptionCategory.Optimize=Optimization OptionCategory.Debug=Debugging @@ -117,6 +117,7 @@ Option.Posix.DefSym=Defined symbols (-D) Option.Posix.UndefSym=Undefined symbols (-U) Option.Posix.InclPaths=Include paths (-I) +Option.Posix.InclFiles=Include files (-include) Option.Posix.OptLevel=Optimization Level Option.Posix.Optimize.None=None (-O0) diff --git a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml index 8d43a117b99..93a06519967 100644 --- a/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml +++ b/build/org.eclipse.cdt.managedbuilder.gnu.ui/plugin.xml @@ -1011,6 +1011,14 @@ valueType="includePath" browseType="directory"> + Fe*Gzy5sq^84P4A5Y%=eE#m|+fTnffBSvs`S<%Te>{Bk zY{#TTGTTn=EKDo!?|SryhvRrq!4~IMKhU z%V2$n;hJ`%m955CHf3DdlzD4!&DBkr|NsAIAOsYDvM@3*m@w#o6oUN3z*grltH47? zDDs5LC5;@`c^4$QU(SkHzv<={i%AvxwI$z#>M-)Pv$OQ7iTd~LuzDvjqf4XtpJ1hp z6q}~29CvFScP+P;t2|F%4Nonrf~z8nAWO}3eikKHNiP0{f?Ty+60TC5tJkb%7IT&1 a*t}(nw5zPRh=}MO5pi)@pTo|M4AuY>sgSAw literal 0 HcmV?d00001 diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties index 95552c6a6e4..44f9e2d45c1 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties +++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties @@ -79,6 +79,8 @@ Builder.settings=Builder Settings WBB.settings=Behaviour Includes=Includes Includes.tooltip=Includes list +IncludeFiles=Include Files +IncludeFiles.tooltip=Include Files list Symbols=Symbols Symbols.tooltip=Macros list Libraries=Libraries diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml index 5313a8ad381..75d1b5c7e95 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml +++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.xml @@ -251,6 +251,14 @@ helpId="cdt_u_prop_pns_inc" parent="org.eclipse.cdt.managedbuilder.ui.properties.Page_PathAndSymb" tooltip="%Includes.tooltip"/> + + + * This tab is hidden by default and can be shown under:
+ * 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()); + } +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties index ad06c18a150..5e87a5d318c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/PluginResources.properties @@ -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.8=Always show names + profile IDs PropertyPageDefsTab.9=Always show profile IDs only +PropertyPageDefsTab.showIncludeFileTab=Display "Include Files" tab ProjectConvert.convertersList=Converters List ScannerConfigOptionsDialog.title=Discovery Options @@ -409,6 +410,9 @@ EnvironmentTab.9=Undefine IncludeTab.0=Include directories IncludeTab.1=Add 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.1=File: IncludeDialog.2=Add to all configurations