mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 11:55:40 +02:00
Bug #220011 : Manged Project Properties: Path and symbols - UI inconsitencies
This commit is contained in:
parent
0da7636b1b
commit
41becf515a
8 changed files with 121 additions and 86 deletions
|
@ -49,7 +49,7 @@ CDTExpPathSymbolsProperty.name=Export settings
|
||||||
CDTBuildProperty.name=Settings
|
CDTBuildProperty.name=Settings
|
||||||
CDTToolchainProperty.name=Tool chain editor
|
CDTToolchainProperty.name=Tool chain editor
|
||||||
CDTVariablesProperty.name=Variables
|
CDTVariablesProperty.name=Variables
|
||||||
Discovery.options=Discovery options
|
Discovery.options=Discovery Options
|
||||||
Environment=Environment
|
Environment=Environment
|
||||||
|
|
||||||
BuildCfgMenu.label=Build configurations
|
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.name1=Convert to a C/C++ Make Project1
|
||||||
WizardConvertMakeProject.description=Convert to a C/C++ Project which uses a simple makefile
|
WizardConvertMakeProject.description=Convert to a C/C++ Project which uses a simple makefile
|
||||||
|
|
||||||
Tool.settings=Tool settings
|
Tool.settings=Tool Settings
|
||||||
Build.steps=Build steps
|
Build.steps=Build Steps
|
||||||
Build.artifact=Build artifact
|
Build.artifact=Build Artifact
|
||||||
Builder.settings=Builder settings
|
Builder.settings=Builder Settings
|
||||||
WBB.settings=Behaviour
|
WBB.settings=Behaviour
|
||||||
Includes=Includes
|
Includes=Includes
|
||||||
Symbols=Symbols
|
Symbols=Symbols
|
||||||
Libraries=Libraries
|
Libraries=Libraries
|
||||||
Library.paths=Library paths
|
Library.paths=Library Paths
|
||||||
References=References
|
References=References
|
||||||
Source.location=Source location
|
Source.location=Source Location
|
||||||
Output.location=Output location
|
Output.location=Output Location
|
||||||
Binary.parsers=Binary parsers
|
Binary.parsers=Binary Parsers
|
||||||
Error.parsers=Error parsers
|
Error.parsers=Error Parsers
|
||||||
Data.hierarchy=Data hierarchy
|
Data.hierarchy=Data Hierarchy
|
||||||
Preferred.toolchains=Preferred toolchains
|
Preferred.toolchains=Preferred Toolchains
|
||||||
Wizard.defaults=Wizard defaults
|
Wizard.defaults=Wizard Defaults
|
||||||
PropertyPage.defaults=Property page settings
|
PropertyPage.defaults=Property Page Settings
|
||||||
MBSPerProjectProfile.name=Managed Build System - per project scanner info profile
|
MBSPerProjectProfile.name=Managed Build System - per project scanner info profile
|
||||||
multicfg=Multiple configurations edit
|
multicfg=Multiple Configurations Edit
|
||||||
|
|
||||||
# menu labels
|
# menu labels
|
||||||
Configurations.menu=Build Configurations
|
Configurations.menu=Build Configurations
|
||||||
|
|
|
@ -28,6 +28,8 @@ import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.accessibility.AccessibleAdapter;
|
import org.eclipse.swt.accessibility.AccessibleAdapter;
|
||||||
import org.eclipse.swt.accessibility.AccessibleEvent;
|
import org.eclipse.swt.accessibility.AccessibleEvent;
|
||||||
import org.eclipse.swt.custom.SashForm;
|
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.MouseAdapter;
|
||||||
import org.eclipse.swt.events.MouseEvent;
|
import org.eclipse.swt.events.MouseEvent;
|
||||||
import org.eclipse.swt.events.PaintEvent;
|
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.Label;
|
||||||
import org.eclipse.swt.widgets.Listener;
|
import org.eclipse.swt.widgets.Listener;
|
||||||
import org.eclipse.swt.widgets.Table;
|
import org.eclipse.swt.widgets.Table;
|
||||||
|
import org.eclipse.swt.widgets.TableColumn;
|
||||||
import org.eclipse.swt.widgets.Tree;
|
import org.eclipse.swt.widgets.Tree;
|
||||||
import org.eclipse.swt.widgets.TreeColumn;
|
import org.eclipse.swt.widgets.TreeColumn;
|
||||||
import org.eclipse.swt.widgets.TreeItem;
|
import org.eclipse.swt.widgets.TreeItem;
|
||||||
|
@ -76,6 +79,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
protected boolean toAllCfgs = false;
|
protected boolean toAllCfgs = false;
|
||||||
protected boolean toAllLang = false;
|
protected boolean toAllLang = false;
|
||||||
protected Label lb1, lb2;
|
protected Label lb1, lb2;
|
||||||
|
protected TableColumn columnToFit = null;
|
||||||
|
|
||||||
protected ICLanguageSetting lang;
|
protected ICLanguageSetting lang;
|
||||||
protected LinkedList<ICLanguageSettingEntry> incs;
|
protected LinkedList<ICLanguageSettingEntry> incs;
|
||||||
|
@ -116,7 +120,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
gd = new GridData(GridData.FILL_BOTH);
|
gd = new GridData(GridData.FILL_BOTH);
|
||||||
gd.widthHint = 255;
|
gd.widthHint = 255;
|
||||||
table.setLayoutData(gd);
|
table.setLayoutData(gd);
|
||||||
table.setHeaderVisible(true);
|
table.setHeaderVisible(isHeaderVisible());
|
||||||
table.setLinesVisible(true);
|
table.setLinesVisible(true);
|
||||||
|
|
||||||
sashForm.setWeights(DEFAULT_SASH_WEIGHTS);
|
sashForm.setWeights(DEFAULT_SASH_WEIGHTS);
|
||||||
|
@ -163,6 +167,15 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
buttonPressed(1);
|
buttonPressed(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
table.addControlListener(new ControlListener() {
|
||||||
|
public void controlMoved(ControlEvent e) {
|
||||||
|
setColumnToFit();
|
||||||
|
}
|
||||||
|
public void controlResized(ControlEvent e) {
|
||||||
|
setColumnToFit();
|
||||||
|
}});
|
||||||
|
|
||||||
setupLabel(usercomp, EMPTY_STR, 1, 0);
|
setupLabel(usercomp, EMPTY_STR, 1, 0);
|
||||||
|
|
||||||
lb1 = new Label(usercomp, SWT.BORDER | SWT.CENTER);
|
lb1 = new Label(usercomp, SWT.BORDER | SWT.CENTER);
|
||||||
|
@ -698,4 +711,13 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
||||||
return se;
|
return se;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected boolean isHeaderVisible() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setColumnToFit() {
|
||||||
|
if (columnToFit != null)
|
||||||
|
columnToFit.setWidth(table.getBounds().width - 4);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,12 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
|
||||||
break;
|
break;
|
||||||
// create / link
|
// create / link
|
||||||
case 1:
|
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) {
|
if (d.open() == Window.OK) {
|
||||||
IFolder f = (IFolder)d.getFirstResult();
|
IFolder f = (IFolder)d.getFirstResult();
|
||||||
src.add(new _Entry(newEntry(f, new IPath[0], !f.isLinked())));
|
src.add(new _Entry(newEntry(f, new IPath[0], !f.isLinked())));
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
package org.eclipse.cdt.ui.newui;
|
package org.eclipse.cdt.ui.newui;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
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.swt.widgets.TableColumn;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
|
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 class IncludeTab extends AbstractLangsListTab {
|
||||||
|
|
||||||
public void additionalTableSet() {
|
public void additionalTableSet() {
|
||||||
TableColumn c = new TableColumn(table, SWT.NONE);
|
columnToFit = new TableColumn(table, SWT.NONE);
|
||||||
c.setWidth(210);
|
columnToFit.setText(UIMessages.getString("IncludeTab.0")); //$NON-NLS-1$
|
||||||
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$
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
showBIButton.setSelection(true);
|
showBIButton.setSelection(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -12,8 +12,6 @@
|
||||||
package org.eclipse.cdt.ui.newui;
|
package org.eclipse.cdt.ui.newui;
|
||||||
|
|
||||||
import org.eclipse.swt.SWT;
|
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.Composite;
|
||||||
import org.eclipse.swt.widgets.TableColumn;
|
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 };
|
private static final int[] PRIVATE_SASH_WEIGHTS = new int[] { 0, 30 };
|
||||||
|
|
||||||
public void additionalTableSet() {
|
public void additionalTableSet() {
|
||||||
TableColumn c = new TableColumn(table, SWT.NONE);
|
columnToFit = 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$
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
super.createControls(parent);
|
super.createControls(parent);
|
||||||
// ((GridData)langTree.getLayoutData()).widthHint = 0;
|
|
||||||
sashForm.setWeights(PRIVATE_SASH_WEIGHTS);
|
sashForm.setWeights(PRIVATE_SASH_WEIGHTS);
|
||||||
langTree.setVisible(false);
|
langTree.setVisible(false);
|
||||||
}
|
}
|
||||||
|
@ -81,5 +69,11 @@ public class LibraryPathTab extends AbstractLangsListTab implements IPathEntrySt
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getKind() { return ICSettingEntry.LIBRARY_PATH; }
|
public int getKind() {
|
||||||
|
return ICSettingEntry.LIBRARY_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isHeaderVisible() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* 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 };
|
private static final int[] PRIVATE_SASH_WEIGHTS = new int[] { 0, 30 };
|
||||||
|
|
||||||
public void additionalTableSet() {
|
public void additionalTableSet() {
|
||||||
TableColumn c = new TableColumn(table, SWT.NONE);
|
columnToFit = new TableColumn(table, SWT.NONE);
|
||||||
c.setWidth(300);
|
|
||||||
c.setText(UIMessages.getString("LibraryTab.0")); //$NON-NLS-1$
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
super.createControls(parent);
|
super.createControls(parent);
|
||||||
// ((GridData)langTree.getLayoutData()).widthHint = 0;
|
|
||||||
sashForm.setWeights(PRIVATE_SASH_WEIGHTS);
|
sashForm.setWeights(PRIVATE_SASH_WEIGHTS);
|
||||||
langTree.setVisible(false);
|
langTree.setVisible(false);
|
||||||
}
|
}
|
||||||
|
@ -71,8 +68,13 @@ public class LibraryTab extends AbstractLangsListTab implements IPathEntryStoreL
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getKind() { return ICSettingEntry.LIBRARY_FILE; }
|
public int getKind() {
|
||||||
|
return ICSettingEntry.LIBRARY_FILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean isHeaderVisible() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are made available under the terms of the Eclipse Public License v1.0
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
# which accompanies this distribution, and is available at
|
# which accompanies this distribution, and is available at
|
||||||
|
@ -303,9 +303,9 @@ BuildToolSettingsPage.tool.commandLinePattern=Command\nline pattern:
|
||||||
BuildToolSettingsPage.tool.advancedSettings=Expert settings:
|
BuildToolSettingsPage.tool.advancedSettings=Expert settings:
|
||||||
|
|
||||||
# ----------- File List Control -----------
|
# ----------- File List Control -----------
|
||||||
FileListControl.add=Add
|
FileListControl.add=Add...
|
||||||
FileListControl.delete=Delete
|
FileListControl.delete=Delete
|
||||||
FileListControl.edit=Edit
|
FileListControl.edit=Edit...
|
||||||
FileListControl.moveup=Move Up
|
FileListControl.moveup=Move Up
|
||||||
FileListControl.movedown=Move Down
|
FileListControl.movedown=Move Down
|
||||||
FileListControl.filedialog.title=Select File
|
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.
|
AbstractPrefPage.0=\ Preference settings will be applied to new projects \n only when there were no toolchains selected.
|
||||||
AbstractExportTab.0=[All]
|
AbstractExportTab.0=[All]
|
||||||
AbstractExportTab.1=[List]
|
AbstractExportTab.1=[List]
|
||||||
AbstractExportTab.2=Create
|
AbstractExportTab.2=Create...
|
||||||
AbstractExportTab.3=Edit
|
AbstractExportTab.3=Edit...
|
||||||
CLocationTab.0=Filter (empty)
|
CLocationTab.0=Filter (empty)
|
||||||
CLocationTab.1=Filter (
|
CLocationTab.1=Filter (
|
||||||
CLocationTab.2=,
|
CLocationTab.2=,
|
||||||
CLocationTab.3=)
|
CLocationTab.3=)
|
||||||
CLocationTab.4=Add workspace folder
|
CLocationTab.4=Add Folder...
|
||||||
CLocationTab.5=Create / link folder
|
CLocationTab.5=Link Folder...
|
||||||
CLocationTab.6=Edit filter data
|
CLocationTab.6=Edit Filter...
|
||||||
CLocationTab.7=Delete folder
|
CLocationTab.7=Delete
|
||||||
CLocationSourceTab.0=Source folders on build path:
|
CLocationSourceTab.0=Source folders on build path:
|
||||||
CLocationOutputTab.0=Output folders on build path:
|
CLocationOutputTab.0=Output folders on build path:
|
||||||
EnvDialog.0=Name:
|
EnvDialog.0=Name:
|
||||||
|
@ -475,15 +475,12 @@ IncludeDialog.2=Add to all configurations
|
||||||
IncludeDialog.3=Add to all languages
|
IncludeDialog.3=Add to all languages
|
||||||
LanguagesTab.0=Content type
|
LanguagesTab.0=Content type
|
||||||
LanguagesTab.1=Language
|
LanguagesTab.1=Language
|
||||||
LibraryPathTab.0=Library paths
|
LibraryPathTab.1=Add...
|
||||||
LibraryPathTab.1=Add library path
|
LibraryPathTab.2=Edit...
|
||||||
LibraryPathTab.2=Change library path
|
LibraryTab.1=Add...
|
||||||
LibraryTab.0=Libraries
|
LibraryTab.2=Edit...
|
||||||
LibraryTab.1=Add library
|
RefsTab.0=Expand All
|
||||||
LibraryTab.2=Change library name
|
RefsTab.2=Collapse All
|
||||||
RefsTab.0=Expand all
|
|
||||||
RefsTab.1=Expand selected
|
|
||||||
RefsTab.2=Collapse all
|
|
||||||
RefsTab.3=Active
|
RefsTab.3=Active
|
||||||
RefsTab.4=Projects list
|
RefsTab.4=Projects list
|
||||||
SymbolTab.0=Symbol
|
SymbolTab.0=Symbol
|
||||||
|
|
|
@ -15,12 +15,13 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.jface.viewers.TreeViewer;
|
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
import org.eclipse.swt.accessibility.AccessibleAdapter;
|
import org.eclipse.swt.accessibility.AccessibleAdapter;
|
||||||
import org.eclipse.swt.accessibility.AccessibleEvent;
|
import org.eclipse.swt.accessibility.AccessibleEvent;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
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.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
|
@ -32,15 +33,14 @@ import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
|
|
||||||
public class RefsTab extends AbstractCPropertyTab {
|
public class RefsTab extends AbstractCPropertyTab {
|
||||||
|
|
||||||
TreeViewer tv;
|
|
||||||
public Composite comp;
|
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$
|
static private final String ACTIVE = "[" + UIMessages.getString("RefsTab.3") + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
|
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
super.createControls(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));
|
usercomp.setLayout(new GridLayout(1, false));
|
||||||
|
|
||||||
tree = new Tree(usercomp, SWT.SINGLE | SWT.CHECK | SWT.BORDER);
|
tree = new Tree(usercomp, SWT.SINGLE | SWT.CHECK | SWT.BORDER);
|
||||||
|
@ -84,12 +84,26 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
parent.setChecked(false);
|
parent.setChecked(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
saveChecked();
|
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 which represents "Active" configuration
|
||||||
class ActiveCfg {
|
class ActiveCfg {
|
||||||
IProject project;
|
IProject project;
|
||||||
|
@ -102,20 +116,11 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void buttonPressed(int n) {
|
public void buttonPressed(int n) {
|
||||||
TreeItem[] items = tree.getItems();
|
for (TreeItem item : tree.getItems())
|
||||||
switch (n) {
|
item.setExpanded(n==0);
|
||||||
case 0: // expand
|
|
||||||
case 1: // expand selected
|
|
||||||
case 2: // collapse
|
|
||||||
for (int i=0; i<items.length; i++)
|
|
||||||
items[i].setExpanded(n==0 || (n==1 && items[i].getChecked()));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateData(ICResourceDescription cfgd) {
|
protected void updateData(ICResourceDescription cfgd) {
|
||||||
if (page.isMultiCfg()) {
|
if (page.isMultiCfg()) {
|
||||||
setAllVisible(false, null);
|
setAllVisible(false, null);
|
||||||
} else {
|
} else {
|
||||||
|
@ -149,7 +154,7 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
getResDesc().getConfiguration().setReferenceInfo(refs);
|
getResDesc().getConfiguration().setReferenceInfo(refs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initData() {
|
private void initData() {
|
||||||
tree.removeAll();
|
tree.removeAll();
|
||||||
IProject p = page.getProject();
|
IProject p = page.getProject();
|
||||||
if (p == null) return;
|
if (p == null) return;
|
||||||
|
@ -190,6 +195,7 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||||
|
@ -205,6 +211,25 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
getResDesc().getConfiguration().setReferenceInfo(new HashMap<String, String>());
|
getResDesc().getConfiguration().setReferenceInfo(new HashMap<String, String>());
|
||||||
initData();
|
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
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue