Chandrayya G K
Chandrayya G K

Reputation: 8849

Setting initial Pattern in FilteredResourcesSelectionDialog for files without extension

I want to filter only files without extensions in FilteredResourcesSelectionDialog. I used the code below.

FilteredResourcesSelectionDialog dia = new FilteredResourcesSelectionDialog(
                                       getShell(), true, ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE);
dia.setInitialPattern("?"); //Which Pattern I need to set here?

Upvotes: 1

Views: 145

Answers (1)

greg-449
greg-449

Reputation: 111141

The filter in FilteredResourcesSelectionDialog just runs the name match part of the pattern if there is no extension, so I can't see a way to get this.

It looks like you could create a subclass of FilteredResourcesSelectionDialog and override the createFilter method and provide your own filter to do what you want.

Upvotes: 1

Related Questions