Compare commits

...

4 Commits

Author SHA1 Message Date
Chao MENG
db6ca5af36 chore: support dark theme 2022-09-17 19:31:11 +08:00
zyuan-talend
1c919979c2 fix(TUP-35745): Research: Bring a dark mode for Talend Studio. (#5582)
* fix(TUP-35745): Research: Bring a dark mode for Talend Studio as
Experimental.

* fix(TUP-35745): Research: Bring a dark mode for Talend Studio.
2022-09-17 19:30:49 +08:00
kjwang
351bf44095 Temp commit (#5271)
TUP-32606 Support SSO on Studio
https://jira.talendforge.org/browse/TUP-32606
2022-09-16 15:06:03 +08:00
jiezhang-tlnd
5bab4f7de2 Add localized files (#5598) (#5600)
Co-authored-by: jenkins-git <jenkins-git@talend.com>

Co-authored-by: Alexiane Yvonet <ayvonet@talend.com>
Co-authored-by: jenkins-git <jenkins-git@talend.com>
2022-09-16 10:23:48 +08:00
63 changed files with 3667 additions and 252 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

View File

@@ -151,7 +151,9 @@ public enum EImage implements IImage {
OPEN_DATA_PREP("/icons/favicon.png"),
CHESS_GRAY("/icons/gray.gif"); //$NON-NLS-1$
CHESS_GRAY("/icons/gray.gif"), //$NON-NLS-1$
MANAGE_CONNECTION("/icons/manage_connection.gif");
private String path;

View File

@@ -0,0 +1,43 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.commons.runtime.service;
import org.osgi.framework.BundleContext;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
import org.talend.commons.exception.ExceptionHandler;
/**
* DOC cmeng class global comment. Detailled comment
*/
public interface ITalendThemeService {
Object getGlobalThemeColor(String cssProp);
String getGlobalThemeProp(String key);
static ITalendThemeService get() {
try {
BundleContext bc = FrameworkUtil.getBundle(ITalendThemeService.class).getBundleContext();
ServiceReference<ITalendThemeService> serviceReference = bc.getServiceReference(ITalendThemeService.class);
if (serviceReference == null) {
return null;
}
return bc.getService(serviceReference);
} catch (Exception e) {
ExceptionHandler.process(e);
}
return null;
}
}

View File

@@ -96,7 +96,9 @@ public class EclipseCommandLine {
static public final String PROP_KEY_PROFILE_ID = "eclipse.p2.profile";
static public final String ARG_BRANCH = "-branch";
static public final String ARG_PROJECT = "-project";
static public final String LOGIN_ONLINE_UPDATE = "--loginOnlineUpdate";
static public final String ARG_TALEND_BUNDLES_CLEANED = "-talend.studio.bundles.cleaned"; //$NON-NLS-1$

View File

@@ -1,125 +1,127 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.repository.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.swt.events.SelectionListener;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.extensions.ExtensionImplementationProvider;
import org.talend.commons.utils.workbench.extensions.ExtensionPointLimiterImpl;
import org.talend.commons.utils.workbench.extensions.IExtensionPointLimiter;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ui.branding.IBrandingService;
/**
* Provides, using extension points, implementation of many factories.
*
* <ul>
* <li>IProcessFactory</li>
* </ul>
*
* $Id: RepositoryFactoryProvider.java 38013 2010-03-05 14:21:59Z mhirt $
*/
public class RepositoryFactoryProvider {
private static List<IRepositoryFactory> list = null;
public static final IExtensionPointLimiter REPOSITORY_PROVIDER = new ExtensionPointLimiterImpl(
"org.talend.core.repository.repository_provider", //$NON-NLS-1$
"RepositoryFactory", 1, -1); //$NON-NLS-1$
public static List<IRepositoryFactory> getAvailableRepositories() {
if (list == null) {
list = new ArrayList<IRepositoryFactory>();
List<IConfigurationElement> extension = ExtensionImplementationProvider.getInstanceV2(REPOSITORY_PROVIDER);
String hiddenRepos = System.getProperty("hidden.repositories"); //$NON-NLS-1$
String hiddenRepository[] = new String[]{};
if (hiddenRepos != null) {
hiddenRepository = hiddenRepos.split(";"); //$NON-NLS-1$
}
boolean isPoweredByTalend = false;
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault()
.getService(IBrandingService.class);
isPoweredByTalend = brandingService.isPoweredbyTalend();
for (IConfigurationElement current : extension) {
try {
String only4TalendStr = current.getAttribute("only4Talend"); //$NON-NLS-1$
if (Boolean.valueOf(only4TalendStr) && !isPoweredByTalend) {
continue;
}
String only4OemStr = current.getAttribute("only4Oem"); //$NON-NLS-1$
if (Boolean.valueOf(only4OemStr) && isPoweredByTalend) {
continue;
}
IRepositoryFactory currentAction = (IRepositoryFactory) current.createExecutableExtension("class"); //$NON-NLS-1$
currentAction.setId(current.getAttribute("id")); //$NON-NLS-1$
currentAction.setName(current.getAttribute("name")); //$NON-NLS-1$
currentAction.setAuthenticationNeeded(new Boolean(current.getAttribute("authenticationNeeded"))); //$NON-NLS-1$
currentAction.setDisplayToUser(new Boolean(current.getAttribute("displayToUser")).booleanValue()); //$NON-NLS-1$
// Getting dynamic login fields:
for (IConfigurationElement currentLoginField : current.getChildren("loginField")) { //$NON-NLS-1$
DynamicFieldBean key = new DynamicFieldBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
currentLoginField.getAttribute("defaultValue"), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("required")), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("password")), //$NON-NLS-1$
Boolean.valueOf(currentLoginField.getAttribute("readonly"))); //$NON-NLS-1$
currentAction.getFields().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("button")) { //$NON-NLS-1$
DynamicButtonBean key = new DynamicButtonBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
(SelectionListener) currentLoginField.createExecutableExtension("selectionListener")); //$NON-NLS-1$
currentAction.getButtons().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("choiceField")) { //$NON-NLS-1$
DynamicChoiceBean key = new DynamicChoiceBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name")); //$NON-NLS-1$
for (IConfigurationElement currentChoice : currentLoginField.getChildren("choice")) { //$NON-NLS-1$
String value = currentChoice.getAttribute("value"); //$NON-NLS-1$
String label = currentChoice.getAttribute("label"); //$NON-NLS-1$
key.addChoice(value, label);
}
currentAction.getChoices().add(key);
}
if (ArrayUtils.contains(hiddenRepository, currentAction.getId())) {
continue;
}
list.add(currentAction);
} catch (CoreException e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
}
return list;
}
public static IRepositoryFactory getRepositoriyById(String id) {
for (IRepositoryFactory current : getAvailableRepositories()) {
if (current.getId().equals(id)) {
return current;
}
}
return null;
}
}
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.repository.model;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.ArrayUtils;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.swt.events.SelectionListener;
import org.talend.commons.CommonsPlugin;
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
import org.talend.commons.utils.workbench.extensions.ExtensionImplementationProvider;
import org.talend.commons.utils.workbench.extensions.ExtensionPointLimiterImpl;
import org.talend.commons.utils.workbench.extensions.IExtensionPointLimiter;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.ui.branding.IBrandingService;
/**
* Provides, using extension points, implementation of many factories.
*
* <ul>
* <li>IProcessFactory</li>
* </ul>
*
* $Id: RepositoryFactoryProvider.java 38013 2010-03-05 14:21:59Z mhirt $
*/
public class RepositoryFactoryProvider {
private static List<IRepositoryFactory> list = null;
public static final IExtensionPointLimiter REPOSITORY_PROVIDER = new ExtensionPointLimiterImpl(
"org.talend.core.repository.repository_provider", //$NON-NLS-1$
"RepositoryFactory", 1, -1); //$NON-NLS-1$
public static synchronized List<IRepositoryFactory> getAvailableRepositories() {
if (list == null) {
list = new ArrayList<IRepositoryFactory>();
List<IConfigurationElement> extension = ExtensionImplementationProvider.getInstanceV2(REPOSITORY_PROVIDER);
String hiddenRepos = System.getProperty("hidden.repositories"); //$NON-NLS-1$
String hiddenRepository[] = new String[]{};
if (hiddenRepos != null) {
hiddenRepository = hiddenRepos.split(";"); //$NON-NLS-1$
}
boolean isPoweredByTalend = false;
IBrandingService brandingService = (IBrandingService) GlobalServiceRegister.getDefault()
.getService(IBrandingService.class);
isPoweredByTalend = brandingService.isPoweredbyTalend();
for (IConfigurationElement current : extension) {
try {
String only4TalendStr = current.getAttribute("only4Talend"); //$NON-NLS-1$
if (Boolean.valueOf(only4TalendStr) && !isPoweredByTalend) {
continue;
}
String only4OemStr = current.getAttribute("only4Oem"); //$NON-NLS-1$
if (Boolean.valueOf(only4OemStr) && isPoweredByTalend) {
continue;
}
IRepositoryFactory currentAction = (IRepositoryFactory) current.createExecutableExtension("class"); //$NON-NLS-1$
currentAction.setId(current.getAttribute("id")); //$NON-NLS-1$
currentAction.setName(current.getAttribute("name")); //$NON-NLS-1$
currentAction.setAuthenticationNeeded(new Boolean(current.getAttribute("authenticationNeeded"))); //$NON-NLS-1$
currentAction.setDisplayToUser(new Boolean(current.getAttribute("displayToUser")).booleanValue()); //$NON-NLS-1$
// Getting dynamic login fields:
for (IConfigurationElement currentLoginField : current.getChildren("loginField")) { //$NON-NLS-1$
DynamicFieldBean key = new DynamicFieldBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
currentLoginField.getAttribute("defaultValue"), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("required")), //$NON-NLS-1$
new Boolean(currentLoginField.getAttribute("password")), //$NON-NLS-1$
Boolean.valueOf(currentLoginField.getAttribute("readonly"))); //$NON-NLS-1$
currentAction.getFields().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("button")) { //$NON-NLS-1$
DynamicButtonBean key = new DynamicButtonBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name"), //$NON-NLS-1$
(SelectionListener) currentLoginField.createExecutableExtension("selectionListener")); //$NON-NLS-1$
currentAction.getButtons().add(key);
}
for (IConfigurationElement currentLoginField : current.getChildren("choiceField")) { //$NON-NLS-1$
DynamicChoiceBean key = new DynamicChoiceBean(currentLoginField.getAttribute("id"), //$NON-NLS-1$
currentLoginField.getAttribute("name")); //$NON-NLS-1$
for (IConfigurationElement currentChoice : currentLoginField.getChildren("choice")) { //$NON-NLS-1$
String value = currentChoice.getAttribute("value"); //$NON-NLS-1$
String label = currentChoice.getAttribute("label"); //$NON-NLS-1$
key.addChoice(value, label);
}
currentAction.getChoices().add(key);
}
if (ArrayUtils.contains(hiddenRepository, currentAction.getId())) {
continue;
}
list.add(currentAction);
} catch (CoreException e) {
// e.printStackTrace();
ExceptionHandler.process(e);
}
}
}
return list;
}
public static IRepositoryFactory getRepositoriyById(String id) {
for (IRepositoryFactory current : getAvailableRepositories()) {
if (current.getId().equals(id)) {
return current;
}
}
ExceptionHandler.log("Can't find repository factory for: " + id);
return null;
}
}

View File

@@ -25,6 +25,7 @@ import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.talend.commons.runtime.model.repository.ECDCStatus;
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
import org.talend.commons.runtime.service.ITalendThemeService;
import org.talend.commons.ui.runtime.image.ECoreImage;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.IImage;
@@ -91,6 +92,8 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
private static boolean refreshProperty = true;
private static ITalendThemeService themeServ;
public RepositoryLabelProvider(IRepositoryView view) {
super();
this.view = view;
@@ -100,6 +103,61 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
return view;
}
private static ITalendThemeService getThemeServ() {
if (themeServ == null) {
themeServ = ITalendThemeService.get();
}
return themeServ;
}
private Color getColor(String prop) {
ITalendThemeService theme = getThemeServ();
if (theme != null) {
return (Color) theme.getGlobalThemeColor(prop);
}
return null;
}
private Color getStableSecondaryEntryColor() {
Color color = getColor("REPO_STABLE_SECONDARY_ENTRY_COLOR");
if (color == null) {
color = STABLE_SECONDARY_ENTRY_COLOR;
}
return color;
}
private Color getStablePrimaryEntryColor() {
Color color = getColor("REPO_STABLE_PRIMARY_ENTRY_COLOR");
if (color == null) {
color = STABLE_PRIMARY_ENTRY_COLOR;
}
return color;
}
private Color getInactiveEntryColor() {
Color color = getColor("REPO_INACTIVE_ENTRY_COLOR");
if (color == null) {
color = INACTIVE_ENTRY_COLOR;
}
return color;
}
private Color getLockedEntryColor() {
Color color = getColor("REPO_LOCKED_ENTRY");
if (color == null) {
color = LOCKED_ENTRY;
}
return color;
}
private Color getMergedReferencedItemsColor() {
Color color = getColor("REPO_MERGED_REFERENCED_ITEMS_COLOR");
if (color == null) {
color = MERGED_REFERENCED_ITEMS_COLOR;
}
return color;
}
public String getText(IRepositoryViewObject object) {
StringBuffer string = new StringBuffer();
string.append(object.getLabel());
@@ -482,23 +540,23 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
RepositoryNode node = (RepositoryNode) element;
switch (node.getType()) {
case REFERENCED_PROJECT:
return STABLE_PRIMARY_ENTRY_COLOR;
return getStablePrimaryEntryColor();
case STABLE_SYSTEM_FOLDER:
if (node.getLabel().equals(ERepositoryObjectType.SNIPPETS.toString())) {
return INACTIVE_ENTRY_COLOR;
return getInactiveEntryColor();
}
if (node.getContentType() == ERepositoryObjectType.METADATA) {
return STABLE_PRIMARY_ENTRY_COLOR;
return getStablePrimaryEntryColor();
}
case SYSTEM_FOLDER:
if (node.getContentType() == ERepositoryObjectType.PROCESS) {
return STABLE_PRIMARY_ENTRY_COLOR;
return getStablePrimaryEntryColor();
}
return STABLE_SECONDARY_ENTRY_COLOR;
return getStableSecondaryEntryColor();
default:
ERepositoryStatus repositoryStatus = node.getObject().getRepositoryStatus();
if (repositoryStatus == ERepositoryStatus.LOCK_BY_OTHER) {
return LOCKED_ENTRY;
return getLockedEntryColor();
} else {
if (PluginChecker.isRefProjectLoaded()) {
IReferencedProjectService service = (IReferencedProjectService) GlobalServiceRegister.getDefault()
@@ -510,7 +568,7 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
.getCurrentProject().getEmfProject();
String projectLabel = object.getProjectLabel();
if (!mainProject.getLabel().equals(projectLabel)) {
return MERGED_REFERENCED_ITEMS_COLOR;
return getMergedReferencedItemsColor();
}
}
}

View File

@@ -129,7 +129,8 @@ Require-Bundle: org.eclipse.jdt.core,
jackson-core-asl,
org.talend.libraries.jackson,
org.eclipse.m2e.core,
org.talend.libraries.apache.common
org.talend.libraries.apache.common,
org.talend.signon.util
Bundle-Activator: org.talend.core.runtime.CoreRuntimePlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .,

View File

@@ -15,8 +15,10 @@ package org.talend.core.context;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.general.Project;
import org.talend.core.model.properties.User;
import org.talend.core.service.ICloudSignOnService;
/**
* DOC smallet class global comment. Detailled comment <br/>
@@ -139,6 +141,14 @@ public class RepositoryContext {
* @return the clearPassword
*/
public String getClearPassword() {
try {
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
return ICloudSignOnService.get().getLatestToken().getAccessToken();
}
}catch (Exception ex) {
ExceptionHandler.process(ex);
}
return clearPassword;
}

View File

@@ -17,10 +17,14 @@ import java.util.Iterator;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.pendo.PendoTrackSender;
import org.talend.core.runtime.i18n.Messages;
import org.talend.repository.model.RepositoryConstants;
import org.talend.signon.util.TMCRepositoryUtil;
import org.talend.signon.util.TokenMode;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
@@ -58,12 +62,14 @@ public class ConnectionBean implements Cloneable {
private static final String TOKEN = "token"; //$NON-NLS-1$
private static final String URL = "url"; //$NON-NLS-1$
private static final String STORECREDENTIALS = "storeCredentials"; //$NON-NLS-1$
private String credentials = ""; //$NON-NLS-1$
public static final String CLOUD_TOKEN_ID ="cloud_token"; //$NON-NLS-1$
private static final String LOGIN_VIA_CLOUD = "login_via_cloud"; //$NON-NLS-1$
/**
* DOC smallet ConnectionBean constructor comment.
*/
@@ -89,6 +95,24 @@ public class ConnectionBean implements Cloneable {
newConnection.setPassword(""); //$NON-NLS-1$
return newConnection;
}
public static ConnectionBean getDefaultCloudConnectionBean(String dataCenter) {
ConnectionBean newConnection = new ConnectionBean();
newConnection.setName(Messages.getString("ConnectionBean.Cloud.name", TMCRepositoryUtil.getDisplayNameByDatacenter(dataCenter))); //$NON-NLS-1$
newConnection.setDescription(Messages.getString("ConnectionBean.CloudConnection.description", TMCRepositoryUtil.getDisplayNameByDatacenter(dataCenter))); //$NON-NLS-1$
newConnection.setRepositoryId(TMCRepositoryUtil.getRepositoryId(dataCenter));
newConnection.setToken(true);
newConnection.setStoreCredentials(true);
newConnection.setComplete(true);
newConnection.setLoginViaCloud(true);
newConnection.setWorkSpace(getRecentWorkSpace());
return newConnection;
}
protected static String getRecentWorkSpace() {
String filePath = new Path(Platform.getInstanceLocation().getURL().getPath()).toFile().getPath();
return filePath;
}
/**
* Getter for ID.
@@ -184,11 +208,16 @@ public class ConnectionBean implements Cloneable {
*/
public String getPassword() {
try {
if (conDetails.has(PASSWORD)) {
if (isStoreCredentials() && credentials != null) {
return this.credentials;
}
return conDetails.getString(PASSWORD);
} else if (conDetails.has(CLOUD_TOKEN_ID)){
String object = conDetails.getString(CLOUD_TOKEN_ID);
TokenMode token = TokenMode.parseFromJson(object, null);
return token.getAccessToken();
}
} catch (JSONException e) {
ExceptionHandler.process(e);
@@ -215,10 +244,10 @@ public class ConnectionBean implements Cloneable {
* @return the user
*/
public String getUser() {
try {
try {
if (conDetails.has(USER)) {
String user = conDetails.getString(USER);
if (isToken()) {
if (isToken() && StringUtils.isEmpty(user)) {
String url = getDynamicFields().get(RepositoryConstants.REPOSITORY_URL);
user = PendoTrackSender.getInstance().getTmcUser(url, getPassword());
if (StringUtils.isNotBlank(user)) {
@@ -226,7 +255,7 @@ public class ConnectionBean implements Cloneable {
}
}
return user;
}
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
@@ -320,6 +349,25 @@ public class ConnectionBean implements Cloneable {
ExceptionHandler.process(e);
}
}
public boolean isLoginViaCloud() {
try {
if (conDetails.has(LOGIN_VIA_CLOUD)) {
return (Boolean) conDetails.get(LOGIN_VIA_CLOUD);
}
} catch (JSONException e) {
// do nothing
}
return false;
}
public void setLoginViaCloud(boolean isLoginViaCloud) {
try {
conDetails.put(LOGIN_VIA_CLOUD, isLoginViaCloud);
} catch (JSONException e) {
// do nothing
}
}
@Override
public ConnectionBean clone() throws CloneNotSupportedException {
@@ -418,14 +466,21 @@ public class ConnectionBean implements Cloneable {
public String getUrl() {
try {
if (conDetails.has(URL)) {
return conDetails.getString(URL);
if (dynamicFields.containsKey(RepositoryConstants.REPOSITORY_URL)) {
return dynamicFields.get(RepositoryConstants.REPOSITORY_URL);
}
if (conDetails.has(RepositoryConstants.REPOSITORY_URL)) {
return conDetails.getString(RepositoryConstants.REPOSITORY_URL);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return "";
}
public void setUrl(String url) {
dynamicFields.put(RepositoryConstants.REPOSITORY_URL, url);
}
public boolean isStoreCredentials() {
try {
@@ -453,4 +508,27 @@ public class ConnectionBean implements Cloneable {
public void setCredentials(String credentials) {
this.credentials = credentials;
}
public TokenMode getConnectionToken() {
try {
if (conDetails.has(CLOUD_TOKEN_ID)) {
String object = conDetails.getString(CLOUD_TOKEN_ID);
return TokenMode.parseFromJson(object, null);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return null;
}
public void setConnectionToken(TokenMode connectionToken) {
try {
conDetails.put(CLOUD_TOKEN_ID, TokenMode.writeToJson(connectionToken));
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
}

View File

@@ -25,6 +25,7 @@ import org.talend.core.model.general.Project;
import org.talend.core.model.properties.ProjectReference;
import org.talend.core.pendo.properties.IPendoDataProperties;
import org.talend.core.pendo.properties.PendoLoginProperties;
import org.talend.core.service.ICloudSignOnService;
import org.talend.core.service.IStudioLiteP2Service;
import org.talend.core.ui.IInstalledPatchService;
import org.talend.repository.ProjectManager;
@@ -81,6 +82,10 @@ public class PendoTrackDataUtil {
loginEvent.setEnabledFeatures(enabledFeatures);
}
setUpRefProjectsStructure(loginEvent);
loginEvent.setIsOneClickLogin(Boolean.FALSE.toString());
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
loginEvent.setIsOneClickLogin(Boolean.TRUE.toString());
}
} catch (Exception e) {
ExceptionHandler.process(e);
}

View File

@@ -36,6 +36,9 @@ public class PendoLoginProperties implements IPendoDataProperties {
@JsonProperty("referenced_projects")
private List<String> refProjectList;
@JsonProperty("one_click_login")
private String isOneClickLogin;
/**
* Getter for studio_version.
*
@@ -126,4 +129,22 @@ public class PendoLoginProperties implements IPendoDataProperties {
this.refProjectList = refProjectList;
}
/**
* Getter for isOneClickLogin.
*
* @return the isOneClickLogin
*/
public String getIsOneClickLogin() {
return isOneClickLogin;
}
/**
* Sets the isOneClickLogin.
*
* @param isOneClickLogin the isOneClickLogin to set
*/
public void setIsOneClickLogin(String isOneClickLogin) {
this.isOneClickLogin = isOneClickLogin;
}
}

View File

@@ -552,6 +552,8 @@ BusinessAppearanceComposite.textAlignment.vertical.centre=Centre
ConnectionBean.Local=Local
ConnectionBean.Remote=Remote
ConnectionBean.DefaultConnection=Default connection
ConnectionBean.Cloud.name=Signed in: Cloud ({0})
ConnectionBean.CloudConnection.description=Remote connection to Cloud - Signed in: Cloud ({0})
InegerCellEditorListener.NegativeNumberMessage=The value of {0} can't be set by negative number.
InegerCellEditorListener.NumeralMessage=The value of {0} should be numeral.
OpenXSDFileDialog.cancel=Cancel

View File

@@ -0,0 +1,58 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.service;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.IService;
import org.talend.signon.util.TokenMode;
import org.talend.signon.util.listener.LoginEventListener;
public interface ICloudSignOnService extends IService {
TokenMode getToken(String authCode, String codeVerifier, String dataCenter) throws Exception;
void startHeartBeat() throws Exception;
void stopHeartBeat();
String generateCodeVerifier();
String getCodeChallenge(String seed) throws Exception;
boolean hasValidToken() throws Exception;
String getTokenUser(String url, TokenMode token) throws Exception;
void signonCloud(LoginEventListener listener) throws Exception;
TokenMode getLatestToken() throws Exception;
public boolean refreshToken() throws Exception;
boolean isSignViaCloud();
boolean isNeedShowSSOPage();
public void showReloginDialog();
public boolean isReloginDialogRunning();
public void reload();
public static ICloudSignOnService get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICloudSignOnService.class)) {
return GlobalServiceRegister.getDefault().getService(ICloudSignOnService.class);
}
return null;
}
}

View File

@@ -32,6 +32,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.PlatformUI;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.core.model.general.ConnectionBean;
import org.talend.core.service.ICloudSignOnService;
import org.talend.utils.json.JSONArray;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
@@ -158,6 +159,8 @@ public class ConnectionUserPerReader {
}
if (cons == null || cons.size() == 0) {
proper.remove("connection.users");//$NON-NLS-1$
proper.remove("connection.define");//$NON-NLS-1$
proper.remove("connection.lastConnection");//$NON-NLS-1$
} else {
JSONArray usersJsonArray = new JSONArray();
for (ConnectionBean currentConnection : cons) {
@@ -207,7 +210,6 @@ public class ConnectionUserPerReader {
} catch (Exception e) {
e.printStackTrace();
}
}
public void createPropertyFile() {

View File

@@ -34,6 +34,7 @@ import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
import org.talend.commons.runtime.service.ITalendThemeService;
import org.talend.commons.ui.runtime.image.EImage;
import org.talend.commons.ui.runtime.image.ImageProvider;
import org.talend.core.GlobalServiceRegister;
@@ -73,6 +74,8 @@ public class TalendTabbedPropertyTitle extends Composite implements ITalendTabbe
private TalendTabbedPropertyColorHelper colorHelper;
private static ITalendThemeService theme;
/**
* Constructor for TabbedPropertyTitle.
*
@@ -173,10 +176,10 @@ public class TalendTabbedPropertyTitle extends Composite implements ITalendTabbe
helpComp.setVisible(false);
if (colorHelper.getTitleBackground() == null) {
label.setBackground(new Color[] { factory.getColors().getColor(IFormColors.H_GRADIENT_END),
factory.getColors().getColor(IFormColors.H_GRADIENT_START) }, new int[] { 100 }, true);
titleLabelComp.setBackground(factory.getColors().getColor(IFormColors.H_GRADIENT_START));
helpComp.setBackground(factory.getColors().getColor(IFormColors.H_GRADIENT_START));
label.setBackground(new Color[] { getStartColor(),
getEndColor() }, new int[] { 100 }, true);
titleLabelComp.setBackground(getEndColor());
helpComp.setBackground(getEndColor());
} else {
label.setBackground(colorHelper.getTitleBackground());
titleLabelComp.setBackground(colorHelper.getTitleBackground());
@@ -184,23 +187,54 @@ public class TalendTabbedPropertyTitle extends Composite implements ITalendTabbe
}
}
private static ITalendThemeService getTheme() {
if (theme == null) {
theme = ITalendThemeService.get();
}
return theme;
}
private Color getColor(String prop) {
ITalendThemeService themeServ = getTheme();
if (themeServ == null) {
return null;
}
return (Color) themeServ.getGlobalThemeColor(prop);
}
private Color getStartColor() {
Color color = getColor("TAB_START_COLOR");
if (color == null) {
color = factory.getColors().getColor(IFormColors.H_GRADIENT_END);
}
return color;
}
private Color getEndColor() {
Color color = getColor("TAB_END_COLOR");
if (color == null) {
color = factory.getColors().getColor(IFormColors.H_GRADIENT_START);
}
return color;
}
/**
* @param e
*/
protected void drawTitleBackground(PaintEvent e) {
Rectangle bounds = getClientArea();
if (colorHelper.getTitleBackground() == null) {
label.setBackground(new Color[] { factory.getColors().getColor(IFormColors.H_GRADIENT_END),
factory.getColors().getColor(IFormColors.H_GRADIENT_START) }, new int[] { 100 }, true);
titleLabelComp.setBackground(factory.getColors().getColor(IFormColors.H_GRADIENT_START));
helpComp.setBackground(factory.getColors().getColor(IFormColors.H_GRADIENT_START));
label.setBackground(new Color[] { getStartColor(),
getEndColor() }, new int[] { 100 }, true);
titleLabelComp.setBackground(getEndColor());
helpComp.setBackground(getEndColor());
} else {
label.setBackground(colorHelper.getTitleBackground());
titleLabelComp.setBackground(colorHelper.getTitleBackground());
helpComp.setBackground(colorHelper.getTitleBackground());
}
Color bg = factory.getColors().getColor(IFormColors.H_GRADIENT_END);
Color gbg = factory.getColors().getColor(IFormColors.H_GRADIENT_START);
Color bg = getStartColor();
Color gbg = getEndColor();
GC gc = e.gc;
gc.setForeground(bg);
gc.setBackground(gbg);

View File

@@ -1,86 +1,103 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.prefs;
import java.util.Arrays;
import java.util.ResourceBundle;
import org.talend.commons.i18n.MessagesCore;
/**
* Use to retrieve general application parameters.<br/>
*
* $Id: Messages.java 1 2006-09-29 17:06:40 +0000 (ven., 29 sept. 2006) nrousseau $
*
*/
public class GeneralParametersProvider extends MessagesCore {
private static final String BUNDLE_NAME = "parameters"; //$NON-NLS-1$
private static final String PLUGIN_ID = "org.talend.core"; //$NON-NLS-1$
private static ResourceBundle resourceBundle;
private static ResourceBundle getBundle() {
if (resourceBundle == null) {
try {
resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
} catch (Exception e) {
// Nothing to do (return null)
}
}
return resourceBundle;
}
/**
* Returns the value corresponding to the specified key.
*/
public static String getString(GeneralParameters key) {
return getString(key.getParamName(), PLUGIN_ID, getBundle());
}
/**
* Returns a sorted string array containing values corresponding to the specified key.
*/
public static String[] getStrings(GeneralParameters key) {
String value = getString(key);
String[] toReturn = value.split(","); //$NON-NLS-1$
Arrays.sort(toReturn);
return toReturn;
}
/**
* DOC smallet GeneralParametersProvider class global comment. Detailled comment <br/>
*
* $Id$
*/
public enum GeneralParameters {
AUTHORIZED_LANGUAGE("param.authorizedlanguage"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_WIN32("param.defaultPerlInterpreterPath.win32"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_LINUX("param.defaultPerlInterpreterPath.linux"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_EMBEDDED_SUFFIX_WIN32("param.defaultPerlInterpreterEmbeddedSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_WIN32("param.defaultJavaInterpreterSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_LINUX("param.defaultJavaInterpreterSuffix.linux"), //$NON-NLS-1$
PROJECTS_EXCLUDED_FROM_EXPORT("param.projectsExcludedFromExport"); //$NON-NLS-1$
private String paramName;
GeneralParameters(String paramName) {
this.paramName = paramName;
}
public String getParamName() {
return this.paramName;
}
}
}
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.core.prefs;
import java.util.Arrays;
import java.util.Locale;
import java.util.ResourceBundle;
import org.apache.commons.lang3.StringUtils;
import org.talend.commons.i18n.MessagesCore;
import org.talend.core.CorePlugin;
/**
* Use to retrieve general application parameters.<br/>
*
* $Id: Messages.java 1 2006-09-29 17:06:40 +0000 (ven., 29 sept. 2006) nrousseau $
*
*/
public class GeneralParametersProvider extends MessagesCore {
private static final String BUNDLE_NAME = "parameters"; //$NON-NLS-1$
private static final String PLUGIN_ID = "org.talend.core"; //$NON-NLS-1$
private static ResourceBundle resourceBundle;
private static ResourceBundle getBundle() {
if (resourceBundle == null) {
try {
resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
} catch (Exception e) {
// Nothing to do (return null)
}
}
return resourceBundle;
}
/**
* Returns the value corresponding to the specified key.
*/
public static String getString(GeneralParameters key) {
return getString(key.getParamName(), PLUGIN_ID, getBundle());
}
/**
* Returns a sorted string array containing values corresponding to the specified key.
*/
public static String[] getStrings(GeneralParameters key) {
String value = getString(key);
String[] toReturn = value.split(","); //$NON-NLS-1$
Arrays.sort(toReturn);
return toReturn;
}
public static String getOnLineHelpLanguageSetting() {
String language = CorePlugin.getDefault().getPluginPreferences().getString(ITalendCorePrefConstants.LANGUAGE_SELECTOR);
if (StringUtils.isBlank(language)) {
language = Locale.getDefault().getLanguage();
}
if (Locale.FRENCH.getLanguage().equals(language)) {
return "fr";
}
if (Locale.JAPAN.getLanguage().equals(language)) {
return "ja";
}
return "en"; //$NON-NLS-1$ //$NON-NLS-2$
}
/**
* DOC smallet GeneralParametersProvider class global comment. Detailled comment <br/>
*
* $Id$
*/
public enum GeneralParameters {
AUTHORIZED_LANGUAGE("param.authorizedlanguage"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_WIN32("param.defaultPerlInterpreterPath.win32"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_LINUX("param.defaultPerlInterpreterPath.linux"), //$NON-NLS-1$
DEFAULT_PERL_INTERPRETER_EMBEDDED_SUFFIX_WIN32("param.defaultPerlInterpreterEmbeddedSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_WIN32("param.defaultJavaInterpreterSuffix.win32"), //$NON-NLS-1$
DEFAULT_JAVA_INTERPRETER_SUFFIX_LINUX("param.defaultJavaInterpreterSuffix.linux"), //$NON-NLS-1$
PROJECTS_EXCLUDED_FROM_EXPORT("param.projectsExcludedFromExport"); //$NON-NLS-1$
private String paramName;
GeneralParameters(String paramName) {
this.paramName = paramName;
}
public String getParamName() {
return this.paramName;
}
}
}

View File

@@ -36,7 +36,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.talend.core.runtime,
org.eclipse.e4.ui.workbench,
javax.inject,
org.eclipse.m2e.core
org.eclipse.m2e.core,
org.talend.singlesignon.client
Eclipse-LazyStart: true
Export-Package: org.talend.rcp,
org.talend.rcp.intro,

View File

@@ -112,7 +112,6 @@ public class Application implements IApplication {
Boolean.TRUE.toString(), false);
return IApplication.EXIT_RELAUNCH;
}
try {
String vmArgs = System.getProperty(EclipseCommandLine.PROP_VMARGS);
if (StringUtils.isNotBlank(vmArgs)) {

View File

@@ -26,12 +26,14 @@ import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.exception.LoginException;
import org.talend.commons.exception.PersistenceException;
import org.talend.commons.utils.system.EclipseCommandLine;
import org.talend.core.GlobalServiceRegister;
import org.talend.core.repository.model.ProxyRepositoryFactory;
import org.talend.core.repository.utils.LoginTaskRegistryReader;
import org.talend.core.service.ICloudSignOnService;
import org.talend.core.ui.branding.IBrandingConfiguration;
import org.talend.core.ui.branding.IBrandingService;
import org.talend.core.ui.services.IGitUIProviderService;
@@ -135,20 +137,33 @@ public class ApplicationWorkbenchAdvisor extends IDEWorkbenchAdvisor {
@Override
public void postStartup() {
super.postStartup();
try {
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isSignViaCloud()) {
ICloudSignOnService.get().startHeartBeat();
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
if (!ArrayUtils.contains(Platform.getApplicationArgs(), EclipseCommandLine.TALEND_DISABLE_LOGINDIALOG_COMMAND)) {
RegisterManagement.getInstance().validateRegistration();
}
// PerspectiveReviewUtil.checkPerspectiveDisplayItems();
}
@Override
public boolean preShutdown() {
if (IGitUIProviderService.get() != null && IGitUIProviderService.get().checkPendingChanges()) {
return false;
boolean preShutwond = super.preShutdown();
boolean commitChanges = true;
if (ICloudSignOnService.get() != null && ICloudSignOnService.get().isReloginDialogRunning()) {
commitChanges = false;
}
return super.preShutdown();
if (commitChanges && IGitUIProviderService.get() != null && IGitUIProviderService.get().checkPendingChanges()) {
preShutwond = false;
}
if (preShutwond && ICloudSignOnService.get() != null) {
ICloudSignOnService.get().stopHeartBeat();
}
return preShutwond;
}
}

View File

@@ -983,6 +983,7 @@ DatabaseForm.helpInfo.installDriverLink.label=Installer un pilote
DatabaseForm.redshift.driverVersion=Version du pilote
DatabaseForm.redshift.driverVersion.tip=S\u00E9lectionnez un pilote Redshift
DatabaseForm.redshift.useStringAdditionParam=Utiliser un param\u00E8tre de cha\u00EEne de caract\u00E8res
DatabaseForm.supportnls=Support de NLS
DatabaseTableFilterForm.allSynonyms=Tous les synonymes
DatabaseTableFilterForm.edit=Modifier...
DatabaseTableFilterForm.editFilterName=Modifier le nom du filtre

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry exported="true" kind="lib" path="lib/commons-exec.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.talend.signon.util</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,20 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.talend.signon.util
Bundle-ManifestVersion: 2
Bundle-Name: Cloud sign on util
Bundle-SymbolicName: org.talend.signon.util;singleton:=true
Bundle-Version: 8.0.1.qualifier
Eclipse-LazyStart: true
Bundle-ClassPath: .,
lib/commons-exec.jar
Bundle-Vendor: .Talend SA.
Import-Package: org.osgi.framework;version="1.10.0",
org.talend.utils.json
Export-Package: org.talend.signon.util,
org.talend.signon.util.i18n,
org.talend.signon.util.listener
Require-Bundle: org.talend.utils,
org.apache.log4j,
org.eclipse.osgi,
org.eclipse.equinox.common,
org.eclipse.core.runtime

View File

@@ -0,0 +1 @@
jarprocessor.exclude.children=true

View File

@@ -0,0 +1,8 @@
source.. = src/main/java/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
schema/,\
lib/commons-exec.jar

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
</plugin>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.talend.studio</groupId>
<artifactId>tcommon-studio-se</artifactId>
<version>8.0.1-SNAPSHOT</version>
<relativePath>../../../</relativePath>
</parent>
<artifactId>org.talend.signon.util</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<!-- same as org.talend.libraries.excel -->
<id>copy-maven-repository</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<stripVersion>true</stripVersion>
<outputDirectory>${project.basedir}/lib</outputDirectory>
<artifactItems>
<artifactItem>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.3</version>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1 @@
SSOClientExec.error.timeout=Timeout waiting for login

View File

@@ -0,0 +1,55 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.Platform;
/**
* DOC amaumont class global comment. Detailled comment <br/>
*
*/
public class EnvironmentUtils {
public static boolean isWindowsSystem() {
return getEnvOs().startsWith("Windows"); //$NON-NLS-1$
}
public static boolean isLinuxUnixSystem() {
return !isWindowsSystem() && !isMacOsSytem();
}
/**
* DOC amaumont Comment method "isMacOsSytem".
*
* @return
*/
public static boolean isMacOsSytem() {
return getEnvOs().startsWith("Mac"); //$NON-NLS-1$
}
/**
* DOC amaumont Comment method "getEnv".
*/
public static String getEnvOs() {
return System.getProperty("os.name"); //$NON-NLS-1$
}
public static boolean isX86_64() {
return StringUtils.equals(Platform.ARCH_X86_64, Platform.getOSArch());
}
public static boolean isAarch64() {
return StringUtils.equals(Platform.ARCH_AARCH64, Platform.getOSArch());
}
}

View File

@@ -0,0 +1,120 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import org.eclipse.osgi.service.datalocation.Location;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Filter;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.ServiceReference;
import org.osgi.util.tracker.ServiceTracker;
public class EquinoxUtils {
public static URL[] getConfigAreaURL(BundleContext context) {
Location configLocation = getConfigLocation(context);
if (configLocation == null) {
return null;
}
URL baseURL = configLocation.getURL();
if (configLocation.getParentLocation() != null && configLocation.getURL() != null) {
if (baseURL == null) {
return new URL[] { configLocation.getParentLocation().getURL() };
} else {
return new URL[] { baseURL, configLocation.getParentLocation().getURL() };
}
}
if (baseURL != null) {
return new URL[] { baseURL };
}
return null;
}
public static Location getConfigLocation(BundleContext context) {
Filter filter = null;
try {
filter = context.createFilter(Location.CONFIGURATION_FILTER);
} catch (InvalidSyntaxException e) {
// should not happen
}
ServiceTracker configLocationTracker = new ServiceTracker(context, filter, null);
configLocationTracker.open();
try {
return (Location) configLocationTracker.getService();
} finally {
configLocationTracker.close();
}
}
public static URI getInstallLocationURI(BundleContext context) {
try {
ServiceReference[] references = context.getServiceReferences(Location.class.getName(), Location.INSTALL_FILTER);
if (references != null && references.length > 0) {
ServiceReference reference = references[0];
Location installLocation = (Location) context.getService(reference);
if (installLocation != null) {
try {
if (installLocation.isSet()) {
URL location = installLocation.getURL();
return URIUtil.toURI(location);
}
} catch (URISyntaxException e) {
// TODO: log an error
} finally {
context.ungetService(reference);
}
}
}
} catch (InvalidSyntaxException e) {
// TODO: log an error
}
return null;
}
// always return a valid bundlesContext or throw a runtimeException
public static BundleContext getCurrentBundleContext() {
Bundle bundle = FrameworkUtil.getBundle(EquinoxUtils.class);
if (bundle != null) {
BundleContext bundleContext = bundle.getBundleContext();
if (bundleContext != null) {
return bundleContext;
} else {
throw new RuntimeException(
"could not find current BundleContext, this should never happen, check that the bunlde is activated when this class is accessed");
}
} else {
throw new RuntimeException(
"could not find current Bundle, this should never happen, check that the bunlde is activated when this class is accessed");
}
}
public static File getConfigurationFolder() {
BundleContext configuratorBundleContext = getCurrentBundleContext();
final URL url = getConfigLocation(configuratorBundleContext).getURL();
try {
return URIUtil.toFile(URIUtil.toURI(url));
} catch (URISyntaxException e) {
//
}
return null;
}
}

View File

@@ -0,0 +1,121 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import java.io.File;
import java.io.UnsupportedEncodingException;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.log4j.Logger;
import org.eclipse.equinox.app.IApplication;
import org.talend.signon.util.i18n.Messages;
import org.talend.signon.util.listener.LoginEventListener;
public class SSOClientExec implements Runnable {
private static Logger LOGGER = Logger.getLogger(SSOClientExec.class);
public static final String STUDIO_CALL_PREFIX = "studioCall:";
private static final String STUDIO_SSO_CLIENT_DEBUG_PORT = "talend.studio.sso.client.debug.port";
private File execFile;
private String codeChallenge;
private String clientId;
private int port;
private ExecuteWatchdog executeWatchdog;
private Exception error;
private LoginEventListener listener;
public SSOClientExec(File execFile, String clientId, String codeChallenge, int port, LoginEventListener listener) {
this.execFile = execFile;
this.clientId = clientId;
this.codeChallenge = codeChallenge;
this.port = port;
this.listener = listener;
}
@Override
public void run() {
int exitValue = 0;
try {
CommandLine cmdLine = new CommandLine(execFile);
String url = getInvokeParameter(clientId, port);
cmdLine.addArgument(url);
if (SSOClientUtil.isDebugMode()) {
LOGGER.info("Opening:" + url.substring(STUDIO_CALL_PREFIX.length()));
}
if (getClientDebugPort() != null) {
cmdLine.addArgument("-vmargs");
cmdLine.addArgument("-Xdebug");
String cmd = "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=*:" + getClientDebugPort();
cmdLine.addArgument(cmd);
}
DefaultExecutor executor = new DefaultExecutor();
executeWatchdog = new ExecuteWatchdog(900000);
executor.setWatchdog(executeWatchdog);
executor.setExitValues(new int[] { 0, 24 });
if (!execFile.canExecute()) {
execFile.setExecutable(true);
}
executor.setWorkingDirectory(execFile.getParentFile());
exitValue = executor.execute(cmdLine);
if (IApplication.EXIT_RELAUNCH == exitValue) {
cmdLine = new CommandLine(execFile);
if (getClientDebugPort() != null) {
cmdLine.addArgument("-vmargs");
cmdLine.addArgument("-Xdebug");
String cmd = "-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=*:" + getClientDebugPort();
cmdLine.addArgument(cmd);
}
exitValue = executor.execute(cmdLine);
}
} catch (Exception e) {
error = e;
if ((e instanceof ExecuteException) && ((ExecuteException)e).getExitValue() == 143) {
LOGGER.error("SSO client exited by timeout.");
listener.loginFailed(new Exception(Messages.getString("SSOClientExec.error.timeout")));
} else {
LOGGER.error(e);
listener.loginFailed(e);
}
}
}
private String getClientDebugPort() {
return System.getProperty(STUDIO_SSO_CLIENT_DEBUG_PORT);
}
private String getInvokeParameter(String clientID, int callbackPort) throws UnsupportedEncodingException {
return STUDIO_CALL_PREFIX + SSOClientUtil.getInstance().getSignOnURL(clientID, codeChallenge, callbackPort);
}
public void stop() {
if (executeWatchdog != null && !executeWatchdog.killedProcess()) {
executeWatchdog.destroyProcess();
}
}
public Exception getError() {
return error;
}
}

View File

@@ -0,0 +1,131 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Properties;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.FileLocator;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.talend.utils.io.FilesUtils;
public class SSOClientInstaller {
private static Logger LOGGER = Logger.getLogger(SSOClientInstaller.class);
private final String SIGN_CLIENT_BUNDLE_NAME = "org.talend.singlesignon.client";
private final String INSTALL_FOLDER_NAME = "repository";
private final String INSTALL_FILE_NAME = "TalendSignTool.zip";
private final String version = "8.0.1.202206081050";
private static final SSOClientInstaller instance = new SSOClientInstaller();
public static SSOClientInstaller getInstance() {
return instance;
}
private SSOClientInstaller() {
}
public boolean isNeedInstall() {
String installedVersion = getInstalledVersion();
if (SSOClientUtil.isDebugMode()) {
LOGGER.info(String.format("Installed client version is %s and latest version is %s .", installedVersion, version));
}
if (installedVersion != null && installedVersion.compareTo(version) >= 0) {
return false;
}
return true;
}
public void install() throws Exception {
File sourceFile = getInstallFile();
if (!sourceFile.exists()) {
LOGGER.error("Can't find install file:" + sourceFile.getAbsolutePath());
}
File targetFolder = getInstallDir();
if (targetFolder.exists()) {
targetFolder.delete();
LOGGER.info("Deleted target folder:" + targetFolder.getAbsolutePath());
}
targetFolder.mkdirs();
if (SSOClientUtil.isDebugMode()) {
LOGGER.info("Created target folder:" + targetFolder.getAbsolutePath());
}
FilesUtils.unzip(sourceFile.getAbsolutePath(), targetFolder.getAbsolutePath(), true);
if (SSOClientUtil.isDebugMode()) {
LOGGER.info("Installed client:" + targetFolder.getAbsolutePath());
}
}
private String getInstalledVersion() {
FileInputStream in = null;
try {
File eclipseProductFile = getEclipseProductFile();
if (eclipseProductFile != null && eclipseProductFile.exists()) {
Properties p = new Properties();
in = new FileInputStream(eclipseProductFile);
p.load(in);
String productFileVersion = p.getProperty("version"); //$NON-NLS-1$
return productFileVersion;
}
} catch (Exception e) {
LOGGER.error(e);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
LOGGER.error(e);
}
}
}
return null;
}
private File getEclipseProductFile() throws URISyntaxException {
File eclipseproductFile = new File(getInstallDir(), ".eclipseproduct");//$NON-NLS-1$
return eclipseproductFile;
}
protected File getInstallDir() {
return SSOClientUtil.getSSOClientFolder();
}
protected File getInstallFile() throws IOException {
BundleContext context = EquinoxUtils.getCurrentBundleContext();
Bundle[] bundles = context.getBundles();
Bundle bundle = null;
for (Bundle b : bundles) {
if (SIGN_CLIENT_BUNDLE_NAME.equals(b.getSymbolicName())) {
bundle = b;
break;
}
}
if (bundle != null) {
File bundleFile = FileLocator.getBundleFile(bundle).getAbsoluteFile();
File folder = new File(bundleFile, INSTALL_FOLDER_NAME);
File installFile = new File(folder, INSTALL_FILE_NAME);
return installFile;
}
return null;
}
}

View File

@@ -0,0 +1,217 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
import org.talend.signon.util.listener.LoginEventListener;
public class SSOClientMonitor implements Runnable {
private static Logger LOGGER = Logger.getLogger(SSOClientMonitor.class);
private static final String STUDIO_AUTH_CODE_KEY = "code";
private static final String STUDIO_AUTH_STATE_KEY = "state";
private static final String STUDIO_CALLBACK_PREFIX = "studioCallback:";
private static final String STUDIO_CALLBACK_ERROR_PREFIX = "studioCallbackError:";
private static final SSOClientMonitor instance = new SSOClientMonitor();
private static int listenPort = -1;
private static volatile boolean isRunning = false;
private Set<LoginEventListener> listenerSet = new HashSet<LoginEventListener>();
public static SSOClientMonitor getInscance() {
return instance;
}
private SSOClientMonitor() {
}
private void processData(String msg) {
if (msg.startsWith(STUDIO_CALLBACK_PREFIX)) {
msg = msg.substring(STUDIO_CALLBACK_PREFIX.length());
Map<String, String> data = decodeMsg(msg);
String code = data.get(STUDIO_AUTH_CODE_KEY);
String state = data.get(STUDIO_AUTH_STATE_KEY);
String[] splits = state.split(",");
String dateCenter = TMCRepositoryUtil.getDefaultDataCenter();
if (splits.length == 2) {
dateCenter = splits[1];
}
fireLoginStop(code, dateCenter);
}
if (msg.startsWith(STUDIO_CALLBACK_ERROR_PREFIX)) {
msg = msg.substring(STUDIO_CALLBACK_ERROR_PREFIX.length());
fireLoginFailed(new Exception (msg));
}
}
private Map<String, String> decodeMsg(String data) {
Map<String, String> map = new HashMap<String, String>();
if (data.startsWith(STUDIO_CALLBACK_PREFIX)) {
data = data.substring(STUDIO_CALLBACK_PREFIX.length());
}
if (data.startsWith(SSOUtil.STUDIO_REDIRECT_URL)) {
data = data.substring(SSOUtil.STUDIO_REDIRECT_URL.length());
}
if (data.startsWith("?")) {
data = data.substring("?".length());
}
String[] splits = data.split("&");
for (int i = 0; i < splits.length; i++) {
String str = splits[i];
String[] spls = str.split("=");
if (spls.length == 2) {
map.put(spls[0], spls[1]);
} else {
LOGGER.error("Parse msg error is should be contains =:" + str);
}
}
return map;
}
public void stop() {
isRunning = false;
listenPort = -1;
}
private Integer newPort() {
final Integer port = Integer.getInteger("stduio.login.client.monitor.port", -1);
if (port <= 0) {
try (ServerSocket socket = new ServerSocket(0)) {
socket.setReuseAddress(true);
return socket.getLocalPort();
} catch (final IOException e) {
throw new IllegalStateException(e);
}
}
return port;
}
private void fireLoginStop(String code, String dataCenter) {
for (LoginEventListener l : listenerSet) {
try {
l.loginStop(code, dataCenter);
} catch (Exception ex) {
LOGGER.error(ex);
}
}
}
private void fireLoginStart() {
for (LoginEventListener l : listenerSet) {
try {
l.loginStart();
} catch (Exception ex) {
LOGGER.error(ex);
}
}
}
private void fireLoginFailed(Exception ex) {
for (LoginEventListener l : listenerSet) {
try {
l.loginFailed(ex);
} catch (Exception e) {
LOGGER.error(e);
}
}
}
public void addLoginEventListener(LoginEventListener listener) {
listenerSet.add(listener);
}
public void removeLoginEventListener(LoginEventListener listener) {
if (listenerSet.contains(listener)) {
listenerSet.remove(listener);
}
}
public int getListenPort() {
return listenPort;
}
@Override
public void run() {
if (isRunning) {
LOGGER.info("Login client monitor started.");
return;
}
listenPort = newPort();
ServerSocket server;
try {
server = new ServerSocket(listenPort);
if (SSOClientUtil.isDebugMode()) {
LOGGER.info("Start sso client monitor on " + listenPort);
}
isRunning = true;
fireLoginStart();
while (isRunning) {
Socket socket = server.accept();
try {
InputStream inputStream = socket.getInputStream();
byte[] bytes = new byte[1024];
int len;
StringBuilder sb = new StringBuilder();
while ((len = inputStream.read(bytes)) != -1) {
sb.append(new String(bytes, 0, len, StandardCharsets.UTF_8));
}
inputStream.close();
processData(sb.toString());
stop();
if (SSOClientUtil.isDebugMode()) {
LOGGER.info("Stop sso client monitor");
}
break;
} catch (Exception e) {
LOGGER.error(e);
fireLoginFailed(e);
} finally {
try {
socket.close();
} catch (IOException e) {
LOGGER.error(e);
fireLoginFailed(e);
}
}
}
} catch (Exception ex) {
LOGGER.error(ex);
fireLoginFailed(ex);
}
}
public static boolean isRunning() {
return isRunning;
}
}

View File

@@ -0,0 +1,165 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.log4j.Logger;
import org.eclipse.core.runtime.Platform;
import org.talend.signon.util.listener.LoginEventListener;
public class SSOClientUtil {
private static Logger LOGGER = Logger.getLogger(SSOClientUtil.class);
private static final String STUDIO_CLIENT_ID = "0c51933d-c542-4918-9baf-86ef709af5d8";
private static final String CLIENT_FILE_PATH_PROPERTY = "talend.studio.signon.client.path";
private static final String CLIENT_FILE_NAME_ON_WINDOWS = "Talend_Sign_On_Tool_win-x86_64.exe";
private static final String CLIENT_FILE_NAME_ON_LINUX_X86 = "Talend_Sign_On_Tool_linux_gtk_x86_64";
private static final String CLIENT_FILE_NAME_ON_LINUX_AARCH64 = "Talend_Sign_On_Tool_linux_gtk_aarch64";
private static final String CLIENT_FILE_NAME_ON_MAC_X86 = "Talend_Sign_On_Tool.app";
private static final String CLIENT_FILE_NAME_ON_MAC_AARCH64 = "Talend_Sign_On_Tool_aarch64.app";
private static final String CLIENT_FOLDER_NAME = "studio_sso_client";
static final String DATA_CENTER_KEY = "talend.tmc.datacenter";
static final String DATA_CENTER_DISPLAY_KEY = "talend.tmc.datacenter.display";
public static final String TALEND_DEBUG = "--talendDebug"; //$NON-NLS-1$
private static final SSOClientUtil instance = new SSOClientUtil();
private SSOClientExec signOnClientExec;
private SSOClientUtil() {
if (SSOClientInstaller.getInstance().isNeedInstall()) {
try {
SSOClientInstaller.getInstance().install();
} catch (Exception e) {
LOGGER.error(e);
}
}
}
public String getClientID() throws IOException {
return STUDIO_CLIENT_ID;
}
public File getSSOClientAppFile() throws Exception {
if (System.getProperty(CLIENT_FILE_PATH_PROPERTY) != null) {
return new File(System.getProperty(CLIENT_FILE_PATH_PROPERTY));
}
File folder = getSSOClientFolder();
if (EnvironmentUtils.isWindowsSystem()) {
return new File(folder, CLIENT_FILE_NAME_ON_WINDOWS);
} else if (EnvironmentUtils.isLinuxUnixSystem()) {
if (EnvironmentUtils.isX86_64()) {
return new File(folder, CLIENT_FILE_NAME_ON_LINUX_X86);
} else if (EnvironmentUtils.isAarch64()) {
return new File(folder, CLIENT_FILE_NAME_ON_LINUX_AARCH64);
}
} else if (EnvironmentUtils.isMacOsSytem()) {
File appFolder = null;
if (EnvironmentUtils.isX86_64()) {
appFolder = new File(folder, CLIENT_FILE_NAME_ON_MAC_X86);
} else if (EnvironmentUtils.isAarch64()) {
appFolder = new File(folder, CLIENT_FILE_NAME_ON_MAC_AARCH64);
}
if (appFolder != null) {
return new File(appFolder, "Contents/MacOS/Talend_Sign_On_Tool");
}
}
throw new Exception("Unsupported OS");
}
public static File getSSOClientFolder() {
File configFolder = EquinoxUtils.getConfigurationFolder();
File signClientFolder = new File(configFolder, CLIENT_FOLDER_NAME);
return signClientFolder;
}
private synchronized void startSignOnClient(LoginEventListener listener) throws Exception {
if (signOnClientExec != null) {
signOnClientExec.stop();
}
String clientId = getClientID();
File execFile = getSSOClientAppFile();
String codeChallenge = listener.getCodeChallenge();
if (isDebugMode()) {
LOGGER.info("Prepare to start login cloud client monitor");
}
SSOClientMonitor signOnClientListener = SSOClientMonitor.getInscance();
signOnClientListener.addLoginEventListener(listener);
new Thread(signOnClientListener).start();
if (isDebugMode()) {
LOGGER.info("Login cloud client monitor started.");
}
while (!SSOClientMonitor.isRunning()) {
TimeUnit.MILLISECONDS.sleep(100);
}
if (signOnClientListener.getListenPort() < 0) {
throw new Exception("Login cloud client monitor start failed.");
}
if (isDebugMode()) {
LOGGER.info("Prepare to start cloud client on " + signOnClientListener.getListenPort());
}
signOnClientExec = new SSOClientExec(execFile, clientId, codeChallenge, signOnClientListener.getListenPort(), listener);
new Thread(signOnClientExec).start();
if (isDebugMode()) {
LOGGER.info("Login cloud client started.");
}
}
public static SSOClientUtil getInstance() {
return instance;
}
public void signOnCloud(LoginEventListener listener) throws Exception {
SSOClientUtil.getInstance().startSignOnClient(listener);
}
public String getSignOnURL(String clientID, String codeChallenge, int callbackPort) throws UnsupportedEncodingException {
String dataCenter = TMCRepositoryUtil.getDefaultDataCenter();
StringBuffer urlSB = new StringBuffer();
urlSB.append(TMCRepositoryUtil.getBaseLoginURL(dataCenter)).append("?");
urlSB.append("client_id=").append(clientID).append("&");
urlSB.append("redirect_uri=")
.append(URLEncoder.encode(TMCRepositoryUtil.getRedirectURL(dataCenter), StandardCharsets.UTF_8.name()))
.append("&");
urlSB.append("scope=openid refreshToken&");
urlSB.append("response_type=code&");
urlSB.append("code_challenge_method=S256&");
urlSB.append("code_challenge=").append(codeChallenge).append("&");
urlSB.append("state=").append(callbackPort).append(SSOUtil.STATE_PARAM_SEPARATOR)
.append(TMCRepositoryUtil.getDefaultDataCenter());
return urlSB.toString();
}
public static boolean isDebugMode() {
return Boolean.getBoolean("talendDebug") //$NON-NLS-1$
|| ArrayUtils.contains(Platform.getApplicationArgs(), SSOClientUtil.TALEND_DEBUG);
}
}

View File

@@ -0,0 +1,39 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.Base64;
public class SSOUtil {
public static final String STUDIO_REDIRECT_URL = "talendstudio://code";
public static final String STATE_PARAM_SEPARATOR = ",";
public static String generateCodeVerifier() {
SecureRandom secureRandom = new SecureRandom();
byte[] codeVerifier = new byte[32];
secureRandom.nextBytes(codeVerifier);
return Base64.getUrlEncoder().withoutPadding().encodeToString(codeVerifier);
}
public static String getCodeChallenge(String seed) throws Exception {
byte[] bytes = seed.getBytes("US-ASCII");
MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
messageDigest.update(bytes, 0, bytes.length);
byte[] digest = messageDigest.digest();
return Base64.getUrlEncoder().withoutPadding().encodeToString(digest);
}
}

View File

@@ -0,0 +1,122 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
public class TMCRepositoryUtil {
public static final String REPOSITORY_CLOUD_US_ID = "cloud_us"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_EU_ID = "cloud_eu"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_APAC_ID = "cloud_apac"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_US_WEST_ID = "cloud_us_west"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_AUS_ID = "cloud_aus"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_US_DISPALY = "United States - East on AWS"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_EU_DISPALY = "Europe on AWS"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_APAC_DISPALY = "Asia Pacific on AWS"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_US_WEST_DISPALY = "United States - West on Azure"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_AUS_DISPALY = "Australia on AWS"; //$NON-NLS-1$
public static final String REPOSITORY_CLOUD_CUSTOM_ID = "cloud_custom"; //$NON-NLS-1$
public static final String AUTHORIZE_URL = "https://iam.%s.cloud.talend.com/oidc/idp/authorize"; //$NON-NLS-1$
public static final String ADMIN_URL = "https://tmc.%s.cloud.talend.com/studio_cloud_connection"; //$NON-NLS-1$
public static final String TOKEN_URL = "https://iam.%s.cloud.talend.com/oidc/oauth2/token"; //$NON-NLS-1$
public static final String SUCCESS_REDIRECT_URL = "https://iam.%s.cloud.talend.com/idp/login-sso-success"; //$NON-NLS-1$
public static final String ONLINE_HELP_URL = "https://document-link.us.cloud.talend.com/ts_ug_launch-studio?version=%s&lang=%s&env=prd";
public static String getBaseLoginURL(String dataCenter) {
if (dataCenter == null) {
dataCenter = TMCRepositoryUtil.getDefaultDataCenter();
}
return String.format(AUTHORIZE_URL, dataCenter);
}
public static String getDefaultDataCenter() {
String defaultDataCenter = "us";
if (System.getProperty(SSOClientUtil.DATA_CENTER_KEY) != null) {
defaultDataCenter = System.getProperty(SSOClientUtil.DATA_CENTER_KEY);
}
return defaultDataCenter;
}
public static String getCloudAdminURL(String dataCenter) {
return String.format(ADMIN_URL, dataCenter);
}
public static String getTokenURL(String dataCenter) {
return String.format(TOKEN_URL, dataCenter);
}
public static String getRedirectURL(String dataCenter) {
if (dataCenter == null) {
dataCenter = getDefaultDataCenter();
}
return String.format(SUCCESS_REDIRECT_URL, dataCenter);
}
public static String getDisplayNameByDatacenter(String dataCenter) {
if ("ap".equals(dataCenter)) {
return REPOSITORY_CLOUD_APAC_DISPALY;
}
if ("us".equals(dataCenter)) {
return REPOSITORY_CLOUD_US_DISPALY;
}
if ("us-west".equals(dataCenter)) {
return REPOSITORY_CLOUD_US_WEST_DISPALY;
}
if ("eu".equals(dataCenter)) {
return REPOSITORY_CLOUD_EU_DISPALY;
}
if ("au".equals(dataCenter)) {
return REPOSITORY_CLOUD_AUS_DISPALY;
}
if (System.getProperty(SSOClientUtil.DATA_CENTER_DISPLAY_KEY) != null) {
return System.getProperty(SSOClientUtil.DATA_CENTER_DISPLAY_KEY);
}
return dataCenter;
}
public static String getRepositoryId(String dataCenter) {
if ("ap".equals(dataCenter)) {
return REPOSITORY_CLOUD_APAC_ID;
}
if ("us".equals(dataCenter)) {
return REPOSITORY_CLOUD_US_ID;
}
if ("us-west".equals(dataCenter)) {
return REPOSITORY_CLOUD_US_WEST_ID;
}
if ("eu".equals(dataCenter)) {
return REPOSITORY_CLOUD_EU_ID;
}
if ("au".equals(REPOSITORY_CLOUD_AUS_ID)) {
return REPOSITORY_CLOUD_EU_ID;
}
return REPOSITORY_CLOUD_CUSTOM_ID;
}
}

View File

@@ -0,0 +1,159 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import org.talend.utils.json.JSONException;
import org.talend.utils.json.JSONObject;
public class TokenMode {
private static final String ACCESS_TOKEN_KEY = "access_token";
private static final String EXPIRES_IN_KEY = "expires_in";
private static final String ID_TOKEN_KEY = "id_token";
private static final String REFRESH_TOKEN_KEY = "refresh_token";
private static final String SCOPE_KEY = "scope";
private static final String TOKEN_TYPE_KEY = "token_type";
private static final String LAST_REFRESH_TIME_KEY = "last_refresh_time";
private static final String DATA_CENTER_KEY = "data_center";
private String clientId;
private String accessToken;
private String refreshToken;
private long expiresIn;
private String idToken;
private String scope;
private String tokenType;
private String dataCenter;
private long lastRefreshTime = System.currentTimeMillis();
public String getClientId() {
return clientId;
}
public void setClientId(String clientId) {
this.clientId = clientId;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getRefreshToken() {
return refreshToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken;
}
public long getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(long expiresIn) {
this.expiresIn = expiresIn;
}
public String getIdToken() {
return idToken;
}
public void setIdToken(String idToken) {
this.idToken = idToken;
}
public String getScope() {
return scope;
}
public void setScope(String scope) {
this.scope = scope;
}
public String getTokenType() {
return tokenType;
}
public void setTokenType(String tokenType) {
this.tokenType = tokenType;
}
public long getLastRefreshTime() {
return lastRefreshTime;
}
public void setLastRefreshTime(long lastRefreshTime) {
this.lastRefreshTime = lastRefreshTime;
}
public String getDataCenter() {
return dataCenter;
}
public void setDataCenter(String dataCenter) {
this.dataCenter = dataCenter;
}
public static TokenMode parseFromJson(String jsonString, String dataCenter) throws JSONException {
JSONObject jsonObj = new JSONObject(jsonString);
TokenMode token = new TokenMode();
token.setAccessToken(jsonObj.getString(TokenMode.ACCESS_TOKEN_KEY));
token.setExpiresIn(jsonObj.getLong(TokenMode.EXPIRES_IN_KEY));
token.setIdToken(jsonObj.getString(TokenMode.ID_TOKEN_KEY));
token.setRefreshToken(jsonObj.getString(TokenMode.REFRESH_TOKEN_KEY));
token.setScope(jsonObj.getString(TokenMode.SCOPE_KEY));
token.setTokenType(jsonObj.getString(TokenMode.TOKEN_TYPE_KEY));
if (jsonObj.has(TokenMode.LAST_REFRESH_TIME_KEY)) {
token.setLastRefreshTime(jsonObj.getLong(TokenMode.LAST_REFRESH_TIME_KEY));
}
if (dataCenter == null && jsonObj.has(TokenMode.DATA_CENTER_KEY)) {
token.setDataCenter(jsonObj.getString(TokenMode.DATA_CENTER_KEY));
} else {
token.setDataCenter(dataCenter);
}
return token;
}
public static JSONObject writeToJson(TokenMode token) throws JSONException {
JSONObject object = new JSONObject();
object.put(TokenMode.ACCESS_TOKEN_KEY, token.getAccessToken());
object.put(TokenMode.EXPIRES_IN_KEY, token.getExpiresIn());
object.put(TokenMode.ID_TOKEN_KEY, token.getIdToken());
object.put(TokenMode.REFRESH_TOKEN_KEY, token.getRefreshToken());
object.put(TokenMode.SCOPE_KEY, token.getScope());
object.put(TokenMode.TOKEN_TYPE_KEY, token.getTokenType());
object.put(TokenMode.LAST_REFRESH_TIME_KEY, token.getLastRefreshTime());
object.put(TokenMode.DATA_CENTER_KEY, token.getDataCenter());
return object;
}
}

View File

@@ -0,0 +1,195 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
/**
* This class copies various methods from the URIUtil class in org.eclipse.equinox.common. Unless otherwise noted the
* implementations here should mirror those in the common implementation.
*/
public class URIUtil {
public static final String SCHEME_FILE = "file"; //$NON-NLS-1$
private static final String UNC_PREFIX = "//"; //$NON-NLS-1$
/**
* Appends the given extension to the path of the give base URI and returns the corresponding new path.
*
* @param base The base URI to append to
* @param extension The path extension to be added
* @return The appended URI
*/
public static URI append(URI base, String extension) {
try {
String path = base.getPath();
if (path == null)
return appendOpaque(base, extension);
// if the base is already a directory then resolve will just do the right thing
if (path.endsWith("/")) {//$NON-NLS-1$
URI result = base.resolve(extension);
// Fix UNC paths that are incorrectly normalized by URI#resolve (see Java bug 4723726)
String resultPath = result.getPath();
if (path.startsWith(UNC_PREFIX) && (resultPath == null || !resultPath.startsWith(UNC_PREFIX)))
result = new URI(result.getScheme(), "///" + result.getSchemeSpecificPart(), result.getFragment()); //$NON-NLS-1$
return result;
}
path = path + "/" + extension; //$NON-NLS-1$
return new URI(base.getScheme(), base.getUserInfo(), base.getHost(), base.getPort(), path, base.getQuery(),
base.getFragment());
} catch (URISyntaxException e) {
// shouldn't happen because we started from a valid URI
throw new RuntimeException(e);
}
}
/**
* Special case of appending to an opaque URI. Since opaque URIs have no path segment the best we can do is append
* to the scheme-specific part
*/
private static URI appendOpaque(URI base, String extension) throws URISyntaxException {
String ssp = base.getSchemeSpecificPart();
if (ssp.endsWith("/")) //$NON-NLS-1$
ssp += extension;
else
ssp = ssp + "/" + extension; //$NON-NLS-1$
return new URI(base.getScheme(), ssp, base.getFragment());
}
/**
* Returns a URI corresponding to the given unencoded string.
*
* @throws URISyntaxException If the string cannot be formed into a valid URI
*/
public static URI fromString(String uriString) throws URISyntaxException {
int colon = uriString.indexOf(':');
int hash = uriString.lastIndexOf('#');
boolean noHash = hash < 0;
if (noHash)
hash = uriString.length();
String scheme = colon < 0 ? null : uriString.substring(0, colon);
String ssp = uriString.substring(colon + 1, hash);
String fragment = noHash ? null : uriString.substring(hash + 1);
// use java.io.File for constructing file: URIs
if (scheme != null && scheme.equals(SCHEME_FILE)) {
File file = new File(uriString.substring(5));
if (file.isAbsolute())
return file.toURI();
scheme = null;
if (File.separatorChar != '/')
ssp = ssp.replace(File.separatorChar, '/');
}
return new URI(scheme, ssp, fragment);
}
/*
* Compares two URI for equality. Return false if one of them is null
*/
public static boolean sameURI(URI url1, URI url2) {
if (url1 == url2)
return true;
if (url1 == null || url2 == null)
return false;
if (url1.equals(url2))
return true;
if (url1.isAbsolute() != url2.isAbsolute())
return false;
// check if we have two local file references that are case variants
File file1 = toFile(url1);
return file1 == null ? false : file1.equals(toFile(url2));
}
/**
* Returns the URI as a local file, or <code>null</code> if the given URI does not represent a local file.
*
* @param uri The URI to return the file for
* @return The local file corresponding to the given URI, or <code>null</code>
*/
public static File toFile(URI uri) {
try {
if (!SCHEME_FILE.equalsIgnoreCase(uri.getScheme()))
return null;
// assume all illegal characters have been properly encoded, so use URI class to unencode
return new File(uri);
} catch (IllegalArgumentException e) {
// File constructor does not support non-hierarchical URI
String path = uri.getPath();
// path is null for non-hierarchical URI such as file:c:/tmp
if (path == null)
path = uri.getSchemeSpecificPart();
return new File(path);
}
}
/**
* Returns a string representation of the given URI that doesn't have illegal characters encoded. This string is
* suitable for later passing to {@link #fromString(String)}.
*
* @param uri The URI to convert to string format
* @return An unencoded string representation of the URI
*/
public static String toUnencodedString(URI uri) {
StringBuffer result = new StringBuffer();
String scheme = uri.getScheme();
if (scheme != null)
result.append(scheme).append(':');
// there is always a ssp
result.append(uri.getSchemeSpecificPart());
String fragment = uri.getFragment();
if (fragment != null)
result.append('#').append(fragment);
return result.toString();
}
/**
* Returns the URL as a URI. This method will handle broken URLs that are not properly encoded (for example they
* contain unencoded space characters).
*/
public static URI toURI(URL url) throws URISyntaxException {
// URL behaves differently across platforms so for file: URLs we parse from string form
if (SCHEME_FILE.equals(url.getProtocol())) {
String pathString = url.toExternalForm().substring(5);
// ensure there is a leading slash to handle common malformed URLs such as file:c:/tmp
if (pathString.indexOf('/') != 0)
pathString = '/' + pathString;
else if (pathString.startsWith(UNC_PREFIX) && !pathString.startsWith(UNC_PREFIX, 2)) {
// URL encodes UNC path with two slashes, but URI uses four (see bug 207103)
pathString = UNC_PREFIX + pathString;
}
return new URI(SCHEME_FILE, null, pathString, null);
}
try {
return new URI(url.toExternalForm());
} catch (URISyntaxException e) {
// try multi-argument URI constructor to perform encoding
return new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(),
url.getRef());
}
}
/**
* Returns a URI as a URL.
*
* @throws MalformedURLException
*/
public static URL toURL(URI uri) throws MalformedURLException {
return new URL(uri.toString());
}
}

View File

@@ -0,0 +1,63 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util.i18n;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* DOC zwzhao class global comment. Detailled comment
*/
public class Messages extends MessagesCore {
private static final String BUNDLE_NAME = "messages"; //$NON-NLS-1$
private static final String PLUGIN_ID = "org.talend.license.gui";
private static ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
/**
* Returns the i18n formatted message for <i>key</i> in the class bundle.
*
* @param key - the key for the desired string
* @return the string for the given key in the class resource bundle
* @see MessagesCore#getString(String, ResourceBundle)
*/
public static String getString(String key) {
return getString(key, PLUGIN_ID, resourceBundle);
}
/**
* Returns the i18n formatted message for <i>key</i> and <i>args</i> in the specified bundle.
*
* @param key - the key for the desired string
* @param args - arg to include in the string
* @return the string for the given key in the given resource bundle
* @see MessagesCore#getString(String, ResourceBundle, Object[])
*/
public static String getString(String key, Object... args) {
return getString(key, PLUGIN_ID, resourceBundle, args);
}
/**
* Returns the i18n formatted message for <i>key</i> and <i>locale<i> in the class bundle.
*
* @param key - the key for the desired string
* @param locale - the locale for which a resource bundle is desired
* @return the string for the given key in the given locale resource bundle
*/
public static String getLocaleString(String key, Locale locale) {
ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME, locale);
return getString(key, PLUGIN_ID, resourceBundle);
}
}

View File

@@ -0,0 +1,94 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util.i18n;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
* DOC zwzhao class global comment. Detailled comment
*/
public abstract class MessagesCore {
public static final String KEY_NOT_FOUND_PREFIX = "!!!"; //$NON-NLS-1$
public static final String KEY_NOT_FOUND_SUFFIX = "!!!"; //$NON-NLS-1$
// add by wzhang for 13249, MessageFormat will not indicate {0} as i18n args if in couple single quotes.
public static final String SINGLE_QUOTE = "'"; //$NON-NLS-1$
public static final String SINGLE_QUOTE_MUTI = "''"; //$NON-NLS-1$
/**
* Returns the i18n formatted message for <i>key</i> in the specified bundle.
*
* @param key - the key for the desired string
* @param resourceBundle - the ResourceBundle to search in
* @return the string for the given key in the given resource bundle
*/
public static String getString(String key, String pluginId, ResourceBundle resourceBundle) {
if (resourceBundle == null) {
return KEY_NOT_FOUND_PREFIX + key + KEY_NOT_FOUND_SUFFIX;
}
try {
return resourceBundle.getString(key);
} catch (MissingResourceException e) {
return KEY_NOT_FOUND_PREFIX + key + KEY_NOT_FOUND_SUFFIX;
}
}
/**
* Returns the i18n formatted message for <i>key</i> and <i>args</i> in the specified bundle.
*
* @param key - the key for the desired string
* @param resourceBundle - the ResourceBundle to search in
* @param args - arg to include in the string
* @return the string for the given key in the given resource bundle
*/
// modified by wzhang. add a pluginId parameter
public static String getString(String key, String pluginId, ResourceBundle resourceBundle, Object... args) {
try {
return MessageFormat.format(getString(key, pluginId, resourceBundle).replaceAll(SINGLE_QUOTE, SINGLE_QUOTE_MUTI),
args);
} catch (Exception e) {
return KEY_NOT_FOUND_PREFIX + key + KEY_NOT_FOUND_SUFFIX;
}
}
/**
* Returns the i18n formatted message for <i>key</i> and <i>args</i> in the specified bundle.
*
* @param key - the key for the desired string
* @param resourceBundle - the ResourceBundle to search in
* @param args - arg to include in the string
* @return the string for the given key in the given resource bundle
* @deprecated
*/
public static String getString(String key, ResourceBundle resourceBundle, Object... args) {
return getString(key, null, resourceBundle, args);
}
/**
* Returns the i18n formatted message for <i>key</i> in the specified bundle.
*
* @param key - the key for the desired string
* @param resourceBundle - the ResourceBundle to search in
* @return the string for the given key in the given resource bundle
* @deprecated
*/
public static String getString(String key, ResourceBundle resourceBundle) {
return getString(key, null, resourceBundle);
}
}

View File

@@ -0,0 +1,24 @@
// ============================================================================
//
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.signon.util.listener;
public interface LoginEventListener {
public void loginStart();
public void loginStop(String authCode, String dataCenter);
public void loginFailed(Exception ex);
public String getCodeChallenge();
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>

View File

@@ -19,6 +19,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.e4.ui.model.workbench,
org.eclipse.e4.ui.css.swt.theme,
org.eclipse.osgi.services
Service-Component: OSGI-INF/core.xml
Bundle-ActivationPolicy: lazy
Export-Package: org.talend.themes.core.elements.constants,
org.talend.themes.core.elements.interfaces,

View File

@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<component name="TalendThemeService">
<implementation class="org.talend.themes.core.TalendThemeService"/>
<service>
<provide interface="org.talend.commons.runtime.service.ITalendThemeService"/>
</service>
</component>

View File

@@ -3,4 +3,5 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
build.properties
build.properties,\
OSGI-INF/

View File

@@ -0,0 +1,91 @@
// ============================================================================
//
// Copyright (C) 2006-2022 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.themes.core;
import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.eclipse.e4.ui.css.swt.dom.WidgetElement;
import org.eclipse.e4.ui.css.swt.theme.IThemeEngine;
import org.eclipse.e4.ui.css.swt.theme.IThemeManager;
import org.eclipse.jface.resource.ColorRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.talend.commons.exception.ExceptionHandler;
import org.talend.commons.runtime.service.ITalendThemeService;
import org.w3c.dom.css.CSSStyleDeclaration;
import org.w3c.dom.css.CSSValue;
/**
* DOC cmeng class global comment. Detailled comment
*/
public class TalendThemeService implements ITalendThemeService {
private IThemeEngine themeEngine;
@Override
public Object getGlobalThemeColor(String cssProp) {
Shell shell = Display.getDefault().getActiveShell();
CSSValue cssValue = getCssValue(shell, cssProp);
if (cssValue == null) {
return null;
}
String key = cssValue.getCssText();
ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
if (!colorRegistry.hasValueFor(key)) {
CSSEngine cssEngin = WidgetElement.getEngine(shell);
try {
RGB rgb = (RGB) cssEngin.convert(cssValue, RGB.class, Display.getDefault());
colorRegistry.put(key, rgb);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
return colorRegistry.get(key);
}
@Override
public String getGlobalThemeProp(String key) {
Shell shell = Display.getDefault().getActiveShell();
CSSValue cssValue = getCssValue(shell, key);
if (cssValue == null) {
return null;
}
return cssValue.getCssText();
}
private IThemeEngine getThemeEngine() {
if (themeEngine == null) {
BundleContext context = TalendThemesCorePlugin.getDefault().getBundle().getBundleContext();
ServiceReference ref = context.getServiceReference(IThemeManager.class.getName());
IThemeManager mgr = (IThemeManager) context.getService(ref);
themeEngine = mgr.getEngineForDisplay(Display.getDefault());
}
return themeEngine;
}
private CSSValue getCssValue(Object element, String property) {
IThemeEngine engine = getThemeEngine();
if (engine == null) {
return null;
}
CSSStyleDeclaration style = engine.getStyle(element);
if (style == null) {
return null;
}
return style.getPropertyCSSValue(property);
}
}

View File

@@ -10,4 +10,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.e4.ui.css.swt,
org.eclipse.e4.ui.css.swt.theme
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-Vendor: .Talend SA.
Eclipse-BundleShape: dir
Automatic-Module-Name: org.talend.themes.css.talend

View File

@@ -3,4 +3,5 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
themes/,\
plugin.xml
plugin.xml,\
plugin.properties

View File

@@ -0,0 +1,32 @@
theme.default=Talend default theme
theme.dark=Talend experimental dark theme
#New theme element definitions
DARK_BACKGROUND=Dark Background Color
DARK_FOREGROUND=Dark Foreground Color
INACTIVE_UNSELECTED_TABS_COLOR_START=Inactive, unselected part color begin
INACTIVE_UNSELECTED_TABS_COLOR_START=Inactive, unselected part color begin
INACTIVE_UNSELECTED_TABS_COLOR_END=Inactive, unselected part color end
INACTIVE_TAB_TEXT_COLOR=Inactive part text color
INACTIVE_TAB_OUTER_KEYLINE_COLOR=Inactive part outer keyline color
INACTIVE_TAB_INNER_KEYLINE_COLOR=Inactive part inner keyline color
INACTIVE_TAB_OUTLINE_COLOR=Inactive part outline color
ACTIVE_UNSELECTED_TABS_COLOR_START=Active, unselected part color begin
ACTIVE_UNSELECTED_TABS_COLOR_END=Active, unselected part color end
ACTIVE_TAB_TEXT_COLOR=Active part text color
ACTIVE_TAB_OUTER_KEYLINE_COLOR=Active part outer keyline color
ACTIVE_TAB_INNER_KEYLINE_COLOR=Active part inner keyline color
ACTIVE_TAB_OUTLINE_COLOR=Active part outline color
INACTIVE_TAB_BG_START=Inactive, selected part background begin
INACTIVE_TAB_BG_END=Inactive, selected part background end
INACTIVE_TAB_UNSELECTED_TEXT_COLOR=Inactive, unselected part foreground
INACTIVE_TAB_SELECTED_TEXT_COLOR=Inactive, selected part foreground
ACTIVE_TAB_BG_START=Active, selected part background begin
ACTIVE_TAB_BG_END=Active, selected part background end
ACTIVE_TAB_UNSELECTED_TEXT_COLOR=Active, unselected part foreground
ACTIVE_TAB_SELECTED_TEXT_COLOR=Active, selected part foreground
ACTIVE_NOFOCUS_TAB_TEXT_COLOR=Active (no focus), selected part text color
ACTIVE_NOFOCUS_TAB_BG_START=Active (no focus), selected part background begin
ACTIVE_NOFOCUS_TAB_BG_END=Active (no focus), selected part background end
ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR=Active (no focus), selected part foreground
LINK_COLOR=Link color

View File

@@ -7,9 +7,39 @@
<theme
basestylesheeturi="themes/default/css/default.css"
id="org.talend.themes.css.talend.default"
label="Talend default theme">
label="%theme.default">
<!-- please see: TalendThemeConstants.TALEND_DEFAULT_THEME_ID -->
</theme>
<theme
basestylesheeturi="themes/dark/e4-dark_linux.css"
id="org.eclipse.e4.ui.css.theme.e4_dark"
label="%theme.dark"
os="linux">
</theme>
<theme
basestylesheeturi="themes/dark/e4-dark_win.css"
id="org.eclipse.e4.ui.css.theme.e4_dark"
label="%theme.dark"
os="win32">
</theme>
<theme
basestylesheeturi="themes/dark/e4-dark_mac.css"
id="org.eclipse.e4.ui.css.theme.e4_dark"
label="%theme.dark"
os="macosx">
</theme>
<theme
basestylesheeturi="themes/dark/e4-dark_mac1013.css"
id="org.eclipse.e4.ui.css.theme.e4_dark"
label="%theme.dark"
os="macosx"
os_version="10.11,10.12,10.13">
</theme>
<stylesheet
uri="themes/dark/dark/e4-dark_preferencestyle.css">
<themeid
refid="org.eclipse.e4.ui.css.theme.e4_dark"></themeid>
</stylesheet>
</extension>
</plugin>

View File

@@ -0,0 +1,24 @@
/*******************************************************************************
* Copyright (c) 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
.MTrimmedWindow.topLevel {
margin-top: 0px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
}
.MPartStack Tree, .MPartStack Table {
font-family: '#org-eclipse-ui-workbench-TREE_TABLE_FONT';
}

View File

@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2019 vogella GmbH and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Vogel - initial API and implementation
*******************************************************************************/
/* ################################ CSS related to drag and drop ########################## */
.DragFeedback {
background-color: COLOR-WIDGET-NORMAL-SHADOW;
}
.ModifiedDragFeedback {
background-color: #4176AF;
}

View File

@@ -0,0 +1,358 @@
/*******************************************************************************
* Copyright (c) 2010, 2015 Andrea Guarinoni and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Andrea Guarinoni <andrea.guarinoni.dev@outlook.com> - initial API and implementation
* Stefan Winkler <stefan@winklerweb.net> - Bug 434189, 430848
* Simon Scholz <simon.scholz@vogella.com> - Bug 431635
* Fabio Zadrozny <fabiofz@gmail.com> - Bug 465148, 465711
* Lars Vogel <Lars.Vogel@vogella.com> Bug 463652,466275
*******************************************************************************/
/*******************************************************************************
* The following bugs are referred to in this style sheet
* 2.) Bug 419377 - Setting a property to 'inherit' is not supported
* 3.) Bug 430051 - Regression for CTabRendering when drawing bottom tabs
*******************************************************************************/
/* ############################## Global Styles ############################## */
Shell {
background-color:'#org-eclipse-ui-workbench-DARK_BACKGROUND';
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
REPO_STABLE_SECONDARY_ENTRY_COLOR: #afafaf;
REPO_STABLE_PRIMARY_ENTRY_COLOR: #ffffff;
REPO_INACTIVE_ENTRY_COLOR: #8a8a8a;
REPO_LOCKED_ENTRY: #6b0000;
REPO_MERGED_REFERENCED_ITEMS_COLOR: #afafaf;
TAB_START_COLOR: #1b3c4f;
TAB_END_COLOR: #565656;
DESIGNER_COLOR_A: #000000;
DESIGNER_COLOR_B: #4f4f4f;
DESIGNER_COLOR_ALPHA: 95;
}
.TalendTabbedPropertyList{
background-color: black;
border-visible: true;
color:black;
_t-widget-normal-shadow-color:black;
_t-widget-dark-shadow-color:black;
_t-list-background-color: #ffffff;
_t-widget-vertical-line-color: #E3E3E3;
}
.TalendTabbedPropertyTitle{
border-visible: false;
_t-title-foreground-color:black;
_t-title-background-color:black;
_t-title-bottom-foreground-keyline1-color:black;
_t-title-bottom-foreground-keyline2-color:black;
}
Composite, ScrolledComposite, ExpandableComposite, Canvas, TabFolder, CLabel, Label,
CoolBar, Sash, Group, RefactoringLocationControl, ChangeParametersControl, Link, FilteredTree,
ProxyEntriesComposite, NonProxyHostsComposite, DelayedFilterCheckboxTree,
Splitter, ScrolledPageContent, ViewForm, LaunchConfigurationFilteredTree,
ContainerSelectionGroup, BrowseCatalogItem, EncodingSettings,
ProgressMonitorPart, DocCommentOwnerComposite, NewServerComposite,
NewManualServerComposite, ServerTypeComposite, FigureCanvas,
DependenciesComposite, ListEditorComposite, WrappedPageBook,
CompareStructureViewerSwitchingPane, CompareContentViewerSwitchingPane,
QualifiedNameComponent, RefactoringStatusViewer,
MessageLine,
Button /* SWT-BUG: checkbox inner label font color is not accessible */,
Composite > *,
Composite > * > *,
Group > StyledText {
background-color:'#org-eclipse-ui-workbench-DARK_BACKGROUND';
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
/* ############################## Toolbar ############################## */
/* Ensure that the labels in the tabfolder gets updated
See Bug 552780
*/
TabFolder > *,
CTabFolder > *,
TabFolder > Composite > *, /* Composite > CommitSearchPage$... */
CTabFolder > Composite > *, /* Composite > CommitSearchPage$... */
TabFolder > Composite > * > * { /* [style~='SWT.NO_BACKGROUND'] <- generate E4 non-sense bugs in apparently not related other rules Composite > ContentMergeViewer$... > TextMergeViewer$... */
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
/* Toolbar should inherit the colors of its container to avoid drawing artifacts*/
ToolBar {
background-color:inherit;
}
Combo,
List,
Text,
Spinner,
CCombo {
background-color:'#org-eclipse-ui-workbench-DARK_BACKGROUND';
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
Composite > StyledText,
Shell [style~='SWT.DROP_DOWN'] > StyledText, /* for eg. folded code popup (but it's ignored) */
SashForm > StyledText {
/* Fix StyledText inside a SashForm */
background-color:'#org-eclipse-ui-workbench-DARK_BACKGROUND';
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
Text[style~='SWT.SEARCH'],
Text[style~='SWT.SEARCH'] + Label /* SWT-BUG: adjacent sibling selector is ignored (CSS2.1) */ {
/* search boxes */
background-color: #333;
color: #F4F7F7;
}
Text[style~='SWT.READ_ONLY'] {
background-color: '#org-eclipse-ui-workbench-DARK_BACKGROUND';
color: #bbbbbb;
}
Shell Tree, Shell Table, Shell List {
background-color: #2F2F2F;
}
DatePicker,
DatePicker > Text,
ScheduleDatePicker,
ScheduleDatePicker > Text {
background-color:'#org-eclipse-ui-workbench-DARK_BACKGROUND';
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
ScrolledFormText,
FormText {
background-color:'#org-eclipse-ui-workbench-DARK_BACKGROUND';
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
Table,
Tree,
RegistryFilteredTree {
background-color:inherit;
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
Hyperlink,
ImageHyperlink {
background-color: inherit;
color: #6fc5ee;
}
ViewerPane,
DrillDownComposite {
background-color: #232323;
color: #CCC;
}
ProgressInfoItem,
ProgressInfoItem > *,
CompareViewerPane,
CompareViewerPane > * {
background-color: inherit;
color: '#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
ProgressIndicator {
background-color: #777;
color: '#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
DiscoveryItem,
DiscoveryItem Label,
DiscoveryItem Composite {
background-color: #383C3E;
color: #dddddd;
}
DiscoveryItem StyledText {
background-color: #383C3E;
color: #aaaaaa;
}
DiscoveryItem Link {
background-color: #383C3E;
color: #8B9498;
}
CatalogSwitcher,
CatalogSwitcher > ScrolledComposite > Composite > Composite /* ignored because hard-coded */,
CategoryItem {
background-color: '#org-eclipse-ui-workbench-DARK_BACKGROUND';
color: #dddddd;
}
GradientCanvas,
GradientCanvas > Label {
background-color: #3f4447;
color: #9ac9d8;
}
GradientCanvas {
/* SWT-BUG workaround: GradientCanvas background-color is ignored */
background: #3f4447;
}
CategoryItem > GradientCanvas,
CategoryItem > GradientCanvas > Label {
/* SWT-BUG workaround: a style for background is not applied on GradientCanvas (CSS engine repaint issue) */
background-color: #fafafa;
color: #333;
}
CategoryItem > GradientCanvas {
/* SWT-BUG workaround: a style for background is not applied on GradientCanvas (CSS engine repaint issue) */
background: #fafafa;
background-image: #333;
}
WebSite {
background-color: #41464A;
color: #dddddd;
}
Form,
FormHeading {
background-color: #505F70;
color: #9AC9D8;
}
Form {
/* Bug 465148: Additional styling for the Form */
text-background-color: #505F70;
tb-toggle-hover-color: #313538;
tb-toggle-color: #313538;
h-hover-full-color: #313538;
h-hover-light-color: #313538;
h-bottom-keyline-2-color: #313538;
h-bottom-keyline-1-color: #313538;
/* We also have to force the background mode (the
* Label/ToolBar in the heading should inherit it).
*/
swt-background-mode: 'force';
}
Section {
background-color: #4F5355;
color: #AEBED0;
background-color-titlebar: #4F5355;
background-color-gradient-titlebar: #4F5355;
border-color-titlebar: #4F5355;
swt-titlebar-color: #cccccc;
tb-toggle-hover-color: #F4F7F7;
tb-toggle-color: #F4F7F7;
}
Table,
Tree {
swt-header-color: #CCC;
swt-header-background-color: #383D3F;
}
Twistie {
color: #E8E4DF;
}
.MPartSashContainer {
background-color: '#org-eclipse-ui-workbench-DARK_BACKGROUND';
color: #EEEEEE;
}
HeapStatus {
background-color: #4F5355;
color: #EEEEEE;
}
PageSiteComposite, PageSiteComposite > CImageLabel {
color: #EEEEEE;
}
PageSiteComposite > PropertyTable {
background-color: #333;
color: #EEEEEE;
}
PageSiteComposite > PropertyTable:disabled {
/* SWT-BUG: event is triggered but styles for PropertyTable are hard-coded */
background-color: #444;
color: #EEEEEE;
}
/* See Bug 430848: We need to override the theme of the Eclipse splash screen, because
* otherwise the splash screen would be partly switched to the dark theme during startup,
* which does not look very nice.
*/
Label#org-eclipse-ui-splash-progressText {
background-color: inherit; /* transparent */
color: #9c9696; /* see property startupForegroundColor in the product */
}
Label#org-eclipse-ui-buildid-text {
background-color: inherit; /* transparent */
}
ProgressIndicator#org-eclipse-ui-splash-progressIndicator {
background-color: #e1e1e1;
}
Link {
swt-link-foreground-color: '#org-eclipse-ui-workbench-LINK_COLOR'
}
ExpandableComposite {
swt-titlebar-color: #cccccc;
tb-toggle-hover-color: #F4F7F7;
tb-toggle-color: #F4F7F7;
}
TabbedPropertyTitle > CLabel{
color: #9AC9D8;
}
TabbedPropertyTitle {
swt-backgroundGradientStart-color: #505F70;
swt-backgroundGradientEnd-color: #505F70;
swt-backgroundBottomKeyline1-color: #505F70;
swt-backgroundBottomKeyline2-color: #505F70;
}
TabbedPropertyList {
swt-tabNormalShadow-color : '#org-eclipse-ui-workbench-INACTIVE_TAB_OUTLINE_COLOR'; /* color of shadow lines around the tabs */
swt-tabDarkShadow-color : '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR'; /* line color of the tiny scroll triangle (at top / at bottom) */
swt-tabAreaBackground-color : '#org-eclipse-ui-workbench-DARK_BACKGROUND'; /*same as canvas*/
swt-tabBackground-color : '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START';
color : '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR'; /* text color in the tab / tab area */
}
.TalendPaletteCls {
tPalette-collapsed-forground-color: #515658;
tPalette-collapsed-background-color: #515658;
tPalette-mouseOver-forground-color1:#cccccc;
tPalette-mouseOver-forground-color2:#cccccc;
tPalette-mouseOver-forground-color3:#cccccc;
tPalette-mouseOver-background-color1:#3c8ad2;
tPalette-mouseOver-background-color2:#3c8ad2;
tPalette-mouseOver-background-color3:#3c8ad2; /* */
tPalette-expanded-background-color: black;
/* tPalette-expanded-background-color:#0069d9; /* background color when level is selected */
tPalette-collapse-topBorder-forground-lineColor1:'#org-eclipse-ui-workbench-DARK_BACKGROUND'; /* top border */
tPalette-collapse-topBorder-forground-lineColor2: #2F2F2F; /* top border */
tPalette-collapse-expanded-forground-lineColor: #2F2F2F; /* bottom border */
tPalette-collapse-notExpanded-forground-lineColor: #2F2F2F; /* bottom border */
tPalette-scroll-pane-list-border:0 0 0 0;
tPalette-scroll-pane-border:0 0 0 0;
tPalette-color-increment:10; /* color increment in palette depth */
tPalette-x-offset:17;
tPalette-entryEditPart-entry-color-inheritFromParent:true;
tPalette-searchButton-background-color:'#org-eclipse-ui-workbench-DARK_BACKGROUND';
}

View File

@@ -0,0 +1,212 @@
/*******************************************************************************
* Copyright (c) 2010, 2014 Andrea Guarinoni and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
* Andrea Guarinoni - initial API and implementation
*******************************************************************************/
/* ColorDefinitions for the dark theme for the Eclipse IDE
*
* ThemeExtensions and ColorDefinition are mapped to the Colors and Fonts preference
* dialog in the IDE
*/
ThemesExtension { color-definition:
'#org-eclipse-ui-workbench-DARK_BACKGROUND',
'#org-eclipse-ui-workbench-DARK_FOREGROUND',
'#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START',
'#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END',
'#org-eclipse-ui-workbench-INACTIVE_TAB_BG_START',
'#org-eclipse-ui-workbench-INACTIVE_TAB_BG_END',
'#org-eclipse-ui-workbench-INACTIVE_TAB_OUTER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-INACTIVE_TAB_INNER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-INACTIVE_TAB_OUTLINE_COLOR',
'#org-eclipse-ui-workbench-INACTIVE_TAB_TEXT_COLOR',
'#org-eclipse-ui-workbench-INACTIVE_TAB_UNSELECTED_TEXT_COLOR',
'#org-eclipse-ui-workbench-INACTIVE_TAB_SELECTED_TEXT_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START',
'#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END',
'#org-eclipse-ui-workbench-ACTIVE_TAB_BG_START',
'#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END',
'#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_TAB_INNER_KEYLINE_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_TAB_TEXT_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_TAB_UNSELECTED_TEXT_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_TAB_SELECTED_TEXT_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START',
'#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END',
'#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_TEXT_COLOR',
'#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR',
'#org-eclipse-ui-workbench-LINK_COLOR';
}
ColorDefinition#org-eclipse-ui-workbench-DARK_BACKGROUND {
color: #515658;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=DARK_BACKGROUND');
}
ColorDefinition#org-eclipse-ui-workbench-DARK_FOREGROUND {
color: #eeeeee;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=DARK_FOREGROUND');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_START {
color: #515658;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_UNSELECTED_TABS_COLOR_START');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_UNSELECTED_TABS_COLOR_END {
color: #464649;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_UNSELECTED_TABS_COLOR_END');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_BG_START {
color: #3B4042;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_BG_START');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_BG_END {
color: #313538;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_BG_END');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_OUTER_KEYLINE_COLOR {
color: #515658;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_OUTER_KEYLINE_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_INNER_KEYLINE_COLOR {
color: #515658;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_INNER_KEYLINE_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_OUTLINE_COLOR {
color: #3B4042;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_OUTLINE_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_TEXT_COLOR {
color: #BBBBBB;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_UNSELECTED_TEXT_COLOR {
color: #BBBBBB;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_UNSELECTED_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-INACTIVE_TAB_SELECTED_TEXT_COLOR {
color: #FFFFFF;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=INACTIVE_TAB_SELECTED_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START {
color: #494A4D;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_UNSELECTED_TABS_COLOR_START');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END {
color: #404043;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_UNSELECTED_TABS_COLOR_END');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_BG_START {
color: #2B2C2D;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_BG_START');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END {
color: #292929;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_BG_END');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR {
color: #4B4C4F;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_OUTER_KEYLINE_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_INNER_KEYLINE_COLOR {
color: #4B4C4F;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_INNER_KEYLINE_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR {
color: #4B4C4F;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_OUTLINE_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_TEXT_COLOR {
color: #DDDDDD;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_UNSELECTED_TEXT_COLOR {
color: #DDDDDD;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_UNSELECTED_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_TAB_SELECTED_TEXT_COLOR {
color: #f7f8f8;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_TAB_SELECTED_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_START {
color: #2B2C2D;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_NOFOCUS_TAB_BG_START');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_BG_END {
color: #292929;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_NOFOCUS_TAB_BG_END');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_TEXT_COLOR {
color: #CCCCCC;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_NOFOCUS_TAB_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR {
color: #CCCCCC;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR');
}
ColorDefinition#org-eclipse-ui-workbench-LINK_COLOR {
color: #6FC5EE;
category: '#org-eclipse-ui-presentation-default';
label: url('platform:/plugin/org.talend.themes.css.talend?message=LINK_COLOR');
}

View File

@@ -0,0 +1,141 @@
/*******************************************************************************
* Copyright (c) 2010, 2014 Andrea Guarinoni and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Andrea Guarinoni <andrea.guarinoni.dev@outlook.com> - initial API and implementation
* Lars Vogel - initial API and implementation
*******************************************************************************/
/* ################################ CSS for .MParts ########################## */
.MPart {
font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT';
background-color: #292929;
color: #DDDDDD;
}
.MPart.busy {
font-style: italic;
}
.MPart.highlighted {
font-weight: bold;
}
.MPart Composite,
.MPart Composite > *,
.MPart Composite > * > *,
.MPart Label,
.MPart ScrolledForm,
.MPart Form,
.MPart Section,
.MPart FormText,
.MPart Link,
.MPart Sash,
.MPart Button,
.MPart Group,
.MPart SashForm,
.MPart Tree,
.MPart FilteredTree,
.MPart RegistryFilteredTree,
.MPart PageSiteComposite,
.MPart DependenciesComposite,
.MPart Text[style~='SWT.READ_ONLY'],
.MPart FigureCanvas,
.MPart ListEditorComposite,
.MPart ScrolledComposite,
.Mpart ScrolledComposite ProgressInfoItem,
.MPart Form ScrolledPageBook,
.MPart DependenciesComposite > SashForm > Section > * { /* Section > DependenciesComposite$... */
background-color: #2F2F2F;
color: #AAAAAA;
}
.MPart Section > Label {
background-color: #2F2F2F;
color: #ABCEDA;
}
.MPart Table,
.MPart Browser,
.Mpart OleFrame,
.MPart ViewForm,
.MPart ViewForm > CLabel,
.MPart PageBook > Label,
.MPart PageBook > SashForm {
background-color: #313538;
color: #CCC;
}
.MPart Section Tree {
background-color: #383A3B;
color: #DDDDDD;
}
.MPart DatePicker,
.MPart DatePicker > Text,
.MPart ScheduleDatePicker,
.MPart ScheduleDatePicker > Text,
.MPart CCombo,
.MPart Spinner,
.MPart Composite > StyledText,
.MPart PageBook > SashForm Label,
.MPart SashForm > Text[style~='SWT.BORDER'] {
background-color: #3f4447;
color: #BBBBBB;
}
.MPart FormHeading,
.MPart FormHeading > TitleRegion,
.MPart FormHeading > TitleRegion > Label,
.MPart FormHeading > TitleRegion > StyledText {
background-color: #505f70;
color: #9ac9d8;
}
.MPart FormHeading,
.MPart FormHeading > TitleRegion {
swt-background-mode: none;
}
.MPart FormHeading > CLabel {
background-color: #505f70;
color: #E98787;
}
/* ------------------------------------------------------------- */
#org-eclipse-jdt-ui-SourceView StyledText,
#org-eclipse-wst-jsdt-ui-SourceView StyledText {
background-color: #252525;
}
/* ------------------------------------------------------------- */
#org-eclipse-ui-console-ConsoleView .MPart > Composite,
#org-eclipse-ui-console-ConsoleView .MPart StyledText,
#org-eclipse-ui-console-ConsoleView .MPart PageBook Label {
background-color: #2F2F2F;
color: #CCCCCC;
}
/* ------------------------------------------------------------- */
#org-eclipse-e4-ui-compatibility-editor Canvas {
background-color: inherit;
}
#org-eclipse-e4-ui-compatibility-editor LayoutCanvas {
background-color: #252525;
color: #CCCCCC;
}

View File

@@ -0,0 +1,76 @@
/*******************************************************************************
* Copyright (c) 2014, 2015 Lars Vogel and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Lars Vogel <Lars.Vogel@gmail.com> - initial API and implementation
* Andrea Guarinoni - intial color schema definition
* Lars Vogel <Lars.Vogel@vogella.com> - Ongoing maintenance
*******************************************************************************/
/* ############################## Eclipse UI properties ############################## */
IEclipsePreferences#org-eclipse-ui-editors:org-talend-themes-css-talend { /* pseudo attribute added to allow contributions without replacing this node, see Bug 466075 */
preferences:
'AbstractTextEditor.Color.Background.SystemDefault=false'
'AbstractTextEditor.Color.SelectionForeground.SystemDefault=false'
'AbstractTextEditor.Color.SelectionBackground.SystemDefault=false'
'AbstractTextEditor.Color.Background=47,47,47'
'AbstractTextEditor.Color.Foreground.SystemDefault=false'
'AbstractTextEditor.Color.SelectionBackground=33,66,131'
'AbstractTextEditor.Color.SelectionForeground=147,161,161'
'AbstractTextEditor.Color.Foreground=204,204,204'
'AbstractTextEditor.Color.FindScope=30,120,155'
'asOccurencesIndicationColor=72,72,72'
'breakpointIndicationColor=51,119,193'
'currentIPColor=90,90,90'
'currentLineColor=55,55,55'
'deletionIndicationColor=224,226,228'
'filteredSearchResultIndicationColor=27,98,145'
'hyperlinkColor=102,175,249'
'hyperlinkColor.SystemDefault=false'
'infoIndicationColor=86,194,170'
'lineNumberColor=119,145,154'
'linked.slave.color=66,156,255'
'matchingTagIndicationColor=72,72,72'
'occurrenceIndicationColor=27,98,145'
'overrideIndicatorColor=78,120,117'
'printMarginColor=81,86,88'
'searchResultHighlighting=false'
'searchResultIndication=true'
'searchResultIndicationColor=94,94,94'
'searchResultTextStyle=BOX'
'secondaryIPColor=90,90,90'
'spellingIndicationColor=253,170,211'
'writeOccurrenceIndicationColor=27,98,145'
}
IEclipsePreferences#org-eclipse-ui-workbench:org-talend-themes-css-talend { /* pseudo attribute added to allow contributions without replacing this node, see Bug 466075 */
preferences:
'ACTIVE_HYPERLINK_COLOR=138,201,242'
'CONFLICTING_COLOR=240,15,66'
'CONTENT_ASSIST_BACKGROUND_COLOR=52,57,61'
'CONTENT_ASSIST_FOREGROUND_COLOR=238,238,238'
'org.eclipse.ui.workbench.INFORMATION_BACKGROUND=81,86,88'
'org.eclipse.ui.workbench.INFORMATION_FOREGROUND=238,238,238'
'org.eclipse.ui.workbench.HOVER_BACKGROUND=52,57,61'
'org.eclipse.ui.workbench.HOVER_FOREGROUND=238,238,238'
'ERROR_COLOR=247,68,117'
'HYPERLINK_COLOR=111,197,238'
'INCOMING_COLOR=31,179,235'
'OUTGOING_COLOR=238,238,238'
'RESOLVED_COLOR=108,210,17'
'EDITION_COLOR=238,238,238'
'org.eclipse.search.ui.match.highlight=206,92,0'
'org.eclipse.ui.editors.rangeIndicatorColor=27,118,153'
'org.eclipse.jface.REVISION_NEWEST_COLOR=75,44,3'
'org.eclipse.jface.REVISION_OLDEST_COLOR=154,113,61'
}

View File

@@ -0,0 +1,97 @@
/*******************************************************************************
* Copyright (c) 2018 Andrea Guarinoni and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Andrea Guarinoni <andrea.guarinoni.dev@outlook.com> - initial API and implementation
* Lars Vogel - initial API and implementation
*******************************************************************************/
/* ################################ CSS for Tabs ########################## */
#org-eclipse-ui-editorss {
swt-tab-height: 8px;
}
.MPartStack {
font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT';
swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
swt-shadow-visible: false;
}
CTabFolder {
/* Set the styles for the inner tabs: */
color: '#org-eclipse-ui-workbench-INACTIVE_TAB_TEXT_COLOR';
swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
swt-tab-outline: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTLINE_COLOR'; /* border color for selected tab */
swt-outer-keyline-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_OUTER_KEYLINE_COLOR'; /* border color for whole tabs container */
swt-unselected-tabs-color: '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_START' '#org-eclipse-ui-workbench-ACTIVE_UNSELECTED_TABS_COLOR_END' 100% 100%; /* title background for unselected tab */
swt-selected-tab-fill: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END'; /* title background for selected tab */
swt-shadow-visible: false;
swt-unselected-hot-tab-color-background: #161616; /* Bug 465711 */
swt-selected-tab-highlight: none;
}
CTabFolder[style~='SWT.DOWN'][style~='SWT.BOTTOM'] {
/* Set the styles for the bottom inner tabs (Bug 430051): */
swt-tab-renderer: url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
swt-unselected-hot-tab-color-background: #161616; /* Bug 465711 */
swt-selected-tab-highlight: #316c9b;
swt-selected-highlight-top: false;
}
CTabFolder.active {
swt-selected-tab-highlight: #316c9b;
swt-selected-highlight-top: false;
}
CTabItem,
CTabItem CLabel {
background-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END'; /* HACK for background of CTabFolder inner Toolbars */
color: '#org-eclipse-ui-workbench-INACTIVE_TAB_UNSELECTED_TEXT_COLOR';
}
CTabItem:selected,
CTabItem:selected CLabel {
color: '#org-eclipse-ui-workbench-INACTIVE_TAB_SELECTED_TEXT_COLOR';
}
.MPartStack.active > CTabItem,
.MPartStack.active > CTabItem CLabel {
background-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END'; /* HACK for background of CTabFolder inner Toolbars */
color: '#org-eclipse-ui-workbench-ACTIVE_TAB_UNSELECTED_TEXT_COLOR';
}
.MPartStack.active > CTabItem:selected,
.MPartStack.active > CTabItem:selected CLabel {
color: '#org-eclipse-ui-workbench-ACTIVE_TAB_SELECTED_TEXT_COLOR';
}
.MPartStack.active.noFocus > CTabItem:selected {
color: '#org-eclipse-ui-workbench-ACTIVE_NOFOCUS_TAB_SELECTED_TEXT_COLOR';
}
CTabFolder > Composite#ToolbarComposite {
background-color: '#org-eclipse-ui-workbench-ACTIVE_TAB_BG_END'; /* HACK for background of CTabFolder inner Toolbars */
}
CTabFolder.MArea CTabItem,
CTabFolder.MArea CTabItem CLabel {
background-color: '#org-eclipse-ui-workbench-DARK_BACKGROUND'; /* Disable HACK for background of CTabFolder inner Toolbars */
}
CTabItem.busy {
color: #888888;
}
CTabFolder.MArea .MPartStack,CTabFolder.MArea .MPartStack.active {
swt-shadow-visible: false;
}

View File

@@ -0,0 +1,47 @@
/*******************************************************************************
* Copyright (c) 2010, 2014 Andrea Guarinoni and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Andrea Guarinoni <andrea.guarinoni.dev@outlook.com> - initial API and implementation
* Lars Vogel - initial API and implementation
*******************************************************************************/
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/common/e4_globalstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_ide_colorextensions.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_globalstyle.css"); /* Remove this to have ONLY the main IDE shell dark */
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_partstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_tabstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark-drag-styling.css");
CTabFolder Canvas {
background-color: #2F2F2F;
color: #CCC;
}
CTabFolder Scale {
background-color: inherit;
}
.MPartStack.active CTabFolder Canvas {
background-color: #262626;
color: #CCC;
}
/* #################### Bottom Status Bar ######################## */
StatusLine,
ImageBasedFrame,
#org-eclipse-ui-StatusLine,
#org-eclipse-ui-StatusLine CLabel,
#org-eclipse-ui-ProgressBar,
#org-eclipse-ui-ProgressBar Canvas {
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}

View File

@@ -0,0 +1,55 @@
/*******************************************************************************
* Copyright (c) 2010, 2019 Andrea Guarinoni and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Andrea Guarinoni <andrea.guarinoni.dev@outlook.com> - initial API and implementation
*******************************************************************************/
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/common/e4_globalstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_ide_colorextensions.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_globalstyle.css"); /* Remove this to have ONLY the main IDE shell dark */
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_partstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_tabstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark-drag-styling.css");
.MPartStack.active CTabFolder Canvas {
background-color: #262626;
color: #CCC;
}
/* #################### Bottom Status Bar ######################## */
StatusLine,
ImageBasedFrame,
#org-eclipse-ui-StatusLine,
#org-eclipse-ui-StatusLine CLabel,
#org-eclipse-ui-ProgressBar,
#org-eclipse-ui-ProgressBar Canvas {
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
/* ###################### Global Styles ########################## */
/* Use unset to set the foreground/background color to null */
Table[swt-lines-visible=true] {
background-color: unset;
}
Tree[swt-lines-visible=true] {
background-color: unset;
}
Button {
background-color: unset;
color: unset;
}

View File

@@ -0,0 +1,80 @@
/*******************************************************************************
* Copyright (c) 2010, 2014 Andrea Guarinoni and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Andrea Guarinoni <andrea.guarinoni.dev@outlook.com> - initial API and implementation
*******************************************************************************/
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/common/e4_globalstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_ide_colorextensions.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_globalstyle.css"); /* Remove this to have ONLY the main IDE shell dark */
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_partstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_tabstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark-drag-styling.css");
CTabFolder Canvas {
background-color: #2F2F2F;
color: #CCC;
}
.MPartStack.active CTabFolder Canvas {
background-color: #262626;
color: #CCC;
}
/* #################### Bottom Status Bar ######################## */
StatusLine,
ImageBasedFrame,
#org-eclipse-ui-StatusLine,
#org-eclipse-ui-StatusLine CLabel,
#org-eclipse-ui-ProgressBar,
#org-eclipse-ui-ProgressBar Canvas {
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
/* ###################### Global Styles ########################## */
TabFolder {
/* background-color is not applied to the whole button,
but text color is changed, so it appear light on light */
background-color: '#org-eclipse-ui-workbench-DARK_BACKGROUND';
color: #222;
}
Button {
/* background-color is not applied to the whole button,
but text color is changed, so it appear light on light */
background-color: #2F2F2F;
color: #CCCCCC;
}
Button[style~='SWT.CHECK'] {
/* currently, Button object isn't consistent (eg. also a checkbox is seen as Button) */
/* so, css rules applied to Button have to be overridden for non-Button matches */
background-color: '#org-eclipse-ui-workbench-DARK_BACKGROUND';
color: #ddd;
}
Button[style~='SWT.RADIO'] {
/* currently, Button object isn't consistent (eg. also a checkbox is seen as Button) */
/* so, css rules applied to Button have to be overridden for non-Button matches */
background-color: '#org-eclipse-ui-workbench-DARK_BACKGROUND';
color: #ddd;
}
Combo {
background-color: #949DA5;
color: #222; /* background of drop-drown list is hard-coded to white */
}
Combo:selected {
background-color: #41464A;
color: #FFF;
}

View File

@@ -0,0 +1,120 @@
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/common/e4_globalstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_ide_colorextensions.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_globalstyle.css"); /* Remove this to have ONLY the main IDE shell dark */
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_partstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark_tabstyle.css");
@import url("platform:/plugin/org.talend.themes.css.talend/themes/dark/dark/e4-dark-drag-styling.css");
CTabFolder Canvas {
background-color: #2F2F2F;
color: #CCC;
}
CTabFolder Scale {
background-color: inherit;
}
.MPartStack.active CTabFolder Canvas {
background-color: #262626;
color: #CCC;
}
.MPartStack.active Table {
background-color: #2F2F2F;
color: #CCC;
}
Tree, Table {
swt-lines-visible: false;
}
/* ##################### Bottom Status Bar ####################### */
StatusLine,
ImageBasedFrame,
#org-eclipse-ui-StatusLine,
#org-eclipse-ui-StatusLine CLabel,
#org-eclipse-ui-ProgressBar,
#org-eclipse-ui-ProgressBar Canvas {
color:'#org-eclipse-ui-workbench-DARK_FOREGROUND';
}
/* ####################### CSS for .MParts ####################### */
.MPart Form Section,
.MPart Form Label,
.MPart Form FormText,
.MPartStack .MPart Form MasterDetailsBlock-MDSashForm,
.MPartStack .MPart Form SashForm,
.MPartStack .MPart Form Sash,
.MPart Form Button[style~='SWT.CHECK'],
.MPart Form Button[style~='SWT.RADIO'],
.MPartStack.active .MPart Form Section,
.MPartStack.active .MPart Form Label,
.MPartStack.active .MPart Form FormText,
.MPartStack.active .MPart Form MasterDetailsBlock-MDSashForm,
.MPartStack.active .MPart Form SashForm,
.MPartStack.active .MPart Form Sash,
.MPartStack.active .MPart Form Button[style~='SWT.CHECK'],
.MPartStack.active .MPart Form Button[style~='SWT.RADIO']
{
background-color: inherit;
color: #f4f7f7;
}
/* Make the content of the Form brighter because the color of
the font of some widgets is hard-coded to be black on Window */
.MPart Form,
.MPart Form Link,
.MPart Form Button,
.MPart Form Group,
.MPart Form ScrolledPageBook,
.MPart Form DependenciesComposite,
.MPart Form ListEditorComposite,
.MPart Form Text[style~='SWT.READ_ONLY'],
.MPart Form DependenciesComposite > SashForm > Section > *, /* Section > DependenciesComposite$... */
.MPartStack.active .MPart Form,
.MPartStack.active .MPart Form Link,
.MPartStack.active .MPart Form Button,
.MPartStack.active .MPart Form Group,
.MPartStack.active .MPart Form ScrolledPageBook,
.MPartStack.active .MPart Form DependenciesComposite,
.MPartStack.active .MPart Form ListEditorComposite,
.MPartStack.active .MPart Form Text[style~='SWT.READ_ONLY'],
.MPartStack.active .MPart Form DependenciesComposite > SashForm > Section > * { /* Section > DependenciesComposite$... */
background-color: #4f5355;
color: #f4f7f7;
}
#org-eclipse-help-ui-HelpView Form,
#org-eclipse-help-ui-HelpView Form Sash,
#org-eclipse-help-ui-HelpView Form Label,
#org-eclipse-help-ui-HelpView Form Section,
#org-eclipse-help-ui-HelpView Form FormText,
#org-eclipse-help-ui-HelpView Form Button,
#org-eclipse-help-ui-HelpView Form Group,
#org-eclipse-help-ui-HelpView Form ScrolledPageBook,
#org-eclipse-help-ui-HelpView Form Text[style~='SWT.READ_ONLY'] {
background-color: #2F2F2F;
color: #CCCCCC;
}
.MPartStack.active #org-eclipse-help-ui-HelpView Form,
.MPartStack.active #org-eclipse-help-ui-HelpView Form Sash,
.MPartStack.active #org-eclipse-help-ui-HelpView Form Label,
.MPartStack.active #org-eclipse-help-ui-HelpView Form Section,
.MPartStack.active #org-eclipse-help-ui-HelpView Form FormText,
.MPartStack.active #org-eclipse-help-ui-HelpView Form Button,
.MPartStack.active #org-eclipse-help-ui-HelpView Form Group,
.MPartStack.active #org-eclipse-help-ui-HelpView Form ScrolledPageBook,
.MPartStack.active #org-eclipse-help-ui-HelpView Form Text[style~='SWT.READ_ONLY'] {
background-color: #262626;
color: #BBBBBB;
}
.MPart Form Section Tree,
.MPartStack.active .MPart Form Section Tree {
background-color: #313538;
color: #DDDDDD;
}

View File

@@ -9,6 +9,14 @@
font-family: '#org-eclipse-ui-workbench-TAB_TEXT_FONT';
}
Shell {
REPO_STABLE_SECONDARY_ENTRY_COLOR: #646464;
REPO_STABLE_PRIMARY_ENTRY_COLOR: #000000;
REPO_INACTIVE_ENTRY_COLOR: #c8c8c8;
REPO_LOCKED_ENTRY: #c80000;
REPO_MERGED_REFERENCED_ITEMS_COLOR: #787878;
}
/**************************************************
* Global Color Setting
**************************************************/
@@ -648,7 +656,10 @@ CTabFolder.org-talend-rcp-abstractMultiPageEditor-footer CTabItem:selected {
.TalendStagingView StyledText {
background-color: COLOR-LIST-BACKGROUND;
}
Table {
background-color: #ff0000;
swt-header-color: #00ff00;
}
/**************************************************
* Palette
**************************************************/
@@ -657,7 +668,7 @@ CTabFolder.org-talend-rcp-abstractMultiPageEditor-footer CTabItem:selected {
tPalette-collapsed-background-color:white;
tPalette-mouseOver-forground-color1:#ADADAD;
tPalette-mouseOver-forground-color2:#ADADAD;
tPalette-mouseOver-forground-color3:#ADADAD;
tPalette-mouseOver-forground-color3:black;
tPalette-mouseOver-background-color1:#ADADAD;
tPalette-mouseOver-background-color2:#ADADAD;
tPalette-mouseOver-background-color3:#ADADAD; /* */
@@ -678,6 +689,15 @@ CTabFolder.org-talend-rcp-abstractMultiPageEditor-footer CTabItem:selected {
tPalette-searchButton-image:url('./default/pics/studio_6.0-repo-search.png');
}
/* Repository tree */
.TalendRepositoryLabel {
STABLE_SECONDARY_ENTRY_COLOR: #646464;
STABLE_PRIMARY_ENTRY_COLOR: #000000;
INACTIVE_ENTRY_COLOR: #C8C8C8;
LOCKED_ENTRY: #C80000;
MERGED_REFERENCED_ITEMS_COLOR: #787878;
}
/**************************************************
* User Color and Font Changes
**************************************************/

View File

@@ -112,6 +112,7 @@
<module>main/plugins/org.talend.themes.css.talend</module>
<module>main/plugins/org.talend.designer.maven.tos/resources</module>
<module>main/plugins/org.talend.designer.maven.tos</module>
<module>main/plugins/org.talend.signon.util</module>
<module>main/plugins/org.talend.designer.maven.repo.tck</module>
<module>main/plugins/org.talend.designer.maven.repo.tcksdk</module>