diff --git a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties index 40ecda6e13c..680bf7e77db 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties +++ b/build/org.eclipse.cdt.managedbuilder.ui/plugin.properties @@ -49,7 +49,7 @@ CDTExpPathSymbolsProperty.name=Export settings CDTBuildProperty.name=Settings CDTToolchainProperty.name=Tool chain editor CDTVariablesProperty.name=Variables -Discovery.options=Discovery options +Discovery.options=Discovery Options Environment=Environment BuildCfgMenu.label=Build configurations @@ -64,26 +64,26 @@ WizardConvertMakeProject.name=Convert to a C/C++ Make Project WizardConvertMakeProject.name1=Convert to a C/C++ Make Project1 WizardConvertMakeProject.description=Convert to a C/C++ Project which uses a simple makefile -Tool.settings=Tool settings -Build.steps=Build steps -Build.artifact=Build artifact -Builder.settings=Builder settings +Tool.settings=Tool Settings +Build.steps=Build Steps +Build.artifact=Build Artifact +Builder.settings=Builder Settings WBB.settings=Behaviour Includes=Includes Symbols=Symbols Libraries=Libraries -Library.paths=Library paths +Library.paths=Library Paths References=References -Source.location=Source location -Output.location=Output location -Binary.parsers=Binary parsers -Error.parsers=Error parsers -Data.hierarchy=Data hierarchy -Preferred.toolchains=Preferred toolchains -Wizard.defaults=Wizard defaults -PropertyPage.defaults=Property page settings +Source.location=Source Location +Output.location=Output Location +Binary.parsers=Binary Parsers +Error.parsers=Error Parsers +Data.hierarchy=Data Hierarchy +Preferred.toolchains=Preferred Toolchains +Wizard.defaults=Wizard Defaults +PropertyPage.defaults=Property Page Settings MBSPerProjectProfile.name=Managed Build System - per project scanner info profile -multicfg=Multiple configurations edit +multicfg=Multiple Configurations Edit # menu labels Configurations.menu=Build Configurations diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java index abb630c4e9b..488bcce879b 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/AbstractLangsListTab.java @@ -28,6 +28,8 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.accessibility.AccessibleAdapter; import org.eclipse.swt.accessibility.AccessibleEvent; import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.PaintEvent; @@ -45,6 +47,7 @@ import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeColumn; import org.eclipse.swt.widgets.TreeItem; @@ -76,6 +79,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { protected boolean toAllCfgs = false; protected boolean toAllLang = false; protected Label lb1, lb2; + protected TableColumn columnToFit = null; protected ICLanguageSetting lang; protected LinkedList incs; @@ -116,7 +120,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 255; table.setLayoutData(gd); - table.setHeaderVisible(true); + table.setHeaderVisible(isHeaderVisible()); table.setLinesVisible(true); sashForm.setWeights(DEFAULT_SASH_WEIGHTS); @@ -163,6 +167,15 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { buttonPressed(1); } }); + + table.addControlListener(new ControlListener() { + public void controlMoved(ControlEvent e) { + setColumnToFit(); + } + public void controlResized(ControlEvent e) { + setColumnToFit(); + }}); + setupLabel(usercomp, EMPTY_STR, 1, 0); lb1 = new Label(usercomp, SWT.BORDER | SWT.CENTER); @@ -698,4 +711,13 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab { return se; } + protected boolean isHeaderVisible() { + return true; + } + + protected void setColumnToFit() { + if (columnToFit != null) + columnToFit.setWidth(table.getBounds().width - 4); + } + } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java index 769ccffde5b..40d228fddad 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/CLocationTab.java @@ -183,7 +183,12 @@ public abstract class CLocationTab extends AbstractCPropertyTab { break; // create / link case 1: - NewFolderDialog d = new NewFolderDialog(shell, page.getProject()); + NewFolderDialog d = new NewFolderDialog(shell, page.getProject()) { + public void create() { + super.create(); + handleAdvancedButtonSelect(); + } + }; if (d.open() == Window.OK) { IFolder f = (IFolder)d.getFirstResult(); src.add(new _Entry(newEntry(f, new IPath[0], !f.isLinked()))); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/IncludeTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/IncludeTab.java index 5f139477430..c1d8252cc14 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/IncludeTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/IncludeTab.java @@ -12,8 +12,6 @@ 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.TableColumn; import org.eclipse.cdt.core.settings.model.CIncludePathEntry; @@ -23,16 +21,8 @@ import org.eclipse.cdt.core.settings.model.ICSettingEntry; public class IncludeTab extends AbstractLangsListTab { public void additionalTableSet() { - TableColumn c = new TableColumn(table, SWT.NONE); - c.setWidth(210); - c.setText(UIMessages.getString("IncludeTab.0")); //$NON-NLS-1$ - table.getAccessible().addAccessibleListener( - new AccessibleAdapter() { - public void getName(AccessibleEvent e) { - e.result = UIMessages.getString("IncludeTab.0"); //$NON-NLS-1$ - } - } - ); + columnToFit = new TableColumn(table, SWT.NONE); + columnToFit.setText(UIMessages.getString("IncludeTab.0")); //$NON-NLS-1$ showBIButton.setSelection(true); } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryPathTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryPathTab.java index 446cbf3d619..4afeacdec5a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryPathTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryPathTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -12,8 +12,6 @@ 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; @@ -29,21 +27,11 @@ public class LibraryPathTab extends AbstractLangsListTab implements IPathEntrySt private static final int[] PRIVATE_SASH_WEIGHTS = new int[] { 0, 30 }; public void additionalTableSet() { - TableColumn c = new TableColumn(table, SWT.NONE); - c.setWidth(300); - c.setText(UIMessages.getString("LibraryPathTab.0")); //$NON-NLS-1$ - table.getAccessible().addAccessibleListener( - new AccessibleAdapter() { - public void getName(AccessibleEvent e) { - e.result = UIMessages.getString("LibraryPathTab.0"); //$NON-NLS-1$ - } - } - ); + columnToFit = new TableColumn(table, SWT.NONE); } public void createControls(Composite parent) { super.createControls(parent); -// ((GridData)langTree.getLayoutData()).widthHint = 0; sashForm.setWeights(PRIVATE_SASH_WEIGHTS); langTree.setVisible(false); } @@ -81,5 +69,11 @@ public class LibraryPathTab extends AbstractLangsListTab implements IPathEntrySt return null; } - public int getKind() { return ICSettingEntry.LIBRARY_PATH; } + public int getKind() { + return ICSettingEntry.LIBRARY_PATH; + } + + protected boolean isHeaderVisible() { + return false; + } } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryTab.java index 03fd0c12764..fd8452ece62 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/LibraryTab.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Intel Corporation and others. + * Copyright (c) 2007, 2008 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 @@ -26,14 +26,11 @@ public class LibraryTab extends AbstractLangsListTab implements IPathEntryStoreL private static final int[] PRIVATE_SASH_WEIGHTS = new int[] { 0, 30 }; public void additionalTableSet() { - TableColumn c = new TableColumn(table, SWT.NONE); - c.setWidth(300); - c.setText(UIMessages.getString("LibraryTab.0")); //$NON-NLS-1$ + columnToFit = new TableColumn(table, SWT.NONE); } public void createControls(Composite parent) { super.createControls(parent); -// ((GridData)langTree.getLayoutData()).widthHint = 0; sashForm.setWeights(PRIVATE_SASH_WEIGHTS); langTree.setVisible(false); } @@ -71,8 +68,13 @@ public class LibraryTab extends AbstractLangsListTab implements IPathEntryStoreL return null; } - public int getKind() { return ICSettingEntry.LIBRARY_FILE; } + public int getKind() { + return ICSettingEntry.LIBRARY_FILE; + } + protected boolean isHeaderVisible() { + return false; + } } 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 fc1de7ba355..23717df6c37 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 @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2007 IBM Corporation and others. +# Copyright (c) 2000, 2008 IBM 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 @@ -303,9 +303,9 @@ BuildToolSettingsPage.tool.commandLinePattern=Command\nline pattern: BuildToolSettingsPage.tool.advancedSettings=Expert settings: # ----------- File List Control ----------- -FileListControl.add=Add +FileListControl.add=Add... FileListControl.delete=Delete -FileListControl.edit=Edit +FileListControl.edit=Edit... FileListControl.moveup=Move Up FileListControl.movedown=Move Down FileListControl.filedialog.title=Select File @@ -427,16 +427,16 @@ AbstractLangsListTab.4=Unexport AbstractPrefPage.0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected. AbstractExportTab.0=[All] AbstractExportTab.1=[List] -AbstractExportTab.2=Create -AbstractExportTab.3=Edit +AbstractExportTab.2=Create... +AbstractExportTab.3=Edit... CLocationTab.0=Filter (empty) CLocationTab.1=Filter ( CLocationTab.2=, CLocationTab.3=) -CLocationTab.4=Add workspace folder -CLocationTab.5=Create / link folder -CLocationTab.6=Edit filter data -CLocationTab.7=Delete folder +CLocationTab.4=Add Folder... +CLocationTab.5=Link Folder... +CLocationTab.6=Edit Filter... +CLocationTab.7=Delete CLocationSourceTab.0=Source folders on build path: CLocationOutputTab.0=Output folders on build path: EnvDialog.0=Name: @@ -475,15 +475,12 @@ IncludeDialog.2=Add to all configurations IncludeDialog.3=Add to all languages LanguagesTab.0=Content type LanguagesTab.1=Language -LibraryPathTab.0=Library paths -LibraryPathTab.1=Add library path -LibraryPathTab.2=Change library path -LibraryTab.0=Libraries -LibraryTab.1=Add library -LibraryTab.2=Change library name -RefsTab.0=Expand all -RefsTab.1=Expand selected -RefsTab.2=Collapse all +LibraryPathTab.1=Add... +LibraryPathTab.2=Edit... +LibraryTab.1=Add... +LibraryTab.2=Edit... +RefsTab.0=Expand All +RefsTab.2=Collapse All RefsTab.3=Active RefsTab.4=Projects list SymbolTab.0=Symbol diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java index 6568d047ad9..965bb235e1a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/newui/RefsTab.java @@ -15,12 +15,13 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.core.resources.IProject; -import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.swt.SWT; import org.eclipse.swt.accessibility.AccessibleAdapter; import org.eclipse.swt.accessibility.AccessibleEvent; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.TreeEvent; +import org.eclipse.swt.events.TreeListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -32,15 +33,14 @@ import org.eclipse.cdt.core.settings.model.ICResourceDescription; public class RefsTab extends AbstractCPropertyTab { - TreeViewer tv; public Composite comp; - Tree tree; + private Tree tree; static private final String ACTIVE = "[" + UIMessages.getString("RefsTab.3") + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ public void createControls(Composite parent) { super.createControls(parent); - initButtons(new String[] {UIMessages.getString("RefsTab.0"), UIMessages.getString("RefsTab.1"), UIMessages.getString("RefsTab.2")}, 120); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + initButtons(new String[] {UIMessages.getString("RefsTab.0"), UIMessages.getString("RefsTab.2")}, 120); //$NON-NLS-1$ //$NON-NLS-2$ usercomp.setLayout(new GridLayout(1, false)); tree = new Tree(usercomp, SWT.SINGLE | SWT.CHECK | SWT.BORDER); @@ -84,12 +84,26 @@ public class RefsTab extends AbstractCPropertyTab { parent.setChecked(false); } } + saveChecked(); } + updateButtons(); } }); + + tree.addTreeListener(new TreeListener() { + public void treeCollapsed(TreeEvent e) { + updateButtons(e, false, true); + } + public void treeExpanded(TreeEvent e) { + updateButtons(e, true, false); + }}); + } + + + // Class which represents "Active" configuration class ActiveCfg { IProject project; @@ -102,20 +116,11 @@ public class RefsTab extends AbstractCPropertyTab { } public void buttonPressed(int n) { - TreeItem[] items = tree.getItems(); - switch (n) { - case 0: // expand - case 1: // expand selected - case 2: // collapse - for (int i=0; i()); initData(); } - protected void updateButtons() {} // Do nothing. No buttons to update. + + protected void updateButtons() { + updateButtons(null, false, false); + } + + private void updateButtons(TreeEvent e, boolean stateE, boolean stateC) { + boolean cntE = stateE; + boolean cntC = stateC; + for (TreeItem item : tree.getItems()) { + if (e != null && e.widget.equals(item)) + continue; + if (item.getExpanded()) + cntE = true; + else + cntC = true; + } + buttonSetEnabled(0, cntC); // Expand All + buttonSetEnabled(1, cntE); // Collapse all + } + }