use of org.eclipse.sapphire.modeling.Status in project liferay-ide by liferay.
the class GradleModuleProjectTests method create.
private IProject create(NewLiferayModuleProjectOp op) throws Exception {
Status status = op.execute(ProgressMonitorBridge.create(_monitor));
assertNotNull(status);
assertTrue(status.message(), status.ok());
Util.waitForBuildAndValidation();
return CoreUtil.getProject(op.getProjectName().content());
}
use of org.eclipse.sapphire.modeling.Status in project liferay-ide by liferay.
the class BundleNameValidationService method compute.
@Override
protected Status compute() {
Status retval = Status.createOkStatus();
Value<String> bundleName = _op().getBundleName();
String serverName = bundleName.content();
if (CoreUtil.empty(serverName)) {
retval = Status.createErrorStatus("The Server Name is empty. Please input one.");
return retval;
}
if (ServerPlugin.isNameInUse(null, serverName)) {
retval = Status.createErrorStatus("The Server Name \"" + serverName + "\"+ is already in use. Specify a different name.");
return retval;
}
return retval;
}
use of org.eclipse.sapphire.modeling.Status in project liferay-ide by liferay.
the class ConvertedProjectLocationValidationService method compute.
@Override
protected Status compute() {
Status retval = Status.createOkStatus();
Value<Path> convertedProjectLocation = _op().getConvertedProjectLocation();
final Path currentProjectLocation = convertedProjectLocation.content(true);
if (currentProjectLocation != null) {
final String currentPath = currentProjectLocation.toPortableString();
if (!org.eclipse.core.runtime.Path.EMPTY.isValidPath(currentPath)) {
retval = Status.createErrorStatus("\"" + currentPath + "\" is not a valid path.");
} else {
IPath osPath = org.eclipse.core.runtime.Path.fromOSString(currentPath);
if (!osPath.toFile().isAbsolute()) {
retval = Status.createErrorStatus("\"" + currentPath + "\" is not an absolute path.");
} else {
if (!osPath.toFile().exists()) {
if (!_canCreate(osPath.toFile())) {
retval = Status.createErrorStatus("Cannot create project content at \"" + currentPath + "\"");
}
}
}
}
} else {
retval = Status.createErrorStatus("Converted Project Location must be specified.");
}
return retval;
}
use of org.eclipse.sapphire.modeling.Status in project liferay-ide by liferay.
the class UpgradeServiceBuilderHandler method execute.
@Override
public Status execute(IProject project, String runtimeName, IProgressMonitor monitor, int perUnit) {
Status retval = Status.createOkStatus();
try {
int worked = 0;
IProgressMonitor submon = CoreUtil.newSubMonitor(monitor, 25);
submon.subTask("Executing build-service for " + project.getName());
worked = worked + perUnit;
submon.worked(worked);
BuildServiceJob job = new BuildServiceJob(project);
job.schedule();
job.join();
IStatus result = job.getResult();
if (!result.isOK()) {
throw new CoreException(result);
}
worked = worked + perUnit;
submon.worked(worked);
} catch (Exception e) {
IStatus error = ServiceCore.createErrorStatus("Unable to run service build task for " + project.getName(), e);
ServiceCore.logError("Unable to run service build task for " + project.getName(), e);
retval = StatusBridge.create(error);
}
return retval;
}
use of org.eclipse.sapphire.modeling.Status in project liferay-ide by liferay.
the class NewNodeNameValidationService method compute.
@Override
public Status compute() {
Status retval = Status.createOkStatus();
WorkflowNode newNode = context(WorkflowNode.class);
WorkflowDefinition workflowDefinition = newNode.adapt(WorkflowDefinition.class);
if (workflowDefinition != null) {
for (WorkflowNode node : workflowDefinition.getDiagramNodes()) {
Value<String> nodeName = node.getName();
String name = nodeName.content();
if ((name != null) && name.equals(newNode.getName().content())) {
retval = Status.createErrorStatus("Name already in use.");
break;
}
}
}
return retval;
}
Aggregations