mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
Add "needsHeader()" method
This commit is contained in:
parent
7028cddf94
commit
b5e8c719fe
5 changed files with 17 additions and 12 deletions
|
@ -347,9 +347,9 @@
|
|||
/>
|
||||
<tab
|
||||
class="org.eclipse.cdt.managedbuilder.ui.newui.BuilderSettingsTab"
|
||||
icon="icons/obj16/build_settings.gif"
|
||||
name="Builder settings"
|
||||
parent="org.eclipse.cdt.managedbuilder.ui.newui.PrefPage_NewCDTProject"
|
||||
/>
|
||||
parent="org.eclipse.cdt.managedbuilder.ui.newui.PrefPage_NewCDTProject"/>
|
||||
</extension>
|
||||
|
||||
<extension
|
||||
|
|
|
@ -36,4 +36,5 @@ public class PrefPage_NewCDTProject extends AbstractPrefPage {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected boolean needsHeader() { return true; }
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ public abstract class AbstractPrefPage extends AbstractPage
|
|||
compositeLayout.marginWidth = 0;
|
||||
composite.setLayout( compositeLayout );
|
||||
|
||||
if (needsHeader()) {
|
||||
Group configGroup = ControlFactory.createGroup(composite, EMPTY_STR, 1);
|
||||
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
|
||||
gd.grabExcessHorizontalSpace = true;
|
||||
|
@ -48,7 +49,7 @@ public abstract class AbstractPrefPage extends AbstractPage
|
|||
titleLabel = ControlFactory.createLabel(configGroup,
|
||||
NewUIMessages.getResourceString("AbstractPrefPage.0") + //$NON-NLS-1$
|
||||
NewUIMessages.getResourceString("AbstractPrefPage.1")); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
createWidgets(composite);
|
||||
return composite;
|
||||
}
|
||||
|
@ -58,6 +59,5 @@ public abstract class AbstractPrefPage extends AbstractPage
|
|||
public void init(IWorkbench workbench) {}
|
||||
public ICResourceDescription getResDesc() { return null; }
|
||||
public void performApply() { performOk(); }
|
||||
|
||||
|
||||
abstract protected boolean needsHeader();
|
||||
}
|
||||
|
|
|
@ -9,4 +9,6 @@ public class PrefPage_Env extends AbstractPrefPage {
|
|||
forEach(ICPropertyTab.OK, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean needsHeader() { return false; }
|
||||
}
|
||||
|
|
|
@ -3,10 +3,12 @@ package org.eclipse.cdt.ui.newui;
|
|||
public class PrefPage_Vars extends AbstractPrefPage {
|
||||
|
||||
protected boolean isSingle() { return true; }
|
||||
protected boolean needsHeader() { return false; }
|
||||
|
||||
// Tabs themselves should save data
|
||||
public boolean performOk() {
|
||||
forEach(ICPropertyTab.OK, null);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue