use of com.liferay.ide.project.ui.workspace.ImportLiferayWorkspaceWizard in project liferay-ide by liferay.
the class ImportLiferayWorkspaceAction method run.
@Override
public void run(IIntroSite site, Properties params) {
ImportLiferayWorkspaceWizard wizard = new ImportLiferayWorkspaceWizard();
WizardDialog dialog = new WizardDialog(site.getShell(), wizard);
if (dialog.open() == Window.OK) {
IntroPlugin.closeIntro();
}
}
use of com.liferay.ide.project.ui.workspace.ImportLiferayWorkspaceWizard in project liferay-ide by liferay.
the class ImportLiferayWorkspaceFromInstallerAction method run.
@Override
public void run(IIntroSite site, Properties params) {
Location platformLocation = Platform.getInstallLocation();
File location = new File(platformLocation.getURL().getFile());
if (Platform.getOS().equals(Platform.OS_MACOSX)) {
location = location.getParentFile().getParentFile();
}
IPath path = new Path(location.getAbsolutePath());
File workspaceDir = path.append("../liferay-workspace").toFile();
if (!workspaceDir.exists()) {
MessageDialog.openInformation(site.getShell(), "Liferay", "Can't import liferay workspace.\nDirectory \"" + workspaceDir.getAbsolutePath() + "\" doesn't exist.");
return;
}
Job job = new WorkspaceJob("Importing Liferay Workspace...") {
@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
ImportLiferayWorkspaceWizard wizard = new ImportLiferayWorkspaceWizard();
ImportLiferayWorkspaceOp op = wizard.element().nearest(ImportLiferayWorkspaceOp.class);
op.setWorkspaceLocation(workspaceDir.getAbsolutePath());
op.setProvisionLiferayBundle(true);
if (op.validation().ok()) {
op.execute(ProgressMonitorBridge.create(monitor));
return Status.OK_STATUS;
} else {
return StatusBridge.create(op.validation());
}
}
};
job.schedule();
_openLiferayPerspective();
ProjectExplorerLayoutUtil.setNested(true);
IntroPlugin.closeIntro();
}
Aggregations