1 11 package org.eclipse.ltk.internal.ui.refactoring; 12 13 import org.eclipse.swt.widgets.Shell; 14 15 import org.eclipse.core.runtime.IAdaptable; 16 17 import org.eclipse.ltk.core.refactoring.IValidationCheckResultQuery; 18 import org.eclipse.ltk.core.refactoring.IValidationCheckResultQueryFactory; 19 20 public class UIQueryFactory implements IValidationCheckResultQueryFactory { 21 22 private IValidationCheckResultQueryFactory fCoreQueryFactory; 23 24 public UIQueryFactory(IValidationCheckResultQueryFactory coreFactory) { 25 fCoreQueryFactory= coreFactory; 26 } 27 28 public IValidationCheckResultQuery create(IAdaptable context) { 29 if (context != null) { 30 Shell parent= (Shell)context.getAdapter(Shell.class); 31 if (parent != null) { 32 String title= (String )context.getAdapter(String .class); 33 if (title != null) { 34 return new ValidationCheckResultQuery(parent, title); 35 } 36 } 37 } 38 return fCoreQueryFactory.create(context); 39 } 40 } 41 | Popular Tags |