mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
Cosmetics.
This commit is contained in:
parent
cd19464169
commit
c961b374f4
1 changed files with 12 additions and 18 deletions
|
@ -27,7 +27,6 @@ import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterIns
|
|||
import org.eclipse.cdt.internal.ui.refactoring.utils.NameHelper;
|
||||
|
||||
public class GetterAndSetterContext implements ITreeContentProvider{
|
||||
|
||||
public ArrayList<IASTSimpleDeclaration> existingFields = new ArrayList<IASTSimpleDeclaration>();
|
||||
public ArrayList<IASTFunctionDefinition> existingFunctionDefinitions = new ArrayList<IASTFunctionDefinition>();
|
||||
public ArrayList<IASTSimpleDeclaration> existingFunctionDeclarations = new ArrayList<IASTSimpleDeclaration>();
|
||||
|
@ -37,7 +36,6 @@ public class GetterAndSetterContext implements ITreeContentProvider{
|
|||
private boolean implementationInHeader = false;
|
||||
|
||||
public Object[] getChildren(Object parentElement) {
|
||||
|
||||
ArrayList<GetterSetterInsertEditProvider> children = new ArrayList<GetterSetterInsertEditProvider>();
|
||||
if (parentElement instanceof FieldWrapper) {
|
||||
FieldWrapper wrapper = (FieldWrapper) parentElement;
|
||||
|
@ -72,14 +70,12 @@ public class GetterAndSetterContext implements ITreeContentProvider{
|
|||
public boolean hasChildren(Object element) {
|
||||
if (element instanceof FieldWrapper) {
|
||||
FieldWrapper wrapper = (FieldWrapper) element;
|
||||
|
||||
return wrapper.missingGetterOrSetter();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object[] getElements(Object inputElement) {
|
||||
|
||||
return getWrappedFields().toArray();
|
||||
}
|
||||
|
||||
|
@ -119,7 +115,6 @@ public class GetterAndSetterContext implements ITreeContentProvider{
|
|||
String getterName = "get" + NameHelper.makeFirstCharUpper(trimmedName); //$NON-NLS-1$
|
||||
|
||||
setFunctionToWrapper(wrapper, getterName);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
|
@ -137,9 +132,9 @@ public class GetterAndSetterContext implements ITreeContentProvider{
|
|||
String setterName = "set" + NameHelper.makeFirstCharUpper(trimmedName); //$NON-NLS-1$
|
||||
|
||||
setFunctionToWrapper(wrapper, setterName);
|
||||
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
private void setFunctionToWrapper(FunctionWrapper wrapper, String getterName) {
|
||||
for (IASTFunctionDefinition currentDefinition : existingFunctionDefinitions){
|
||||
if (currentDefinition.getDeclarator().getName().toString().endsWith(getterName)){
|
||||
|
@ -184,7 +179,6 @@ public class GetterAndSetterContext implements ITreeContentProvider{
|
|||
protected IASTFunctionDefinition functionDefinition;
|
||||
|
||||
public boolean exists() {
|
||||
|
||||
return functionDeclaration != null || functionDefinition != null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue