mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Renamed GetterAndSetterContext to GetterSetterContext.
This commit is contained in:
parent
ae1e9fa9b4
commit
0d20c954e0
5 changed files with 12 additions and 10 deletions
|
@ -30,7 +30,7 @@ import org.eclipse.cdt.ui.tests.refactoring.RefactoringTest;
|
||||||
import org.eclipse.cdt.ui.tests.refactoring.TestSourceFile;
|
import org.eclipse.cdt.ui.tests.refactoring.TestSourceFile;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GenerateGettersAndSettersRefactoring;
|
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GenerateGettersAndSettersRefactoring;
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterAndSetterContext;
|
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Thomas Corbat
|
* @author Thomas Corbat
|
||||||
|
@ -86,7 +86,7 @@ public class GenerateGettersAndSettersTest extends RefactoringTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectFields() {
|
private void selectFields() {
|
||||||
GetterAndSetterContext context = refactoring.getContext();
|
GetterSetterContext context = refactoring.getContext();
|
||||||
|
|
||||||
for (IASTSimpleDeclaration currentDecl : context.existingFields) {
|
for (IASTSimpleDeclaration currentDecl : context.existingFields) {
|
||||||
String name = currentDecl.getDeclarators()[0].getName().getRawSignature();
|
String name = currentDecl.getDeclarators()[0].getName().getRawSignature();
|
||||||
|
|
|
@ -27,15 +27,15 @@ import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
|
import org.eclipse.ui.dialogs.ContainerCheckedTreeViewer;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterAndSetterContext.FieldWrapper;
|
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterContext.FieldWrapper;
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterInsertEditProvider.AccessorKind;
|
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterInsertEditProvider.AccessorKind;
|
||||||
|
|
||||||
public class GenerateGettersAndSettersInputPage extends UserInputWizardPage {
|
public class GenerateGettersAndSettersInputPage extends UserInputWizardPage {
|
||||||
private GetterAndSetterContext context;
|
private GetterSetterContext context;
|
||||||
private ContainerCheckedTreeViewer variableSelectionView;
|
private ContainerCheckedTreeViewer variableSelectionView;
|
||||||
private GetterSetterLabelProvider labelProvider;
|
private GetterSetterLabelProvider labelProvider;
|
||||||
|
|
||||||
public GenerateGettersAndSettersInputPage(GetterAndSetterContext context) {
|
public GenerateGettersAndSettersInputPage(GetterSetterContext context) {
|
||||||
super(Messages.GettersAndSetters_Name);
|
super(Messages.GettersAndSetters_Name);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,13 +89,13 @@ public class GenerateGettersAndSettersRefactoring extends CRefactoring2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String MEMBER_DECLARATION = "MEMBER_DECLARATION"; //$NON-NLS-1$
|
private static final String MEMBER_DECLARATION = "MEMBER_DECLARATION"; //$NON-NLS-1$
|
||||||
private final GetterAndSetterContext context;
|
private final GetterSetterContext context;
|
||||||
private InsertLocation definitionInsertLocation;
|
private InsertLocation definitionInsertLocation;
|
||||||
|
|
||||||
public GenerateGettersAndSettersRefactoring(ICElement element, ISelection selection,
|
public GenerateGettersAndSettersRefactoring(ICElement element, ISelection selection,
|
||||||
ICProject project, RefactoringASTCache astCache) {
|
ICProject project, RefactoringASTCache astCache) {
|
||||||
super(element, selection, project, astCache);
|
super(element, selection, project, astCache);
|
||||||
context = new GetterAndSetterContext();
|
context = new GetterSetterContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -261,7 +261,7 @@ public class GenerateGettersAndSettersRefactoring extends CRefactoring2 {
|
||||||
rewrite = rewrite.insertBefore(parent, nodeToInsertBefore, cont, null);
|
rewrite = rewrite.insertBefore(parent, nodeToInsertBefore, cont, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GetterAndSetterContext getContext() {
|
public GetterSetterContext getContext() {
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterInsertEditProvider.AccessorKind;
|
import org.eclipse.cdt.internal.ui.refactoring.gettersandsetters.GetterSetterInsertEditProvider.AccessorKind;
|
||||||
|
|
||||||
public class GetterAndSetterContext implements ITreeContentProvider {
|
public class GetterSetterContext implements ITreeContentProvider {
|
||||||
public ArrayList<IASTSimpleDeclaration> existingFields = new ArrayList<IASTSimpleDeclaration>();
|
public ArrayList<IASTSimpleDeclaration> existingFields = new ArrayList<IASTSimpleDeclaration>();
|
||||||
public ArrayList<IASTFunctionDefinition> existingFunctionDefinitions = new ArrayList<IASTFunctionDefinition>();
|
public ArrayList<IASTFunctionDefinition> existingFunctionDefinitions = new ArrayList<IASTFunctionDefinition>();
|
||||||
public ArrayList<IASTSimpleDeclaration> existingFunctionDeclarations = new ArrayList<IASTSimpleDeclaration>();
|
public ArrayList<IASTSimpleDeclaration> existingFunctionDeclarations = new ArrayList<IASTSimpleDeclaration>();
|
|
@ -116,9 +116,10 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
protected static final int METHOD_STUBS_ID = 16;
|
protected static final int METHOD_STUBS_ID = 16;
|
||||||
protected static final int HEADER_FILE_ID = 32;
|
protected static final int HEADER_FILE_ID = 32;
|
||||||
protected static final int SOURCE_FILE_ID = 64;
|
protected static final int SOURCE_FILE_ID = 64;
|
||||||
|
// protected static final int TEST_FILE_ID = 128; XXX
|
||||||
protected static final int ALL_FIELDS = SOURCE_FOLDER_ID | NAMESPACE_ID
|
protected static final int ALL_FIELDS = SOURCE_FOLDER_ID | NAMESPACE_ID
|
||||||
| CLASS_NAME_ID | BASE_CLASSES_ID | METHOD_STUBS_ID
|
| CLASS_NAME_ID | BASE_CLASSES_ID | METHOD_STUBS_ID
|
||||||
| HEADER_FILE_ID | SOURCE_FILE_ID;
|
| HEADER_FILE_ID | SOURCE_FILE_ID/* | TEST_FILE_ID*/;
|
||||||
protected int fLastFocusedField = 0;
|
protected int fLastFocusedField = 0;
|
||||||
|
|
||||||
protected StringButtonDialogField fSourceFolderDialogField;
|
protected StringButtonDialogField fSourceFolderDialogField;
|
||||||
|
@ -130,6 +131,7 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
|
||||||
protected SelectionButtonDialogField fUseDefaultSelection;
|
protected SelectionButtonDialogField fUseDefaultSelection;
|
||||||
protected StringButtonDialogField fHeaderFileDialogField;
|
protected StringButtonDialogField fHeaderFileDialogField;
|
||||||
protected StringButtonDialogField fSourceFileDialogField;
|
protected StringButtonDialogField fSourceFileDialogField;
|
||||||
|
// protected StringButtonDialogField fTestFileDialogField; XXX
|
||||||
|
|
||||||
protected IStatus fSourceFolderStatus;
|
protected IStatus fSourceFolderStatus;
|
||||||
protected IStatus fNamespaceStatus;
|
protected IStatus fNamespaceStatus;
|
||||||
|
|
Loading…
Add table
Reference in a new issue