1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 02:36:01 +02:00

Bug #190131 : Hiding configurations group in property page

This commit is contained in:
Oleg Krasilnikov 2008-03-25 15:58:25 +00:00
parent 7bd2f84e6a
commit 5c7a3c6f61

View file

@ -234,6 +234,7 @@ implements
protected void contentForCDT(Composite composite) {
GridData gd;
if (showsConfig()) {
// Add a config selection area
Group configGroup = ControlFactory.createGroup(composite, EMPTY_STR, 1);
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
@ -309,10 +310,10 @@ implements
}
});
}
}
// Update the contents of the configuration widget
populateConfigurations();
if (excludeFromBuildCheck != null) {
excludeFromBuildCheck.setSelection(getResDesc().isExcluded());
}
@ -544,19 +545,32 @@ implements
}
private void populateConfigurations() {
// Do nothing if widget not created yet.
if (configSelector == null) return;
// Do not re-read if list already created by another page
if (cfgDescs == null) {
cfgDescs = CDTPropertyManager.getProjectDescription(this, getProject()).getConfigurations();
if (cfgDescs == null || cfgDescs.length == 0) return;
Arrays.sort(cfgDescs, CDTListComparator.getInstance());
} else {
// just register in CDTPropertyManager;
CDTPropertyManager.getProjectDescription(this, getProject());
}
// Do nothing if widget not created yet.
if (configSelector == null) {
if (cfgDescs != null && cfgDescs.length > 0) {
for (int i = 0; i < cfgDescs.length; ++i) {
if (cfgIndex == -1 && cfgDescs[i].isActive())
cfgIndex = i;
}
if (cfgIndex < 0) {
cfgIndex = 0;
}
cfgChanged(cfgDescs[cfgIndex]);
}
return;
}
// Clear and replace the contents of the selector widget
configSelector.removeAll();
for (int i = 0; i < cfgDescs.length; ++i) {
@ -697,6 +711,9 @@ implements
populateConfigurations();
if (cfgDescs == null || cfgDescs.length == 0) return null;
}
if (cfgDescs.length == 0) {
return null;
}
resd = getResDesc(cfgDescs[cfgIndex]);
}
return resd;
@ -734,12 +751,14 @@ implements
protected void cfgChanged(ICConfigurationDescription _cfgd) {
CConfigurationStatus st = _cfgd.getConfigurationStatus();
if (errPane != null && errMessage != null) {
if (st.isOK()) {
errPane.setVisible(false);
} else {
errMessage.setText(st.getMessage());
errPane.setVisible(true);
}
}
resd = getResDesc(_cfgd);
@ -779,6 +798,13 @@ implements
*/
abstract protected boolean isSingle();
/**
* Defines whether the configurations control is shown or not.
* Subclasses may override this.
* @return true, if the configurations control should be shown (default); false otherwise
*/
protected boolean showsConfig() { return true; }
/**
* Apply specified method to all tabs
*/