mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
methods naming consistency.
This commit is contained in:
parent
b5f228114b
commit
7b016f3cf4
16 changed files with 26 additions and 160 deletions
|
@ -139,4 +139,5 @@ public class PreferredToolchainsTab extends AbstractCBuildPropertyTab {
|
|||
h_selected.handleSelection();
|
||||
}
|
||||
protected void updateData(ICResourceDescription cfg) {}
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
|
|
@ -53,4 +53,5 @@ public class WizardDefaultsTab extends AbstractCPropertyTab {
|
|||
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) { performOK(); }
|
||||
protected void updateData(ICResourceDescription cfg) {} // Do nothing. Data is read once after creation
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
|
|
@ -156,5 +156,5 @@ public class ArtifactTab extends AbstractCBuildPropertyTab {
|
|||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
|
|
@ -371,4 +371,5 @@ public class BuildStepsTab extends AbstractCBuildPropertyTab {
|
|||
}
|
||||
update();
|
||||
}
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
c_builderType.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
cfg.enableInternalBuilder(c_builderType.getSelectionIndex() == 1);
|
||||
setState();
|
||||
updateButtons();
|
||||
}});
|
||||
|
||||
b_useDefault = setupCheck(g1, Messages.getString("BuilderSettingsTab.4"), 3, GridData.BEGINNING); //$NON-NLS-1$
|
||||
|
@ -135,7 +135,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
b_parallelOpt.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
cfg.setParallelDef(b_parallelOpt.getSelection());
|
||||
setState();
|
||||
updateButtons();
|
||||
}});
|
||||
|
||||
b_parallelNum= new Button(c2, SWT.RADIO);
|
||||
|
@ -145,7 +145,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
b_parallelNum.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
cfg.setParallelDef(!b_parallelNum.getSelection());
|
||||
setState();
|
||||
updateButtons();
|
||||
}});
|
||||
|
||||
parallelProcesses = new Spinner(c2, SWT.BORDER);
|
||||
|
@ -154,7 +154,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
parallelProcesses.addSelectionListener(new SelectionAdapter () {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
cfg.setParallelNumber(parallelProcesses.getSelection());
|
||||
setState();
|
||||
updateButtons();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -211,14 +211,14 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
try {
|
||||
bld.setManagedBuildOn(enable);
|
||||
page.informPages(MANAGEDBUILDSTATE, null);
|
||||
setState();
|
||||
updateButtons();
|
||||
} catch (CoreException ex) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* sets widgets states
|
||||
*/
|
||||
void setState() {
|
||||
protected void updateButtons() {
|
||||
bld = cfg.getEditableBuilder();
|
||||
|
||||
b_genMakefileAuto.setEnabled(cfg.supportsBuild(true));
|
||||
|
@ -353,7 +353,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
|
||||
public void checkPressed(SelectionEvent e) {
|
||||
checkPressed((Button)e.widget);
|
||||
setState();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
void checkPressed(Button b) {
|
||||
|
@ -412,7 +412,7 @@ public class BuilderSettingsTab extends AbstractCBuildPropertyTab {
|
|||
IConfiguration icfg = getCfg(cfgd.getConfiguration());
|
||||
if (!(icfg instanceof Configuration)) return;
|
||||
cfg = (Configuration)icfg;
|
||||
setState();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
|
|
|
@ -220,7 +220,7 @@ public class CPropertyVarsTab extends AbstractCPropertyTab {
|
|||
updateButtons();
|
||||
}
|
||||
|
||||
private void updateButtons() {
|
||||
protected void updateButtons() {
|
||||
Object[] obs = ((IStructuredSelection)tv.getSelection()).toArray();
|
||||
boolean canEdit = false;
|
||||
boolean canDel = false;
|
||||
|
|
|
@ -522,4 +522,5 @@ public class DiscoveryTab extends AbstractCBuildPropertyTab implements IBuildInf
|
|||
}
|
||||
updateData();
|
||||
}
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
|
|
@ -246,4 +246,5 @@ public class ToolChainEditTab extends AbstractCBuildPropertyTab {
|
|||
protected void performDefaults() {
|
||||
updateData();
|
||||
}
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
|
|
@ -214,6 +214,7 @@ public abstract class AbstractCPropertyTab implements ICPropertyTab {
|
|||
protected abstract void performApply(ICResourceDescription src, ICResourceDescription dst);
|
||||
protected abstract void performDefaults();
|
||||
protected abstract void updateData(ICResourceDescription cfg);
|
||||
protected abstract void updateButtons();
|
||||
protected void performCancel() {}
|
||||
protected void performOK() {}
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab {
|
|||
|
||||
table.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
setButtons();
|
||||
updateButtons();
|
||||
}
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
if (buttonIsEnabled(1) && table.getSelectionIndex() != -1)
|
||||
|
@ -141,7 +141,7 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab {
|
|||
* Updates state of add/edit/delete buttons
|
||||
* Called when table selection changes.
|
||||
*/
|
||||
protected void setButtons() {
|
||||
protected void updateButtons() {
|
||||
int i = table.getSelectionIndex();
|
||||
boolean x = i != -1;
|
||||
boolean y = x;
|
||||
|
@ -175,7 +175,7 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab {
|
|||
ICExternalSetting[] vals = cfg.getExternalSettings();
|
||||
if (vals == null || vals.length == 0) {
|
||||
tv.setInput(null);
|
||||
setButtons();
|
||||
updateButtons();
|
||||
return;
|
||||
}
|
||||
for (int i=0; i<vals.length; i++) {
|
||||
|
@ -190,7 +190,7 @@ public abstract class AbstractExportTab extends AbstractCPropertyTab {
|
|||
tv.setInput(lst.toArray(new Object[lst.size()]));
|
||||
if (table.getItemCount() > x) table.select(x);
|
||||
else if (table.getItemCount() > 0) table.select(0);
|
||||
setButtons();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -165,7 +165,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
|
|||
* Updates state for all buttons
|
||||
* Called when table selection changes.
|
||||
*/
|
||||
public void updateButtons() {
|
||||
protected void updateButtons() {
|
||||
int index = table.getSelectionIndex();
|
||||
boolean canAdd = langTree.getItemCount() > 0;
|
||||
boolean canExport = index != -1;
|
||||
|
|
|
@ -154,7 +154,7 @@ public abstract class CLocationTab extends AbstractCPropertyTab {
|
|||
* Edit: enabled if 1 element selected (entry or filter)
|
||||
* Delete: enabled if selected element is entry
|
||||
*/
|
||||
private void updateButtons() {
|
||||
protected void updateButtons() {
|
||||
TreeItem[] sel = tree.getTree().getSelection();
|
||||
buttonSetEnabled(2, sel.length == 1);
|
||||
buttonSetEnabled(3, sel.length > 0 && sel[0].getData() instanceof _Entry);
|
||||
|
|
|
@ -1,144 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 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
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.ui.newui;
|
||||
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.content.IContentTypeManager;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
|
||||
import org.eclipse.cdt.core.model.ILanguageDescriptor;
|
||||
import org.eclipse.cdt.core.model.LanguageManager;
|
||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||
|
||||
/**
|
||||
*
|
||||
* Functionality temporary commented
|
||||
* because of changes in Languages manager.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class LanguagesTab extends AbstractCPropertyTab {
|
||||
|
||||
Table table;
|
||||
LanguageManager lm = LanguageManager.getInstance();
|
||||
IContentTypeManager ctm = Platform.getContentTypeManager();
|
||||
IResource cr;
|
||||
|
||||
public void createControls(Composite parent) {
|
||||
super.createControls(parent);
|
||||
cr = (IResource)page.getElement();
|
||||
|
||||
usercomp.setLayout(new GridLayout(2, false));
|
||||
|
||||
table = new Table(usercomp, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
|
||||
table.setHeaderVisible(true);
|
||||
table.setLinesVisible(true);
|
||||
String[] headers = new String[] {UIMessages.getString("LanguagesTab.0"), UIMessages.getString("LanguagesTab.1"), }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
for (int i = 0; i < headers.length; i++) {
|
||||
TableColumn tc = new TableColumn(table, SWT.LEFT);
|
||||
tc.setText(headers[i]);
|
||||
tc.setWidth(200);
|
||||
}
|
||||
GridData gd = new GridData(GridData.FILL_BOTH);
|
||||
gd.grabExcessHorizontalSpace = true;
|
||||
table.setLayoutData(gd);
|
||||
|
||||
}
|
||||
|
||||
class ComboDataHolder {
|
||||
String id;
|
||||
ILanguageDescriptor[] des;
|
||||
|
||||
ComboDataHolder(String _id, ILanguageDescriptor[] _des) {
|
||||
id = _id;
|
||||
des = _des;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateData(ICResourceDescription cfgd2) {
|
||||
/*
|
||||
table.removeAll();
|
||||
String[] ids = lm.getRegisteredContentTypeIds();
|
||||
for (int i=0; i< ids.length; i++) {
|
||||
IContentType ct = ctm.getContentType(ids[i]);
|
||||
ILanguageDescriptor[] des = null;
|
||||
boolean needForFile = true;
|
||||
if (cr instanceof IFile) {
|
||||
needForFile = ct.isAssociatedWith(cr.getName());
|
||||
}
|
||||
if (needForFile) {
|
||||
des = lm.getDescriptorsForContentTypeId(ids[i]);
|
||||
}
|
||||
if (des != null && des.length > 0) {
|
||||
TableItem t = new TableItem(table, SWT.NONE);
|
||||
t.setText(0, ct.getName());
|
||||
t.setData(ct);
|
||||
|
||||
TableEditor editor = new TableEditor(table);
|
||||
CCombo combo = new CCombo(table, SWT.NONE);
|
||||
combo.setData(new ComboDataHolder(ct.getId(), des));
|
||||
int pos = 0;
|
||||
|
||||
ILanguageDescriptor curr = lm.getLanguageForContentTypeId(cr.getProject(), cr.getFullPath().removeFirstSegments(1), ids[i]);
|
||||
for (int j=0; j<des.length; j++) {
|
||||
combo.add(des[j].getName());
|
||||
if (des[j].equals(curr)) pos = j; // selected language
|
||||
}
|
||||
combo.select(pos);
|
||||
combo.addSelectionListener(new SelectionListener() {
|
||||
public void widgetDefaultSelected(SelectionEvent e) {}
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
int n = ((CCombo)e.widget).getSelectionIndex();
|
||||
ComboDataHolder h = (ComboDataHolder)e.widget.getData();
|
||||
try {
|
||||
lm.setLanguageForContentTypeId(cr.getProject(), cr.getFullPath().removeFirstSegments(1), h.id, h.des[n]);
|
||||
} catch (CoreException e2) {}
|
||||
}});
|
||||
editor.grabHorizontal = true;
|
||||
editor.setEditor(combo, t, 1);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
public void setVisible(boolean _visible) {
|
||||
super.setVisible(_visible);
|
||||
page.enableConfigSelection(!_visible);
|
||||
}
|
||||
|
||||
public void performApply(ICResourceDescription src, ICResourceDescription dst) {
|
||||
// ICProjectDescription p1 = src.getConfiguration().getProjectDescription();
|
||||
// ICProjectDescription p2 = dst.getConfiguration().getProjectDescription();
|
||||
|
||||
}
|
||||
|
||||
protected void performDefaults() {
|
||||
/*
|
||||
String[] ids = lm.getRegisteredContentTypeIds();
|
||||
for (int i=0; i< ids.length; i++) {
|
||||
IContentType ct = ctm.getContentType(ids[i]);
|
||||
ILanguageDescriptor curr = lm.getDefaultLanguageDescriptor(ct);
|
||||
try {
|
||||
lm.setLanguageForContentTypeId(cr.getProject(), cr.getFullPath().removeFirstSegments(1), ids[i], curr);
|
||||
} catch (CoreException e) {}
|
||||
}
|
||||
updateData(getResDesc());
|
||||
*/
|
||||
}
|
||||
}
|
|
@ -76,4 +76,5 @@ public class PropertyPageDefsTab extends AbstractCPropertyTab {
|
|||
|
||||
protected void performApply(ICResourceDescription src, ICResourceDescription dst) { performOK(); }
|
||||
protected void updateData(ICResourceDescription cfg) {} // Do nothing. Data is read once after creation
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update
|
||||
}
|
||||
|
|
|
@ -189,5 +189,6 @@ public class RefsTab extends AbstractCPropertyTab {
|
|||
getResDesc().getConfiguration().setReferenceInfo(new HashMap());
|
||||
initData();
|
||||
}
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
||||
|
|
|
@ -781,4 +781,6 @@ public class StructureTreeTab extends AbstractCPropertyTab {
|
|||
public boolean canBeVisible() {
|
||||
return CDTPrefUtil.getBool(CDTPrefUtil.KEY_DTREE);
|
||||
}
|
||||
|
||||
protected void updateButtons() {} // Do nothing. No buttons to update.
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue