Compare commits

...

4 Commits

Author SHA1 Message Date
Chao MENG
bc213b440e test 2021-07-30 11:54:15 +08:00
Chao MENG
3f583f9fab test 2021-07-29 20:08:38 +08:00
Chao MENG
53a20cbd15 test 2021-07-29 15:30:17 +08:00
Chao MENG
5d3ca12e20 test 2021-07-29 00:21:02 +08:00
3 changed files with 17 additions and 30 deletions

View File

@@ -12,19 +12,15 @@
// ============================================================================
package org.talend.core;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.util.Properties;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.utils.VersionUtils;
import org.talend.core.service.IStudioLiteP2Service;
/**
* This class can check whether some specific plugins are loaded or not. <br/>
@@ -142,6 +138,13 @@ public class PluginChecker {
public static final String SWTBOT_PLUGIN_ID = "org.eclipse.swtbot.eclipse.core"; //$NON-NLS-1$
public static final String PROD_LITE = "org.talend.rcp.branding.lite.product";
/**
* Currently only used by CI, since CI is installed by p2Installer, it will use the cmd product
*/
public static final String PROD_LITE_CI = "org.talend.rcp.branding.lite.ci.product";
private static Boolean isStudioLite;
/**
@@ -165,12 +168,10 @@ public class PluginChecker {
public static boolean isStudioLite() {
if (isStudioLite == null) {
try {
File studioConfigFile = VersionUtils.getStudioConfigFile();
Properties props = new Properties();
try (BufferedReader reader = Files.newBufferedReader(studioConfigFile.toPath())) {
props.load(reader);
}
isStudioLite = Boolean.valueOf(props.getProperty("talend.studio.lite"));
// IProduct product = Platform.getProduct();
// String prodId = product.getId();
// isStudioLite = StringUtils.equals(prodId, PROD_LITE) || StringUtils.equals(prodId, PROD_LITE_CI);
isStudioLite = IStudioLiteP2Service.get() != null;
} catch (Exception e) {
isStudioLite = false;
ExceptionHandler.process(e);

View File

@@ -17,7 +17,6 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.talend.commons.CommonsPlugin;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.core.model.general.Project;
@@ -88,13 +87,6 @@ public interface IStudioLiteP2Service extends IService {
int adaptFeaturesForProject(IProgressMonitor monitor, Project proj) throws Exception;
public static IStudioLiteP2Service get() {
boolean forceLoad = Boolean.getBoolean("talend.studio.studiolite.p2.enable");
if (!forceLoad) {
if (CommonsPlugin.isHeadless() || CommonsPlugin.isJUnitTest() || CommonsPlugin.isTUJTest()
|| CommonsPlugin.isScriptCmdlineMode()) {
return null;
}
}
if (GlobalServiceRegister.getDefault().isServiceRegistered(IStudioLiteP2Service.class)) {
return GlobalServiceRegister.getDefault().getService(IStudioLiteP2Service.class);
}
@@ -154,9 +146,9 @@ public interface IStudioLiteP2Service extends IService {
void setRelease(IProgressMonitor monitor, URI uri) throws Exception;
URI getUpdate(IProgressMonitor monitor) throws Exception;
Collection<URI> getUpdates(IProgressMonitor monitor) throws Exception;
void setUpdate(IProgressMonitor monitor, URI uri) throws Exception;
void setUpdates(IProgressMonitor monitor, Collection<URI> uris) throws Exception;
}

View File

@@ -18,7 +18,6 @@ import java.util.List;
import org.eclipse.jface.preference.IPreferenceStore;
import org.talend.core.CorePlugin;
import org.talend.core.PluginChecker;
import org.talend.core.model.repository.ERepositoryObjectType;
import org.talend.core.model.repository.IRepositoryViewObject;
import org.talend.core.prefs.ITalendCorePrefConstants;
@@ -38,14 +37,9 @@ public class DynamicContentProviderGeneric extends DynamicContentProvider {
@Override
public void createContent(String id, Element parent) {
String dBranding = "default";
String branding = null;
if (PluginChecker.isStudioLite()) {
branding = "LITE";
} else {
branding = System.getProperty("talend.license.branding");
if (branding == null || "".equals(branding)) {
branding = dBranding;
}
String branding = System.getProperty("talend.license.branding");
if (branding == null || "".equals(branding)) {
branding = dBranding;
}
Document dom = parent.getOwnerDocument();