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);
}
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();
}
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;
}
}
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);
}
Aggregations