protected void setUp() throws Exception { super.setUp(); fProject = new SWTTestProject(); IType control = fProject.getProject().findType("org.eclipse.swt.widgets.Control"); ExtractInterfaceProcessor processor = new ExtractInterfaceProcessor( control, JavaPreferencesSettings.getCodeGenerationSettings(fProject.getProject())); fRefactoring = new ProcessorBasedRefactoring(processor); IMethod[] methods = control.getMethods(); List extractedMembers = new ArrayList(); for (int i = 0; i < methods.length; i++) { IMethod method = methods[i]; int flags = method.getFlags(); if (Flags.isPublic(flags) && !Flags.isStatic(flags) && !method.isConstructor()) { extractedMembers.add(method); } } processor.setTypeName("IControl"); processor.setExtractedMembers( (IMember[]) extractedMembers.toArray(new IMember[extractedMembers.size()])); processor.setReplace(true); }
protected void tearDown() throws Exception { fProject.delete(); super.tearDown(); }