1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

Bug Fixing

This commit is contained in:
Hoda Amer 2004-06-14 18:15:34 +00:00
parent 7e9807c15f
commit f4d51f7416
3 changed files with 26 additions and 19 deletions

View file

@ -1,3 +1,7 @@
2004-06-14 Hoda Amer
Fix for PR 61043: Accessibility: Code Templates: New Template Pattern field accesskey broken
Fix for PR 63388: [Refactoring] items of an enumeration not working
2004-06-11 Bogdan Gheorghe
Fix for Bug 66016: Moved search related items from work in progress to search page

View file

@ -18,6 +18,7 @@ import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IEnumeration;
import org.eclipse.cdt.core.model.IEnumerator;
import org.eclipse.cdt.core.model.IField;
import org.eclipse.cdt.core.model.IFunction;
import org.eclipse.cdt.core.model.IFunctionDeclaration;
@ -160,13 +161,16 @@ public class RenameElementProcessor extends RenameProcessor implements IReferenc
// add the whole signature
IFunctionDeclaration function = (IFunctionDeclaration)element;
name.append(getElementQualifiedName(element.getParent()));
if(name.length() > 0)
name.append("::");
name.append("::");
name.append(function.getSignature());
} else {
name.append(getElementQualifiedName(element.getParent()));
if(name.length() > 0)
name.append("::");
if (element instanceof IEnumerator) {
IEnumeration enum = (IEnumeration) element.getParent();
name.append(getElementQualifiedName(enum.getParent()));
}else {
name.append(getElementQualifiedName(element.getParent()));
}
name.append("::");
name.append(element.getElementName());
}
return name.toString();
@ -478,6 +482,15 @@ public class RenameElementProcessor extends RenameProcessor implements IReferenc
ICSearchConstants.ENUM, ICSearchConstants.DECLARATIONS, false ));
}
}
else if(fCElement instanceof IEnumerator){
if(updateReferences){
orPattern.addPattern(SearchEngine.createSearchPattern( searchPrefix,
ICSearchConstants.ENUMTOR, ICSearchConstants.ALL_OCCURRENCES, false ));
}else {
orPattern.addPattern(SearchEngine.createSearchPattern( searchPrefix,
ICSearchConstants.ENUMTOR, ICSearchConstants.DECLARATIONS, false ));
}
}
else if(fCElement instanceof IField){
if(updateReferences){
orPattern.addPattern(SearchEngine.createSearchPattern( searchPrefix,

View file

@ -278,28 +278,19 @@ public class EditTemplateDialog extends StatusDialog {
createLabel(parent, TemplateMessages.getString("EditTemplateDialog.description")); //$NON-NLS-1$
fDescriptionText= createText(parent);
composite= new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
layout= new GridLayout();
layout.marginWidth= 0;
layout.marginHeight= 0;
composite.setLayout(layout);
createLabel(composite, TemplateMessages.getString("EditTemplateDialog.pattern")); //$NON-NLS-1$
createLabel(parent, TemplateMessages.getString("EditTemplateDialog.pattern")); //$NON-NLS-1$
fPatternEditor= createEditor(parent);
Label filler= new Label(composite, SWT.NONE);
filler.setLayoutData(new GridData(GridData.FILL_VERTICAL));
fInsertVariableButton= new Button(parent, SWT.NONE);
GridData data = getButtonGridData(fInsertVariableButton);
fInsertVariableButton= new Button(composite, SWT.NONE);
fInsertVariableButton.setLayoutData(getButtonGridData(fInsertVariableButton));
fInsertVariableButton.setLayoutData(data);
fInsertVariableButton.setText(TemplateMessages.getString("EditTemplateDialog.insert.variable")); //$NON-NLS-1$
fInsertVariableButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
fPatternEditor.getTextWidget().setFocus();
fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
}
public void widgetDefaultSelected(SelectionEvent e) {}
});
@ -315,7 +306,6 @@ public class EditTemplateDialog extends StatusDialog {
private static GridData getButtonGridData(Button button) {
GridData data= new GridData(GridData.FILL_HORIZONTAL);
data.heightHint= SWTUtil.getButtonHeigthHint(button);
return data;
}