Search in sources :

Example 1 with ProjectLocationSelectionDialog

use of org.eclipse.ui.dialogs.ProjectLocationSelectionDialog in project eclipse.platform.ui by eclipse-platform.

the class UIDialogs method testCopyMoveProject.

@Test
public void testCopyMoveProject() {
    IProject dummyProject = ResourcesPlugin.getWorkspace().getRoot().getProject("DummyProject");
    Dialog dialog = new ProjectLocationSelectionDialog(getShell(), dummyProject);
    DialogCheck.assertDialog(dialog);
}
Also used : ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog) SelectPerspectiveDialog(org.eclipse.ui.internal.dialogs.SelectPerspectiveDialog) ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog) TypeFilteringDialog(org.eclipse.ui.dialogs.TypeFilteringDialog) ContainerSelectionDialog(org.eclipse.ui.dialogs.ContainerSelectionDialog) FileExtensionDialog(org.eclipse.ui.internal.dialogs.FileExtensionDialog) EditorSelectionDialog(org.eclipse.ui.dialogs.EditorSelectionDialog) AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) SaveAsDialog(org.eclipse.ui.dialogs.SaveAsDialog) SavePerspectiveDialog(org.eclipse.ui.internal.dialogs.SavePerspectiveDialog) Dialog(org.eclipse.jface.dialogs.Dialog) ListSelectionDialog(org.eclipse.ui.dialogs.ListSelectionDialog) ShowViewDialog(org.eclipse.ui.internal.dialogs.ShowViewDialog) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 2 with ProjectLocationSelectionDialog

use of org.eclipse.ui.dialogs.ProjectLocationSelectionDialog in project eclipse.platform.ui by eclipse-platform.

the class CopyProjectAction method queryDestinationParameters.

/**
 * Query for a new project name and destination using the parameters in the
 * existing project.
 *
 * @return Object [] or null if the selection is cancelled
 * @param project
 *            the project we are going to copy.
 */
protected Object[] queryDestinationParameters(IProject project) {
    ProjectLocationSelectionDialog dialog = new ProjectLocationSelectionDialog(shellProvider.getShell(), project);
    dialog.setTitle(IDEWorkbenchMessages.CopyProjectAction_copyTitle);
    dialog.open();
    return dialog.getResult();
}
Also used : ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog)

Example 3 with ProjectLocationSelectionDialog

use of org.eclipse.ui.dialogs.ProjectLocationSelectionDialog in project eclipse.platform.ui by eclipse-platform.

the class CopyProjectOperation method copyProject.

/**
 * Paste a copy of the project on the clipboard to the workspace.
 *
 * @param project
 *            The project that is beign copied.
 */
public void copyProject(IProject project) {
    errorStatus = null;
    // Get the project name and location in a two element list
    ProjectLocationSelectionDialog dialog = new ProjectLocationSelectionDialog(parentShell, project);
    dialog.setTitle(IDEWorkbenchMessages.CopyProjectOperation_copyProject);
    if (dialog.open() != Window.OK) {
        return;
    }
    Object[] destinationPaths = dialog.getResult();
    if (destinationPaths == null) {
        return;
    }
    String newName = (String) destinationPaths[0];
    URI newLocation = URIUtil.toURI((String) destinationPaths[1]);
    boolean completed = performProjectCopy(project, newName, newLocation);
    if (!completed) {
        // not appropriate to show errors
        return;
    }
    // If errors occurred, open an Error dialog
    if (errorStatus != null) {
        ErrorDialog.openError(parentShell, IDEWorkbenchMessages.CopyProjectOperation_copyFailedTitle, null, errorStatus);
        errorStatus = null;
    }
}
Also used : ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog) URI(java.net.URI)

Example 4 with ProjectLocationSelectionDialog

use of org.eclipse.ui.dialogs.ProjectLocationSelectionDialog in project eclipse.platform.ui by eclipse-platform.

the class UIDialogsAuto method testCopyMoveProject.

@Test
public void testCopyMoveProject() {
    IProject dummyProject = ResourcesPlugin.getWorkspace().getRoot().getProject("DummyProject");
    Dialog dialog = new ProjectLocationSelectionDialog(getShell(), dummyProject);
    DialogCheck.assertDialogTexts(dialog);
}
Also used : ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog) SelectPerspectiveDialog(org.eclipse.ui.internal.dialogs.SelectPerspectiveDialog) ProjectLocationSelectionDialog(org.eclipse.ui.dialogs.ProjectLocationSelectionDialog) TypeFilteringDialog(org.eclipse.ui.dialogs.TypeFilteringDialog) ContainerSelectionDialog(org.eclipse.ui.dialogs.ContainerSelectionDialog) FileExtensionDialog(org.eclipse.ui.internal.dialogs.FileExtensionDialog) EditorSelectionDialog(org.eclipse.ui.dialogs.EditorSelectionDialog) AboutDialog(org.eclipse.ui.internal.dialogs.AboutDialog) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) SaveAsDialog(org.eclipse.ui.dialogs.SaveAsDialog) AboutPluginsDialog(org.eclipse.ui.internal.dialogs.AboutPluginsDialog) SavePerspectiveDialog(org.eclipse.ui.internal.dialogs.SavePerspectiveDialog) Dialog(org.eclipse.jface.dialogs.Dialog) ListSelectionDialog(org.eclipse.ui.dialogs.ListSelectionDialog) ShowViewDialog(org.eclipse.ui.internal.dialogs.ShowViewDialog) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Aggregations

ProjectLocationSelectionDialog (org.eclipse.ui.dialogs.ProjectLocationSelectionDialog)4 IProject (org.eclipse.core.resources.IProject)2 Dialog (org.eclipse.jface.dialogs.Dialog)2 ProgressMonitorDialog (org.eclipse.jface.dialogs.ProgressMonitorDialog)2 ContainerSelectionDialog (org.eclipse.ui.dialogs.ContainerSelectionDialog)2 EditorSelectionDialog (org.eclipse.ui.dialogs.EditorSelectionDialog)2 ListSelectionDialog (org.eclipse.ui.dialogs.ListSelectionDialog)2 SaveAsDialog (org.eclipse.ui.dialogs.SaveAsDialog)2 TypeFilteringDialog (org.eclipse.ui.dialogs.TypeFilteringDialog)2 AboutDialog (org.eclipse.ui.internal.dialogs.AboutDialog)2 FileExtensionDialog (org.eclipse.ui.internal.dialogs.FileExtensionDialog)2 SavePerspectiveDialog (org.eclipse.ui.internal.dialogs.SavePerspectiveDialog)2 SelectPerspectiveDialog (org.eclipse.ui.internal.dialogs.SelectPerspectiveDialog)2 ShowViewDialog (org.eclipse.ui.internal.dialogs.ShowViewDialog)2 Test (org.junit.Test)2 URI (java.net.URI)1 AboutPluginsDialog (org.eclipse.ui.internal.dialogs.AboutPluginsDialog)1