/** * Creates a selection dialog that lists all packages of the given Java search scope. * The caller is responsible for opening the dialog with <code>Window.open</code>, * and subsequently extracting the selected package (of type * <code>IPackageFragment</code>) via <code>SelectionDialog.getResult</code>. * * @param parent the parent shell of the dialog to be created * @param context the runnable context to run the search in * @param scope the scope defining the available packages. * @param multipleSelection true if multiple selection is allowed * @param removeDuplicates true if only one package is shown per package name * @param filter the initial pattern to filter the set of packages. For example "com" shows * all packages starting with "com". The meta character '?' representing any character and * '*' representing any string are supported. Clients can pass an empty string if no filtering * is required. * @return a new selection dialog * * @since 3.2 */ public static SelectionDialog createPackageDialog(Shell parent, IRunnableContext context, IJavaSearchScope scope, boolean multipleSelection, boolean removeDuplicates, String filter) { int flag= removeDuplicates ? PackageSelectionDialog.F_REMOVE_DUPLICATES : 0; PackageSelectionDialog dialog= new PackageSelectionDialog(parent, context, flag, scope); dialog.setFilter(filter); dialog.setIgnoreCase(false); dialog.setMultipleSelection(multipleSelection); return dialog; }
/** * Creates a selection dialog that lists all packages of the given Java search scope. * The caller is responsible for opening the dialog with <code>Window.open</code>, * and subsequently extracting the selected package (of type * <code>IPackageFragment</code>) via <code>SelectionDialog.getResult</code>. * * @param parent the parent shell of the dialog to be created * @param context the runnable context to run the search in * @param scope the scope defining the available packages. * @param multipleSelection true if multiple selection is allowed * @param removeDuplicates true if only one package is shown per package name * @param filter the initial pattern to filter the set of packages. For example "com" shows * all packages starting with "com". The meta character '?' representing any character and * '*' representing any string are supported. Clients can pass an empty string if no filtering * is required. * @return a new selection dialog * * @since 3.2 */ public static SelectionDialog createPackageDialog(Shell parent, IRunnableContext context, IJavaSearchScope scope, boolean multipleSelection, boolean removeDuplicates, String filter) { int flag= removeDuplicates ? PackageSelectionDialog.F_REMOVE_DUPLICATES : 0; PackageSelectionDialog dialog= new PackageSelectionDialog(parent, context, flag, scope); dialog.setFilter(filter); dialog.setIgnoreCase(false); dialog.setMultipleSelection(multipleSelection); return dialog; }
/** * Creates a selection dialog that lists all packages of the given Java search scope. * The caller is responsible for opening the dialog with <code>Window.open</code>, * and subsequently extracting the selected package (of type * <code>IPackageFragment</code>) via <code>SelectionDialog.getResult</code>. * * @param parent the parent shell of the dialog to be created * @param context the runnable context to run the search in * @param scope the scope defining the available packages. * @param multipleSelection true if multiple selection is allowed * @param removeDuplicates true if only one package is shown per package name * @param filter the initial pattern to filter the set of packages. For example "com" shows * all packages starting with "com". The meta character '?' representing any character and * '*' representing any string are supported. Clients can pass an empty string if no filtering * is required. * @return a new selection dialog * * @since 3.2 */ public static SelectionDialog createPackageDialog(Shell parent, IRunnableContext context, IJavaSearchScope scope, boolean multipleSelection, boolean removeDuplicates, String filter) { int flag= removeDuplicates ? PackageSelectionDialog.F_REMOVE_DUPLICATES : 0; PackageSelectionDialog dialog= new PackageSelectionDialog(parent, context, flag, scope); dialog.setFilter(filter); dialog.setIgnoreCase(false); dialog.setMultipleSelection(multipleSelection); return dialog; }
private SelectionDialog createAllPackagesDialog(Shell shell) throws JavaModelException{ IProgressService progressService= PlatformUI.getWorkbench().getProgressService(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int flag= PackageSelectionDialog.F_HIDE_EMPTY_INNER; PackageSelectionDialog dialog= new PackageSelectionDialog(shell, progressService, flag, scope); dialog.setFilter(""); //$NON-NLS-1$ dialog.setIgnoreCase(false); dialog.setMultipleSelection(false); return dialog; }
private SelectionDialog createAllPackagesDialog(Shell shell) { IProgressService progressService= PlatformUI.getWorkbench().getProgressService(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int flag= PackageSelectionDialog.F_HIDE_EMPTY_INNER; PackageSelectionDialog dialog= new PackageSelectionDialog(shell, progressService, flag, scope); dialog.setFilter(""); //$NON-NLS-1$ dialog.setIgnoreCase(false); dialog.setMultipleSelection(false); return dialog; }
private SelectionDialog createAllPackagesDialog(Shell shell) { IProgressService progressService= PlatformUI.getWorkbench().getProgressService(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int flag= PackageSelectionDialog.F_HIDE_EMPTY_INNER; PackageSelectionDialog dialog= new PackageSelectionDialog(shell, progressService, flag, scope); dialog.setFilter(""); //$NON-NLS-1$ dialog.setIgnoreCase(false); dialog.setMultipleSelection(false); return dialog; }
private void doButtonPressed() { IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext(); int flags= PackageSelectionDialog.F_SHOW_PARENTS | PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE | PackageSelectionDialog.F_REMOVE_DUPLICATES; PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, flags , scope); dialog.setTitle(PreferencesMessages.TypeFilterInputDialog_choosepackage_label); dialog.setMessage(PreferencesMessages.TypeFilterInputDialog_choosepackage_description); dialog.setMultipleSelection(false); dialog.setFilter(fNameDialogField.getText()); if (dialog.open() == IDialogConstants.OK_ID) { IPackageFragment res= (IPackageFragment) dialog.getFirstResult(); fNameDialogField.setText(res.getElementName() + "*"); //$NON-NLS-1$ } }
private void doButtonPressed() { IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext(); int flags= PackageSelectionDialog.F_SHOW_PARENTS | PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE | PackageSelectionDialog.F_REMOVE_DUPLICATES; PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, flags , scope); dialog.setTitle(PreferencesMessages.TypeFilterInputDialog_choosepackage_label); dialog.setMessage(PreferencesMessages.TypeFilterInputDialog_choosepackage_description); dialog.setMultipleSelection(false); dialog.setFilter(fNameDialogField.getText()); if (dialog.open() == IDialogConstants.OK_ID) { IPackageFragment res= (IPackageFragment) dialog.getFirstResult(); fNameDialogField.setText(res.getElementName() + "*"); //$NON-NLS-1$ } }
private void doButtonPressed() { IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext(); int flags= PackageSelectionDialog.F_SHOW_PARENTS | PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE | PackageSelectionDialog.F_REMOVE_DUPLICATES; PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, flags , scope); dialog.setTitle(PreferencesMessages.TypeFilterInputDialog_choosepackage_label); dialog.setMessage(PreferencesMessages.TypeFilterInputDialog_choosepackage_description); dialog.setMultipleSelection(false); dialog.setFilter(fNameDialogField.getText()); if (dialog.open() == IDialogConstants.OK_ID) { IPackageFragment res= (IPackageFragment) dialog.getFirstResult(); fNameDialogField.setText(res.getElementName() + "*"); //$NON-NLS-1$ } }
private void doButtonPressed() { IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); BusyIndicatorRunnableContext context= new BusyIndicatorRunnableContext(); int flags= PackageSelectionDialog.F_SHOW_PARENTS | PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE | PackageSelectionDialog.F_REMOVE_DUPLICATES; PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, flags , scope); dialog.setTitle(PreferencesMessages.TypeFilterInputDialog_choosepackage_label); dialog.setMessage(PreferencesMessages.TypeFilterInputDialog_choosepackage_description); dialog.setMultipleSelection(false); dialog.setFilter(fNameDialogField.getText()); if (dialog.open() == IDialogConstants.OK_ID) { IPackageFragment res= (IPackageFragment) dialog.getFirstResult(); fNameDialogField.setText(res.getElementName() + "*"); //$NON-NLS-1$ } }
final void doBrowsePackages() { IRunnableContext context= new BusyIndicatorRunnableContext(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int style= PackageSelectionDialog.F_REMOVE_DUPLICATES | PackageSelectionDialog.F_SHOW_PARENTS | PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE; PackageSelectionDialog dialog= new PackageSelectionDialog(getShell(), context, style, scope); dialog.setFilter(fNameDialogField.getText()); dialog.setIgnoreCase(false); dialog.setTitle(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_title); dialog.setMessage(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_description); dialog.setEmptyListMessage(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_empty); if (dialog.open() == Window.OK) { IPackageFragment res= (IPackageFragment) dialog.getFirstResult(); fNameDialogField.setText(res.getElementName()); } }
final void doBrowsePackages() { IRunnableContext context= new BusyIndicatorRunnableContext(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int style= PackageSelectionDialog.F_REMOVE_DUPLICATES | PackageSelectionDialog.F_SHOW_PARENTS | PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE; PackageSelectionDialog dialog= new PackageSelectionDialog(getShell(), context, style, scope); dialog.setFilter(fNameDialogField.getText()); dialog.setIgnoreCase(false); dialog.setTitle(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_title); dialog.setMessage(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_description); dialog.setEmptyListMessage(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_empty); if (dialog.open() == Window.OK) { IPackageFragment res= (IPackageFragment) dialog.getFirstResult(); fNameDialogField.setText(res.getElementName()); } }
final void doBrowsePackages() { IRunnableContext context= new BusyIndicatorRunnableContext(); IJavaSearchScope scope= SearchEngine.createWorkspaceScope(); int style= PackageSelectionDialog.F_REMOVE_DUPLICATES | PackageSelectionDialog.F_SHOW_PARENTS | PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE; PackageSelectionDialog dialog= new PackageSelectionDialog(getShell(), context, style, scope); dialog.setFilter(fNameDialogField.getText()); dialog.setIgnoreCase(false); dialog.setTitle(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_title); dialog.setMessage(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_description); dialog.setEmptyListMessage(PreferencesMessages.ImportOrganizeInputDialog_ChoosePackageDialog_empty); if (dialog.open() == Window.OK) { IPackageFragment res= (IPackageFragment) dialog.getFirstResult(); fNameDialogField.setText(res.getElementName()); } }