Package org.eclipse.ui.internal.ide.dialogs

Examples of org.eclipse.ui.internal.ide.dialogs.OpenResourceDialog


     * Asks the user to select a new manage.py file and saves that selection.
     */
    private String askNewManageSubstitution(IPythonPathNature pythonPathNature,
            Map<String, String> variableSubstitution, String message) {
        String manageVarible = null;
        OpenResourceDialog manageSelectionDialog = createManageSelectionDialog(message);
        if (manageSelectionDialog.open() == OpenResourceDialog.OK) {
            Object firstResult = manageSelectionDialog.getFirstResult();
            if (firstResult instanceof IFile) {
                IFile iFile = (IFile) firstResult;
                IPath projectRelativePath = iFile.getProjectRelativePath();
                manageVarible = projectRelativePath.toPortableString();
                variableSubstitution.put(DjangoConstants.DJANGO_MANAGE_VARIABLE, manageVarible);
View Full Code Here


        }
        return manageVarible;
    }

    private OpenResourceDialog createManageSelectionDialog(String message) {
        OpenResourceDialog resourceDialog = new OpenResourceDialog(PyAction.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;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.ide.dialogs.OpenResourceDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.