return new IInclusionExclusionQuery() { final boolean[] result= new boolean[1]; final IPath[][] inclusionPattern= new IPath[1][1]; final IPath[][] exclusionPattern= new IPath[1][1]; public boolean doQuery(final CPListElement element, final boolean focusOnExcluded) { Display.getDefault().syncExec(new Runnable() { public void run() { Shell sh= shell != null ? shell : JavaPlugin.getActiveWorkbenchShell(); ExclusionInclusionDialog dialog= new ExclusionInclusionDialog(sh, element, focusOnExcluded); result[0]= dialog.open() == Window.OK; inclusionPattern[0]= dialog.getInclusionPattern(); exclusionPattern[0]= dialog.getExclusionPattern(); } }); return result[0]; }  public IPath[] getInclusionPattern() { return inclusionPattern[0]; }  public IPath[] getExclusionPattern() { return exclusionPattern[0]; } }; }
return new IInclusionExclusionQuery() {  protected IPath[] fInclusionPattern; protected IPath[] fExclusionPattern;  public boolean doQuery(final CPListElement element, final boolean focusOnExcluded) { final boolean[] result= { false }; Display.getDefault().syncExec(new Runnable() { public void run() { Shell sh= shell != null ? shell : JavaPlugin.getActiveWorkbenchShell(); ExclusionInclusionDialog dialog= new ExclusionInclusionDialog(sh, element, focusOnExcluded); result[0]= dialog.open() == Window.OK; fInclusionPattern= dialog.getInclusionPattern(); fExclusionPattern= dialog.getExclusionPattern(); } }); return result[0]; }  public IPath[] getInclusionPattern() { return fInclusionPattern; }  public IPath[] getExclusionPattern() { return fExclusionPattern; } }; }
    public static IInclusionExclusionQuery getDefaultInclusionExclusionQuery(final Shell shell) {        return new IInclusionExclusionQuery() {            final boolean[] result= new boolean[1];            final IPath[][] inclusionPattern= new IPath[1][1];            final IPath[][] exclusionPattern= new IPath[1][1];            public boolean doQuery(final CPListElement element, final boolean focusOnExcluded) {                Display.getDefault().syncExec(new Runnable() {                    public void run() {                        Shell sh= shell != null ? shell : JavaPlugin.getActiveWorkbenchShell();                        ExclusionInclusionDialog dialog= new ExclusionInclusionDialog(sh, element, focusOnExcluded);                        result[0]= dialog.open() == Window.OK;                        inclusionPattern[0]= dialog.getInclusionPattern();                        exclusionPattern[0]= dialog.getExclusionPattern();                    }                });                return result[0];            }                        public IPath[] getInclusionPattern() {                return inclusionPattern[0];            }                        public IPath[] getExclusionPattern() {                return exclusionPattern[0];            }        };    }