下面列出了怎么用org.eclipse.ui.dialogs.FilteredItemsSelectionDialog的API类实例代码及写法,或者点击链接到github查看源代码。
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;
}