Search in sources :

Example 1 with SDKProjectsImportOp

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;
}
Also used : Status(org.eclipse.sapphire.modeling.Status) Path(org.eclipse.sapphire.modeling.Path) SDKProjectsImportOp(com.liferay.ide.project.core.model.SDKProjectsImportOp)

Example 2 with SDKProjectsImportOp

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;
}
Also used : Path(org.eclipse.sapphire.modeling.Path) IStatus(org.eclipse.core.runtime.IStatus) SDKProjectsImportOp(com.liferay.ide.project.core.model.SDKProjectsImportOp) SDK(com.liferay.ide.sdk.core.SDK)

Example 3 with SDKProjectsImportOp

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;
}
Also used : SDKProjectsImportOp(com.liferay.ide.project.core.model.SDKProjectsImportOp)

Example 4 with SDKProjectsImportOp

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);
}
Also used : PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) SDKProjectsImportOp(com.liferay.ide.project.core.model.SDKProjectsImportOp)

Example 5 with SDKProjectsImportOp

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();
}
Also used : SDKProjectsImportOp(com.liferay.ide.project.core.model.SDKProjectsImportOp)

Aggregations

SDKProjectsImportOp (com.liferay.ide.project.core.model.SDKProjectsImportOp)5 Path (org.eclipse.sapphire.modeling.Path)2 SDK (com.liferay.ide.sdk.core.SDK)1 IStatus (org.eclipse.core.runtime.IStatus)1 PropertyContentEvent (org.eclipse.sapphire.PropertyContentEvent)1 Status (org.eclipse.sapphire.modeling.Status)1