use of com.liferay.ide.project.core.model.SDKProjectsImportOp in project liferay-ide by liferay.
the class SDKImportLocationValidationService method compute.
@Override
protected Status compute() {
Status retval = Status.createOkStatus();
SDKProjectsImportOp op = _op();
Path currentProjectLocation = op.getSdkLocation().content(true);
if ((currentProjectLocation != null) && !currentProjectLocation.isEmpty()) {
String currentPath = currentProjectLocation.toOSString();
retval = StatusBridge.create(ProjectImportUtil.validateSDKPath(currentPath));
}
return retval;
}
use of com.liferay.ide.project.core.model.SDKProjectsImportOp in project liferay-ide by liferay.
the class SDKImportVersionDerivedValueService method compute.
@Override
protected String compute() {
String retVal = null;
SDKProjectsImportOp op = _op();
Value<Path> sdkLocation = op.getSdkLocation();
if ((sdkLocation != null) && (sdkLocation.content() != null) && !sdkLocation.content().isEmpty()) {
Path sdkPath = sdkLocation.content();
IStatus status = ProjectImportUtil.validateSDKPath(sdkLocation.content().toPortableString());
if (status.isOK()) {
SDK sdk = SDKUtil.createSDKFromLocation(PathBridge.create(sdkPath));
retVal = sdk.getVersion();
}
}
return retVal;
}
use of com.liferay.ide.project.core.model.SDKProjectsImportOp in project liferay-ide by liferay.
the class ImportSDKProjectsWizard method _createDefaultOp.
private static SDKProjectsImportOp _createDefaultOp(final IPath sdkPath) {
SDKProjectsImportOp importOp = SDKProjectsImportOp.TYPE.instantiate();
importOp.setSdkLocation(PathBridge.create(sdkPath));
return importOp;
}
use of com.liferay.ide.project.core.model.SDKProjectsImportOp in project liferay-ide by liferay.
the class SDKImportVersionDerivedValueService method initDerivedValueService.
@Override
protected void initDerivedValueService() {
super.initDerivedValueService();
_listener = new FilteredListener<PropertyContentEvent>() {
@Override
protected void handleTypedEvent(PropertyContentEvent event) {
refresh();
}
};
SDKProjectsImportOp op = _op();
op.property(SDKProjectsImportOp.PROP_SDK_LOCATION).attach(_listener);
}
use of com.liferay.ide.project.core.model.SDKProjectsImportOp in project liferay-ide by liferay.
the class SDKImportVersionDerivedValueService method dispose.
@Override
public void dispose() {
SDKProjectsImportOp op = _op();
if (op != null) {
op.property(SDKProjectsImportOp.PROP_SDK_LOCATION).detach(_listener);
}
super.dispose();
}
Aggregations