1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

bug 288032: renamed some private members to self-documented names

This commit is contained in:
Andrew Gvozdev 2009-08-30 02:21:26 +00:00
parent c240c7fe35
commit 8696b7c566

View file

@ -75,13 +75,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
private static final int DEFAULT_HEIGHT = 110; private static final int DEFAULT_HEIGHT = 110;
private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 }; private static final int[] DEFAULT_SASH_WEIGHTS = new int[] { 10, 20 };
private Label fTableDefinition; private Label fTableDefinition;
private Table resTable;
private Button scEnabledButton;
private Button scProblemReportingEnabledButton;
private Combo profileComboBox;
private Combo scopeComboBox; private Combo scopeComboBox;
private Composite profileComp; private Table resTable;
private Group scGroup; private Group autoDiscoveryGroup;
private Button autoDiscoveryCheckBox;
private Button reportProblemsCheckBox;
private Combo profileComboBox;
private Composite profileOptionsComposite;
private ICfgScannerConfigBuilderInfo2Set cbi; private ICfgScannerConfigBuilderInfo2Set cbi;
private Map<InfoContext, Object> baseInfoMap; private Map<InfoContext, Object> baseInfoMap;
@ -102,20 +102,22 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
* org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets * org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets
* .Composite) * .Composite)
*/ */
@Override
public void createControls(Composite parent) { public void createControls(Composite parent) {
super.createControls(parent); super.createControls(parent);
wrapper = new DiscoveryPageWrapper(this.page, this); wrapper = new DiscoveryPageWrapper(this.page, this);
usercomp.setLayout(new GridLayout(1, false)); usercomp.setLayout(new GridLayout(1, false));
if (page.isForProject() || page.isForPrefs()) { if (page.isForProject() || page.isForPrefs()) {
Group scopeGroup = setupGroup(usercomp, Messages.getString("DiscoveryTab.0"), Group scopeGroup = setupGroup(usercomp, Messages.getString("DiscoveryTab.0"), //$NON-NLS-1$
1, GridData.FILL_HORIZONTAL); //$NON-NLS-1$ 1, GridData.FILL_HORIZONTAL);
scopeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); scopeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
scopeComboBox = new Combo(scopeGroup, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); scopeComboBox = new Combo(scopeGroup, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
scopeComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); scopeComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
scopeComboBox.add(Messages.getString("DiscoveryTab.1")); //$NON-NLS-1$ scopeComboBox.add(Messages.getString("DiscoveryTab.1")); //$NON-NLS-1$
scopeComboBox.add(Messages.getString("DiscoveryTab.2")); //$NON-NLS-1$ scopeComboBox.add(Messages.getString("DiscoveryTab.2")); //$NON-NLS-1$
scopeComboBox.addSelectionListener(new SelectionAdapter() { scopeComboBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
if (cbi == null) if (cbi == null)
return; return;
@ -142,6 +144,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
gd.widthHint = 150; gd.widthHint = 150;
resTable.setLayoutData(gd); resTable.setLayoutData(gd);
resTable.addSelectionListener(new SelectionAdapter() { resTable.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
handleToolSelected(); handleToolSelected();
} }
@ -154,43 +157,47 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
createScannerConfigControls(c); createScannerConfigControls(c);
profileComp = new Composite(c, SWT.NONE); profileOptionsComposite = new Composite(c, SWT.NONE);
gd = new GridData(GridData.FILL, GridData.FILL, true, true); gd = new GridData(GridData.FILL, GridData.FILL, true, true);
gd.heightHint = Dialog.convertVerticalDLUsToPixels(getFontMetrics(parent), DEFAULT_HEIGHT); gd.heightHint = Dialog.convertVerticalDLUsToPixels(getFontMetrics(parent), DEFAULT_HEIGHT);
profileComp.setLayoutData(gd); profileOptionsComposite.setLayoutData(gd);
profileComp.setLayout(new TabFolderLayout()); profileOptionsComposite.setLayout(new TabFolderLayout());
sashForm.setWeights(DEFAULT_SASH_WEIGHTS); sashForm.setWeights(DEFAULT_SASH_WEIGHTS);
} }
private void createScannerConfigControls(Composite parent) { private void createScannerConfigControls(Composite parent) {
scGroup = setupGroup(parent, UIMessages.getString("ScannerConfigOptionsDialog.scGroup.label"), autoDiscoveryGroup = setupGroup(parent, UIMessages.getString("ScannerConfigOptionsDialog.scGroup.label"), //$NON-NLS-1$
2, GridData.FILL_HORIZONTAL); 2, GridData.FILL_HORIZONTAL);
scEnabledButton = setupCheck(scGroup, UIMessages.getString("ScannerConfigOptionsDialog.scGroup.enabled.button"), autoDiscoveryCheckBox = setupCheck(autoDiscoveryGroup, UIMessages.getString("ScannerConfigOptionsDialog.scGroup.enabled.button"), //$NON-NLS-1$
2, GridData.FILL_HORIZONTAL); 2, GridData.FILL_HORIZONTAL);
scEnabledButton.addSelectionListener(new SelectionAdapter() { autoDiscoveryCheckBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
buildInfo.setAutoDiscoveryEnabled(scEnabledButton.getSelection()); buildInfo.setAutoDiscoveryEnabled(autoDiscoveryCheckBox.getSelection());
enableAllControls(); enableAllControls();
if (scEnabledButton.getSelection()) if (autoDiscoveryCheckBox.getSelection())
handleDiscoveryProfileChanged(); handleDiscoveryProfileChanged();
} }
}); });
scProblemReportingEnabledButton = setupCheck(scGroup, UIMessages.getString("ScannerConfigOptionsDialog.scGroup.problemReporting.enabled.button"), reportProblemsCheckBox = setupCheck(autoDiscoveryGroup,
UIMessages.getString("ScannerConfigOptionsDialog.scGroup.problemReporting.enabled.button"), //$NON-NLS-1$
2, GridData.FILL_HORIZONTAL); 2, GridData.FILL_HORIZONTAL);
scProblemReportingEnabledButton.addSelectionListener(new SelectionAdapter() { reportProblemsCheckBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
buildInfo.setProblemReportingEnabled(scProblemReportingEnabledButton.getSelection()); buildInfo.setProblemReportingEnabled(reportProblemsCheckBox.getSelection());
} }
}); });
// Add profile combo box // Add profile combo box
setupLabel(scGroup, UIMessages.getString("ScannerConfigOptionsDialog.scGroup.selectedProfile.combo"), setupLabel(autoDiscoveryGroup, UIMessages.getString("ScannerConfigOptionsDialog.scGroup.selectedProfile.combo"), //$NON-NLS-1$
1, GridData.BEGINNING); 1, GridData.BEGINNING);
profileComboBox = new Combo(scGroup, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER); profileComboBox = new Combo(autoDiscoveryGroup, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.BORDER);
profileComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); profileComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
profileComboBox.addSelectionListener(new SelectionAdapter() { profileComboBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
int x = profileComboBox.getSelectionIndex(); int x = profileComboBox.getSelectionIndex();
String s = visibleProfilesList.get(x); String s = visibleProfilesList.get(x);
@ -201,12 +208,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
} }
private void enableAllControls() { private void enableAllControls() {
boolean isSCDEnabled = scEnabledButton.getSelection(); boolean isSCDEnabled = autoDiscoveryCheckBox.getSelection();
scProblemReportingEnabledButton.setEnabled(isSCDEnabled); reportProblemsCheckBox.setEnabled(isSCDEnabled);
profileComboBox.setEnabled(isSCDEnabled); profileComboBox.setEnabled(isSCDEnabled);
profileComp.setVisible(isSCDEnabled); profileOptionsComposite.setVisible(isSCDEnabled);
} }
@Override
public void updateData(ICResourceDescription rcfg) { public void updateData(ICResourceDescription rcfg) {
if (page.isMultiCfg()) { if (page.isMultiCfg()) {
setAllVisible(false, null); setAllVisible(false, null);
@ -278,13 +286,13 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
} }
private void setVisibility(String errMsg) { private void setVisibility(String errMsg) {
scGroup.setVisible(errMsg == null); autoDiscoveryGroup.setVisible(errMsg == null);
profileComp.setVisible(errMsg == null); profileOptionsComposite.setVisible(errMsg == null);
resTable.setEnabled(errMsg == null); resTable.setEnabled(errMsg == null);
if (errMsg != null) { if (errMsg != null) {
String[] ss = errMsg.split("\n"); //$NON-NLS-1$ String[] ss = errMsg.split("\n"); //$NON-NLS-1$
for (int i = 0; i < ss.length; i++) for (String line : ss)
new TableItem(resTable, SWT.NONE).setText(ss[i]); new TableItem(resTable, SWT.NONE).setText(line);
} }
} }
@ -302,8 +310,8 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
TableItem ti = resTable.getSelection()[0]; TableItem ti = resTable.getSelection()[0];
buildInfo = (IScannerConfigBuilderInfo2) ti.getData("info"); //$NON-NLS-1$ buildInfo = (IScannerConfigBuilderInfo2) ti.getData("info"); //$NON-NLS-1$
iContext = (CfgInfoContext) ti.getData("cont"); //$NON-NLS-1$ iContext = (CfgInfoContext) ti.getData("cont"); //$NON-NLS-1$
scEnabledButton.setSelection(buildInfo.isAutoDiscoveryEnabled()); autoDiscoveryCheckBox.setSelection(buildInfo.isAutoDiscoveryEnabled());
scProblemReportingEnabledButton.setSelection(buildInfo.isProblemReportingEnabled()); reportProblemsCheckBox.setSelection(buildInfo.isProblemReportingEnabled());
profileComboBox.removeAll(); profileComboBox.removeAll();
List<String> profilesList = buildInfo.getProfileIdList(); List<String> profilesList = buildInfo.getProfileIdList();
@ -311,10 +319,10 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
visibleProfilesList = new ArrayList<String>(profilesList.size()); visibleProfilesList = new ArrayList<String>(profilesList.size());
if (realPages != null && realPages.length > 0) { if (realPages != null && realPages.length > 0) {
for (int i = 0; i < realPages.length; i++) { for (AbstractDiscoveryPage realPage : realPages) {
if (realPages[i] != null) { if (realPage != null) {
realPages[i].setVisible(false); realPage.setVisible(false);
realPages[i].dispose(); realPage.dispose();
} }
} }
} }
@ -343,11 +351,11 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
for (String profileId : profilesList) { for (String profileId : profilesList) {
if (tools != null) { if (tools != null) {
boolean ok = false; boolean ok = false;
for (int i = 0; i < tools.length; ++i) { for (ITool tool : tools) {
IInputType[] inputTypes = ((Tool) tools[i]).getAllInputTypes(); IInputType[] inputTypes = ((Tool) tool).getAllInputTypes();
if (null != inputTypes) { if (null != inputTypes) {
for (IInputType it : inputTypes) { for (IInputType it : inputTypes) {
String[] requiedProfiles = getDiscoveryProfileIds(tools[i], it); String[] requiedProfiles = getDiscoveryProfileIds(tool, it);
if (null != requiedProfiles) { if (null != requiedProfiles) {
for (String requiredProfile : requiedProfiles) { for (String requiredProfile : requiedProfiles) {
if (profileId.equals(requiredProfile)) { if (profileId.equals(requiredProfile)) {
@ -381,8 +389,8 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
if (s != null && s.length() > 0) if (s != null && s.length() > 0)
labels[counter] = s; labels[counter] = s;
pg.setContainer(wrapper); pg.setContainer(wrapper);
pg.createControl(profileComp); pg.createControl(profileOptionsComposite);
profileComp.layout(true); profileOptionsComposite.layout(true);
break; break;
} }
} }
@ -404,8 +412,8 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
return new String[0]; return new String[0];
// FIXME: temporary; we should add new method to IInputType instead of // FIXME: temporary; we should add new method to IInputType instead of
// that // that
String[] profileIds = attribute.split("\\|"); String[] profileIds = attribute.split("\\|"); //$NON-NLS-1$
for (int i = 0; i < profileIds.length; ++i) for (int i = 0; i < profileIds.length; i++)
profileIds[i] = profileIds[i].trim(); profileIds[i] = profileIds[i].trim();
return profileIds; return profileIds;
} }
@ -486,9 +494,9 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
if (point == null) if (point == null)
return; return;
IConfigurationElement[] infos = point.getConfigurationElements(); IConfigurationElement[] infos = point.getConfigurationElements();
for (int i = 0; i < infos.length; i++) { for (IConfigurationElement info : infos) {
if (infos[i].getName().equals(PROFILE_PAGE)) { if (info.getName().equals(PROFILE_PAGE)) {
pagesList.add(new DiscoveryProfilePageConfiguration(infos[i])); pagesList.add(new DiscoveryProfilePageConfiguration(info));
} }
} }
} }
@ -522,6 +530,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
} }
} }
@Override
public void performApply(ICResourceDescription src, public void performApply(ICResourceDescription src,
ICResourceDescription dst) { ICResourceDescription dst) {
if (page.isMultiCfg()) if (page.isMultiCfg())
@ -548,6 +557,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
clearChangedDiscoveredInfos(); clearChangedDiscoveredInfos();
} }
@Override
protected void performOK() { protected void performOK() {
performOK(true); performOK(true);
} }
@ -573,10 +583,9 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
} }
private void clearChangedDiscoveredInfos() { private void clearChangedDiscoveredInfos() {
List<CfgInfoContext> changedContexts = checkChanges();
IProject project = getProject(); IProject project = getProject();
for (int i = 0; i < changedContexts.size(); i++) { List<CfgInfoContext> changedContexts = checkChanges();
CfgInfoContext c = changedContexts.get(i); for (CfgInfoContext c : changedContexts) {
CfgDiscoveredPathManager.getInstance().removeDiscoveredInfo(project, c); CfgDiscoveredPathManager.getInstance().removeDiscoveredInfo(project, c);
// MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(c.getProject(), c); // MakeCorePlugin.getDefault().getDiscoveryManager().removeDiscoveredInfo(c.getProject(), c);
} }
@ -657,6 +666,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
return true; return true;
} }
@Override
public boolean canBeVisible() { public boolean canBeVisible() {
if (page.isMultiCfg()) { if (page.isMultiCfg()) {
setAllVisible(false, null); setAllVisible(false, null);
@ -691,6 +701,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
return getResDesc().getConfiguration(); return getResDesc().getConfiguration();
} }
@Override
protected void performDefaults() { protected void performDefaults() {
if (page.isMultiCfg()) if (page.isMultiCfg())
return; return;
@ -704,6 +715,7 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
updateData(); updateData();
} }
@Override
protected void updateButtons() { protected void updateButtons() {
// Do nothing. No buttons to update. // Do nothing. No buttons to update.
} }