org.eclipse.ui.dialogs.FilteredItemsSelectionDialog Java Examples

The following examples show how to use org.eclipse.ui.dialogs.FilteredItemsSelectionDialog. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DjangoAction.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
private OpenResourceDialog createManageSelectionDialog(String message) {
    OpenResourceDialog resourceDialog = new OpenResourceDialog(EditorUtils.getShell(), selectedProject,
            IResource.FILE);
    try {
        //Hack warning: changing the multi internal field to false because we don't want a multiple selection
        //(but the OpenResourceDialog didn't make available an API to change that -- even though
        //it'd be possible to create a FilteredItemsSelectionDialog in single selection mode)
        Field field = FilteredItemsSelectionDialog.class.getDeclaredField("multi");
        field.setAccessible(true);
        field.set(resourceDialog, false);
    } catch (Throwable e) {
        //just ignore any error here
    }
    resourceDialog.setInitialPattern("manage.py");
    resourceDialog.setMessage(message);
    return resourceDialog;
}