use of com.liferay.ide.core.ILiferayProjectProvider in project liferay-ide by liferay.
the class LiferayVersionPossibleValuesService method compute.
@Override
protected void compute(Set<String> values) {
if (_versions != null) {
values.addAll(_versions);
} else if (_versionsJob == null) {
_versionsJob = new Job("Determining possible Liferay versions.") {
@Override
protected IStatus run(IProgressMonitor monitor) {
NewLiferayPluginProjectOp op = _op();
if (!op.disposed()) {
ILiferayProjectProvider projectProvider = op.getProjectProvider().content();
try {
_versions = projectProvider.getData("liferayVersions", String.class, _groupId, _artifactId);
} catch (Exception e) {
ProjectCore.logError("Could not determine possible versions.", e);
}
refresh();
}
return Status.OK_STATUS;
}
};
_versionsJob.schedule();
}
}
use of com.liferay.ide.core.ILiferayProjectProvider in project liferay-ide by liferay.
the class JSFModuleProjectProviderDefaultValueService method compute.
@Override
protected String compute() {
String defaultProjectBuildType = "maven-jsf";
IScopeContext[] prefContexts = { DefaultScope.INSTANCE, InstanceScope.INSTANCE };
String buildType = Platform.getPreferencesService().getString(ProjectCore.PLUGIN_ID, ProjectCore.PREF_DEFAULT_JSF_MODULE_PROJECT_BUILD_TYPE_OPTION, null, prefContexts);
if (buildType == null) {
return "maven-jsf";
}
ILiferayProjectProvider provider = LiferayCore.getProvider(buildType);
if (provider != null) {
return provider.getShortName();
}
return defaultProjectBuildType;
}
use of com.liferay.ide.core.ILiferayProjectProvider in project liferay-ide by liferay.
the class ProjectProviderDefaultValueService method compute.
@Override
protected String compute() {
String retval = "ant";
IScopeContext[] prefContexts = { DefaultScope.INSTANCE, InstanceScope.INSTANCE };
String defaultProjectBuildType = Platform.getPreferencesService().getString(ProjectCore.PLUGIN_ID, ProjectCore.PREF_DEFAULT_PLUGIN_PROJECT_BUILD_TYPE_OPTION, null, prefContexts);
if (defaultProjectBuildType == null) {
return retval;
}
ILiferayProjectProvider provider = LiferayCore.getProvider(defaultProjectBuildType);
if (provider != null) {
retval = defaultProjectBuildType;
}
return retval;
}
use of com.liferay.ide.core.ILiferayProjectProvider in project liferay-ide by liferay.
the class ProjectProviderPossibleValuesService method initPossibleValuesService.
@Override
protected void initPossibleValuesService() {
super.initPossibleValuesService();
_possibleValues = new ArrayList<>();
for (ILiferayProjectProvider provider : LiferayCore.getProviders("plugin")) {
_possibleValues.add(provider.getShortName());
}
Collections.sort(_possibleValues);
}
use of com.liferay.ide.core.ILiferayProjectProvider in project liferay-ide by liferay.
the class PortletFrameworkValidationService method compute.
@Override
protected Status compute() {
Status retval = Status.createOkStatus();
NewLiferayPluginProjectOp op = _op();
ILiferayProjectProvider projectProvider = op.getProjectProvider().content();
IPortletFramework portletFramework = op.getPortletFramework().content();
if (!portletFramework.supports(projectProvider)) {
return Status.createErrorStatus("Selected portlet framework is not supported with " + projectProvider.getDisplayName());
}
try {
if ("ant".equals(projectProvider.getShortName())) {
SDK sdk = SDKUtil.getWorkspaceSDK();
if (sdk != null) {
Version requiredVersion = new Version(portletFramework.getRequiredSDKVersion());
Version sdkVersion = new Version(sdk.getVersion());
if (CoreUtil.compareVersions(requiredVersion, sdkVersion) > 0) {
retval = Status.createErrorStatus("Selected portlet framework requires SDK version at least " + requiredVersion);
}
}
}
} catch (CoreException ce) {
}
return retval;
}
Aggregations