1 11 package org.eclipse.jface.window; 12 13 import org.eclipse.swt.widgets.Control; 14 import org.eclipse.swt.widgets.Shell; 15 16 23 public class SameShellProvider implements IShellProvider { 24 25 private Control targetControl; 26 27 34 public SameShellProvider(Control targetControl) { 35 this.targetControl = targetControl; 36 } 37 38 41 public Shell getShell() { 42 if (targetControl instanceof Shell) { 43 return (Shell)targetControl; 44 } 45 46 return targetControl == null? null :targetControl.getShell(); 47 } 48 49 } 50 | Popular Tags |