Compare commits
131 Commits
release/8.
...
patch/TPS-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87fc7471dd | ||
|
|
abdbe7a669 | ||
|
|
345cf6c44b | ||
|
|
9f9a381bd7 | ||
|
|
f2599689ed | ||
|
|
3b647c2316 | ||
|
|
4ff0184a49 | ||
|
|
0e37b9632e | ||
|
|
f2a4328037 | ||
|
|
771a1bf810 | ||
|
|
3f7d1a83d9 | ||
|
|
c20078c3d1 | ||
|
|
d13ae7e637 | ||
|
|
6b094dd4fd | ||
|
|
1ebdb18d27 | ||
|
|
98930c8c96 | ||
|
|
a7ab220672 | ||
|
|
553b2770c9 | ||
|
|
dd851d3202 | ||
|
|
f47f991977 | ||
|
|
a2e44cb5c2 | ||
|
|
e36f0690f0 | ||
|
|
9c4a9c1589 | ||
|
|
da4ba3f1a0 | ||
|
|
087dac391d | ||
|
|
ab843f7a55 | ||
|
|
5949ce647d | ||
|
|
f9e7be104e | ||
|
|
774e6dea26 | ||
|
|
3eccad0352 | ||
|
|
ada4bcf7e3 | ||
|
|
7c72d190de | ||
|
|
025cec4828 | ||
|
|
91df21afcd | ||
|
|
a3af2de13a | ||
|
|
5c6fd374f1 | ||
|
|
c11aa42cee | ||
|
|
5506094ec3 | ||
|
|
a0a7b7cc52 | ||
|
|
0a7eb0653f | ||
|
|
baabcf9167 | ||
|
|
d24160aaf7 | ||
|
|
ff42b63947 | ||
|
|
bc536f772e | ||
|
|
6e88e334a3 | ||
|
|
5b86f87d99 | ||
|
|
11ff6ac63d | ||
|
|
a4679a906a | ||
|
|
a4a0bc0649 | ||
|
|
0709202ae3 | ||
|
|
899c5a03f6 | ||
|
|
5e1bca282f | ||
|
|
61a8ed2b73 | ||
|
|
ab88eda019 | ||
|
|
c4942af4b0 | ||
|
|
80ccccb407 | ||
|
|
4063e6888b | ||
|
|
54d1a85c1f | ||
|
|
a2c23dd110 | ||
|
|
9e56acd4e5 | ||
|
|
a9f5e42f6d | ||
|
|
e4250d1120 | ||
|
|
7225c51654 | ||
|
|
11bf826613 | ||
|
|
2039df6058 | ||
|
|
59147d2bf3 | ||
|
|
a272ce7fe3 | ||
|
|
d32d4c1c2c | ||
|
|
51ca13e2ee | ||
|
|
3d697f472c | ||
|
|
0dcd60f44b | ||
|
|
8f59c857d8 | ||
|
|
442631c61b | ||
|
|
31303fa608 | ||
|
|
fea26cbefa | ||
|
|
21254ffaca | ||
|
|
caa4b51cc4 | ||
|
|
b2fdccc3e7 | ||
|
|
da208c72f6 | ||
|
|
bd6a271805 | ||
|
|
cd5af34395 | ||
|
|
ba71689fac | ||
|
|
f6a123ad2b | ||
|
|
14d9caec2e | ||
|
|
96f177cb95 | ||
|
|
4a34141e6f | ||
|
|
9bf06c26bb | ||
|
|
51010064c7 | ||
|
|
d0a5c76459 | ||
|
|
4b308e1d34 | ||
|
|
b39332b706 | ||
|
|
556ab359d9 | ||
|
|
55f8537c15 | ||
|
|
98f0a248dc | ||
|
|
360c36b6bb | ||
|
|
c5e48b7e97 | ||
|
|
8b3040a4f6 | ||
|
|
fac09dcc63 | ||
|
|
f97757fa8e | ||
|
|
3a557a7658 | ||
|
|
00a777d477 | ||
|
|
eb661b81c5 | ||
|
|
557afc2b02 | ||
|
|
965a4d5a3b | ||
|
|
bde2e73cfa | ||
|
|
421dde4b8e | ||
|
|
037502c43c | ||
|
|
12345b5216 | ||
|
|
850a8cbdf6 | ||
|
|
fe6ed85b34 | ||
|
|
46a2aac8c1 | ||
|
|
424266a771 | ||
|
|
d2751b3e59 | ||
|
|
90aeb07148 | ||
|
|
ef76386e26 | ||
|
|
a76d9081dc | ||
|
|
6d10555da1 | ||
|
|
6aec89ed62 | ||
|
|
4d5c0aba06 | ||
|
|
156a67b79a | ||
|
|
0de0c82b35 | ||
|
|
83d720a6df | ||
|
|
bba3a2a7ff | ||
|
|
33e9a9bf7c | ||
|
|
865d4317ea | ||
|
|
8949a8291a | ||
|
|
620a43e169 | ||
|
|
6143714a75 | ||
|
|
613ec4e1ae | ||
|
|
c2f33ca3c7 | ||
|
|
ee7e8a0a32 |
55
PATCH_RELEASE_NOTE.md
Normal file
55
PATCH_RELEASE_NOTE.md
Normal file
@@ -0,0 +1,55 @@
|
||||
---
|
||||
version: 8.0.1
|
||||
module: https://talend.poolparty.biz/coretaxonomy/42
|
||||
product:
|
||||
- https://talend.poolparty.biz/coretaxonomy/183
|
||||
- https://talend.poolparty.biz/coretaxonomy/23
|
||||
---
|
||||
|
||||
# TPS-5573
|
||||
|
||||
| Info | Value |
|
||||
| ---------------- | ---------------- |
|
||||
| Patch Name | Patch\_20231204\_TPS-5573\_v1-8.0.1 |
|
||||
| Release date | 2023-12-04 |
|
||||
| Target version | 20211109\_1610-8.0.1 |
|
||||
| Product affected | Talend Studio |
|
||||
|
||||
## Introduction
|
||||
|
||||
This is a self-contained patch.
|
||||
|
||||
**NOTE**: For information on how to obtain this patch, reach out to your Support contact at Talend.
|
||||
|
||||
## Fixed issues
|
||||
|
||||
This patch contains the following fix:
|
||||
|
||||
- TDI-50317 [8.0.1] tFileInputPositional don't parse properly when pattern units field is set to Symbols
|
||||
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Consider the following requirements for your system:
|
||||
|
||||
- Must install Talend Studio 8.0.1 with the monthly released patch, Patch\_20230421\_R2023-04_v1-8.0.1.zip.
|
||||
- Or must update the Talend Studio 8.0.1 with the URL, https://update.talend.com/Studio/8/updates/R2023-04/.
|
||||
|
||||
## Installation
|
||||
|
||||
Installation On Studio:
|
||||
|
||||
1. Shut down Talend studio if it is opened.
|
||||
2. Extract the zip.
|
||||
3. Merge the folder "plugins" and its content to "{studio}/plugins" and overwrite the existing files.
|
||||
4. remove the folder "{studio}/configuration/org.eclipse.osgi".
|
||||
5. Start the Talend studio.
|
||||
6. Rebuild your jobs.
|
||||
|
||||
Installation On CI:
|
||||
|
||||
1. put the patch in a location that can be reached in CI environment.
|
||||
2. copy the patch to <product.path>/patches folder between executions of org.talend.ci:builder-maven-plugin:8.0.x:install and org.talend.ci:builder-maven-plugin:8.0.x:generateAllPoms command.
|
||||
3. if it's an automation task for CI/CD, use scripts to do the copy action.
|
||||
4. Run the CI/CD task.
|
||||
@@ -5,7 +5,6 @@
|
||||
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
|
||||
<license url="http://www.example.com/license">[Enter License Description here.]</license>
|
||||
<requires>
|
||||
<import plugin="org.bouncycastle.bcprov" version="1.70.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.cedarsoftware.json-io" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.fasterxml.jackson.core.jackson-annotations" version="2.9.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.fasterxml.jackson.core.jackson-core" version="2.9.8" match="greaterOrEqual"/>
|
||||
|
||||
@@ -9,4 +9,7 @@
|
||||
</parent>
|
||||
<artifactId>org.talend.utils.feature</artifactId>
|
||||
<packaging>eclipse-feature</packaging>
|
||||
<properties>
|
||||
<tycho.buildtimestamp.format>${timestamp}</tycho.buildtimestamp.format>
|
||||
</properties>
|
||||
</project>
|
||||
|
||||
@@ -4,4 +4,6 @@ bin.includes = META-INF/,\
|
||||
plugin.xml,\
|
||||
icons/,\
|
||||
icons1/,\
|
||||
.
|
||||
.,\
|
||||
resources/
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
|
||||
<extension
|
||||
point="org.eclipse.e4.ui.css.swt.theme">
|
||||
<stylesheet
|
||||
uri="resources/theme/light_preferencestyle.css">
|
||||
<themeid
|
||||
refid="org.talend.themes.css.talend.default"></themeid>
|
||||
</stylesheet>
|
||||
<stylesheet
|
||||
uri="resources/theme/dark_preferencestyle.css">
|
||||
<themeid
|
||||
refid="org.eclipse.e4.ui.css.theme.e4_dark"></themeid>
|
||||
</stylesheet>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/* ############################## Eclipse UI properties ############################## */
|
||||
|
||||
IEclipsePreferences#org-talend-common-ui-runtime:org-talend-common-ui-runtime { /* pseudo attribute added to allow contributions without replacing this node, see Bug 466075 */
|
||||
preferences:
|
||||
'table.background=#org-eclipse-ui-workbench-DARK_BACKGROUND'
|
||||
'table.foreground=#org-eclipse-ui-workbench-DARK_FOREGROUND'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/* ############################## Eclipse UI properties ############################## */
|
||||
|
||||
|
||||
IEclipsePreferences#org-talend-common-ui-runtime:org-talend-common-ui-runtime { /* pseudo attribute added to allow contributions without replacing this node, see Bug 466075 */
|
||||
preferences:
|
||||
'table.background=COLOR-LIST-BACKGROUND'
|
||||
'table.foreground=COLOR_LIST_FOREGROUND'
|
||||
}
|
||||
@@ -12,14 +12,22 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.runtime;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
/**
|
||||
* DOC cmeng class global comment. Detailled comment
|
||||
*/
|
||||
public interface ColorConstants {
|
||||
|
||||
static final String BUNDLE_ID_COMMON_UI_RUNTIME = "org.talend.common.ui.runtime";
|
||||
|
||||
static final String KEY_TABLE_BACKGROUND = "table.background";
|
||||
|
||||
static final String KEY_TABLE_FOREGROUND = "table.foreground";
|
||||
|
||||
static final Color WHITE_COLOR = new Color(null, 255, 255, 255);
|
||||
|
||||
static final Color GREY_COLOR = new Color(null, 215, 215, 215);
|
||||
@@ -29,6 +37,8 @@ public interface ColorConstants {
|
||||
static final Color YELLOW_COLOR = new Color(null, 255, 173, 37);// 254, 182, 84
|
||||
|
||||
static final Color RED_COLOR = new Color(null, new RGB(204, 87, 89));// 255
|
||||
|
||||
static final Color ERROR_FONT_COLOR = new Color(null, new RGB(255, 0, 0));// 255
|
||||
|
||||
static final Color VERTICAL_SEPERATOR_LINE_COLOR = new Color(null, 162, 179, 195);
|
||||
|
||||
@@ -45,4 +55,19 @@ public interface ColorConstants {
|
||||
|
||||
static final Color SUCCEED_COLOR = new Color(null, 221, 242, 217);
|
||||
|
||||
static Color getTableBackgroundColor() {
|
||||
return ITalendThemeService.getColor(ColorConstants.BUNDLE_ID_COMMON_UI_RUNTIME, ColorConstants.KEY_TABLE_BACKGROUND)
|
||||
.orElse(Display.getDefault().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
|
||||
}
|
||||
|
||||
static Color getTableForegroundColor() {
|
||||
return ITalendThemeService.getColor(ColorConstants.BUNDLE_ID_COMMON_UI_RUNTIME, ColorConstants.KEY_TABLE_FOREGROUND)
|
||||
.orElse(Display.getDefault().getSystemColor(SWT.COLOR_LIST_FOREGROUND));
|
||||
}
|
||||
|
||||
static Color getTableReadOnlyForegroundColor() {
|
||||
return ITalendThemeService.getColor("CONTEXT_TABLE_READONLY_FOREGROUND")
|
||||
.orElse(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.talend.commons.ui.runtime.exception.ExceptionServiceImpl;
|
||||
|
||||
public class CommonUIPlugin implements BundleActivator {
|
||||
|
||||
public static String BUNDLE_ID = "org.talend.common.ui.runtime";
|
||||
|
||||
private static Boolean fullyHeadless = null;
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.ui.runtime;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
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 {
|
||||
|
||||
public static String DEFAULT_PREFERENCE_ID = "org.eclipse.ui.workbench";
|
||||
|
||||
public static String THEME_PREFERENCE_ID = "org.eclipse.e4.ui.css.swt.theme";
|
||||
|
||||
/**
|
||||
* Get color from instance scope preference of default bundleId, which managed by theme; the standard way eclipse
|
||||
* uses
|
||||
*
|
||||
* @param prop
|
||||
* @return the Color, <font color="red">please <b>DON'T</b> dispose it, it is managed by JFaceResources</font>
|
||||
*/
|
||||
static Optional<Color> getColor(String prop) {
|
||||
return getColor(DEFAULT_PREFERENCE_ID, prop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color from instance scope preference of bundleId, which managed by theme; the standard way eclipse uses
|
||||
*
|
||||
* @param bundleId the instance scope preference which stores the prop
|
||||
* @param prop
|
||||
* @return the Color, <font color="red">please <b>DON'T</b> dispose it, it is managed by JFaceResources</font>
|
||||
*/
|
||||
static Optional<Color> getColor(String bundleId, String prop) {
|
||||
ITalendThemeService theme = get();
|
||||
if (theme != null) {
|
||||
return Optional.ofNullable(theme.getColorForTheme(bundleId, prop));
|
||||
}
|
||||
return Optional.ofNullable(null);
|
||||
}
|
||||
|
||||
Color getColorForTheme(String bundleId, String prop);
|
||||
|
||||
/**
|
||||
* Get property from instance scope preference of default bundleId, which managed by theme; the standard way eclipse
|
||||
* uses
|
||||
*
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
static Optional<String> getProperty(String key) {
|
||||
return getProperty(DEFAULT_PREFERENCE_ID, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get property from instance scope preference of bundleId, which managed by theme; the standard way eclipse uses
|
||||
*
|
||||
* @param bundleId the instance scope preference which stores the key
|
||||
* @param key
|
||||
* @return
|
||||
*/
|
||||
static Optional<String> getProperty(String bundleId, String key) {
|
||||
ITalendThemeService theme = get();
|
||||
String value = null;
|
||||
if (theme != null) {
|
||||
value = theme.getPropertyForTheme(bundleId, key);
|
||||
}
|
||||
if (StringUtils.isBlank(value)) {
|
||||
return Optional.ofNullable(null);
|
||||
} else {
|
||||
return Optional.ofNullable(value);
|
||||
}
|
||||
}
|
||||
|
||||
String getPropertyForTheme(String bundleId, String key);
|
||||
|
||||
static void addPropertyChangeListener(IPropertyChangeListener listener) {
|
||||
ITalendThemeService theme = get();
|
||||
if (theme != null) {
|
||||
theme.addPropertyChangeListenerFor(DEFAULT_PREFERENCE_ID, listener);
|
||||
}
|
||||
}
|
||||
|
||||
static void addPropertyChangeListener(String bundleId, IPropertyChangeListener listener) {
|
||||
ITalendThemeService theme = get();
|
||||
if (theme != null) {
|
||||
theme.addPropertyChangeListenerFor(bundleId, listener);
|
||||
}
|
||||
}
|
||||
|
||||
void addPropertyChangeListenerFor(String bundleId, IPropertyChangeListener listener);
|
||||
|
||||
static boolean containsPropertyChangeListener(String bundleId, IPropertyChangeListener listener) {
|
||||
ITalendThemeService theme = get();
|
||||
if (theme != null) {
|
||||
return theme.containsPropertyChangeListenerFor(bundleId, listener);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean containsPropertyChangeListenerFor(String bundleId, IPropertyChangeListener listener);
|
||||
|
||||
static void removePropertyChangeListener(IPropertyChangeListener listener) {
|
||||
ITalendThemeService theme = get();
|
||||
if (theme != null) {
|
||||
theme.removePropertyChangeListenerFor(DEFAULT_PREFERENCE_ID, listener);
|
||||
}
|
||||
}
|
||||
|
||||
static void removePropertyChangeListener(String bundleId, IPropertyChangeListener listener) {
|
||||
ITalendThemeService theme = get();
|
||||
if (theme != null) {
|
||||
theme.removePropertyChangeListenerFor(bundleId, listener);
|
||||
}
|
||||
}
|
||||
|
||||
void removePropertyChangeListenerFor(String bundleId, IPropertyChangeListener listener);
|
||||
|
||||
IPreferenceStore getThemePreferenceStore();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -96,7 +96,7 @@ ProposalUtils.CtrlProposal.ErrorMsg=\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5236\u
|
||||
RemovePushButton.RemoveButton.Tip=\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u3092\u524A\u9664
|
||||
ResetDBTypesButton.ResetDBTypesButton.Tip=DB\u30BF\u30A4\u30D7\u3092\u30EA\u30BB\u30C3\u30C8
|
||||
Rule.rule=\u30EB\u30FC\u30EB[{0}]
|
||||
SaveAsGenericSchemaPushButton.saveAsSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
|
||||
SaveAsGenericSchemaPushButton.saveAsSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
|
||||
SelectContextVariablesPushButton.Label=\u30B3\u30F3\u30C6\u30AF\u30B9\u30C8\u5909\u6570\u3092\u9078\u629E
|
||||
SWTCalendarWithTime.contentEvening=\u5915\u65B9
|
||||
SWTCalendarWithTime.contentHr=\u6642:
|
||||
|
||||
@@ -57,6 +57,8 @@ import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableColumn;
|
||||
import org.eclipse.swt.widgets.TableItem;
|
||||
import org.talend.commons.ui.runtime.ColorConstants;
|
||||
import org.talend.commons.ui.runtime.ITalendThemeService;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.swt.proposal.IShowInvisibleCellEditorMethods;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.behavior.DefaultHeaderColumnSelectionListener;
|
||||
@@ -291,7 +293,8 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
public TableViewerCreatorNotModifiable(Composite compositeParent) {
|
||||
super();
|
||||
this.compositeParent = compositeParent;
|
||||
this.emptyZoneColor = compositeParent.getDisplay().getSystemColor(SWT.COLOR_WHITE);
|
||||
this.emptyZoneColor = ITalendThemeService.getColor("org.talend.commons.ui.BgColorForEmptyArea")
|
||||
.orElse(compositeParent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
|
||||
|
||||
}
|
||||
|
||||
@@ -669,8 +672,22 @@ public class TableViewerCreatorNotModifiable<B> {
|
||||
table.addListener(SWTFacade.Paint, paintListener);
|
||||
}
|
||||
|
||||
setBackgroundColor(backgroundColor != null ? backgroundColor : table.getDisplay().getSystemColor(SWT.COLOR_WHITE));
|
||||
setForegroundColor(foregroundColor != null ? foregroundColor : table.getDisplay().getSystemColor(SWT.COLOR_BLACK));
|
||||
Color prefBackgroundColor = backgroundColor;
|
||||
if (prefBackgroundColor == null) {
|
||||
prefBackgroundColor = ColorConstants.getTableBackgroundColor();
|
||||
if (prefBackgroundColor == null) {
|
||||
prefBackgroundColor = table.getDisplay().getSystemColor(SWT.COLOR_WHITE);
|
||||
}
|
||||
}
|
||||
Color prefForegroundColor = foregroundColor;
|
||||
if (prefForegroundColor == null) {
|
||||
prefForegroundColor = ColorConstants.getTableForegroundColor();
|
||||
if (prefForegroundColor == null) {
|
||||
prefForegroundColor = table.getDisplay().getSystemColor(SWT.COLOR_BLACK);
|
||||
}
|
||||
}
|
||||
setBackgroundColor(prefBackgroundColor);
|
||||
setForegroundColor(prefForegroundColor);
|
||||
|
||||
if (useCustomItemColoring) {
|
||||
setUseCustomItemColoring(true);
|
||||
|
||||
@@ -12,9 +12,14 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.runtime.utils;
|
||||
|
||||
import org.eclipse.jface.resource.ColorRegistry;
|
||||
import org.eclipse.jface.resource.DataFormatException;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.resource.StringConverter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Device;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
/**
|
||||
@@ -102,4 +107,16 @@ public class TalendColorPalette {
|
||||
public static final java.awt.Color TERTIARY_ORANGE_AWT = new java.awt.Color(244, 175, 128);
|
||||
|
||||
public static final java.awt.Color TERTIARY_YELLOW_AWT = new java.awt.Color(255, 217, 143);
|
||||
|
||||
public static Color convertToColor(String rgbStr) throws DataFormatException {
|
||||
ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
|
||||
Color color = colorRegistry.get(rgbStr);
|
||||
if (color != null) {
|
||||
return color;
|
||||
}
|
||||
RGB rgb = StringConverter.asRGB(rgbStr);
|
||||
colorRegistry.put(rgbStr, rgb);
|
||||
return colorRegistry.get(rgbStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -283,6 +283,7 @@
|
||||
<KEYWORD1>smallint</KEYWORD1>
|
||||
<KEYWORD1>smallmoney</KEYWORD1>
|
||||
<KEYWORD1>text</KEYWORD1>
|
||||
<KEYWORD1>TIME</KEYWORD1>
|
||||
<KEYWORD1>timestamp</KEYWORD1>
|
||||
<KEYWORD1>tinyint</KEYWORD1>
|
||||
<KEYWORD1>uniqueidentifier</KEYWORD1>
|
||||
|
||||
@@ -36,6 +36,11 @@ public final class CommonExceptionHandler {
|
||||
Priority priority = getPriority(ex);
|
||||
process(ex, priority);
|
||||
}
|
||||
|
||||
public static void process(Throwable ex, String msg) {
|
||||
Priority priority = getPriority(ex);
|
||||
process(ex, msg, priority);
|
||||
}
|
||||
|
||||
public static void process(Throwable ex, Priority priority) {
|
||||
String message = ex.getMessage();
|
||||
@@ -43,6 +48,13 @@ public final class CommonExceptionHandler {
|
||||
log.log(priority, message, ex);
|
||||
|
||||
}
|
||||
|
||||
public static void process(Throwable ex, String msg, Priority priority) {
|
||||
String message = ex.getMessage() + ": " + msg;
|
||||
|
||||
log.log(priority, message, ex);
|
||||
|
||||
}
|
||||
|
||||
public static void log(String message) {
|
||||
log.log(Level.INFO, message);
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 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.model.emf;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
import org.eclipse.emf.ecore.xmi.XMLHelper;
|
||||
import org.eclipse.emf.ecore.xmi.XMLResource;
|
||||
import org.eclipse.emf.ecore.xmi.XMLSave;
|
||||
import org.eclipse.emf.ecore.xmi.impl.XMISaveImpl;
|
||||
import org.eclipse.emf.ecore.xmi.impl.XMLString;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class CustomXMIResource extends TalendXMIResource {
|
||||
|
||||
public static final String ENCODING = "UTF-8"; //$NON-NLS-1$
|
||||
|
||||
CustomXMISave xmiSave;
|
||||
|
||||
public CustomXMIResource() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CustomXMIResource(URI uri) {
|
||||
super(uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
encoding = ENCODING;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected XMLSave createXMLSave() {
|
||||
xmiSave = new CustomXMISave(createXMLHelper());
|
||||
return xmiSave;
|
||||
}
|
||||
|
||||
public String getResourceContent(Map<?, ?> options) {
|
||||
if (xmiSave == null) {
|
||||
createXMLSave();
|
||||
}
|
||||
return xmiSave.getXMLContent(this, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class CustomXMISave extends XMISaveImpl {
|
||||
|
||||
public CustomXMISave(XMLHelper helper) {
|
||||
super(helper);
|
||||
}
|
||||
|
||||
public String getXMLContent(XMLResource resource, Map<?, ?> options) {
|
||||
StringJoiner strJoin = new StringJoiner("");
|
||||
super.init(resource, options);
|
||||
super.traverse(resource.getContents());
|
||||
XMLString xmlString = this.doc;
|
||||
Iterator<String> iterator = xmlString.stringIterator();
|
||||
while (iterator.hasNext()) {
|
||||
String string = (String) iterator.next();
|
||||
if (string != null) {
|
||||
strJoin.add(string);
|
||||
}
|
||||
}
|
||||
return strJoin.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@@ -263,4 +264,12 @@ public class EmfHelper {
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String getEmfModelContent(EObject model) throws Exception {
|
||||
String content = "";
|
||||
CustomXMIResource xmiResource = new CustomXMIResource();
|
||||
xmiResource.getContents().add(model);
|
||||
content = xmiResource.getResourceContent(Collections.EMPTY_MAP);
|
||||
return content;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.util.regex.Pattern;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
|
||||
import org.eclipse.core.runtime.preferences.InstanceScope;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.runtime.utils.io.FileCopyUtils;
|
||||
|
||||
@@ -108,6 +109,7 @@ public class NetworkUtil {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.process(e, getCheckUrl());
|
||||
return false;
|
||||
} finally {
|
||||
conn.disconnect();
|
||||
@@ -120,7 +122,7 @@ public class NetworkUtil {
|
||||
if (StringUtils.isNotBlank(customUrl)) {
|
||||
return customUrl;
|
||||
} else {
|
||||
return "https://talend-update.talend.com/nexus/content/repositories/libraries/";
|
||||
return "https://talend-update.talend.com/nexus/content/groups/studio-libraries/";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +146,7 @@ public class NetworkUtil {
|
||||
conn.setRequestMethod("HEAD"); //$NON-NLS-1$
|
||||
conn.getResponseMessage();
|
||||
} catch (Exception e) {
|
||||
CommonExceptionHandler.process(e, urlString);
|
||||
// if not reachable , will throw exception(time out/unknown host) .So if catched exception, make it a
|
||||
// invalid server
|
||||
return false;
|
||||
|
||||
@@ -92,7 +92,7 @@ ProposalUtils.CtrlProposal.ErrorMsg=\u3053\u306E\u30BF\u30A4\u30D7\u306E\u5236\u
|
||||
RemovePushButton.RemoveButton.Tip=\u9078\u629E\u3057\u305F\u30A2\u30A4\u30C6\u30E0\u3092\u524A\u9664
|
||||
ResetDBTypesButton.ResetDBTypesButton.Tip=DB\u30BF\u30A4\u30D7\u3092\u30EA\u30BB\u30C3\u30C8
|
||||
Rule.rule=\u30EB\u30FC\u30EB[{0}]
|
||||
SaveAsGenericSchemaPushButton.saveAsSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
|
||||
SaveAsGenericSchemaPushButton.saveAsSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE\u3068\u3057\u3066\u4FDD\u5B58
|
||||
SelectContextVariablesPushButton.Label=\u30B3\u30F3\u30C6\u30AF\u30B9\u30C8\u5909\u6570\u3092\u9078\u629E
|
||||
SWTCalendarWithTime.contentEvening=\u5915\u65B9
|
||||
SWTCalendarWithTime.contentHr=\u6642:
|
||||
|
||||
@@ -18,12 +18,12 @@ import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.resource.StringConverter;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.ui.runtime.ITalendThemeService;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.scanner.ColoringScanner;
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ import org.talend.commons.ui.swt.colorstyledtext.scanner.ColoringScanner;
|
||||
*
|
||||
*/
|
||||
public class ColorManager {
|
||||
|
||||
|
||||
public static final RGB DEFAULT_STRING_COLOR = new RGB(0, 0, 0);
|
||||
|
||||
public static final RGB DEFAULT_KEYWORD1_COLOR = new RGB(50, 32, 160);
|
||||
@@ -106,15 +106,19 @@ public class ColorManager {
|
||||
}
|
||||
|
||||
public Color getColor(String colorName) {
|
||||
RGB prefColor = PreferenceConverter.getColor(store, colorName);
|
||||
Color color = null;
|
||||
if (colorMap.containsKey(colorName) && (colorMap.get(colorName)).getRGB().equals(prefColor)) {
|
||||
color = (Color) colorMap.get(colorName);
|
||||
Color prefColor = getThemeColor(colorName);
|
||||
if (colorMap.containsKey(colorName) && (colorMap.get(colorName)).equals(prefColor)) {
|
||||
return colorMap.get(colorName);
|
||||
} else {
|
||||
color = new Color(Display.getDefault(), prefColor);
|
||||
colorMap.put(colorName, color);
|
||||
colorMap.put(colorName, prefColor);
|
||||
}
|
||||
return color;
|
||||
return prefColor;
|
||||
}
|
||||
|
||||
private static Color getThemeColor(String colorName) {
|
||||
Color c = ITalendThemeService.getColor(colorName)
|
||||
.orElse(Display.getDefault().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
||||
return c;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
@@ -164,20 +168,20 @@ public class ColorManager {
|
||||
}
|
||||
|
||||
public static void initDefaultColors(IPreferenceStore store) {
|
||||
store.setDefault(NULL_COLOR, StringConverter.asString(DEFAULT_STRING_COLOR));
|
||||
store.setDefault(COMMENT1_COLOR, StringConverter.asString(DEFAULT_COMMENT1_COLOR));
|
||||
store.setDefault(COMMENT2_COLOR, StringConverter.asString(DEFAULT_COMMENT2_COLOR));
|
||||
store.setDefault(LITERAL1_COLOR, StringConverter.asString(DEFAULT_LITERAL1_COLOR));
|
||||
store.setDefault(LITERAL2_COLOR, StringConverter.asString(DEFAULT_LITERAL2_COLOR));
|
||||
store.setDefault(LABEL_COLOR, StringConverter.asString(DEFAULT_LABEL_COLOR));
|
||||
store.setDefault(KEYWORD1_COLOR, StringConverter.asString(DEFAULT_KEYWORD1_COLOR));
|
||||
store.setDefault(KEYWORD2_COLOR, StringConverter.asString(DEFAULT_KEYWORD2_COLOR));
|
||||
store.setDefault(KEYWORD3_COLOR, StringConverter.asString(DEFAULT_KEYWORD3_COLOR));
|
||||
store.setDefault(FUNCTION_COLOR, StringConverter.asString(DEFAULT_FUNCTION_COLOR));
|
||||
store.setDefault(MARKUP_COLOR, StringConverter.asString(DEFAULT_MARKUP_COLOR));
|
||||
store.setDefault(OPERATOR_COLOR, StringConverter.asString(DEFAULT_OPERATOR_COLOR));
|
||||
store.setDefault(DIGIT_COLOR, StringConverter.asString(DEFAULT_DIGIT_COLOR));
|
||||
store.setDefault(INVALID_COLOR, StringConverter.asString(DEFAULT_INVALID_COLOR));
|
||||
store.setDefault(NULL_COLOR, StringConverter.asString(getThemeColor(NULL_COLOR).getRGB()));
|
||||
store.setDefault(COMMENT1_COLOR, StringConverter.asString(getThemeColor(COMMENT1_COLOR).getRGB()));
|
||||
store.setDefault(COMMENT2_COLOR, StringConverter.asString(getThemeColor(COMMENT2_COLOR).getRGB()));
|
||||
store.setDefault(LITERAL1_COLOR, StringConverter.asString(getThemeColor(LITERAL1_COLOR).getRGB()));
|
||||
store.setDefault(LITERAL2_COLOR, StringConverter.asString(getThemeColor(LITERAL2_COLOR).getRGB()));
|
||||
store.setDefault(LABEL_COLOR, StringConverter.asString(getThemeColor(LABEL_COLOR).getRGB()));
|
||||
store.setDefault(KEYWORD1_COLOR, StringConverter.asString(getThemeColor(KEYWORD1_COLOR).getRGB()));
|
||||
store.setDefault(KEYWORD2_COLOR, StringConverter.asString(getThemeColor(KEYWORD2_COLOR).getRGB()));
|
||||
store.setDefault(KEYWORD3_COLOR, StringConverter.asString(getThemeColor(KEYWORD3_COLOR).getRGB()));
|
||||
store.setDefault(FUNCTION_COLOR, StringConverter.asString(getThemeColor(FUNCTION_COLOR).getRGB()));
|
||||
store.setDefault(MARKUP_COLOR, StringConverter.asString(getThemeColor(MARKUP_COLOR).getRGB()));
|
||||
store.setDefault(OPERATOR_COLOR, StringConverter.asString(getThemeColor(OPERATOR_COLOR).getRGB()));
|
||||
store.setDefault(DIGIT_COLOR, StringConverter.asString(getThemeColor(DIGIT_COLOR).getRGB()));
|
||||
store.setDefault(INVALID_COLOR, StringConverter.asString(getThemeColor(INVALID_COLOR).getRGB()));
|
||||
|
||||
String bold = BOLD_SUFFIX;
|
||||
store.setDefault(COMMENT1_COLOR + bold, false);
|
||||
|
||||
@@ -1,368 +1,384 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.ui.swt.colorstyledtext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.rules.IToken;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.ExtendedModifyEvent;
|
||||
import org.eclipse.swt.custom.ExtendedModifyListener;
|
||||
import org.eclipse.swt.custom.StyleRange;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.runtime.xml.XmlUtil;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.jedit.Mode;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.jedit.Modes;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.rules.CToken;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.scanner.ColoringScanner;
|
||||
import org.talend.commons.utils.threading.ExecutionLimiter;
|
||||
|
||||
/**
|
||||
* This component is an adaptation of a Color Editor for a StyledText.
|
||||
*
|
||||
* The original editor can be found on http://www.gstaff.org/colorEditor/ <br/>
|
||||
*
|
||||
* <b>How to use it, example :</b> <br/>
|
||||
* ColorStyledText text = new ColorStyledText(parent, SWT.H_SCROLL | SWT.V_SCROLL,
|
||||
* CorePlugin.getDefault().getPreferenceStore(), ECodeLanguage.PERL.getName());</i> <br/>
|
||||
* <br/>
|
||||
*
|
||||
* $Id: ColorStyledText.java 7183 2007-11-23 11:03:36Z amaumont $
|
||||
*
|
||||
*/
|
||||
public class ColorStyledText extends StyledText {
|
||||
|
||||
private final static int MAXIMUM_CHARACTERS_BEFORE_USE_TIMER = 1000;
|
||||
|
||||
private final ColorManager colorManager;
|
||||
|
||||
private final ColoringScanner scanner;
|
||||
|
||||
private final String languageMode;
|
||||
|
||||
private final MenuItem pasteItem;
|
||||
|
||||
private boolean coloring = true;
|
||||
|
||||
private UndoRedoManager undoRedoManager;
|
||||
|
||||
public ColorStyledText(Composite parent, int style, IPreferenceStore store, String languageMode) {
|
||||
super(parent, style);
|
||||
this.languageMode = languageMode;
|
||||
this.colorManager = new ColorManager(store);
|
||||
|
||||
/*
|
||||
* set the Shortcuts of the undo/redo
|
||||
*/
|
||||
this.setKeyBinding('Z' | SWT.CTRL, ActionCode.UNDO);
|
||||
this.setKeyBinding('Y' | SWT.CTRL, ActionCode.REDO);
|
||||
UndoRedoManager undoManager = new UndoRedoManager(50);
|
||||
undoManager.connect(this);
|
||||
this.setUndoManager(undoManager);
|
||||
|
||||
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
|
||||
Menu popupMenu = new Menu(this);
|
||||
|
||||
MenuItem redoItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
redoItem.setText(Messages.getString("ColorStyledText.RedoItem.Text")); //$NON-NLS-1$
|
||||
redoItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
redo();
|
||||
}
|
||||
});
|
||||
|
||||
MenuItem undoItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
undoItem.setText(Messages.getString("ColorStyledText.UndoItem.Text")); //$NON-NLS-1$
|
||||
undoItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
undo();
|
||||
}
|
||||
});
|
||||
|
||||
Image image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
|
||||
MenuItem copyItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
copyItem.setText(Messages.getString("ColorStyledText.CopyItem.Text")); //$NON-NLS-1$
|
||||
copyItem.setImage(image);
|
||||
copyItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
copy();
|
||||
}
|
||||
});
|
||||
|
||||
image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
|
||||
pasteItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
pasteItem.setText(Messages.getString("ColorStyledText.PasteItem.Text")); //$NON-NLS-1$
|
||||
pasteItem.setData(this);
|
||||
pasteItem.setImage(image);
|
||||
pasteItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
paste();
|
||||
}
|
||||
});
|
||||
pasteItem.setEnabled(getEditable());
|
||||
|
||||
this.setMenu(popupMenu);
|
||||
MenuItem selectAllItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
selectAllItem.setText(Messages.getString("ColorStyledText.SelectAllItem.Text")); //$NON-NLS-1$
|
||||
selectAllItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
selectAll();
|
||||
}
|
||||
});
|
||||
this.setMenu(popupMenu);
|
||||
|
||||
Listener selectAllListener = new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
if (event.character == '\u0001') { // CTRL + A
|
||||
selectAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
addListener(SWT.KeyDown, selectAllListener);
|
||||
|
||||
Mode mode = Modes.getMode(languageMode + XmlUtil.FILE_XML_SUFFIX);
|
||||
scanner = new ColoringScanner(mode, colorManager);
|
||||
|
||||
addExtendedModifyListener(modifyListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC qli Comment method "invokeAction".
|
||||
*
|
||||
* @param action
|
||||
*
|
||||
* */
|
||||
public void invokeAction(int action) {
|
||||
super.invokeAction(action);
|
||||
|
||||
switch (action) {
|
||||
case ActionCode.UNDO:
|
||||
undo(); // ctrl+Z
|
||||
break;
|
||||
case ActionCode.REDO:
|
||||
redo(); // ctrl+Y
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for undoRedoManager.
|
||||
*
|
||||
* @return the undoRedoManager
|
||||
*/
|
||||
public UndoRedoManager getUndoManager() {
|
||||
return this.undoRedoManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the undoRedoManager.
|
||||
*
|
||||
* @param undoRedoManager the undoRedoManager to set
|
||||
*/
|
||||
public void setUndoManager(UndoRedoManager undoRedoManager) {
|
||||
this.undoRedoManager = undoRedoManager;
|
||||
}
|
||||
|
||||
public static class ActionCode {
|
||||
|
||||
public static final int UNDO = Integer.MAX_VALUE;
|
||||
|
||||
public static final int REDO = UNDO - 1;
|
||||
|
||||
}
|
||||
|
||||
private void undo() {
|
||||
if (undoRedoManager != null) {
|
||||
undoRedoManager.undo();
|
||||
}
|
||||
}
|
||||
|
||||
private void redo() {
|
||||
if (undoRedoManager != null) {
|
||||
undoRedoManager.redo();
|
||||
}
|
||||
}
|
||||
|
||||
protected void colorize(final ColoringScanner scanner) {
|
||||
final ArrayList<StyleRange> styles = new ArrayList<StyleRange>();
|
||||
if (this.coloring) {
|
||||
IToken token;
|
||||
if (this.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
scanner.parse(this.getText().replaceAll("\"", " ").replaceAll("'", " ")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
|
||||
do {
|
||||
token = scanner.nextToken();
|
||||
if (!token.isEOF()) {
|
||||
if (token instanceof CToken) {
|
||||
CToken ctoken = (CToken) token;
|
||||
StyleRange styleRange;
|
||||
styleRange = new StyleRange();
|
||||
styleRange.start = scanner.getTokenOffset();
|
||||
styleRange.length = scanner.getTokenLength();
|
||||
if (ctoken.getType() == null) {
|
||||
styleRange.fontStyle = colorManager.getStyleFor(ctoken.getColor());
|
||||
styleRange.foreground = colorManager.getColor(ctoken.getColor());
|
||||
} else {
|
||||
styleRange.fontStyle = colorManager.getStyleForType(ctoken.getColor());
|
||||
styleRange.foreground = colorManager.getColorForType(ctoken.getColor());
|
||||
}
|
||||
styles.add(styleRange);
|
||||
}
|
||||
}
|
||||
} while (!token.isEOF());
|
||||
setStyles(styles);
|
||||
} else {
|
||||
StyleRange styleRange = new StyleRange();
|
||||
styles.add(styleRange);
|
||||
styleRange.start = 0;
|
||||
styleRange.length = this.getText().getBytes().length;
|
||||
styleRange.foreground = null;
|
||||
setStyles(styles);
|
||||
}
|
||||
}
|
||||
|
||||
public void setStyles(final ArrayList<StyleRange> styles) {
|
||||
if (ColorStyledText.this.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
int countChars = getCharCount();
|
||||
|
||||
for (int i = 0; i < styles.size(); i++) {
|
||||
StyleRange styleRange = styles.get(i);
|
||||
// System.out.println("styleRange.start=" + styleRange.start);
|
||||
// System.out.println("styleRange.length=" + styleRange.length);
|
||||
if (!(0 <= styleRange.start && styleRange.start + styleRange.length <= countChars)) {
|
||||
continue;
|
||||
}
|
||||
setStyleRange(styleRange);
|
||||
}
|
||||
}
|
||||
|
||||
ExtendedModifyListener modifyListener = new ExtendedModifyListener() {
|
||||
|
||||
public void modifyText(ExtendedModifyEvent event) {
|
||||
if (ColorStyledText.this.getCharCount() > MAXIMUM_CHARACTERS_BEFORE_USE_TIMER) {
|
||||
colorizeLimiter.resetTimer();
|
||||
colorizeLimiter.startIfExecutable(true, null);
|
||||
} else {
|
||||
getDisplay().asyncExec(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
colorize(scanner);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public ColorManager getColorManager() {
|
||||
return this.colorManager;
|
||||
}
|
||||
|
||||
public String getLanguageMode() {
|
||||
return this.languageMode;
|
||||
}
|
||||
|
||||
public ColoringScanner getScanner() {
|
||||
return this.scanner;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.custom.StyledText#setEditable(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setEditable(boolean editable) {
|
||||
super.setEditable(editable);
|
||||
if (pasteItem != null) {
|
||||
pasteItem.setEnabled(editable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for coloring.
|
||||
*
|
||||
* @return the coloring
|
||||
*/
|
||||
public boolean isColoring() {
|
||||
return this.coloring;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the coloring.
|
||||
*
|
||||
* @param coloring the coloring to set
|
||||
*/
|
||||
public void setColoring(boolean coloring) {
|
||||
boolean wasDifferent = this.coloring != coloring;
|
||||
this.coloring = coloring;
|
||||
if (!coloring) {
|
||||
removeExtendedModifyListener(modifyListener);
|
||||
} else if (wasDifferent) {
|
||||
colorizeLimiter.resetTimer();
|
||||
colorizeLimiter.startIfExecutable(true, null);
|
||||
addExtendedModifyListener(modifyListener);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.widgets.Widget#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
colorManager.dispose();
|
||||
}
|
||||
|
||||
private final ExecutionLimiter colorizeLimiter = new ExecutionLimiter(1000, true) {
|
||||
|
||||
@Override
|
||||
public void execute(final boolean isFinalExecution, Object data) {
|
||||
if (!isDisposed()) {
|
||||
getDisplay().asyncExec(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
colorize(scanner);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.commons.ui.swt.colorstyledtext;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.rules.IToken;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.ExtendedModifyEvent;
|
||||
import org.eclipse.swt.custom.ExtendedModifyListener;
|
||||
import org.eclipse.swt.custom.StyleRange;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.swt.widgets.MenuItem;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.runtime.xml.XmlUtil;
|
||||
import org.talend.commons.ui.runtime.ITalendThemeService;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.jedit.Mode;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.jedit.Modes;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.rules.CToken;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.scanner.ColoringScanner;
|
||||
import org.talend.commons.utils.threading.ExecutionLimiter;
|
||||
|
||||
/**
|
||||
* This component is an adaptation of a Color Editor for a StyledText.
|
||||
*
|
||||
* The original editor can be found on http://www.gstaff.org/colorEditor/ <br/>
|
||||
*
|
||||
* <b>How to use it, example :</b> <br/>
|
||||
* ColorStyledText text = new ColorStyledText(parent, SWT.H_SCROLL | SWT.V_SCROLL,
|
||||
* CorePlugin.getDefault().getPreferenceStore(), ECodeLanguage.PERL.getName());</i> <br/>
|
||||
* <br/>
|
||||
*
|
||||
* $Id: ColorStyledText.java 7183 2007-11-23 11:03:36Z amaumont $
|
||||
*
|
||||
*/
|
||||
public class ColorStyledText extends StyledText {
|
||||
|
||||
|
||||
public static final String PREFERENCE_COLOR_FOREGROUND= "ColorStyledText.Color.Foreground"; //$NON-NLS-1$
|
||||
public static final String PREFERENCE_COLOR_BACKGROUND= "ColorStyledText.Color.Background"; //$NON-NLS-1$
|
||||
public static final String PREFERENCE_COLOR_SELECTION_FOREGROUND= "ColorStyledText.Color.SelectionForeground"; //$NON-NLS-1$
|
||||
public static final String PREFERENCE_COLOR_SELECTION_BACKGROUND= "ColorStyledText.Color.SelectionBackground"; //$NON-NLS-1$
|
||||
|
||||
private final static int MAXIMUM_CHARACTERS_BEFORE_USE_TIMER = 1000;
|
||||
|
||||
private final ColorManager colorManager;
|
||||
|
||||
private final ColoringScanner scanner;
|
||||
|
||||
private final String languageMode;
|
||||
|
||||
private final MenuItem pasteItem;
|
||||
|
||||
private boolean coloring = true;
|
||||
|
||||
private UndoRedoManager undoRedoManager;
|
||||
|
||||
public ColorStyledText(Composite parent, int style, IPreferenceStore store, String languageMode) {
|
||||
super(parent, style);
|
||||
this.languageMode = languageMode;
|
||||
this.colorManager = new ColorManager(store);
|
||||
|
||||
/*
|
||||
* set the Shortcuts of the undo/redo
|
||||
*/
|
||||
this.setKeyBinding('Z' | SWT.CTRL, ActionCode.UNDO);
|
||||
this.setKeyBinding('Y' | SWT.CTRL, ActionCode.REDO);
|
||||
UndoRedoManager undoManager = new UndoRedoManager(50);
|
||||
undoManager.connect(this);
|
||||
this.setUndoManager(undoManager);
|
||||
|
||||
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
|
||||
Menu popupMenu = new Menu(this);
|
||||
|
||||
MenuItem redoItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
redoItem.setText(Messages.getString("ColorStyledText.RedoItem.Text")); //$NON-NLS-1$
|
||||
redoItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
redo();
|
||||
}
|
||||
});
|
||||
|
||||
MenuItem undoItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
undoItem.setText(Messages.getString("ColorStyledText.UndoItem.Text")); //$NON-NLS-1$
|
||||
undoItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
undo();
|
||||
}
|
||||
});
|
||||
|
||||
Image image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
|
||||
MenuItem copyItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
copyItem.setText(Messages.getString("ColorStyledText.CopyItem.Text")); //$NON-NLS-1$
|
||||
copyItem.setImage(image);
|
||||
copyItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
copy();
|
||||
}
|
||||
});
|
||||
|
||||
image = ImageProvider.getImage(sharedImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
|
||||
pasteItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
pasteItem.setText(Messages.getString("ColorStyledText.PasteItem.Text")); //$NON-NLS-1$
|
||||
pasteItem.setData(this);
|
||||
pasteItem.setImage(image);
|
||||
pasteItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
paste();
|
||||
}
|
||||
});
|
||||
pasteItem.setEnabled(getEditable());
|
||||
|
||||
this.setMenu(popupMenu);
|
||||
MenuItem selectAllItem = new MenuItem(popupMenu, SWT.PUSH);
|
||||
selectAllItem.setText(Messages.getString("ColorStyledText.SelectAllItem.Text")); //$NON-NLS-1$
|
||||
selectAllItem.addListener(SWT.Selection, new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
selectAll();
|
||||
}
|
||||
});
|
||||
this.setMenu(popupMenu);
|
||||
|
||||
Listener selectAllListener = new Listener() {
|
||||
|
||||
public void handleEvent(Event event) {
|
||||
if (event.character == '\u0001') { // CTRL + A
|
||||
selectAll();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
addListener(SWT.KeyDown, selectAllListener);
|
||||
|
||||
Mode mode = Modes.getMode(languageMode + XmlUtil.FILE_XML_SUFFIX);
|
||||
scanner = new ColoringScanner(mode, colorManager);
|
||||
|
||||
addExtendedModifyListener(modifyListener);
|
||||
initColorSetting();
|
||||
}
|
||||
|
||||
|
||||
protected void initColorSetting() {
|
||||
this.setForeground(ITalendThemeService.getColor(PREFERENCE_COLOR_FOREGROUND).orElse(null));
|
||||
this.setBackground(ITalendThemeService.getColor(PREFERENCE_COLOR_BACKGROUND).orElse(null));
|
||||
this.setSelectionBackground(ITalendThemeService.getColor(PREFERENCE_COLOR_SELECTION_BACKGROUND).orElse(null));
|
||||
this.setSelectionForeground(ITalendThemeService.getColor(PREFERENCE_COLOR_SELECTION_FOREGROUND).orElse(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC qli Comment method "invokeAction".
|
||||
*
|
||||
* @param action
|
||||
*
|
||||
* */
|
||||
public void invokeAction(int action) {
|
||||
super.invokeAction(action);
|
||||
|
||||
switch (action) {
|
||||
case ActionCode.UNDO:
|
||||
undo(); // ctrl+Z
|
||||
break;
|
||||
case ActionCode.REDO:
|
||||
redo(); // ctrl+Y
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for undoRedoManager.
|
||||
*
|
||||
* @return the undoRedoManager
|
||||
*/
|
||||
public UndoRedoManager getUndoManager() {
|
||||
return this.undoRedoManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the undoRedoManager.
|
||||
*
|
||||
* @param undoRedoManager the undoRedoManager to set
|
||||
*/
|
||||
public void setUndoManager(UndoRedoManager undoRedoManager) {
|
||||
this.undoRedoManager = undoRedoManager;
|
||||
}
|
||||
|
||||
public static class ActionCode {
|
||||
|
||||
public static final int UNDO = Integer.MAX_VALUE;
|
||||
|
||||
public static final int REDO = UNDO - 1;
|
||||
|
||||
}
|
||||
|
||||
private void undo() {
|
||||
if (undoRedoManager != null) {
|
||||
undoRedoManager.undo();
|
||||
}
|
||||
}
|
||||
|
||||
private void redo() {
|
||||
if (undoRedoManager != null) {
|
||||
undoRedoManager.redo();
|
||||
}
|
||||
}
|
||||
|
||||
protected void colorize(final ColoringScanner scanner) {
|
||||
final ArrayList<StyleRange> styles = new ArrayList<StyleRange>();
|
||||
if (this.coloring) {
|
||||
IToken token;
|
||||
if (this.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
scanner.parse(this.getText().replaceAll("\"", " ").replaceAll("'", " ")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
|
||||
do {
|
||||
token = scanner.nextToken();
|
||||
if (!token.isEOF()) {
|
||||
if (token instanceof CToken) {
|
||||
CToken ctoken = (CToken) token;
|
||||
StyleRange styleRange;
|
||||
styleRange = new StyleRange();
|
||||
styleRange.start = scanner.getTokenOffset();
|
||||
styleRange.length = scanner.getTokenLength();
|
||||
if (ctoken.getType() == null) {
|
||||
styleRange.fontStyle = colorManager.getStyleFor(ctoken.getColor());
|
||||
styleRange.foreground = colorManager.getColor(ctoken.getColor());
|
||||
} else {
|
||||
styleRange.fontStyle = colorManager.getStyleForType(ctoken.getColor());
|
||||
styleRange.foreground = colorManager.getColorForType(ctoken.getColor());
|
||||
}
|
||||
styles.add(styleRange);
|
||||
}
|
||||
}
|
||||
} while (!token.isEOF());
|
||||
setStyles(styles);
|
||||
} else {
|
||||
StyleRange styleRange = new StyleRange();
|
||||
styles.add(styleRange);
|
||||
styleRange.start = 0;
|
||||
styleRange.length = this.getText().getBytes().length;
|
||||
styleRange.foreground = null;
|
||||
setStyles(styles);
|
||||
}
|
||||
}
|
||||
|
||||
public void setStyles(final ArrayList<StyleRange> styles) {
|
||||
if (ColorStyledText.this.isDisposed()) {
|
||||
return;
|
||||
}
|
||||
int countChars = getCharCount();
|
||||
|
||||
for (int i = 0; i < styles.size(); i++) {
|
||||
StyleRange styleRange = styles.get(i);
|
||||
// System.out.println("styleRange.start=" + styleRange.start);
|
||||
// System.out.println("styleRange.length=" + styleRange.length);
|
||||
if (!(0 <= styleRange.start && styleRange.start + styleRange.length <= countChars)) {
|
||||
continue;
|
||||
}
|
||||
setStyleRange(styleRange);
|
||||
}
|
||||
}
|
||||
|
||||
ExtendedModifyListener modifyListener = new ExtendedModifyListener() {
|
||||
|
||||
public void modifyText(ExtendedModifyEvent event) {
|
||||
if (ColorStyledText.this.getCharCount() > MAXIMUM_CHARACTERS_BEFORE_USE_TIMER) {
|
||||
colorizeLimiter.resetTimer();
|
||||
colorizeLimiter.startIfExecutable(true, null);
|
||||
} else {
|
||||
getDisplay().asyncExec(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
colorize(scanner);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public ColorManager getColorManager() {
|
||||
return this.colorManager;
|
||||
}
|
||||
|
||||
public String getLanguageMode() {
|
||||
return this.languageMode;
|
||||
}
|
||||
|
||||
public ColoringScanner getScanner() {
|
||||
return this.scanner;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.custom.StyledText#setEditable(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setEditable(boolean editable) {
|
||||
super.setEditable(editable);
|
||||
if (pasteItem != null) {
|
||||
pasteItem.setEnabled(editable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for coloring.
|
||||
*
|
||||
* @return the coloring
|
||||
*/
|
||||
public boolean isColoring() {
|
||||
return this.coloring;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the coloring.
|
||||
*
|
||||
* @param coloring the coloring to set
|
||||
*/
|
||||
public void setColoring(boolean coloring) {
|
||||
boolean wasDifferent = this.coloring != coloring;
|
||||
this.coloring = coloring;
|
||||
if (!coloring) {
|
||||
removeExtendedModifyListener(modifyListener);
|
||||
} else if (wasDifferent) {
|
||||
colorizeLimiter.resetTimer();
|
||||
colorizeLimiter.startIfExecutable(true, null);
|
||||
addExtendedModifyListener(modifyListener);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.widgets.Widget#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
super.dispose();
|
||||
colorManager.dispose();
|
||||
}
|
||||
|
||||
private final ExecutionLimiter colorizeLimiter = new ExecutionLimiter(1000, true) {
|
||||
|
||||
@Override
|
||||
public void execute(final boolean isFinalExecution, Object data) {
|
||||
if (!isDisposed()) {
|
||||
getDisplay().asyncExec(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
colorize(scanner);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -20,12 +20,14 @@ import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.RowLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
import org.talend.commons.ui.runtime.ITalendThemeService;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorNotModifiable.LAYOUT_MODE;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent;
|
||||
@@ -156,6 +158,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
final Table table = getTableViewerCreator().getTable();
|
||||
final ILineSelectionListener beforeLineSelectionListener = new ILineSelectionListener() {
|
||||
|
||||
@Override
|
||||
public void handle(LineSelectionEvent e) {
|
||||
if (e.selectionByMethod && !selectionHelper.isMouseSelectionning() && !forceExecuteSelectionEvent) {
|
||||
executeSelectionEvent = false;
|
||||
@@ -166,6 +169,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
};
|
||||
final ILineSelectionListener afterLineSelectionListener = new ILineSelectionListener() {
|
||||
|
||||
@Override
|
||||
public void handle(LineSelectionEvent e) {
|
||||
executeSelectionEvent = true;
|
||||
}
|
||||
@@ -175,6 +179,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
|
||||
DisposeListener disposeListener = new DisposeListener() {
|
||||
|
||||
@Override
|
||||
public void widgetDisposed(DisposeEvent e) {
|
||||
selectionHelper.removeBeforeSelectionListener(beforeLineSelectionListener);
|
||||
selectionHelper.removeAfterSelectionListener(afterLineSelectionListener);
|
||||
@@ -185,6 +190,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
|
||||
table.addListener(SWT.KeyUp, new Listener() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
|
||||
if (event.character == '\u0001') { // CTRL + A
|
||||
@@ -251,7 +257,9 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
newTableViewerCreator.setLazyLoad(TableViewerCreator.getRecommandLazyLoad());
|
||||
newTableViewerCreator.setFirstVisibleColumnIsSelection(false);
|
||||
newTableViewerCreator.setCheckboxInFirstColumn(false);
|
||||
newTableViewerCreator.setBgColorForEmptyArea(getParentComposite().getDisplay().getSystemColor(SWT.COLOR_WHITE));
|
||||
Color bgColorForEmptyArea = ITalendThemeService.getColor("org.talend.commons.ui.BgColorForEmptyArea")
|
||||
.orElse(getParentComposite().getDisplay().getSystemColor(SWT.COLOR_WHITE));
|
||||
newTableViewerCreator.setBgColorForEmptyArea(bgColorForEmptyArea);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -271,6 +279,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
|
||||
getExtendedTableModel().addBeforeOperationListListener(1, new IListenableListListener() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(ListenableListEvent event) {
|
||||
handleBeforeListenableListOperationEvent(event);
|
||||
}
|
||||
@@ -279,6 +288,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
|
||||
getExtendedTableModel().addAfterOperationListListener(1, new IListenableListListener() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(ListenableListEvent event) {
|
||||
handleAfterListenableListOperationEvent(event);
|
||||
}
|
||||
@@ -287,6 +297,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
|
||||
getExtendedTableModel().addAfterOperationListListener(100, new IListenableListListener<B>() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(ListenableListEvent<B> event) {
|
||||
if (tableViewerCreator.getTable() != null && !tableViewerCreator.getTable().isDisposed()) {
|
||||
// tableViewerCreator.getTable().forceFocus();
|
||||
@@ -368,6 +379,7 @@ public abstract class AbstractExtendedTableViewer<B> extends AbstractExtendedCon
|
||||
tableViewerCreator.setInputList(getBeansList());
|
||||
new AsynchronousThreading(100, true, tableViewerCreator.getTable().getDisplay(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
tableViewerCreator.layout();
|
||||
}
|
||||
|
||||
@@ -16,8 +16,10 @@ import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.viewers.ICellEditorListener;
|
||||
import org.eclipse.jface.viewers.TextCellEditor;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.talend.commons.ui.runtime.ColorConstants;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.data.ModifiedObjectInfo;
|
||||
import org.talend.commons.ui.runtime.thread.AsynchronousThreading;
|
||||
@@ -39,6 +41,8 @@ public abstract class DialogErrorForCellEditorListener implements ICellEditorLis
|
||||
protected TableViewerCreatorColumn column;
|
||||
|
||||
protected TableViewerCreator tableViewerCreator;
|
||||
|
||||
private Color tableBackground = ColorConstants.getTableBackgroundColor();
|
||||
|
||||
/**
|
||||
* DOC amaumont CellEditorListener constructor comment.
|
||||
@@ -89,7 +93,7 @@ public abstract class DialogErrorForCellEditorListener implements ICellEditorLis
|
||||
final String errorMessage = validateValue(newValue, beanPosition);
|
||||
if (errorMessage == null) {
|
||||
newValidValueTyped(beanPosition, lastValidValue, newValue, state);
|
||||
text.setBackground(text.getDisplay().getSystemColor(SWT.COLOR_WHITE));
|
||||
text.setBackground(tableBackground);
|
||||
lastValidValue = newValue;
|
||||
} else {
|
||||
text.setBackground(text.getDisplay().getSystemColor(SWT.COLOR_RED));
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.ui.gmf.util.DisplayUtils;
|
||||
import org.talend.commons.ui.runtime.ITalendThemeService;
|
||||
|
||||
/**
|
||||
* Figure managing some simple HTML styles. <br/>
|
||||
@@ -77,6 +78,8 @@ public class SimpleHtmlFigure extends Figure {
|
||||
private static Font boldFont = null;
|
||||
|
||||
private static Font boldItalicFont = null;
|
||||
|
||||
private static final Color DEFAULT_LABEL_COLOR = ITalendThemeService.getColor("NODE_FIGURE_LABEL_FORCEGROUND").orElse(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
|
||||
|
||||
/**
|
||||
* Constructs a new SimpleHtmlFigure.
|
||||
@@ -262,6 +265,8 @@ public class SimpleHtmlFigure extends Figure {
|
||||
label.setFont(fontToUse);
|
||||
if (colorStack.size() > 0) {
|
||||
label.setForegroundColor(colorStack.get(colorStack.size() - 1));
|
||||
} else {
|
||||
label.setForegroundColor(DEFAULT_LABEL_COLOR); // Set label default foreground color
|
||||
}
|
||||
horizContainer.add(label);
|
||||
}
|
||||
|
||||
@@ -285,6 +285,30 @@
|
||||
type="INFORMIX">
|
||||
</DBType>
|
||||
</RepositoryComponent>
|
||||
<RepositoryComponent
|
||||
name="INGRES"
|
||||
withSchema="true"
|
||||
input="tIngresInput"
|
||||
output="tIngresOutput">
|
||||
<Item
|
||||
clazz="org.talend.core.model.properties.DatabaseConnectionItem">
|
||||
</Item>
|
||||
<DBType
|
||||
type="INGRES">
|
||||
</DBType>
|
||||
</RepositoryComponent>
|
||||
<RepositoryComponent
|
||||
name="VECTORWISE"
|
||||
withSchema="true"
|
||||
input="tVectorWiseInput"
|
||||
output="tVectorWiseOutput">
|
||||
<Item
|
||||
clazz="org.talend.core.model.properties.DatabaseConnectionItem">
|
||||
</Item>
|
||||
<DBType
|
||||
type="VECTORWISE">
|
||||
</DBType>
|
||||
</RepositoryComponent>
|
||||
<RepositoryComponent
|
||||
name="JAVADB"
|
||||
withSchema="true"
|
||||
|
||||
@@ -204,3 +204,4 @@ RenameFolderAction.warning.cannotFind.title=Action not available
|
||||
ConvertJobsUtil.warning.title=Warning
|
||||
ConvertJobsUtil.warning.message=The target framework is not fully supported for this release.
|
||||
SyncLibrariesLoginTask.createStatsLogAndImplicitParamter=Create stats log and implicit parameters
|
||||
WizardPageAPIDefinition_operationIdMissing=API is missing operationIds. operationIds are used to initialize tRESTRequest/cRest output flows. See tRESTRequest/cRest online help.
|
||||
|
||||
@@ -204,3 +204,4 @@ RenameFolderAction.warning.cannotFind.title=Action non disponible
|
||||
ConvertJobsUtil.warning.title=Avertissement
|
||||
ConvertJobsUtil.warning.message=Le framework cible n'est pas totalement support\u00E9 dans cette version.
|
||||
SyncLibrariesLoginTask.createStatsLogAndImplicitParamter=Cr\u00E9er des logs de stat et des param\u00E8tres implicites.
|
||||
WizardPageAPIDefinition_operationIdMissing=Des operationIds manquent dans l'API. Ces operationIds sont utilis\u00E9s pour initialiser les flux de sortie du tRESTRequest/cRest. Consultez l'aide en ligne des composants tRESTRequest/cRest.
|
||||
|
||||
@@ -56,7 +56,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
|
||||
PropertiesWizardPage.Description=\u8AAC\u660E
|
||||
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
|
||||
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059
|
||||
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
|
||||
PropertiesWizardPage.Name=\u540D\u524D
|
||||
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002
|
||||
@@ -156,7 +156,7 @@ ProjectRepositoryNode.invalidItem=\u7121\u52B9\u306A\u30A2\u30A4\u30C6\u30E0
|
||||
ProjectRepositoryNode.columns=\u30AB\u30E9\u30E0
|
||||
ProjectRepositoryNode.validationRules=\u691C\u8A3C\u30EB\u30FC\u30EB
|
||||
ProjectRepositoryNode.cdcFoundation=CDC Foundation
|
||||
ProjectRepositoryNode.genericSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE
|
||||
ProjectRepositoryNode.genericSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE
|
||||
ProjectRepositoryNode.queries=\u30AF\u30A8\u30EA\u30FC
|
||||
ProjectRepositoryNode.synonymSchemas=\u30B7\u30CE\u30CB\u30E0\u30B9\u30AD\u30FC\u30DE
|
||||
ProjectRepositoryNode.calculationViewSchemas=\u8A08\u7B97\u30D3\u30E5\u30FC\u30B9\u30AD\u30FC\u30DE
|
||||
@@ -204,3 +204,4 @@ RenameFolderAction.warning.cannotFind.title=\u4F7F\u7528\u3067\u304D\u306A\u3044
|
||||
ConvertJobsUtil.warning.title=\u8B66\u544A
|
||||
ConvertJobsUtil.warning.message=\u3053\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u306F\u3001\u30BF\u30FC\u30B2\u30C3\u30C8\u30D5\u30EC\u30FC\u30E0\u30EF\u30FC\u30AF\u304C\u5B8C\u5168\u306B\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002
|
||||
SyncLibrariesLoginTask.createStatsLogAndImplicitParamter=\u7D71\u8A08\u30ED\u30B0\u3068\u6697\u9ED9\u7684\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3092\u4F5C\u6210
|
||||
WizardPageAPIDefinition_operationIdMissing=API\u3067operationIds\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002operationIds\u306F\u3001tRESTRequest/cRest\u51FA\u529B\u30D5\u30ED\u30FC\u3092\u521D\u671F\u5316\u3059\u308B\u305F\u3081\u306B\u4F7F\u308F\u308C\u307E\u3059\u3002tRESTRequest/cRest\u306E\u30AA\u30F3\u30E9\u30A4\u30F3\u30D8\u30EB\u30D7\u3092\u3054\u89A7\u304F\u3060\u3055\u3044\u3002
|
||||
|
||||
@@ -204,3 +204,4 @@ RenameFolderAction.warning.cannotFind.title=\u64CD\u4F5C\u4E0D\u53EF\u7528
|
||||
ConvertJobsUtil.warning.title=\u8B66\u544A
|
||||
ConvertJobsUtil.warning.message=\u6B64\u7248\u672C\u4E0D\u5B8C\u5168\u652F\u6301\u76EE\u6807\u6846\u67B6.
|
||||
SyncLibrariesLoginTask.createStatsLogAndImplicitParamter=\u521B\u5EFA\u7EDF\u8BA1\u65E5\u5FD7\u548C\u9690\u5F0F\u53C2\u6570
|
||||
WizardPageAPIDefinition_operationIdMissing=API \u7F3A\u5931 operationId \u53C2\u6570\uFF0C\u8FD9\u4E9B operationId \u53C2\u6570\u7528\u6765\u521D\u59CB\u5316 tRESTRequest \u6216 cRest \u8F93\u51FA\u6D41\u3002\u8BF7\u53C2\u89C1 tRESTRequest \u6216 cRest \u5728\u7EBF\u5E2E\u52A9\u6587\u6863\u3002
|
||||
|
||||
@@ -67,6 +67,7 @@ import org.talend.core.model.repository.Folder;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.model.repository.LockInfo;
|
||||
import org.talend.core.model.repository.RepositoryViewObject;
|
||||
import org.talend.core.model.routines.RoutinesUtil;
|
||||
import org.talend.core.repository.i18n.Messages;
|
||||
import org.talend.core.repository.utils.XmiResourceManager;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
@@ -260,6 +261,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
if (type == ERepositoryObjectType.METADATA_CON_TABLE) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean isAllowMultipleName = (type == ERepositoryObjectType.SQLPATTERNS || type == ERepositoryObjectType.METADATA_FILE_XML);
|
||||
String path = "";
|
||||
if (item.getState() != null) {
|
||||
|
||||
@@ -153,6 +153,7 @@ import org.talend.core.runtime.services.IMavenUIService;
|
||||
import org.talend.core.runtime.util.ItemDateParser;
|
||||
import org.talend.core.runtime.util.JavaHomeUtil;
|
||||
import org.talend.core.runtime.util.SharedStudioUtils;
|
||||
import org.talend.core.service.IComponentJsonformGeneratorService;
|
||||
import org.talend.core.service.ICoreUIService;
|
||||
import org.talend.core.service.IDetectCVEService;
|
||||
import org.talend.core.utils.CodesJarResourceCache;
|
||||
@@ -239,14 +240,14 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
return singleton;
|
||||
}
|
||||
|
||||
private ICoreService getCoreService() {
|
||||
public ICoreService getCoreService() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(ICoreService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private IRunProcessService getRunProcessService() {
|
||||
public IRunProcessService getRunProcessService() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
|
||||
}
|
||||
@@ -351,7 +352,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
* @param project
|
||||
* @throws LoginException
|
||||
*/
|
||||
private void checkProjectCompatibility(Project project) throws LoginException {
|
||||
public void checkProjectCompatibility(Project project) throws LoginException {
|
||||
IMigrationToolService migrationToolService = GlobalServiceRegister.getDefault().getService(
|
||||
IMigrationToolService.class);
|
||||
// update migration system.
|
||||
@@ -1848,7 +1849,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
* @param project
|
||||
* @throws PersistenceException
|
||||
*/
|
||||
private void emptyTempFolder(Project project) throws PersistenceException {
|
||||
public void emptyTempFolder(Project project) throws PersistenceException {
|
||||
try {
|
||||
String str = SharedStudioUtils.getTempFolderPath().toPortableString();
|
||||
FilesUtils.deleteFolder(new File(str), false);
|
||||
@@ -2379,11 +2380,22 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
}
|
||||
String str[] = new String[] { getRepositoryContext().getUser() + "", projectManager.getCurrentProject() + "" }; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
log.info(Messages.getString("ProxyRepositoryFactory.log.loggedOn", str)); //$NON-NLS-1$
|
||||
|
||||
// no performance impact for studio or commandline
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IComponentJsonformGeneratorService.class)) {
|
||||
IComponentJsonformGeneratorService jsonformSvc = GlobalServiceRegister.getDefault().getService(IComponentJsonformGeneratorService.class);
|
||||
if (jsonformSvc != null && IComponentJsonformGeneratorService.isEnabled()) {
|
||||
jsonformSvc.generate(null);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (LoginException e) {
|
||||
try {
|
||||
logOffProject();
|
||||
} catch (Exception e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
if (!LoginException.RESTART.equals(e.getKey())) {
|
||||
try {
|
||||
logOffProject();
|
||||
} catch (Exception e1) {
|
||||
ExceptionHandler.process(e1);
|
||||
}
|
||||
}
|
||||
throw e;
|
||||
} catch (PersistenceException e) {
|
||||
@@ -2516,7 +2528,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
}
|
||||
}
|
||||
|
||||
private void checkReferenceProjectsProblems(Project project) throws BusinessException, PersistenceException {
|
||||
public void checkReferenceProjectsProblems(Project project) throws BusinessException, PersistenceException {
|
||||
if (ReferenceProjectProblemManager.getInstance().getAllInvalidProjectReferenceSet().size() > 0) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (String technicalLabel : ReferenceProjectProblemManager.getInstance().getAllInvalidProjectReferenceSet()) {
|
||||
@@ -2561,7 +2573,6 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
public void logOffProject() {
|
||||
// getRepositoryContext().setProject(null);
|
||||
repositoryFactoryFromProvider.logOffProject();
|
||||
if (!CommonsPlugin.isHeadless()) {
|
||||
ProjectRepositoryNode root = ProjectRepositoryNode.getInstance();
|
||||
if (root != null) {
|
||||
@@ -2617,6 +2628,7 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
|
||||
ReferenceProjectProvider.clearTacReferenceList();
|
||||
ReferenceProjectProblemManager.getInstance().clearAll();
|
||||
repositoryFactoryFromProvider.logOffProject();
|
||||
fullLogonFinished = false;
|
||||
}
|
||||
|
||||
@@ -3014,4 +3026,11 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
this.repositoryFactoryFromProvider.saveProject(project);
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.isCancelled = cancelled;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return this.isCancelled;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ public interface IGitInfoService extends IService {
|
||||
public Map<String, String> getGitInfo(Property property) throws Exception;
|
||||
|
||||
public boolean isPushedToRemote(Property property) throws Exception;
|
||||
|
||||
public String getProjectBranch(Project project)throws Exception;
|
||||
|
||||
public static IGitInfoService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IGitInfoService.class)) {
|
||||
|
||||
@@ -17,14 +17,20 @@ import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.jface.viewers.IColorProvider;
|
||||
import org.eclipse.jface.viewers.IFontProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.talend.commons.runtime.model.repository.ECDCStatus;
|
||||
import org.talend.commons.runtime.model.repository.ERepositoryStatus;
|
||||
import org.talend.commons.ui.runtime.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;
|
||||
@@ -77,13 +83,19 @@ import org.talend.utils.string.DigestUtil;
|
||||
*/
|
||||
public class RepositoryLabelProvider extends LabelProvider implements IColorProvider, IFontProvider {
|
||||
|
||||
private static final Color STABLE_SECONDARY_ENTRY_COLOR = new Color(null, 100, 100, 100);
|
||||
private static final String MERGED_PREFERENCED_ITEMS = "org.talend.core.repository.REPO_MERGED_REFERENCED_ITEMS_COLOR";
|
||||
|
||||
private static final Color STABLE_PRIMARY_ENTRY_COLOR = new Color(null, 0, 0, 0);
|
||||
private static final String LOCKED_ENTRY = "org.talend.core.repository.REPO_LOCKED_ENTRY";
|
||||
|
||||
private static final String STABLE_PRIMARY_ENTRY = "org.talend.core.repository.REPO_STABLE_PRIMARY_ENTRY_COLOR";
|
||||
|
||||
private static final String STABLE_SECONDARY_ENTRY = "org.talend.core.repository.REPO_STABLE_SECONDARY_ENTRY_COLOR";
|
||||
|
||||
private static final Color STABLE_SECONDARY_ENTRY_COLOR = new Color(null, 100, 100, 100);
|
||||
|
||||
protected static final Color INACTIVE_ENTRY_COLOR = new Color(null, 200, 200, 200);
|
||||
|
||||
private static final Color LOCKED_ENTRY = new Color(null, 200, 0, 0);
|
||||
private static final Color LOCKED_ENTRY_COLOR = new Color(null, 200, 0, 0);
|
||||
|
||||
private static final Color MERGED_REFERENCED_ITEMS_COLOR = new Color(null, 120, 120, 120);
|
||||
|
||||
@@ -100,6 +112,18 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
|
||||
return view;
|
||||
}
|
||||
|
||||
private Color getStableSecondaryEntryColor() {
|
||||
return ITalendThemeService.getColor(STABLE_SECONDARY_ENTRY).orElse(STABLE_SECONDARY_ENTRY_COLOR);
|
||||
}
|
||||
|
||||
private Color getLockedEntryColor() {
|
||||
return ITalendThemeService.getColor(LOCKED_ENTRY).orElse(LOCKED_ENTRY_COLOR);
|
||||
}
|
||||
|
||||
private Color getMergedReferencedItemsColor() {
|
||||
return ITalendThemeService.getColor(MERGED_PREFERENCED_ITEMS).orElse(MERGED_REFERENCED_ITEMS_COLOR);
|
||||
}
|
||||
|
||||
public String getText(IRepositoryViewObject object) {
|
||||
StringBuffer string = new StringBuffer();
|
||||
string.append(object.getLabel());
|
||||
@@ -482,23 +506,13 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
|
||||
RepositoryNode node = (RepositoryNode) element;
|
||||
switch (node.getType()) {
|
||||
case REFERENCED_PROJECT:
|
||||
return STABLE_PRIMARY_ENTRY_COLOR;
|
||||
case STABLE_SYSTEM_FOLDER:
|
||||
if (node.getLabel().equals(ERepositoryObjectType.SNIPPETS.toString())) {
|
||||
return INACTIVE_ENTRY_COLOR;
|
||||
}
|
||||
if (node.getContentType() == ERepositoryObjectType.METADATA) {
|
||||
return STABLE_PRIMARY_ENTRY_COLOR;
|
||||
}
|
||||
case SYSTEM_FOLDER:
|
||||
if (node.getContentType() == ERepositoryObjectType.PROCESS) {
|
||||
return STABLE_PRIMARY_ENTRY_COLOR;
|
||||
}
|
||||
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 +524,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -536,4 +550,43 @@ public class RepositoryLabelProvider extends LabelProvider implements IColorProv
|
||||
refreshProperty = refresh;
|
||||
}
|
||||
|
||||
public static IPropertyChangeListener createPropertyChangeListener(TreeViewer treeViewer) {
|
||||
return new IPropertyChangeListener() {
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent event) {
|
||||
String property = event.getProperty();
|
||||
if (property == null) {
|
||||
return;
|
||||
}
|
||||
boolean changed = false;
|
||||
switch (property) {
|
||||
case RepositoryLabelProvider.STABLE_PRIMARY_ENTRY:
|
||||
// case RepositoryLabelProvider.INACTIVE_ENTRY:
|
||||
// case RepositoryLabelProvider.LOCKED_ENTRY:
|
||||
// case RepositoryLabelProvider.MERGED_PREFERENCED_ITEMS:
|
||||
// case RepositoryLabelProvider.STABLE_SECONDARY_ENTRY:
|
||||
changed = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (changed) {
|
||||
Display.getDefault().asyncExec(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (treeViewer != null) {
|
||||
Control control = treeViewer.getControl();
|
||||
if (!control.isDisposed()) {
|
||||
treeViewer.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -139,3 +139,5 @@ Bundle-ClassPath: .,
|
||||
lib/delight-rhino-sandbox-0.0.15.jar,
|
||||
lib/rhino-1.7.13.jar
|
||||
Eclipse-RegisterBuddy: org.talend.testutils
|
||||
Import-Package: org.eclipse.equinox.p2.repository,
|
||||
org.eclipse.equinox.security.storage
|
||||
|
||||
@@ -21,7 +21,8 @@ bin.includes = META-INF/,\
|
||||
plugin_ja.properties,\
|
||||
plugin_ru.properties,\
|
||||
plugin_swtbot.properties,\
|
||||
plugin_zh_CN.properties
|
||||
plugin_zh_CN.properties,\
|
||||
resources/
|
||||
src.includes = META-INF/,\
|
||||
mappingMetadataTypes.xml,\
|
||||
mappings/,\
|
||||
|
||||
216
main/plugins/org.talend.core.runtime/mappings/mapping_Ingres.xml
Normal file
216
main/plugins/org.talend.core.runtime/mappings/mapping_Ingres.xml
Normal file
@@ -0,0 +1,216 @@
|
||||
<?xml version="1.0"?>
|
||||
<mapping>
|
||||
<dbms product="INGRES" id="ingres_id" label="Mapping Ingres"
|
||||
default="true">
|
||||
<dbTypes>
|
||||
<dbType type="ANSIDATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BOOLEAN" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BIGINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BYTE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BYTE VARYING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="C" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHAR" ignorePre="true" />
|
||||
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT4" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INGRESDATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTERVAL" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONG NVARCHAR" ignorePre="true" />
|
||||
<dbType type="LONG VARCHAR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MONEY" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="NCHAR" ignorePre="true" defaultLength="10"/>
|
||||
<dbType type="NVARCHAR" ignorePre="true" defaultLength="10"/>
|
||||
<dbType type="OBJECT_KEY" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TABLE_KEY" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="VARCHAR" default="true" defaultLength="1200" ignorePre="true"/>
|
||||
</dbTypes>
|
||||
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean">
|
||||
<dbType type="BOOLEAN" default="true" />
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="BYTE" default="true" />
|
||||
<dbType type="BYTE VARYING" />
|
||||
</talendType>
|
||||
<talendType type="id_byte[]">
|
||||
</talendType>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="CHAR" default="true" />
|
||||
<dbType type="VARCHAR"/>
|
||||
<dbType type="C"/>
|
||||
<dbType type="TEXT"/>
|
||||
<dbType type="LONG VARCHAR"/>
|
||||
<dbType type="NCHAR"/>
|
||||
<dbType type="NVARCHAR"/>
|
||||
<dbType type="LONG NVARCHAR"/>
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="DATE" default="true" />
|
||||
<dbType type="ANSIDATE" />
|
||||
<dbType type="INGRESDATE" />
|
||||
<dbType type="TIME" />
|
||||
<dbType type="TIMESTAMP" />
|
||||
<dbType type="INTERVAL"/>
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="DECIMAL" default="true" />
|
||||
<dbType type="FLOAT4" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="MONEY"/>
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
<dbType type="FLOAT4" />
|
||||
<dbType type="DECIMAL"/>
|
||||
<dbType type="MONEY"/>
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT4" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DECIMAL" />
|
||||
<dbType type="MONEY"/>
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INTEGER" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="SMALLINT"/>
|
||||
<dbType type="TINYINT"/>
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="BIGINT" default="true" />
|
||||
<dbType type="INTEGER"/>
|
||||
<dbType type="SMALLINT"/>
|
||||
<dbType type="TINYINT"/>
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="MONEY" default="true"/>
|
||||
<dbType type="OBJECT_KEY" />
|
||||
<dbType type="TABLE_KEY" />
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SMALLINT" default="true" />
|
||||
<dbType type="INTEGER" />
|
||||
<dbType type="BIGINT"/>
|
||||
<dbType type="TINYINT" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="VARCHAR" default="true" />
|
||||
<dbType type="LONG VARCHAR" />
|
||||
<dbType type="NCHAR"/>
|
||||
<dbType type="NVARCHAR" />
|
||||
<dbType type="LONG NVARCHAR" />
|
||||
<dbType type="TEXT" />
|
||||
<dbType type="C"/>
|
||||
<dbType type="CHAR"/>
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes>
|
||||
<dbType type="ANSIDATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BOOLEAN">
|
||||
<talendType type="id_Boolean" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIGINT">
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BYTE">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BYTE VARYING">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
</dbType>
|
||||
<dbType type="C">
|
||||
<talendType type="id_String" default="true" />
|
||||
<talendType type="id_Character"/>
|
||||
</dbType>
|
||||
<dbType type="CHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
<talendType type="id_Character"/>
|
||||
</dbType>
|
||||
<dbType type="DECIMAL">
|
||||
<talendType type="id_Float"/>
|
||||
<talendType type="id_BigDecimal" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="FLOAT4">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="INTEGER">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
<talendType type="id_Short"/>
|
||||
</dbType>
|
||||
<dbType type="INGRESDATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INTERVAL">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONG NVARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONG VARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MONEY">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="NCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="NVARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="OBJECT_KEY">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="SMALLINT">
|
||||
<talendType type="id_Short" default="true" />
|
||||
<talendType type="id_Integer" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="TEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TINYINT">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
<talendType type="id_Integer" />
|
||||
<talendType type="id_Short"/>
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
<dbType type="TIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TABLE_KEY">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="VARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
|
||||
</mapping>
|
||||
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0"?>
|
||||
<mapping>
|
||||
<dbms product="VECTORWISE" id="vectorwise_id" label="Mapping VectorWise"
|
||||
default="true">
|
||||
<dbTypes>
|
||||
<dbType type="ANSIDATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BIGINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BYTE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="BYTE VARYING" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="C" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="CHAR" ignorePre="true" />
|
||||
<dbType type="DECIMAL" defaultLength="20" defaultPrecision="10" />
|
||||
<dbType type="DATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="FLOAT4" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTEGER" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INGRESDATE" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="INTERVAL" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="LONG NVARCHAR" ignorePre="true" />
|
||||
<dbType type="LONG VARCHAR" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="MONEY" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="NCHAR" ignorePre="true" defaultLength="10"/>
|
||||
<dbType type="NVARCHAR" ignorePre="true" defaultLength="10"/>
|
||||
<dbType type="OBJECT_KEY" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="SMALLINT" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TEXT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TINYINT" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIME" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="TIMESTAMP" ignoreLen="true" ignorePre="true"/>
|
||||
<dbType type="TABLE_KEY" ignoreLen="true" ignorePre="true" />
|
||||
<dbType type="VARCHAR" default="true" defaultLength="1200" ignorePre="true"/>
|
||||
</dbTypes>
|
||||
|
||||
<language name="java">
|
||||
<talendToDbTypes><!-- Adviced mappings -->
|
||||
<talendType type="id_List"/>
|
||||
<talendType type="id_Boolean">
|
||||
</talendType>
|
||||
<talendType type="id_Byte">
|
||||
<dbType type="BYTE" default="true" />
|
||||
<dbType type="BYTE VARYING" />
|
||||
</talendType>
|
||||
<talendType type="id_byte[]">
|
||||
</talendType>
|
||||
<talendType type="id_Character">
|
||||
<dbType type="CHAR" default="true" />
|
||||
<dbType type="VARCHAR"/>
|
||||
<dbType type="C"/>
|
||||
<dbType type="TEXT"/>
|
||||
<dbType type="LONG VARCHAR"/>
|
||||
<dbType type="NCHAR"/>
|
||||
<dbType type="NVARCHAR"/>
|
||||
<dbType type="LONG NVARCHAR"/>
|
||||
</talendType>
|
||||
<talendType type="id_Date">
|
||||
<dbType type="ANSIDATE" default="true"/>
|
||||
<dbType type="DATE"/>
|
||||
<dbType type="INGRESDATE" />
|
||||
<dbType type="TIME" />
|
||||
<dbType type="TIMESTAMP" />
|
||||
<dbType type="INTERVAL"/>
|
||||
</talendType>
|
||||
<talendType type="id_BigDecimal">
|
||||
<dbType type="DECIMAL" default="true" />
|
||||
<dbType type="FLOAT4" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="MONEY"/>
|
||||
</talendType>
|
||||
<talendType type="id_Double">
|
||||
<dbType type="FLOAT" default="true" />
|
||||
<dbType type="FLOAT4" />
|
||||
<dbType type="DECIMAL"/>
|
||||
<dbType type="MONEY"/>
|
||||
</talendType>
|
||||
<talendType type="id_Float">
|
||||
<dbType type="FLOAT4" default="true" />
|
||||
<dbType type="FLOAT"/>
|
||||
<dbType type="DECIMAL" />
|
||||
<dbType type="MONEY"/>
|
||||
</talendType>
|
||||
<talendType type="id_Integer">
|
||||
<dbType type="INTEGER" default="true" />
|
||||
<dbType type="BIGINT" />
|
||||
<dbType type="SMALLINT"/>
|
||||
<dbType type="TINYINT"/>
|
||||
</talendType>
|
||||
<talendType type="id_Long">
|
||||
<dbType type="BIGINT" default="true" />
|
||||
<dbType type="INTEGER"/>
|
||||
<dbType type="SMALLINT"/>
|
||||
<dbType type="TINYINT"/>
|
||||
</talendType>
|
||||
<talendType type="id_Object">
|
||||
<dbType type="MONEY" default="true"/>
|
||||
<dbType type="OBJECT_KEY" />
|
||||
<dbType type="TABLE_KEY" />
|
||||
</talendType>
|
||||
<talendType type="id_Short">
|
||||
<dbType type="SMALLINT" default="true" />
|
||||
<dbType type="INTEGER" />
|
||||
<dbType type="BIGINT"/>
|
||||
<dbType type="TINYINT" />
|
||||
</talendType>
|
||||
<talendType type="id_String">
|
||||
<dbType type="VARCHAR" default="true" />
|
||||
<dbType type="LONG VARCHAR" />
|
||||
<dbType type="NCHAR"/>
|
||||
<dbType type="NVARCHAR" />
|
||||
<dbType type="LONG NVARCHAR" />
|
||||
<dbType type="TEXT" />
|
||||
<dbType type="C"/>
|
||||
<dbType type="CHAR"/>
|
||||
</talendType>
|
||||
</talendToDbTypes>
|
||||
<dbToTalendTypes>
|
||||
<dbType type="ANSIDATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BIGINT">
|
||||
<talendType type="id_Long" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BYTE">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
</dbType>
|
||||
<dbType type="BYTE VARYING">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
</dbType>
|
||||
<dbType type="C">
|
||||
<talendType type="id_String" default="true" />
|
||||
<talendType type="id_Character"/>
|
||||
</dbType>
|
||||
<dbType type="CHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
<talendType type="id_Character"/>
|
||||
</dbType>
|
||||
<dbType type="DECIMAL">
|
||||
<talendType type="id_Float"/>
|
||||
<talendType type="id_BigDecimal" default="true"/>
|
||||
</dbType>
|
||||
<dbType type="DATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="FLOAT">
|
||||
<talendType type="id_Double" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="FLOAT4">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="INTEGER">
|
||||
<talendType type="id_Integer" default="true" />
|
||||
<talendType type="id_Long"/>
|
||||
<talendType type="id_Short"/>
|
||||
</dbType>
|
||||
<dbType type="INGRESDATE">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="INTERVAL">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONG NVARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="LONG VARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="MONEY">
|
||||
<talendType type="id_Float" default="true" />
|
||||
<talendType type="id_BigDecimal"/>
|
||||
</dbType>
|
||||
<dbType type="NCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="NVARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="OBJECT_KEY">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="SMALLINT">
|
||||
<talendType type="id_Short" default="true" />
|
||||
<talendType type="id_Integer" />
|
||||
<talendType type="id_Long"/>
|
||||
</dbType>
|
||||
<dbType type="TEXT">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TINYINT">
|
||||
<talendType type="id_Byte" default="true" />
|
||||
<talendType type="id_Integer" />
|
||||
<talendType type="id_Short"/>
|
||||
<talendType type="id_Long" />
|
||||
</dbType>
|
||||
<dbType type="TIME">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TIMESTAMP">
|
||||
<talendType type="id_Date" default="true" />
|
||||
</dbType>
|
||||
<dbType type="TABLE_KEY">
|
||||
<talendType type="id_Object" default="true" />
|
||||
</dbType>
|
||||
<dbType type="VARCHAR">
|
||||
<talendType type="id_String" default="true" />
|
||||
</dbType>
|
||||
</dbToTalendTypes>
|
||||
</language>
|
||||
</dbms>
|
||||
|
||||
</mapping>
|
||||
@@ -0,0 +1,59 @@
|
||||
|
||||
# Component
|
||||
tSnowflakeConnection=java.base/java.nio
|
||||
tSnowflakeClose=java.base/java.nio
|
||||
tSnowflakeCommit=java.base/java.nio
|
||||
tSnowflakeInput=java.base/java.nio
|
||||
tSnowflakeOutput=java.base/java.nio
|
||||
tSnowflakeOutputBulk=java.base/java.nio
|
||||
tSnowflakeOutputBulkExec=java.base/java.nio
|
||||
tSnowflakeRow=java.base/java.nio
|
||||
tSnowflakeBulkExec=java.base/java.nio
|
||||
tSnowflakeRollback=java.base/java.nio
|
||||
|
||||
tCouchbaseInput=java.base/java.lang.invoke
|
||||
tCouchbaseOutput=java.base/java.lang.invoke
|
||||
tCouchbaseDCPInput=java.base/java.lang.invoke
|
||||
tCouchbaseDCPOutput=java.base/java.lang.invoke
|
||||
|
||||
tWriteJSONField=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
|
||||
|
||||
tFTPClose=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPConnection=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPDelete=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPFileExist=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPFileList=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPFileProperties=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPGet=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPPut=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPRename=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
tFTPTruncate=java.base/sun.security.ssl,java.base/sun.security.util
|
||||
|
||||
tNeo4jBatchOutput=java.base/java.lang,java.base/sun.nio.ch
|
||||
tNeo4jBatchOutputRelationship=java.base/java.lang,java.base/sun.nio.ch
|
||||
tNeo4jBatchSchema=java.base/java.lang,java.base/sun.nio.ch
|
||||
tNeo4jClose=java.base/java.lang,java.base/sun.nio.ch
|
||||
tNeo4jConnection=java.base/java.lang,java.base/sun.nio.ch
|
||||
tNeo4jImportTool=java.base/java.lang,java.base/sun.nio.ch
|
||||
tNeo4jInput=java.base/java.lang,java.base/sun.nio.ch
|
||||
tNeo4jRow=java.base/java.lang,java.base/sun.nio.ch
|
||||
|
||||
tMongoDBOutput=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
|
||||
tCosmosDBOutput=java.xml/com.sun.org.apache.xerces.internal.parsers,java.xml/com.sun.org.apache.xerces.internal.util
|
||||
|
||||
tMatchGroup=java.base/java.io
|
||||
tRuleSurvivorship=java.base/java.lang
|
||||
tRecordMatching=java.base/java.io
|
||||
tDqReportRun=java.base/java.lang,java.base/java.nio
|
||||
|
||||
tWebService=java.base/java.lang
|
||||
tWebServiceInput=java.base/java.lang
|
||||
|
||||
# TCK framework
|
||||
TCK_COMMON_ARGS=java.base/java.io,java.base/java.lang.invoke,java.base/java.lang.reflect,java.base/java.lang,java.base/java.net,java.base/java.nio,java.base/java.util,java.base/sun.nio.ch
|
||||
|
||||
# BigData distribution
|
||||
SPARK_3_3_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
|
||||
SPARK_3_2_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
|
||||
SPARK_3_1_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
|
||||
SPARK_2_4_x=java.base/java.nio,java.base/sun.nio.ch,java.base/java.util,java.base/java.lang.invoke,java.base/sun.util.calendar
|
||||
@@ -58,6 +58,10 @@ public final class JavaUtils {
|
||||
|
||||
public static final List<String> AVAILABLE_VERSIONS = Arrays.asList(JavaCore.VERSION_1_8 );
|
||||
|
||||
public static final String ALLOW_JAVA_INTERNAL_ACCESS = "allow.java.internal.access"; //$NON-NLS-1$
|
||||
|
||||
public static final String CUSTOM_ACCESS_SETTINGS = "custom.access.settings"; //$NON-NLS-1$
|
||||
|
||||
public static final String PROCESSOR_TYPE = "javaProcessor"; //$NON-NLS-1$
|
||||
|
||||
public static final String PATH_SEPARATOR = "/"; //$NON-NLS-1$
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -157,7 +158,7 @@ public interface ILibraryManagerService extends IService {
|
||||
|
||||
public void clearCache(boolean cleanIndex);
|
||||
|
||||
public void deployLibsFromCustomComponents();
|
||||
public void deployLibsFromCustomComponents(File componentFolder, List<ModuleNeeded> modulesNeeded);
|
||||
|
||||
@Deprecated
|
||||
public Set<String> list(boolean withComponent, IProgressMonitor... monitorWrap);
|
||||
|
||||
@@ -34,6 +34,9 @@ public enum EDatabase4DriverClassName {
|
||||
|
||||
INFORMIX(EDatabaseTypeName.INFORMIX, "com.informix.jdbc.IfxDriver"), //$NON-NLS-1$
|
||||
|
||||
INGRES(EDatabaseTypeName.INGRES, "com.ingres.jdbc.IngresDriver"),
|
||||
VECTORWISE(EDatabaseTypeName.VECTORWISE, "com.ingres.jdbc.IngresDriver"),
|
||||
|
||||
JAVADB_DERBYCLIENT(EDatabaseTypeName.JAVADB_DERBYCLIENT, "org.apache.derby.jdbc.ClientDriver"), //$NON-NLS-1$
|
||||
JAVADB_EMBEDED(EDatabaseTypeName.JAVADB_EMBEDED, "org.apache.derby.jdbc.EmbeddedDriver"), //$NON-NLS-1$
|
||||
JAVADB_JCCJDBC(EDatabaseTypeName.JAVADB_JCCJDBC, "com.ibm.db2.jcc.DB2Driver"), //$NON-NLS-1$
|
||||
|
||||
@@ -347,8 +347,7 @@ public enum EDatabaseTypeName {
|
||||
isSupport = isSupportODBC;
|
||||
} else if (EDatabaseTypeName.SAS == this) {
|
||||
isSupport = false;
|
||||
} else if (EDatabaseTypeName.INGRES == this || EDatabaseTypeName.INTERBASE == this || EDatabaseTypeName.VECTORWISE == this
|
||||
|| EDatabaseTypeName.PARACCEL == this) {
|
||||
} else if (EDatabaseTypeName.INTERBASE == this || EDatabaseTypeName.PARACCEL == this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
*/
|
||||
public enum ERedshiftDriver {
|
||||
|
||||
DRIVER_V2("Driver v2", new String[] { "redshift-jdbc42-2.1.0.3.jar" }),
|
||||
DRIVER_V2("Driver v2", new String[] { "redshift-jdbc42-2.1.0.10.jar" }),
|
||||
DRIVER_V1("Driver v1", new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar" });
|
||||
|
||||
private String displayName;
|
||||
|
||||
@@ -366,7 +366,57 @@ public class ConnParameterKeys {
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION="CONN_PARA_KEY_DATABRICKS_RUNTIME_VERSION";
|
||||
|
||||
public static final String CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER="CONN_PARA_KEY_DATABRICKS_DBFS_DEP_FOLDER";
|
||||
|
||||
/**kubernetes*/
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_SUBMIT_MODE="CONN_PARA_KEY_K8S_SUBMIT_MODE";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_MASTER="CONN_PARA_KEY_K8S_MASTER";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_INSTANCES="CONN_PARA_KEY_K8S_INSTANCES";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_REGISTRYSECRET_CHECK="CONN_PARA_KEY_K8S_REGISTRYSECRET_CHECK";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_REGISTRYSECRET="CONN_PARA_KEY_K8S_REGISTRYSECRET";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_IMAGE="CONN_PARA_KEY_K8S_IMAGE";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_NAMESPACE="CONN_PARA_KEY_K8S_NAMESPACE";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_SERVICEACCOUNT="CONN_PARA_KEY_K8S_SERVICEACCOUNT";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_DISTUPLOAD="CONN_PARA_KEY_K8S_DISTUPLOAD";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_S3BUCKET="CONN_PARA_KEY_K8S_S3BUCKET";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_S3FOLDER="CONN_PARA_KEY_K8S_S3FOLDER";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_S3CREDENTIALS="CONN_PARA_KEY_K8S_S3CREDENTIALS";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_S3ACCESSKEY="CONN_PARA_KEY_K8S_S3ACCESSKEY";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_S3SECRETKEY="CONN_PARA_KEY_K8S_S3SECRETKEY";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_BLOBACCOUNT="CONN_PARA_KEY_K8S_BLOBACCOUNT";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_BLOBCONTAINER="CONN_PARA_KEY_K8S_BLOBCONTAINER";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_BLOBSECRETKEY="CONN_PARA_KEY_K8S_BLOBSECRETKEY";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_AZUREACCOUNT="CONN_PARA_KEY_K8S_AZUREACCOUNT";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_AZURECREDENTIALS="CONN_PARA_KEY_K8S_AZURECREDENTIALS";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_AZURECONTAINER="CONN_PARA_KEY_K8S_AZURECONTAINER";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_AZURESECRETKEY="CONN_PARA_KEY_K8S_AZURESECRETKEY";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_AZUREAADKEY="CONN_PARA_KEY_K8S_AZUREAADKEY";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_AZUREAADCLIENTID="CONN_PARA_KEY_K8S_AZUREAADCLIENTID";
|
||||
|
||||
public static final String CONN_PARA_KEY_K8S_AZUREAADDIRECTORYID="CONN_PARA_KEY_K8S_AZUREAADDIRECTORYID";
|
||||
|
||||
/**
|
||||
* Override hadoop configuration
|
||||
*/
|
||||
|
||||
@@ -112,6 +112,13 @@ public enum EDatabaseConnTemplate {
|
||||
SQLITE(new DbConnStr(EDatabaseTypeName.SQLITE, //
|
||||
"jdbc:sqlite:/<filename>")), //$NON-NLS-1$
|
||||
|
||||
INGRES(new DbConnStr(EDatabaseTypeName.INGRES, //
|
||||
"jdbc:ingres://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
|
||||
"II7")), //$NON-NLS-1$
|
||||
VECTORWISE(new DbConnStr(EDatabaseTypeName.VECTORWISE, //
|
||||
"jdbc:ingres://<host>:<port>/<sid>;<property>", //$NON-NLS-1$
|
||||
"II7")),
|
||||
|
||||
FIREBIRD(new DbConnStr(EDatabaseTypeName.FIREBIRD, //
|
||||
"jdbc:firebirdsql:<host>/<port>:<filename>?<property>", //$NON-NLS-1$
|
||||
"3050")), //$NON-NLS-1$
|
||||
@@ -421,6 +428,8 @@ public enum EDatabaseConnTemplate {
|
||||
case PSQL:
|
||||
case PLUSPSQL:
|
||||
case GREENPLUM:
|
||||
case INGRES:
|
||||
case VECTORWISE:
|
||||
case FIREBIRD:
|
||||
case JAVADB_EMBEDED:
|
||||
case JAVADB_JCCJDBC:
|
||||
@@ -447,6 +456,8 @@ public enum EDatabaseConnTemplate {
|
||||
case SYBASEASE_16_SA:
|
||||
case IBMDB2:
|
||||
case IBMDB2_ZOS:
|
||||
case INGRES:
|
||||
case VECTORWISE:
|
||||
case MSSQL:
|
||||
case INFORMIX:
|
||||
case TERADATA:
|
||||
|
||||
@@ -27,25 +27,20 @@ import org.talend.core.database.conn.DatabaseConnConstants;
|
||||
public enum EDatabaseVersion4Drivers {
|
||||
// access
|
||||
ACCESS_JDBC(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, new String[] {
|
||||
"jackcess-2.1.0.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.1.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"jackcess-encrypt-2.1.0.jar", "bcprov-jdk15on-1.51.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
|
||||
"jackcess-2.1.12.jar", "ucanaccess-2.0.9.5.jar", "commons-lang-2.6.jar", "commons-logging-1.1.3.jar", "hsqldb.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"jackcess-encrypt-2.1.4.jar", "bcprov-jdk15on-1.70.jar", "talend-ucanaccess-utils-1.0.0.jar" })),
|
||||
ACCESS_2003(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2003", "Access_2003")), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
ACCESS_2007(new DbVersion4Drivers(EDatabaseTypeName.ACCESS, "Access 2007", "Access_2007")), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
// oracle
|
||||
ORACLE_18(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 18 and above", "ORACLE_18", "ojdbc8-19.3.0.0.jar")),
|
||||
ORACLE_12(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 12", "ORACLE_12", "ojdbc7.jar")),
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 12 (Deprecated)", "ORACLE_12",
|
||||
"ojdbc7.jar")),
|
||||
ORACLE_11(new DbVersion4DriversForOracle11(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID,
|
||||
EDatabaseTypeName.ORACLESN, EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM },
|
||||
"Oracle 11", "ORACLE_11", new String[] { DbVersion4DriversForOracle11.DRIVER_1_5, //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"Oracle 11 (Deprecated)", "ORACLE_11", new String[] { DbVersion4DriversForOracle11.DRIVER_1_5, //$NON-NLS-1$ //$NON-NLS-2$
|
||||
DbVersion4DriversForOracle11.DRIVER_1_6 })),
|
||||
ORACLE_10(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 10", "ORACLE_10", "ojdbc14.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
ORACLE_9(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 9", "ORACLE_9", "ojdbc14-9i.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
ORACLE_8(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 8", "ORACLE_8", "ojdbc12.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// AS400
|
||||
AS400_V7R1_V7R3(new DbVersion4Drivers(EDatabaseTypeName.AS400, "V7R1 to V7R3", "AS400_V7R1_V7R3", "jt400-9.8.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
AS400_V6R1_V7R2(new DbVersion4Drivers(EDatabaseTypeName.AS400, "V6R1 to V7R2", "AS400_V6R1_V7R2", "jt400_V6R1.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
@@ -60,7 +55,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
|
||||
//
|
||||
JAVADB_EMBEDED(new DbVersion4Drivers(EDatabaseTypeName.JAVADB_EMBEDED, "derby.jar")), //$NON-NLS-1$
|
||||
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlitejdbc-v056.jar")), //$NON-NLS-1$
|
||||
SQLITE(new DbVersion4Drivers(EDatabaseTypeName.SQLITE, "sqlite-jdbc-3.40.0.0.jar")), //$NON-NLS-1$
|
||||
FIREBIRD(new DbVersion4Drivers(EDatabaseTypeName.FIREBIRD, "jaybird-full-2.1.1.jar")), //$NON-NLS-1$
|
||||
TERADATA(new DbVersion4Drivers(EDatabaseTypeName.TERADATA,
|
||||
new String[] { "terajdbc4-17.10.00.27.jar" })), //$NON-NLS-1$
|
||||
@@ -83,7 +78,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
"Microsoft SQL Server 2012", "Microsoft SQL Server 2012", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.29.jar", "slf4j-log4j12-1.7.29.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
|
||||
new String[] { "mssql-jdbc.jar", "slf4j-api-1.7.34.jar", "slf4j-reload4j-1.7.34.jar", "msal4j-1.11.0.jar", //$NON-NLS-1$
|
||||
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.22.jar", "jackson-core-2.13.4.jar",
|
||||
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "jcip-annotations-1.0-1.jar",
|
||||
"json-smart-2.4.7.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.7.jar", "asm-9.1.jar",
|
||||
@@ -113,6 +108,8 @@ public enum EDatabaseVersion4Drivers {
|
||||
EXASOL(new DbVersion4Drivers(EDatabaseTypeName.EXASOL, "exajdbc-6.0.9302.jar")), //$NON-NLS-1$
|
||||
MAXDB(new DbVersion4Drivers(EDatabaseTypeName.MAXDB, "sapdbc.jar")), //$NON-NLS-1$
|
||||
|
||||
INGRES(new DbVersion4Drivers(EDatabaseTypeName.INGRES, "iijdbc-10.2-4.1.10.jar")),
|
||||
VECTORWISE(new DbVersion4Drivers(EDatabaseTypeName.VECTORWISE, "iijdbc-10.2-4.1.10.jar")),
|
||||
// HIVE(new DbVersion4Drivers(EDatabaseTypeName.HIVE, "STANDALONE", "STANDALONE", new String[] {
|
||||
// "hive-jdbc-0.8.1.jar",
|
||||
// "hive-metastore-0.8.1.jar", "hive-exec-0.8.1.jar", "hive-service-0.8.1.jar", "libfb303_new.jar",
|
||||
@@ -153,10 +150,11 @@ public enum EDatabaseVersion4Drivers {
|
||||
REDSHIFT(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT, "redshift", "REDSHIFT", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[]{ "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
REDSHIFT_SSO(new DbVersion4Drivers(EDatabaseTypeName.REDSHIFT_SSO, "redshift sso", "REDSHIFT_SSO", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "aws-java-sdk-1.11.848.jar", "jackson-core-2.13.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|
||||
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "httpcore-4.4.13.jar", "httpclient-4.5.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
|
||||
"joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"aws-java-sdk-redshift-internal-1.12.x.jar" })), //$NON-NLS-1$
|
||||
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "jackson-core-2.13.4.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"jackson-databind-2.13.4.2.jar", "jackson-annotations-2.13.4.jar", "httpcore-4.4.13.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"httpclient-4.5.13.jar", "joda-time-2.8.1.jar", "commons-logging-1.2.jar", "commons-codec-1.14.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$//$NON-NLS-4$
|
||||
"aws-java-sdk-redshift-internal-1.12.x.jar", "aws-java-sdk-core-1.12.315.jar", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"aws-java-sdk-sts-1.12.315.jar", "aws-java-sdk-redshift-1.12.315.jar", "jmespath-java-1.12.315.jar" })), //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
|
||||
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "mysql-connector-java-5.1.49.jar")); //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ public class HadoopConstants {
|
||||
public static final String SPARK_MODE_YARN_CLUSTER = "YARN_CLUSTER";
|
||||
|
||||
public static final String SPARK_MODE_DATAPROC = "DATAPROC";
|
||||
|
||||
public static final String SPARK_MODE_SYNAPSE = "SYNAPSE";
|
||||
|
||||
public static final String FRAMEWORK = "FRAMEWORK";
|
||||
|
||||
|
||||
@@ -153,6 +153,52 @@ public enum EHadoopProperties {
|
||||
DATABRICKS_TOKEN,
|
||||
|
||||
DATABRICKS_DBFS_DEP_FOLDER,
|
||||
|
||||
K8S_SUBMIT_MODE,
|
||||
|
||||
K8S_MASTER,
|
||||
|
||||
K8S_INSTANCES,
|
||||
|
||||
K8S_REGISTRYSECRET,
|
||||
|
||||
K8S_IMAGE,
|
||||
|
||||
K8S_NAMESPACE,
|
||||
|
||||
K8S_SERVICEACCOUNT,
|
||||
|
||||
K8S_DISTUPLOAD,
|
||||
|
||||
K8S_S3BUCKET,
|
||||
|
||||
K8S_S3FOLDER,
|
||||
|
||||
K8S_S3CREDENTIALS,
|
||||
|
||||
K8S_S3ACCESSKEY,
|
||||
|
||||
K8S_S3SECRETKEY,
|
||||
|
||||
K8S_BLOBACCOUNT,
|
||||
|
||||
K8S_BLOBCONTAINER,
|
||||
|
||||
K8S_BLOBSECRETKEY,
|
||||
|
||||
K8S_AZUREACCOUNT,
|
||||
|
||||
K8S_AZURECREDENTIALS,
|
||||
|
||||
K8S_AZURECONTAINER,
|
||||
|
||||
K8S_AZURESECRETKEY,
|
||||
|
||||
K8S_AZUREAADKEY,
|
||||
|
||||
K8S_AZUREAADCLIENTID,
|
||||
|
||||
K8S_AZUREAADDIRECTORYID,
|
||||
|
||||
DATABRICKS_NODE_TYPE,
|
||||
|
||||
|
||||
@@ -984,6 +984,14 @@ public class ContextUtils {
|
||||
|
||||
}
|
||||
|
||||
public boolean remove(Item item, String param) {
|
||||
Set<String> params = map.get(item);
|
||||
if (params != null && params.contains(param)) {
|
||||
return params.remove(param);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return map.isEmpty();
|
||||
}
|
||||
|
||||
@@ -293,7 +293,8 @@ public final class MetadataToolHelper {
|
||||
boolean isKeyword = KeywordsValidator.isKeyword(originalColumnName);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int[] charBit = new int[columnName.length()];
|
||||
// keep charBit length align with the length of originalColumnName (StringBuilder)
|
||||
int[] charBit = new int[originalColumnName.length()];
|
||||
if (!isKeyword) {
|
||||
boolean isAllowSpecific = isAllowSpecificCharacters();
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@ public class SparkBatchMetadataTalendTypeFilter extends SparkMetadataTalendTypeF
|
||||
"tJDBCInput",
|
||||
"tJDBCOutput",
|
||||
"tLogRow",
|
||||
"tMongoDBInput",
|
||||
"tAvroInput",
|
||||
"tMongoDBInput",
|
||||
"tMongoDBOutput",
|
||||
"tSqlRow"
|
||||
);
|
||||
|
||||
@@ -433,6 +433,16 @@ public class ComponentToRepositoryProperty {
|
||||
connection.setDatabaseType(EDatabaseTypeName.IBMDB2.getDisplayName());
|
||||
connection.setProductId(EDatabaseTypeName.IBMDB2.getProduct());
|
||||
}
|
||||
// Ingres
|
||||
else if (EDatabaseTypeName.INGRES.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.INGRES.getDisplayName());
|
||||
connection.setProductId(EDatabaseTypeName.INGRES.getProduct());
|
||||
}
|
||||
// VECTORWISE
|
||||
else if (EDatabaseTypeName.VECTORWISE.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.VECTORWISE.getDisplayName());
|
||||
connection.setProductId(EDatabaseTypeName.VECTORWISE.getProduct());
|
||||
}
|
||||
// Sqlite
|
||||
else if (EDatabaseTypeName.SQLITE.getProduct().equalsIgnoreCase((String) parameter.getValue())) {
|
||||
connection.setDatabaseType(EDatabaseTypeName.SQLITE.getDisplayName());
|
||||
|
||||
@@ -1115,7 +1115,9 @@ public class RepositoryToComponentProperty {
|
||||
|| EDatabaseConnTemplate.SAPHana.getDBDisplayName().equals(databaseType)
|
||||
|| EDatabaseConnTemplate.MSSQL.getDBDisplayName().equals(databaseType)) {
|
||||
if (dbVersionString != null) {
|
||||
driverValue = dbVersionString.toUpperCase();
|
||||
if (EDatabaseVersion4Drivers.getDbVersionName(databaseType, dbVersionString) != null) {
|
||||
driverValue = dbVersionString.toUpperCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isContextMode(connection, dbVersionString)) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.commons.codec.binary.StringUtils;
|
||||
import org.talend.components.api.properties.ComponentProperties;
|
||||
import org.talend.core.model.components.IComponent;
|
||||
import org.talend.core.model.components.IMultipleComponentManager;
|
||||
@@ -509,7 +510,7 @@ public abstract class AbstractNode implements INode {
|
||||
}
|
||||
for (String key : childParameters.keySet()) {
|
||||
IElementParameter param = childParameters.get(key);
|
||||
if (param.getName().equals(name)) {
|
||||
if (StringUtils.equals(name, param.getName())) {
|
||||
return param;
|
||||
}
|
||||
}
|
||||
@@ -676,7 +677,8 @@ public abstract class AbstractNode implements INode {
|
||||
return null;
|
||||
}
|
||||
for (IMetadataTable table : metadataList) {
|
||||
if (table.getAttachedConnector().equals(connector)) {
|
||||
String attachedConnector = table.getAttachedConnector();
|
||||
if (attachedConnector != null && attachedConnector.equals(connector)) {
|
||||
return table;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public enum EParameterFieldType {
|
||||
SCHEMA_XPATH_QUERYS,
|
||||
QUERYSTORE_TYPE,
|
||||
GUESS_SCHEMA,
|
||||
DYNAMIC_GUESS_SCHEMA,
|
||||
PROPERTY_TYPE,
|
||||
EXTERNAL,
|
||||
FILE,
|
||||
|
||||
@@ -1477,12 +1477,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return allTypes;
|
||||
}
|
||||
|
||||
public static List<ERepositoryObjectType> getAllTypesOfJoblet() {
|
||||
public static List<ERepositoryObjectType> getAllBigDataTypesOfJoblet(){
|
||||
List<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>();
|
||||
|
||||
if (ERepositoryObjectType.JOBLET != null) {
|
||||
allTypes.add(ERepositoryObjectType.JOBLET);
|
||||
}
|
||||
if (ERepositoryObjectType.SPARK_JOBLET != null) {
|
||||
allTypes.add(ERepositoryObjectType.SPARK_JOBLET);
|
||||
}
|
||||
@@ -1492,6 +1488,15 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return allTypes;
|
||||
}
|
||||
|
||||
public static List<ERepositoryObjectType> getAllTypesOfJoblet() {
|
||||
List<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>();
|
||||
allTypes.addAll(getAllBigDataTypesOfJoblet());
|
||||
if (ERepositoryObjectType.JOBLET != null) {
|
||||
allTypes.add(ERepositoryObjectType.JOBLET);
|
||||
}
|
||||
return allTypes;
|
||||
}
|
||||
|
||||
public static List<ERepositoryObjectType> getAllTypesOfTestContainer() {
|
||||
List<ERepositoryObjectType> allTypes = new ArrayList<ERepositoryObjectType>();
|
||||
|
||||
|
||||
@@ -79,4 +79,8 @@ public final class TalendPropertiesUtil {
|
||||
public static String getProductApp() {
|
||||
return System.getProperty(PROD_APP);
|
||||
}
|
||||
|
||||
public static boolean isEnabledUseShortJobletName() {
|
||||
return isEnabled("talend.job.build.useShortJobletName"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ public class TalendLibsServerManager {
|
||||
|
||||
public static final String TALEND_LIB_PASSWORD = "";//$NON-NLS-1$
|
||||
|
||||
public static final String TALEND_LIB_REPOSITORY = "libraries";//$NON-NLS-1$
|
||||
public static final String TALEND_LIB_REPOSITORY = "studio-libraries";//$NON-NLS-1$
|
||||
|
||||
private static TalendLibsServerManager manager = null;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
package org.talend.core.pendo;
|
||||
|
||||
import org.talend.core.pendo.properties.IPendoDataProperties;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.core.service.ICoreTisRuntimeService;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
@@ -22,11 +22,11 @@ public class PendoDataTrackFactory {
|
||||
|
||||
private static PendoDataTrackFactory instance;
|
||||
|
||||
private static IRemoteService remoteService;
|
||||
private static ICoreTisRuntimeService coreRuntimeService;
|
||||
|
||||
static {
|
||||
instance = new PendoDataTrackFactory();
|
||||
remoteService = IRemoteService.get();
|
||||
coreRuntimeService = ICoreTisRuntimeService.get();
|
||||
}
|
||||
|
||||
private PendoDataTrackFactory() {
|
||||
@@ -37,35 +37,35 @@ public class PendoDataTrackFactory {
|
||||
}
|
||||
|
||||
public boolean isTrackSendAvailable() throws Exception {
|
||||
if (remoteService != null) {
|
||||
return remoteService.isPendoTrackAvailable();
|
||||
if (coreRuntimeService != null) {
|
||||
return coreRuntimeService.isPendoTrackAvailable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void sendTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception {
|
||||
if (remoteService != null) {
|
||||
remoteService.sendPendoTrackData(event, properties);
|
||||
if (coreRuntimeService != null) {
|
||||
coreRuntimeService.sendPendoTrackData(event, properties);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendProjectLoginTrack() {
|
||||
if (remoteService != null) {
|
||||
AbstractPendoTrackManager pendoProjectLoginManager = remoteService.getPendoProjectLoginManager();
|
||||
if (coreRuntimeService != null) {
|
||||
AbstractPendoTrackManager pendoProjectLoginManager = coreRuntimeService.getPendoProjectLoginManager();
|
||||
pendoProjectLoginManager.sendTrackToPendo();
|
||||
}
|
||||
}
|
||||
|
||||
public void sendGenericTrack(TrackEvent event, IPendoDataProperties properties) {
|
||||
if (remoteService != null) {
|
||||
AbstractPendoTrackManager genericManager = remoteService.getPendoGenericManager(event, properties);
|
||||
if (coreRuntimeService != null) {
|
||||
AbstractPendoTrackManager genericManager = coreRuntimeService.getPendoGenericManager(event, properties);
|
||||
genericManager.sendTrackToPendo();
|
||||
}
|
||||
}
|
||||
|
||||
public String getTmcUser(String url, String token) {
|
||||
if (remoteService != null) {
|
||||
return remoteService.getTmcUser(url, token);
|
||||
if (coreRuntimeService != null) {
|
||||
return coreRuntimeService.getTmcUser(url, token);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -203,4 +203,12 @@ public interface ITalendCorePrefConstants {
|
||||
|
||||
public static final boolean NEXUS_SHARE_LIBS_DEFAULT = false;
|
||||
|
||||
public static final String PERSPECTIVE_PERSIST_SCOPE = "PERSPECTIVE_PERSIST_SCOPE"; //$NON-NLS-1$
|
||||
|
||||
public static final String PERSPECTIVE_PERSIST_SCOPE_PROJECT_AND_BRANCH = "PROJECT_AND_BRANCH"; //$NON-NLS-1$
|
||||
|
||||
public static final String PERSPECTIVE_PERSIST_SCOPE_STUDIO = "STUDIO"; //$NON-NLS-1$
|
||||
|
||||
public static final String PERSPECTIVE_PERSIST_SCOPE_DEFAULT = PERSPECTIVE_PERSIST_SCOPE_PROJECT_AND_BRANCH;
|
||||
|
||||
}
|
||||
|
||||
@@ -655,4 +655,9 @@ ItemAnalysisReportManager.Warning.message=Can't run a new analysis now. Wait for
|
||||
AnalysisReportAccessDialog.shellTitle=Project analysis
|
||||
AnalysisReportAccessDialog.generateSuccess=Project analysis completed successfully.
|
||||
AnalysisReportAccessDialog.completeReportAvailable=Check the report
|
||||
AnalysisReportAccessDialog.accessReport=here
|
||||
AnalysisReportAccessDialog.accessReport=here
|
||||
AbstractPomTemplateProjectSettingPage.defaultTabLabel=Default
|
||||
AbstractPomTemplateProjectSettingPage.customTabLabel=Custom
|
||||
AbstractPomTemplateProjectSettingPage.previewButton=Preview
|
||||
AbstractPomTemplateProjectSettingPage.previewButtonTip=Preview the complete customized project POM settings.
|
||||
AbstractPomTemplateProjectSettingPage.learnMoreLink=Learn more
|
||||
@@ -620,7 +620,7 @@ ProgressMonitorDialogWithCancel.executeTimeout=Suspension de l'ex\u00E9cution, l
|
||||
ProgressMonitorDialogWithCancel.CheckingConnectionJob.waitingFinish=en attente de la fin de {0}...
|
||||
ProgressMonitorDialogWithCancel.CheckingConnectionJob.emptyWaitingfinish=en attente de la fin...
|
||||
OverTimePopupDialogTask.title=Ex\u00E9cution...
|
||||
OverTimePopupDialogTask.message=T\u00E2che d'ex\u00E9cution en arri\u00E8re plan, patientez...
|
||||
OverTimePopupDialogTask.message=T\u00E2che d'ex\u00E9cution en arri\u00E8re-plan, patientez...
|
||||
OverTimePopupDialogTask.executeTimeout=Suspension de l'ex\u00E9cution, le Studio a essay\u00E9 d'interrompre la v\u00E9rification en t\u00E2che de fond.
|
||||
OverTimePopupDialogTask.killed=Ex\u00E9cution arr\u00EAt\u00E9e
|
||||
OverTimePopupDialogTask.waitingFinishMessage.default=Interruption impossible de la t\u00E2che en fond,\n
|
||||
@@ -656,3 +656,7 @@ AnalysisReportAccessDialog.shellTitle=Analyse du projet
|
||||
AnalysisReportAccessDialog.generateSuccess=Analyse du projet termin\u00E9e.
|
||||
AnalysisReportAccessDialog.completeReportAvailable=Consulter le rapport
|
||||
AnalysisReportAccessDialog.accessReport=ici
|
||||
AbstractPomTemplateProjectSettingPage.defaultTabLabel=Par d\u00E9faut
|
||||
AbstractPomTemplateProjectSettingPage.customTabLabel=Personnalis\u00E9
|
||||
AbstractPomTemplateProjectSettingPage.previewButton=Aper\u00E7u
|
||||
AbstractPomTemplateProjectSettingPage.learnMoreLink=En savoir plus
|
||||
|
||||
@@ -281,7 +281,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
|
||||
PropertiesWizardPage.Description=\u8AAC\u660E
|
||||
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059\u3002
|
||||
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u5165\u529B\u3092\u63A8\u5968\u3057\u307E\u3059
|
||||
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
|
||||
PropertiesWizardPage.Name=\u540D\u524D
|
||||
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002
|
||||
@@ -637,8 +637,8 @@ DynamicPlugin.addExtension.empty=ExtensionPoint\u307E\u305F\u306FID\u304C\u7A7A\
|
||||
BigDataBasicUtil.loadDynamicDistribution.IDynamicDistributionManager.notFound={0}\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
|
||||
TalendLibsServerManager.connectUserLibraryFailureMessage=\u7BA1\u7406\u8005\u30E2\u30FC\u30C9\u3067\u8A2D\u5B9A\u3055\u308C\u305F\u30E6\u30FC\u30B6\u30FC\u30E9\u30A4\u30D6\u30E9\u30EA\u30FC\u30A2\u30FC\u30C6\u30A3\u30D5\u30A1\u30AF\u30C8\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u304C\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002{0}\u3078\u306E\u63A5\u7D9A\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F
|
||||
TalendLibsServerManager.cannotGetUserLibraryServer=\u30EA\u30E2\u30FC\u30C8\u7BA1\u7406\u8005\u304B\u3089\u30E6\u30FC\u30B6\u30FC\u30E9\u30A4\u30D6\u30E9\u30EA\u30FC\u30B5\u30FC\u30D0\u30FC\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093
|
||||
MigrationReportAccessDialog.title=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30A2\u30A4\u30C6\u30E0\u3092\u79FB\u884C
|
||||
MigrationReportAccessDialog.migrateSuccess=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u30A2\u30A4\u30C6\u30E0\u304C\u6B63\u3057\u304F\u79FB\u884C\u3055\u308C\u307E\u3057\u305F\u3002
|
||||
MigrationReportAccessDialog.title=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9805\u76EE\u3092\u79FB\u884C
|
||||
MigrationReportAccessDialog.migrateSuccess=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u9805\u76EE\u304C\u6B63\u3057\u304F\u79FB\u884C\u3055\u308C\u307E\u3057\u305F\u3002
|
||||
MigrationReportAccessDialog.completeReportAvailable=\u30EC\u30DD\u30FC\u30C8\u3092\u30C1\u30A7\u30C3\u30AF
|
||||
MigrationReportAccessDialog.accessReport=\u3053\u3061\u3089
|
||||
MigrationReportAccessDialog.provideAnalysisTool=\u4ECA\u3059\u3050\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5206\u6790\u3092\u5B9F\u884C\u3057\u3066\u3001\u79FB\u884C\u3055\u308C\u305F\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u5206\u6790\u3067\u304D\u307E\u3059\u3002\u3053\u306E\u8A66\u9A13\u7684\u306A\u30C4\u30FC\u30EB\u306B\u3088\u3063\u3066\u3001\u4EE5\u4E0B\u304C\u542B\u307E\u308C\u308B\u30EC\u30DD\u30FC\u30C8\u304C\u751F\u6210\u3055\u308C\u307E\u3059:
|
||||
@@ -656,3 +656,7 @@ AnalysisReportAccessDialog.shellTitle=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5206
|
||||
AnalysisReportAccessDialog.generateSuccess=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5206\u6790\u304C\u6B63\u3057\u304F\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002
|
||||
AnalysisReportAccessDialog.completeReportAvailable=\u30EC\u30DD\u30FC\u30C8\u3092\u30C1\u30A7\u30C3\u30AF
|
||||
AnalysisReportAccessDialog.accessReport=\u3053\u3061\u3089
|
||||
AbstractPomTemplateProjectSettingPage.defaultTabLabel=\u30C7\u30D5\u30A9\u30EB\u30C8
|
||||
AbstractPomTemplateProjectSettingPage.customTabLabel=\u30AB\u30B9\u30BF\u30E0
|
||||
AbstractPomTemplateProjectSettingPage.previewButton=\u30D7\u30EC\u30D3\u30E5\u30FC
|
||||
AbstractPomTemplateProjectSettingPage.learnMoreLink=\u8A73\u7D30
|
||||
|
||||
@@ -656,3 +656,7 @@ AnalysisReportAccessDialog.shellTitle=\u5DE5\u7A0B\u5206\u6790
|
||||
AnalysisReportAccessDialog.generateSuccess=\u5DE5\u7A0B\u5206\u6790\u6210\u529F\u5B8C\u6210\u3002
|
||||
AnalysisReportAccessDialog.completeReportAvailable=\u8BF7\u68C0\u67E5\u62A5\u544A
|
||||
AnalysisReportAccessDialog.accessReport=\u6B64\u5904
|
||||
AbstractPomTemplateProjectSettingPage.defaultTabLabel=\u9ED8\u8BA4
|
||||
AbstractPomTemplateProjectSettingPage.customTabLabel=\u81EA\u5B9A\u4E49
|
||||
AbstractPomTemplateProjectSettingPage.previewButton=\u9884\u89C8
|
||||
AbstractPomTemplateProjectSettingPage.learnMoreLink=\u4E86\u89E3\u66F4\u591A
|
||||
|
||||
@@ -41,6 +41,8 @@ public interface MavenConstants {
|
||||
static final String DEFAULT_VERSION = "6.0.0";
|
||||
|
||||
static final String SNAPSHOT = "-SNAPSHOT";
|
||||
|
||||
static final String DOT_SNAPSHOT = ".SNAPSHOT";
|
||||
|
||||
static final String POM_FILTER = "POM_FILTER";
|
||||
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.runtime.projectsetting;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CTabFolder;
|
||||
import org.eclipse.swt.custom.CTabItem;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.program.Program;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.ui.forms.events.HyperlinkAdapter;
|
||||
import org.eclipse.ui.forms.events.HyperlinkEvent;
|
||||
import org.eclipse.ui.forms.widgets.Hyperlink;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
|
||||
public abstract class AbstractPomTemplateProjectSettingPage extends AbstractProjectSettingPage {
|
||||
|
||||
private static final Color COLOR_LINK = new Color(null, 0, 0, 255);
|
||||
|
||||
protected StyledText defaultText;
|
||||
|
||||
protected StyledText customText;
|
||||
|
||||
private boolean isDefaultPresentedForScriptTxt = false;
|
||||
|
||||
private boolean readonly;
|
||||
|
||||
public AbstractPomTemplateProjectSettingPage() {
|
||||
super();
|
||||
IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
|
||||
readonly = factory.isUserReadOnlyOnCurrentProject();
|
||||
}
|
||||
|
||||
protected boolean isReadonly() {
|
||||
return readonly;
|
||||
}
|
||||
|
||||
public void setReadonly(boolean readonly) {
|
||||
this.readonly = readonly;
|
||||
}
|
||||
|
||||
protected abstract String getPreferenceKey();
|
||||
|
||||
protected StyledText getScriptTxt() {
|
||||
return customText;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createContents(Composite p) {
|
||||
Composite parent = (Composite) super.createContents(p);
|
||||
|
||||
Composite noteComposite = new Composite(parent, SWT.NONE);
|
||||
noteComposite.setLayout(new GridLayout(2, false));
|
||||
|
||||
Label scriptLabel = new Label(noteComposite, SWT.NONE);
|
||||
String headerMessages = getHeaderMessage();
|
||||
scriptLabel.setText(headerMessages);
|
||||
|
||||
Hyperlink link = new Hyperlink(noteComposite, SWT.NONE);
|
||||
link.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.learnMoreLink")); //$NON-NLS-1$
|
||||
link.setUnderlined(true);
|
||||
link.setForeground(COLOR_LINK);
|
||||
link.addHyperlinkListener(new HyperlinkAdapter() {
|
||||
|
||||
@Override
|
||||
public void linkActivated(HyperlinkEvent e) {
|
||||
Program.launch(getMoreInfoUrl());
|
||||
}
|
||||
});
|
||||
|
||||
CTabFolder tabFolder = new CTabFolder(parent, SWT.BORDER);
|
||||
// tabFolder.setTabPosition(SWT.BOTTOM);
|
||||
tabFolder.setSimple(false);
|
||||
|
||||
GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
|
||||
tabFolder.setLayoutData(data);
|
||||
data.heightHint = 280;
|
||||
data.minimumHeight = 280;
|
||||
data.widthHint = 500;
|
||||
data.minimumWidth = 500;
|
||||
|
||||
CTabItem defaultTabItem = new CTabItem(tabFolder, SWT.NULL);
|
||||
defaultTabItem.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.defaultTabLabel")); //$NON-NLS-1$
|
||||
CTabItem customTabItem = new CTabItem(tabFolder, SWT.NULL);
|
||||
customTabItem.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.customTabLabel")); //$NON-NLS-1$
|
||||
|
||||
tabFolder.setSelection(defaultTabItem);
|
||||
|
||||
int style = SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL;
|
||||
defaultText = new StyledText(tabFolder, style);
|
||||
defaultText.setText(getDefaultText());
|
||||
defaultText.setBackground(new Color(null, 233, 233, 233));
|
||||
defaultText.setEditable(false);
|
||||
defaultTabItem.setControl(defaultText);
|
||||
|
||||
customText = new StyledText(tabFolder, style);
|
||||
customText.setText(getCustomText());
|
||||
customText.setEditable(!isReadonly());
|
||||
customTabItem.setControl(customText);
|
||||
customText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
isDefaultPresentedForScriptTxt = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Button preview = new Button(parent, SWT.NONE);
|
||||
preview.setText(Messages.getString("AbstractPomTemplateProjectSettingPage.previewButton")); //$NON-NLS-1$
|
||||
preview.setToolTipText(Messages.getString("AbstractPomTemplateProjectSettingPage.previewButtonTip")); //$NON-NLS-1$
|
||||
preview.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
checkModel(true);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
protected abstract String getHeaderMessage();
|
||||
|
||||
protected abstract String getDefaultText();
|
||||
|
||||
protected String getCustomText() {
|
||||
return getPreferenceStore().getString(getPreferenceKey());
|
||||
}
|
||||
|
||||
protected abstract boolean checkModel(boolean preview);
|
||||
|
||||
protected abstract String getMoreInfoUrl();
|
||||
|
||||
@Override
|
||||
protected void performDefaults() {
|
||||
super.performDefaults();
|
||||
if (customText != null && !customText.isDisposed()) {
|
||||
isDefaultPresentedForScriptTxt = true;
|
||||
customText.setText(getPreferenceStore().getDefaultString(getPreferenceKey()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performOk() {
|
||||
boolean ok = super.performOk();
|
||||
if (customText != null && !customText.isDisposed()) {
|
||||
if (isDefaultPresentedForScriptTxt) {
|
||||
getPreferenceStore().setToDefault(getPreferenceKey());
|
||||
return ok;
|
||||
}
|
||||
if (!checkModel(false)) {
|
||||
return false;
|
||||
}
|
||||
getPreferenceStore().setValue(getPreferenceKey(), customText.getText());
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -60,6 +60,8 @@ public interface IProjectSettingTemplateConstants {
|
||||
|
||||
final static String PROJECT_TEMPLATE_FILE_NAME = "pom_project_template.xml";
|
||||
|
||||
final static String PROJECT_CUSTOM_TEMPLATE_FILE_NAME = "pom_project_custom_template.xml";
|
||||
|
||||
final static String MAVEN_USER_SETTING_TEMPLATE_FILE_NAME = "maven_user_settings.xml";
|
||||
|
||||
/*
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 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.runtime.projectsetting;
|
||||
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
public class PomPreviewDialog extends Dialog {
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
public PomPreviewDialog(Shell parentShell, String title, String content) {
|
||||
super(parentShell);
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureShell(Shell newShell) {
|
||||
super.configureShell(newShell);
|
||||
newShell.setText(title);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = (Composite) super.createDialogArea(parent);
|
||||
GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);
|
||||
data.heightHint = 280;
|
||||
data.minimumHeight = 1000;
|
||||
data.widthHint = 500;
|
||||
data.minimumWidth = 1100;
|
||||
composite.setLayoutData(data);
|
||||
|
||||
StyledText text = new StyledText(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
|
||||
text.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
|
||||
text.setText(content);
|
||||
text.setEditable(false);
|
||||
|
||||
return composite;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.core.runtime.util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.generation.JavaUtils;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.process.EParameterFieldType;
|
||||
import org.talend.core.model.process.IProcess;
|
||||
import org.talend.core.model.process.JobInfo;
|
||||
import org.talend.core.model.properties.JobletProcessItem;
|
||||
import org.talend.core.model.properties.ProcessItem;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.runprocess.IProcessor;
|
||||
import org.talend.repository.ProjectManager;
|
||||
|
||||
public class ModuleAccessHelper {
|
||||
|
||||
private static final String FORMAT_ADD_OPPENS = "--add-opens=@=ALL-UNNAMED"; //$NON-NLS-1$
|
||||
|
||||
private static final String CLASS_PREVIEW_PROCESS = "org.talend.designer.component.preview.shadow.PreviewComponentDataProcess"; //$NON-NLS-1$
|
||||
|
||||
private static final String CLASS_GUESS_SCHEMA_PROCESS = "org.talend.designer.core.ui.editor.properties.controllers.AbstractGuessSchemaProcess"; //$NON-NLS-1$
|
||||
|
||||
private static Properties PROPS;
|
||||
|
||||
public static Properties getProperties() {
|
||||
if (PROPS == null) {
|
||||
PROPS = new Properties();
|
||||
try (InputStream input = getConfigFileURL().openStream()) {
|
||||
PROPS.load(input);
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
Optional.ofNullable(System.getProperty("internal.custom.modules")).filter(StringUtils::isNotBlank)
|
||||
.ifPresent(modules -> put("GLOBAL", modules));
|
||||
|
||||
List<Project> allProjects = new ArrayList<>();
|
||||
allProjects.add(ProjectManager.getInstance().getCurrentProject());
|
||||
allProjects.addAll(ProjectManager.getInstance().getAllReferencedProjects(true));
|
||||
for (Project ref : allProjects) {
|
||||
ProjectPreferenceManager prefManager = new ProjectPreferenceManager(ref, CoreRuntimePlugin.PLUGIN_ID, false);
|
||||
String settings = prefManager.getValue(JavaUtils.CUSTOM_ACCESS_SETTINGS);
|
||||
if (StringUtils.isNotBlank(settings)) {
|
||||
Properties customProps = new Properties();
|
||||
try {
|
||||
customProps.load(new ByteArrayInputStream(settings.getBytes()));
|
||||
customProps.entrySet().stream().filter(en -> StringUtils.isNotBlank((String) en.getValue()))
|
||||
.forEach(en -> put((String) en.getKey(), (String) en.getValue()));
|
||||
|
||||
} catch (IOException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return PROPS;
|
||||
}
|
||||
|
||||
private static void put(String key, String value) {
|
||||
PROPS.put(key, PROPS.containsKey(key) ? PROPS.getProperty(key) + "," + value : value);
|
||||
}
|
||||
|
||||
public static URL getConfigFileURL() {
|
||||
return Platform.getBundle(CoreRuntimePlugin.PLUGIN_ID).getEntry("resources/module_access.properties"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
private static boolean containsKey(String key) {
|
||||
return getProperties().containsKey(key);
|
||||
}
|
||||
|
||||
private static Set<String> getModules(String key) {
|
||||
String modules = getProperties().getProperty(key);
|
||||
if (modules != null) {
|
||||
return Stream.of(modules.split(",")).map(module -> FORMAT_ADD_OPPENS.replace("@", module.trim())) //$NON-NLS-1$ //$NON-NLS-2$
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
private static boolean allowJavaInternalAcess(Property property) {
|
||||
String allow = System.getProperty(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS);
|
||||
if (allow != null) {
|
||||
return Boolean.valueOf(allow);
|
||||
}
|
||||
if (CommonsPlugin.isJUnitTest() || CommonsPlugin.isJunitWorking()) {
|
||||
return true;
|
||||
}
|
||||
Project project;
|
||||
if (property != null) {
|
||||
project = ProjectManager.getInstance()
|
||||
.getProjectFromProjectTechLabel(ProjectManager.getInstance().getProject(property).getTechnicalLabel());
|
||||
} else {
|
||||
project = ProjectManager.getInstance().getCurrentProject();
|
||||
}
|
||||
ProjectPreferenceManager preferenceManager = new ProjectPreferenceManager(project, CoreRuntimePlugin.PLUGIN_ID, false);
|
||||
return preferenceManager.getBoolean(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS);
|
||||
}
|
||||
|
||||
public static Set<String> getModuleAccessVMArgsForProcessor(IProcessor processor) {
|
||||
Property property = processor.getProperty();
|
||||
if (property == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
if (!allowJavaInternalAcess(property)) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
if (isPreviewProcess(processor)) {
|
||||
// add all for preview process
|
||||
return getProperties().entrySet().stream().filter(en -> StringUtils.isNotBlank((String) en.getValue()))
|
||||
.flatMap(en -> getModules((String) en.getKey()).stream()).collect(Collectors.toSet());
|
||||
|
||||
}
|
||||
ProcessItem mainJobItem = (ProcessItem) property.getItem();
|
||||
Set<JobInfo> allJobInfos = new HashSet<>();
|
||||
allJobInfos.add(new JobInfo(mainJobItem, mainJobItem.getProcess().getDefaultContext()));
|
||||
allJobInfos.addAll(processor.getBuildChildrenJobsAndJoblets());
|
||||
return ModuleAccessHelper.getModuleAccessVMArgs(property, allJobInfos);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Set<String> getModuleAccessVMArgs(Property property, Set<JobInfo> allJobInfos) {
|
||||
if (property == null || property.getItem() == null || !allowJavaInternalAcess(property)) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
Set<String> vmArgs = new HashSet<>();
|
||||
boolean hasTck = false;
|
||||
for (JobInfo info : allJobInfos) {
|
||||
EList<NodeType> nodes = null;
|
||||
EList<ElementParameterType> parameters = null;
|
||||
if (info.getJobletProperty() != null) {
|
||||
JobletProcessItem item = (JobletProcessItem) info.getJobletProperty().getItem();
|
||||
if (item.getJobletProcess() != null) {
|
||||
nodes = item.getJobletProcess().getNode();
|
||||
if (item.getJobletProcess().getParameters() != null) {
|
||||
parameters = item.getJobletProcess().getParameters().getElementParameter();
|
||||
}
|
||||
}
|
||||
} else if (info.getProcessItem() != null && info.getProcessItem().getProcess() != null) {
|
||||
nodes = info.getProcessItem().getProcess().getNode();
|
||||
if (info.getProcessItem().getProcess().getParameters() != null) {
|
||||
parameters = info.getProcessItem().getProcess().getParameters().getElementParameter();
|
||||
}
|
||||
}
|
||||
if (nodes != null) {
|
||||
nodes.stream().filter(node -> containsKey(node.getComponentName()))
|
||||
.forEach(node -> vmArgs.addAll(getModules(node.getComponentName())));
|
||||
}
|
||||
if (parameters != null) {
|
||||
// FIXME currently it depends on spark version, refine the condition if needed
|
||||
Optional<ElementParameterType> optional = parameters.stream()
|
||||
.filter(p -> "SUPPORTED_SPARK_VERSION".equals(p.getName()) && containsKey(p.getValue())).findFirst();
|
||||
if (optional.isPresent()) {
|
||||
vmArgs.addAll(getModules(optional.get().getValue()));
|
||||
}
|
||||
}
|
||||
if (!hasTck) {
|
||||
hasTck = nodes.stream()
|
||||
.anyMatch(node -> node.getElementParameter().stream()
|
||||
.anyMatch(p -> ((ElementParameterType) p).getField() != null
|
||||
&& EParameterFieldType.TECHNICAL.getName().equals(((ElementParameterType) p).getField())
|
||||
&& ((ElementParameterType) p).getName().equals("TACOKIT_COMPONENT_ID")));
|
||||
}
|
||||
}
|
||||
if (hasTck) {
|
||||
vmArgs.addAll(getModules("TCK_COMMON_ARGS"));
|
||||
}
|
||||
|
||||
if (getProperties().containsKey("GLOBAL")) {
|
||||
vmArgs.addAll(getModules("GLOBAL"));
|
||||
}
|
||||
|
||||
return vmArgs;
|
||||
}
|
||||
|
||||
public static void reset() {
|
||||
PROPS = null;
|
||||
}
|
||||
|
||||
private static boolean isPreviewProcess(IProcessor processor) {
|
||||
IProcess process = processor.getProcess();
|
||||
if (process == null) {
|
||||
return false;
|
||||
}
|
||||
Property property = processor.getProperty();
|
||||
if ("ID".equals(property.getId()) && "Mock_job_for_Guess_schema".equals(property.getLabel())) {
|
||||
return true;
|
||||
}
|
||||
Class<?> clazz = process.getClass();
|
||||
// preview process
|
||||
if (CLASS_PREVIEW_PROCESS.equals(clazz.getName()) || CLASS_PREVIEW_PROCESS.equals(clazz.getSuperclass().getName())) {
|
||||
return true;
|
||||
}
|
||||
// guess schema process
|
||||
if (CLASS_GUESS_SCHEMA_PROCESS.equals(clazz.getSuperclass().getName())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,10 +21,6 @@ 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;
|
||||
@@ -43,11 +39,13 @@ public interface ICloudSignOnService extends IService {
|
||||
|
||||
boolean isNeedShowSSOPage();
|
||||
|
||||
public void showReloginDialog();
|
||||
public boolean showReloginDialog();
|
||||
|
||||
public boolean isReloginDialogRunning();
|
||||
|
||||
public void reload();
|
||||
|
||||
public boolean isRelogined4CurrentTask(String clazz);
|
||||
|
||||
public static ICloudSignOnService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICloudSignOnService.class)) {
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 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 java.io.File;
|
||||
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.core.IService;
|
||||
|
||||
/**
|
||||
* @author bhe created on Jan 19, 2023
|
||||
*
|
||||
*/
|
||||
public interface IComponentJsonformGeneratorService extends IService {
|
||||
|
||||
/**
|
||||
* System property to enable whether to generate jsonform or not, not enabled by default
|
||||
*/
|
||||
public static final String JSONFORM_GENERATE_PROP = "jsonform.generate";
|
||||
|
||||
public static final String JSONFORM_GENERATE_FOLDER_PROP = "jsonform.generate.dir";
|
||||
|
||||
public static final String JSONFORM_GENERATE_FOLDER_NAME_PROP = "jsonforms";
|
||||
|
||||
/**
|
||||
* Generate jsonform json files for all of components
|
||||
*
|
||||
* <pre>
|
||||
* Folder structure
|
||||
*
|
||||
* targetFolder
|
||||
* --Category
|
||||
* ----tRowgenerator.json
|
||||
* ----tLogRow.json
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @param targetFolder all of jsonform jsons will be saved into the targetFolder
|
||||
*/
|
||||
void generate(File targetFolder);
|
||||
|
||||
/**
|
||||
* If enabled by -Djsonform.generate or by running junit, then generate jsonform for components, otherwise will not generate.
|
||||
*
|
||||
* @return enabled or not
|
||||
*/
|
||||
public static boolean isEnabled() {
|
||||
return Boolean.getBoolean(JSONFORM_GENERATE_PROP) || CommonsPlugin.isJUnitTest() || CommonsPlugin.isJunitWorking();
|
||||
}
|
||||
|
||||
public static String getDirectoryFromProperty() {
|
||||
return System.getProperty(JSONFORM_GENERATE_FOLDER_PROP);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2023 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.core.pendo.AbstractPendoTrackManager;
|
||||
import org.talend.core.pendo.TrackEvent;
|
||||
import org.talend.core.pendo.properties.IPendoDataProperties;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public interface ICoreTisRuntimeService extends IService {
|
||||
|
||||
String getTmcUser(String url, String token);
|
||||
|
||||
AbstractPendoTrackManager getPendoProjectLoginManager();
|
||||
|
||||
AbstractPendoTrackManager getPendoGenericManager(TrackEvent event, IPendoDataProperties peoperties);
|
||||
|
||||
boolean isPendoTrackAvailable() throws Exception;
|
||||
|
||||
void sendPendoTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception;
|
||||
|
||||
void sendPTPTrackData(String componentName, String componentUniqName, String jobId, String data);
|
||||
|
||||
static ICoreTisRuntimeService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreTisRuntimeService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(ICoreTisRuntimeService.class);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -75,4 +75,6 @@ public interface IESBMicroService extends IService {
|
||||
* @return
|
||||
*/
|
||||
IBuildJobHandler createBuildJobHandler(ProcessItem itemToExport, String version, String context, Map exportChoiceMap);
|
||||
|
||||
public List<String> getExternalizedDependencies();
|
||||
}
|
||||
|
||||
@@ -17,9 +17,6 @@ import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.nexus.ArtifactRepositoryBean;
|
||||
import org.talend.core.pendo.AbstractPendoTrackManager;
|
||||
import org.talend.core.pendo.TrackEvent;
|
||||
import org.talend.core.pendo.properties.IPendoDataProperties;
|
||||
import org.talend.utils.json.JSONException;
|
||||
import org.talend.utils.json.JSONObject;
|
||||
|
||||
@@ -39,16 +36,6 @@ public interface IRemoteService extends IService {
|
||||
|
||||
boolean isAuthorized(String value);
|
||||
|
||||
boolean isPendoTrackAvailable() throws Exception;
|
||||
|
||||
void sendPendoTrackData(TrackEvent event, IPendoDataProperties properties) throws Exception;
|
||||
|
||||
AbstractPendoTrackManager getPendoProjectLoginManager();
|
||||
|
||||
AbstractPendoTrackManager getPendoGenericManager(TrackEvent event, IPendoDataProperties peoperties);
|
||||
|
||||
String getTmcUser(String url, String token);
|
||||
|
||||
public boolean isCloudConnection();
|
||||
|
||||
public static IRemoteService get() {
|
||||
|
||||
@@ -12,14 +12,23 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.service;
|
||||
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.equinox.p2.repository.IRepository;
|
||||
import org.eclipse.equinox.security.storage.ISecurePreferences;
|
||||
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.general.Project;
|
||||
@@ -201,6 +210,12 @@ public interface IStudioLiteP2Service extends IService {
|
||||
}
|
||||
|
||||
public static interface UpdateSiteConfig {
|
||||
|
||||
public static final int DEFAULT_TIMEOUT = 4000;
|
||||
|
||||
public static final String PROTOCOL_HTTP = "http";
|
||||
|
||||
public static final String PROTOCOL_HTTPS = "https";
|
||||
|
||||
boolean isReleaseEditable();
|
||||
|
||||
@@ -239,6 +254,83 @@ public interface IStudioLiteP2Service extends IService {
|
||||
boolean isOverwriteTmcUpdateSettings(IProgressMonitor monitor) throws Exception;
|
||||
|
||||
void overwriteTmcUpdateSettings(IProgressMonitor monitor, boolean overwrite) throws Exception;
|
||||
|
||||
void enableBasicAuth(String uri, boolean enable) throws Exception;
|
||||
|
||||
boolean isEnabledBasicAuth(String uri) throws Exception;
|
||||
|
||||
public static boolean requireCredentials(URI uri, String nameAndPwd) throws Exception {
|
||||
String scheme = uri.getScheme();
|
||||
if (StringUtils.isEmpty(scheme) || (!StringUtils.equals(scheme, PROTOCOL_HTTP) && !StringUtils.equals(scheme, PROTOCOL_HTTPS))) {
|
||||
return false;
|
||||
}
|
||||
URL url = new URL(uri.toString() + "/p2.index");
|
||||
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
||||
conn.setConnectTimeout(DEFAULT_TIMEOUT);
|
||||
conn.setReadTimeout(DEFAULT_TIMEOUT);
|
||||
conn.setRequestMethod("HEAD");
|
||||
if (!StringUtils.isEmpty(nameAndPwd)) {
|
||||
nameAndPwd = Base64.encodeBase64String(nameAndPwd.getBytes());
|
||||
conn.addRequestProperty("Authorization", "Basic " + nameAndPwd);
|
||||
}
|
||||
|
||||
int responseCode = conn.getResponseCode();
|
||||
if (responseCode == HttpURLConnection.HTTP_UNAUTHORIZED || responseCode == HttpURLConnection.HTTP_FORBIDDEN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (responseCode != HttpURLConnection.HTTP_OK) {
|
||||
throw new Exception("status code: " + responseCode);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void saveCredentialsIntoSecureStore(URI uri, String uname, String pwd) throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
String nodeKey = URLEncoder.encode(uri.getHost(), StandardCharsets.UTF_8.name());
|
||||
|
||||
String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey;
|
||||
ISecurePreferences prefNode = null;
|
||||
|
||||
prefNode = securePreferences.node(nodeName);
|
||||
prefNode.put(IRepository.PROP_USERNAME, uname, true);
|
||||
prefNode.put(IRepository.PROP_PASSWORD, pwd, true);
|
||||
securePreferences.flush();
|
||||
}
|
||||
|
||||
public static String[] loadCredentialsFromSecureStore(URI uri) throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
String nodeKey = URLEncoder.encode(uri.getHost(), StandardCharsets.UTF_8.name());
|
||||
|
||||
String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey;
|
||||
ISecurePreferences prefNode = null;
|
||||
|
||||
String[] namePwd = new String[2];
|
||||
|
||||
if (!securePreferences.nodeExists(nodeName)) {
|
||||
return null;
|
||||
}
|
||||
prefNode = securePreferences.node(nodeName);
|
||||
|
||||
namePwd[0] = prefNode.get(IRepository.PROP_USERNAME, "");
|
||||
namePwd[1] = prefNode.get(IRepository.PROP_PASSWORD, "");
|
||||
|
||||
return namePwd;
|
||||
}
|
||||
|
||||
public static void deleteCredentialsFromSecureStore(URI uri) throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
String nodeKey = URLEncoder.encode(uri.getHost(), StandardCharsets.UTF_8.name());
|
||||
|
||||
String nodeName = IRepository.PREFERENCE_NODE + '/' + nodeKey;
|
||||
|
||||
if (securePreferences.nodeExists(nodeName)) {
|
||||
securePreferences.node(nodeName).removeNode();
|
||||
securePreferences.flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -81,6 +81,8 @@ public interface ITestContainerProviderService extends IService {
|
||||
|
||||
public List<ProcessItem> getAllTestContainers(ProcessItem item);
|
||||
|
||||
public List<ProcessItem> getAllTestContainers(ProcessItem item, boolean latest, boolean excludeDeleted);
|
||||
|
||||
public void copyDataSetFiles(IProcess process, IPath srcPath);
|
||||
|
||||
public String getTestDataValue(IProcess process, String instance, String testData);
|
||||
|
||||
@@ -438,6 +438,8 @@ public final class TalendQuoteUtils {
|
||||
return QUOTATION_MARK;
|
||||
case IBMDB2:
|
||||
return QUOTATION_MARK;
|
||||
case INGRES:
|
||||
return QUOTATION_MARK;
|
||||
case MSODBC:
|
||||
return QUOTATION_MARK;
|
||||
case MSSQL:
|
||||
|
||||
@@ -560,6 +560,7 @@ ContextNebulaComposite.ContextsUnAvailable=Context view is not available.
|
||||
ContextNebulaComposite.ContextGroupLabel=Default context environment
|
||||
ContextTreeTable.PromptToolTips=activate prompt on variable
|
||||
ContextValidator.ParameterNotValid=parameter name is not valid
|
||||
ContextValidator.ParameterValueNotMatch=Type/value mismatch: the value of a variable must match its type
|
||||
WorkspaceMnu.switch.text=Switch &Workspace
|
||||
WorkspaceMnu.switch.tooltip=Open Workspace
|
||||
WorkspaceMnu.choose.text=&Choose...
|
||||
|
||||
@@ -560,6 +560,7 @@ ContextNebulaComposite.ContextsUnAvailable=La vue Contextes n'est pas disponible
|
||||
ContextNebulaComposite.ContextGroupLabel=Environnement du contexte par d\u00E9faut
|
||||
ContextTreeTable.PromptToolTips=activer le prompt sur variable
|
||||
ContextValidator.ParameterNotValid=le nom du param\u00E8tre n'est pas valide
|
||||
ContextValidator.ParameterValueNotMatch=Mauvaise correspondance de type/valeur\u00A0: la valeur d'une variable doit correspondre \u00E0 son type
|
||||
WorkspaceMnu.switch.text=Changer de r\u00E9pertoire &Workspace
|
||||
WorkspaceMnu.switch.tooltip=Ouvrir le r\u00E9pertoire Workspace
|
||||
WorkspaceMnu.choose.text=&Choisir...
|
||||
|
||||
@@ -208,7 +208,7 @@ PropertiesWizardPage.Locker=\u30ED\u30C3\u30AF\u4FDD\u6301\u8005
|
||||
PropertiesWizardPage.Description=\u8AAC\u660E
|
||||
PropertiesWizardPage.EmptyDescWarning=\u8AAC\u660E\u306E\u7A7A\u767D\u306F\u907F\u3051\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.EmptyPurposeWarning=\u76EE\u7684\u306E\u7A7A\u767D\u306F\u907F\u3051\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.ItemExistsError=\u30A2\u30A4\u30C6\u30E0\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.ItemExistsError=\u9805\u76EE\u304C\u5B58\u5728\u3057\u307E\u3059\u3002\u3054\u307F\u7BB1\u3092\u78BA\u8A8D\u3057\u3066\u7A7A\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002
|
||||
PropertiesWizardPage.KeywordsError=\u540D\u524D\u304C\u6709\u52B9\u306AID\u3067\u306F\u3042\u308A\u307E\u305B\u3093\u3002
|
||||
PropertiesWizardPage.Name=\u540D\u524D
|
||||
PropertiesWizardPage.NameEmptyError=\u540D\u524D\u304C\u7A7A\u3067\u3059\u3002
|
||||
@@ -321,7 +321,7 @@ repository.metadataFileRegexp=\u6B63\u898F\u8868\u73FE\u30D5\u30A1\u30A4\u30EB
|
||||
repository.metadataFileRegexp.alias=REGX
|
||||
repository.metadataFileXml=XML\u30D5\u30A1\u30A4\u30EB
|
||||
repository.metadataFileXml.alias=XML
|
||||
repository.metadataGenericSchema=\u6C4E\u7528\u30B9\u30AD\u30FC\u30DE
|
||||
repository.metadataGenericSchema=\u30B8\u30A7\u30CD\u30EA\u30C3\u30AF\u30B9\u30AD\u30FC\u30DE
|
||||
repository.metadataGenericSchema.alias=GENERIC
|
||||
repository.metadataLDAPSchema=LDAP
|
||||
repository.metadataLDAPSchema.alias=LDAP
|
||||
@@ -560,6 +560,7 @@ ContextNebulaComposite.ContextsUnAvailable=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\
|
||||
ContextNebulaComposite.ContextGroupLabel=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u74B0\u5883
|
||||
ContextTreeTable.PromptToolTips=\u5909\u6570\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u6709\u52B9\u5316
|
||||
ContextValidator.ParameterNotValid=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u540D\u304C\u7121\u52B9\u3067\u3059\u3002
|
||||
ContextValidator.ParameterValueNotMatch=\u578B\u3068\u5024\u306E\u4E0D\u4E00\u81F4: \u5909\u6570\u306E\u5024\u306F\u305D\u306E\u578B\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
|
||||
WorkspaceMnu.switch.text=\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3092\u5207\u308A\u63DB\u3048(&W)
|
||||
WorkspaceMnu.switch.tooltip=\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3092\u958B\u304F
|
||||
WorkspaceMnu.choose.text=\u9078\u629E(&C)...
|
||||
@@ -579,6 +580,6 @@ I18nPreferencePage.restart=\u518D\u8D77\u52D5
|
||||
I18nPreferencePage.restartButton=\u6709\u52B9\u5316\u306B\u306F\u518D\u8D77\u52D5\u304C\u5FC5\u8981\u3067\u3059\u3002
|
||||
I18nPreferencePage.restoreDefault=\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u5FA9\u5143
|
||||
I18nPreferencePage.wait_process=\u3053\u306E\u51E6\u7406\u306B\u306F\u6570\u5206\u304B\u304B\u308A\u307E\u3059\u3002\u3057\u3070\u3089\u304F\u304A\u5F85\u3061\u304F\u3060\u3055\u3044...
|
||||
MetadataPreferencePage.EnableBasic.name=\u57FA\u672C\u8A8D\u8A3C\u30D8\u30C3\u30C0\u30FC\u3092\u6709\u52B9\u306B\u3059\u308B
|
||||
MetadataPreferencePage.EnableBasic.name=\u57FA\u672C\u8A8D\u8A3C\u30D8\u30C3\u30C0\u30FC\u3092\u6709\u52B9\u5316
|
||||
MetadataPreferencePage.MessageDialog.Restart=\u3053\u306E\u8A2D\u5B9A\u304C\u6709\u52B9\u306B\u306A\u308B\u3088\u3046\u3001Studio\u3092\u518D\u8D77\u52D5\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002\n\u7D9A\u884C\u3057\u307E\u3059\u304B?
|
||||
TalendTabbedPropertyTitle.componentHelpTooltip=\u30AA\u30F3\u30E9\u30A4\u30F3\u30D8\u30EB\u30D7\u3092\u958B\u304F
|
||||
|
||||
@@ -560,6 +560,7 @@ ContextNebulaComposite.ContextsUnAvailable=\u4E0A\u4E0B\u6587\u89C6\u56FE\u4E0D\
|
||||
ContextNebulaComposite.ContextGroupLabel=\u9ED8\u8BA4\u4E0A\u4E0B\u6587\u73AF\u5883
|
||||
ContextTreeTable.PromptToolTips=\u6FC0\u6D3B\u63D0\u793A\u53D8\u91CF
|
||||
ContextValidator.ParameterNotValid=\u53C2\u6570\u540D\u65E0\u6548
|
||||
ContextValidator.ParameterValueNotMatch=\u7C7B\u578B/\u503C\u4E0D\u5339\u914D\uFF1A\u53D8\u91CF\u7684\u503C\u4E0E\u5176\u7C7B\u578B\u4E0D\u5339\u914D
|
||||
WorkspaceMnu.switch.text=\u5207\u6362\u5DE5\u4F5C\u533A(&W)
|
||||
WorkspaceMnu.switch.tooltip=\u6253\u5F00\u5DE5\u4F5C\u533A
|
||||
WorkspaceMnu.choose.text=\u9009\u62E9(&C)...
|
||||
|
||||
@@ -59,6 +59,7 @@ import org.eclipse.nebula.widgets.nattable.hideshow.RowHideShowLayer;
|
||||
import org.eclipse.nebula.widgets.nattable.hideshow.command.ColumnHideCommand;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.DataLayer;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.config.DefaultColumnHeaderStyleConfiguration;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.layer.NatGridLayerPainter;
|
||||
@@ -82,6 +83,7 @@ import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
@@ -89,6 +91,7 @@ import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.ui.runtime.ColorConstants;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
@@ -109,6 +112,7 @@ import org.talend.core.ui.context.nattableTree.ContextNatTableStyleConfiguration
|
||||
import org.talend.core.ui.context.nattableTree.ContextNatTableUtils;
|
||||
import org.talend.core.ui.context.nattableTree.ContextParaModeChangeMenuConfiguration;
|
||||
import org.talend.core.ui.context.nattableTree.ContextRowDataListFixture;
|
||||
import org.talend.core.ui.context.nattableTree.ContextValueLabelAccumulator;
|
||||
import org.talend.core.ui.context.nattableTree.ExtendedContextColumnPropertyAccessor;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.repository.ProjectManager;
|
||||
@@ -128,7 +132,7 @@ public class ContextTreeTable {
|
||||
|
||||
private NatTable natTable;
|
||||
|
||||
// for bug TDI-32821, use LinkedList to keep the original order of context parameter list.
|
||||
// for bug TDI-32821锛<EFBFBD> use LinkedList to keep the original order of context parameter list.
|
||||
private List<ContextTreeNode> treeNodes = new LinkedList<ContextTreeNode>();
|
||||
|
||||
private static Map<String, Boolean> expandMap = new HashMap<>();
|
||||
@@ -270,7 +274,7 @@ public class ContextTreeTable {
|
||||
final GridLayer gridLayer = new GridLayer(viewportLayer, sortHeaderLayer, rowHeaderLayer, cornerLayer);
|
||||
|
||||
// config the column edit configuration
|
||||
ColumnOverrideLabelAccumulator labelAccumulator = new ColumnOverrideLabelAccumulator(bodyDataLayer);
|
||||
ContextValueLabelAccumulator labelAccumulator = new ContextValueLabelAccumulator(bodyDataLayer, bodyDataProvider, manager.getContextManager(), columnGroupModel);
|
||||
bodyDataLayer.setConfigLabelAccumulator(labelAccumulator);
|
||||
registerColumnLabels(labelAccumulator, ContextRowDataListFixture.getContexts(manager.getContextManager()));
|
||||
|
||||
@@ -306,14 +310,15 @@ public class ContextTreeTable {
|
||||
|
||||
attachCheckColumnTip(natTable);
|
||||
|
||||
final Color backgroundColor = ColorConstants.getTableBackgroundColor();
|
||||
// global settings only effect on body and default region, so should set other regions' color separately.
|
||||
natTable.setBackground(GUIHelper.COLOR_WHITE);
|
||||
natTable.setBackground(backgroundColor);
|
||||
natTable.addConfiguration(new AbstractRegistryConfiguration() {
|
||||
|
||||
@Override
|
||||
public void configureRegistry(IConfigRegistry configRegistry) {
|
||||
Style cellStyle = new Style();
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, backgroundColor);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL,
|
||||
GridRegion.COLUMN_HEADER);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL,
|
||||
@@ -550,8 +555,8 @@ public class ContextTreeTable {
|
||||
private void addCustomSelectionBehaviour(SelectionLayer layer) {
|
||||
// need control the selection style when select the rows.
|
||||
DefaultSelectionStyleConfiguration selectStyleConfig = new DefaultSelectionStyleConfiguration();
|
||||
selectStyleConfig.selectedHeaderBgColor = GUIHelper.COLOR_WIDGET_BACKGROUND;
|
||||
selectStyleConfig.selectedHeaderFgColor = GUIHelper.COLOR_BLACK;
|
||||
selectStyleConfig.selectedHeaderBgColor = ColorConstants.getTableBackgroundColor();
|
||||
selectStyleConfig.selectedHeaderFgColor = ColorConstants.getTableForegroundColor();
|
||||
selectStyleConfig.selectedHeaderFont = GUIHelper.DEFAULT_FONT;
|
||||
layer.addConfiguration(selectStyleConfig);
|
||||
}
|
||||
@@ -801,12 +806,32 @@ public class ContextTreeTable {
|
||||
if (cellValue instanceof Boolean) {
|
||||
return new Point(col, row);
|
||||
}
|
||||
ILayerCell cell = this.nt.getCellByPosition(col, row);
|
||||
if (cell != null && cell.getConfigLabels() != null
|
||||
&& cell.getConfigLabels().contains(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE)
|
||||
&& cell.getConfigLabels().contains(ContextTableConstants.COLUMN_CONTEXT_VALUE)) {
|
||||
return new Point(col, row);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getText(Event event) {
|
||||
return Messages.getString("ContextTreeTable.PromptToolTips"); //$NON-NLS-1$
|
||||
int col = this.nt.getColumnPositionByX(event.x);
|
||||
int row = this.nt.getRowPositionByY(event.y);
|
||||
|
||||
Object cellValue = this.nt.getDataValueByPosition(col, row);
|
||||
|
||||
if (cellValue instanceof Boolean) {
|
||||
return Messages.getString("ContextTreeTable.PromptToolTips");
|
||||
}
|
||||
ILayerCell cell = this.nt.getCellByPosition(col, row);
|
||||
if (cell != null && cell.getConfigLabels() != null
|
||||
&& cell.getConfigLabels().contains(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE)
|
||||
&& cell.getConfigLabels().contains(ContextTableConstants.COLUMN_CONTEXT_VALUE)) {
|
||||
return Messages.getString("ContextValidator.ParameterValueNotMatch");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.talend.commons.ui.runtime.ColorConstants;
|
||||
import org.talend.commons.ui.runtime.exception.ExceptionHandler;
|
||||
import org.talend.commons.ui.runtime.swt.calendar.SWTCalendarWithTime;
|
||||
import org.talend.commons.ui.swt.proposal.ContentProposalAdapterExtended;
|
||||
@@ -61,7 +62,7 @@ public class PatternCalendar extends SWTCalendarWithTime {
|
||||
gridLayout.marginHeight = 5;
|
||||
composite.setLayout(gridLayout);
|
||||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
composite.setBackground(getDisplay().getSystemColor(SWT.COLOR_WHITE));
|
||||
composite.setBackground(ColorConstants.getTableBackgroundColor());
|
||||
|
||||
Label patternLabel = new Label(composite, SWT.NONE);
|
||||
patternLabel.setText(Messages.getString("PatternCalendar.pattern")); //$NON-NLS-1$
|
||||
@@ -71,6 +72,7 @@ public class PatternCalendar extends SWTCalendarWithTime {
|
||||
patternText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
|
||||
patternText.addModifyListener(new ModifyListener() {
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
onPatternChange();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ public class ContextTableConstants {
|
||||
public static final String COLUMN_PROMPT_PROPERTY = "Prompt label"; //$NON-NLS-1$
|
||||
|
||||
public static final String COLUMN_CONTEXT_VALUE = "Value"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final String LABEL_CHANGED_FORCEGROUND = "LABEL_CHANGED_FORCEGROUND";
|
||||
|
||||
public static final String LABEL_VALUE_NOT_MATCH_TYPE = "LABEL_VALUE_NOT_MATCH_TYPE";
|
||||
|
||||
public static final int DEFAULT_COLUMN_COUNT = 8;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleProxy;
|
||||
import org.eclipse.nebula.widgets.nattable.style.IStyle;
|
||||
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
@@ -43,12 +44,8 @@ public class ContextAutoResizeTextPainter extends TextPainter {
|
||||
@Override
|
||||
public void setupGCFromConfig(GC gc, IStyle cellStyle) {
|
||||
super.setupGCFromConfig(gc, cellStyle);
|
||||
if (cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR).equals(GUIHelper.COLOR_RED)) {
|
||||
gc.setForeground(GUIHelper.COLOR_BLACK);
|
||||
} else if (containsRowName) {
|
||||
if (containsRowName) {
|
||||
gc.setForeground(GUIHelper.COLOR_RED);
|
||||
} else if (changeBackgroundColor) {
|
||||
gc.setForeground(GUIHelper.COLOR_WIDGET_DARK_SHADOW);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,12 +23,15 @@ import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsData
|
||||
import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
|
||||
import org.talend.core.ui.context.model.ContextTabChildModel;
|
||||
import org.talend.core.ui.context.model.ContextTabParentModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableConstants;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
|
||||
|
||||
/**
|
||||
@@ -49,18 +52,9 @@ public class ContextNatTableBackGroudPainter extends BackgroundPainter {
|
||||
@Override
|
||||
public void paintCell(ILayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getRowObject(cell.getRowIndex());
|
||||
if (rowNode.getTreeData() instanceof ContextTableTabParentModel) {
|
||||
ContextTableTabParentModel rowModel = (ContextTableTabParentModel) rowNode.getTreeData();
|
||||
Boolean isRepositoryContext = rowModel.hasChildren();
|
||||
if (isRepositoryContext) {
|
||||
((ContextAutoResizeTextPainter) getWrappedPainter()).setChangeBackgroundColor(true);
|
||||
} else {
|
||||
((ContextAutoResizeTextPainter) getWrappedPainter()).setChangeBackgroundColor(false);
|
||||
}
|
||||
} else {
|
||||
if (rowNode.getTreeData() instanceof ContextTabChildModel) {
|
||||
ContextTabChildModel rowChildModel = (ContextTabChildModel) rowNode.getTreeData();
|
||||
if (rowChildModel != null) {
|
||||
((ContextAutoResizeTextPainter) getWrappedPainter()).setChangeBackgroundColor(true);
|
||||
checkContainsRowName(rowNode, rowChildModel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.GC;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.talend.commons.ui.runtime.ColorConstants;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
|
||||
import org.talend.core.model.metadata.types.JavaTypesManager;
|
||||
@@ -115,7 +116,7 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
|
||||
private void registerStyleRules(IConfigRegistry configRegistry) {
|
||||
// register the default cell fg/bg colour for the natTable
|
||||
Style cellStyleDefault = new Style();
|
||||
cellStyleDefault.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_WHITE);
|
||||
cellStyleDefault.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, ColorConstants.getTableBackgroundColor());
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleDefault, DisplayMode.NORMAL,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
|
||||
@@ -136,7 +137,6 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
|
||||
|
||||
Style cellStyleSelect = new Style();
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_TITLE_INACTIVE_BACKGROUND);
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_RED);
|
||||
cellStyleSelect.setAttributeValue(CellStyleAttributes.FONT, GUIHelper.DEFAULT_FONT);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleSelect, DisplayMode.SELECT,
|
||||
ContextTableConstants.COLUMN_TYPE_PROPERTY);
|
||||
@@ -160,11 +160,15 @@ public class ContextNatTableConfiguration extends AbstractRegistryConfiguration
|
||||
private void registerValidateRules(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR,
|
||||
new EventDataValidator(dataProvider, manager), DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR,
|
||||
new EventDataValueValidator(dataProvider, manager, columnGroupModel), DisplayMode.EDIT, ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
private void registerErrorHandlingStrategies(IConfigRegistry configRegistry) {
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(),
|
||||
DisplayMode.EDIT, ContextTableConstants.COLUMN_NAME_PROPERTY);
|
||||
configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(),
|
||||
DisplayMode.EDIT, ContextTableConstants.COLUMN_CONTEXT_VALUE);
|
||||
}
|
||||
|
||||
private IEditableRule getEditRule() {
|
||||
|
||||
@@ -21,12 +21,15 @@ import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;
|
||||
import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.LineBorderDecorator;
|
||||
import org.eclipse.nebula.widgets.nattable.style.BorderStyle;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
|
||||
import org.eclipse.nebula.widgets.nattable.style.HorizontalAlignmentEnum;
|
||||
import org.eclipse.nebula.widgets.nattable.style.Style;
|
||||
import org.eclipse.nebula.widgets.nattable.style.VerticalAlignmentEnum;
|
||||
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.talend.commons.ui.runtime.ColorConstants;
|
||||
import org.talend.core.ui.context.model.table.ContextTableConstants;
|
||||
|
||||
/**
|
||||
* created by ldong on Aug 26, 2014 Detailled comment
|
||||
@@ -34,12 +37,6 @@ import org.eclipse.swt.graphics.Font;
|
||||
*/
|
||||
public class ContextNatTableStyleConfiguration extends AbstractRegistryConfiguration {
|
||||
|
||||
public Color bgColor = GUIHelper.COLOR_WHITE;
|
||||
|
||||
public Color fgColor = GUIHelper.COLOR_BLACK;
|
||||
|
||||
public Color gradientBgColor = GUIHelper.COLOR_WHITE;
|
||||
|
||||
public Color gradientFgColor = GUIHelper.getColor(136, 212, 215);
|
||||
|
||||
public Font font = GUIHelper.DEFAULT_FONT;
|
||||
@@ -67,17 +64,27 @@ public class ContextNatTableStyleConfiguration extends AbstractRegistryConfigura
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter);
|
||||
|
||||
Style cellStyle = new Style();
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, bgColor);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, fgColor);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, gradientBgColor);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, ColorConstants.getTableBackgroundColor());
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, ColorConstants.getTableForegroundColor());
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, ColorConstants.getTableBackgroundColor());
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, gradientFgColor);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.FONT, font);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, hAlign);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, vAlign);
|
||||
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, borderStyle);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle);
|
||||
|
||||
|
||||
Style cellStyleValueError = new Style();
|
||||
cellStyleValueError.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, ColorConstants.ERROR_FONT_COLOR);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleValueError, DisplayMode.NORMAL, ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleValueError, DisplayMode.SELECT, ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
|
||||
|
||||
Style cellStyleChangedForceGround = new Style();
|
||||
cellStyleChangedForceGround.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, ColorConstants.getTableReadOnlyForegroundColor());
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyleChangedForceGround, DisplayMode.NORMAL, ContextTableConstants.LABEL_CHANGED_FORCEGROUND);
|
||||
|
||||
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDisplayConverter());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.ILayer;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnOverrideLabelAccumulator;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
|
||||
import org.talend.core.ui.context.model.ContextTabChildModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableConstants;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
|
||||
import org.talend.core.ui.utils.ContextTypeValidator;
|
||||
|
||||
|
||||
public class ContextValueLabelAccumulator extends ColumnOverrideLabelAccumulator {
|
||||
|
||||
private IDataProvider dataProvider;
|
||||
private ColumnGroupModel columnGroupModel;
|
||||
private IContextManager manager;
|
||||
|
||||
public ContextValueLabelAccumulator(ILayer layer, IDataProvider dataProvider, IContextManager manager, ColumnGroupModel columnGroupModel) {
|
||||
super(layer);
|
||||
this.dataProvider = dataProvider;
|
||||
this.manager = manager;
|
||||
this.columnGroupModel = columnGroupModel;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) {
|
||||
super.accumulateConfigLabels(configLabels, columnPosition, rowPosition);
|
||||
boolean isAddedValueNotMatchStyle = false;
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getList().get(rowPosition);
|
||||
if (configLabels.contains(ContextTableConstants.COLUMN_CONTEXT_VALUE)) {
|
||||
if (columnGroupModel != null && columnGroupModel.isPartOfAGroup(columnPosition)) {
|
||||
String columnGroupName = columnGroupModel.getColumnGroupByIndex(columnPosition).getName();
|
||||
IContextParameter realPara = ContextNatTableUtils.getRealParameter(manager, columnGroupName, rowNode.getTreeData());
|
||||
if (realPara != null) {
|
||||
boolean isValid = ContextTypeValidator.isMatchType(realPara.getType(), realPara.getValue());
|
||||
if (isValid) {
|
||||
configLabels.remove(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
|
||||
} else {
|
||||
configLabels.addLabel(ContextTableConstants.LABEL_VALUE_NOT_MATCH_TYPE);
|
||||
isAddedValueNotMatchStyle = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAddedValueNotMatchStyle) {
|
||||
if (rowNode.getTreeData() instanceof ContextTableTabParentModel) {
|
||||
ContextTableTabParentModel rowModel = (ContextTableTabParentModel) rowNode.getTreeData();
|
||||
Boolean isRepositoryContext = rowModel.hasChildren();
|
||||
if (isRepositoryContext) {
|
||||
configLabels.addLabel(ContextTableConstants.LABEL_CHANGED_FORCEGROUND);
|
||||
} else {
|
||||
}
|
||||
} else {
|
||||
ContextTabChildModel rowChildModel = (ContextTabChildModel) rowNode.getTreeData();
|
||||
if (rowChildModel != null) {
|
||||
configLabels.addLabel(ContextTableConstants.LABEL_CHANGED_FORCEGROUND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,8 @@ import org.eclipse.swt.events.KeyListener;
|
||||
import org.eclipse.swt.events.MouseAdapter;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Font;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
@@ -272,4 +274,28 @@ public class ContextValuesNatText extends Composite {
|
||||
public Button getButton() {
|
||||
return this.button;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBackground(Color color) {
|
||||
super.setBackground(color);
|
||||
if (text != null && !text.isDisposed()) {
|
||||
text.setBackground(color);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFont(Font font) {
|
||||
super.setFont(font);
|
||||
if (text != null && !text.isDisposed()) {
|
||||
text.setFont(font);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setForeground(Color color) {
|
||||
super.setForeground(color);
|
||||
if (text != null && !text.isDisposed()) {
|
||||
text.setForeground(color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,17 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.config.RenderErrorHandling;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.AbstractCellEditor;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.ControlDecorationProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.editor.IEditErrorHandler;
|
||||
import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer.MoveDirectionEnum;
|
||||
import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes;
|
||||
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
|
||||
import org.eclipse.nebula.widgets.nattable.style.IStyle;
|
||||
import org.eclipse.nebula.widgets.nattable.style.Style;
|
||||
import org.eclipse.nebula.widgets.nattable.util.GUIHelper;
|
||||
import org.eclipse.nebula.widgets.nattable.widget.EditModeEnum;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.KeyAdapter;
|
||||
@@ -52,6 +60,18 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
* if password, the value will be * always. should find out the real value.
|
||||
*/
|
||||
private Object recordOriginalCanonicalValue;
|
||||
|
||||
protected final ControlDecorationProvider decorationProvider = new ControlDecorationProvider();
|
||||
|
||||
/**
|
||||
* The {@link IEditErrorHandler} that is used for showing conversion errors
|
||||
* on typing into this editor. By default this is the
|
||||
* {@link RenderErrorHandling} which will render the content in the editor
|
||||
* red to indicate a conversion error.
|
||||
*/
|
||||
private IEditErrorHandler inputConversionErrorHandler = new RenderErrorHandling(this.decorationProvider);
|
||||
|
||||
private IEditErrorHandler inputValidationErrorHandler = new RenderErrorHandling(this.decorationProvider);
|
||||
|
||||
public CustomTextCellEditor(IContextParameter realPara, IStyle cellStyle, boolean commitOnUpDown, boolean moveSelectionOnEnter) {
|
||||
this.realPara = realPara;
|
||||
@@ -106,9 +126,26 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyReleased(KeyEvent e) {
|
||||
try {
|
||||
// always do the conversion
|
||||
Object canonicalValue = getCanonicalValue(CustomTextCellEditor.this.inputConversionErrorHandler);
|
||||
// and always do the validation, even if for committing the
|
||||
// validation should be skipped, on editing
|
||||
// a validation failure should be made visible
|
||||
// otherwise there would be no need for validation!
|
||||
validateCanonicalValue(canonicalValue, CustomTextCellEditor.this.inputValidationErrorHandler);
|
||||
} catch (Exception ex) {
|
||||
// do nothing as exceptions caused by conversion or
|
||||
// validation are handled already we just need this catch
|
||||
// block for stopping the process if conversion failed with
|
||||
// an exception
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// text.addFocusListener(new FocusAdapter() {
|
||||
//
|
||||
// @Override
|
||||
@@ -164,6 +201,30 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
}
|
||||
|
||||
this.buttonText = (ContextValuesNatText) createEditorControl(parentComp);
|
||||
if (this.inputConversionErrorHandler instanceof RenderErrorHandling) {
|
||||
IStyle conversionErrorStyle = this.configRegistry.getConfigAttribute(
|
||||
EditConfigAttributes.CONVERSION_ERROR_STYLE,
|
||||
DisplayMode.EDIT,
|
||||
this.labelStack);
|
||||
|
||||
((RenderErrorHandling) this.inputConversionErrorHandler).setErrorStyle(conversionErrorStyle);
|
||||
}
|
||||
|
||||
if (this.inputValidationErrorHandler instanceof RenderErrorHandling) {
|
||||
IStyle validationErrorStyle = this.configRegistry.getConfigAttribute(
|
||||
EditConfigAttributes.VALIDATION_ERROR_STYLE,
|
||||
DisplayMode.EDIT,
|
||||
this.labelStack);
|
||||
|
||||
if (validationErrorStyle == null) {
|
||||
validationErrorStyle = new Style();
|
||||
validationErrorStyle.setAttributeValue(
|
||||
CellStyleAttributes.FOREGROUND_COLOR,
|
||||
GUIHelper.COLOR_RED);
|
||||
}
|
||||
|
||||
((RenderErrorHandling) this.inputValidationErrorHandler).setErrorStyle(validationErrorStyle);
|
||||
}
|
||||
// use the real value.
|
||||
setCanonicalValue(this.recordOriginalCanonicalValue);
|
||||
|
||||
@@ -194,4 +255,24 @@ public class CustomTextCellEditor extends AbstractCellEditor {
|
||||
this.freeEdit = freeEdit;
|
||||
}
|
||||
|
||||
|
||||
public IEditErrorHandler getInputConversionErrorHandler() {
|
||||
return inputConversionErrorHandler;
|
||||
}
|
||||
|
||||
|
||||
public void setInputConversionErrorHandler(IEditErrorHandler inputConversionErrorHandler) {
|
||||
this.inputConversionErrorHandler = inputConversionErrorHandler;
|
||||
}
|
||||
|
||||
|
||||
public IEditErrorHandler getInputValidationErrorHandler() {
|
||||
return inputValidationErrorHandler;
|
||||
}
|
||||
|
||||
|
||||
public void setInputValidationErrorHandler(IEditErrorHandler inputValidationErrorHandler) {
|
||||
this.inputValidationErrorHandler = inputValidationErrorHandler;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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.core.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.data.validate.DataValidator;
|
||||
import org.eclipse.nebula.widgets.nattable.data.validate.ValidationFailedException;
|
||||
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.ui.context.ContextTreeTable.ContextTreeNode;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.core.ui.utils.ContextTypeValidator;
|
||||
|
||||
public class EventDataValueValidator extends DataValidator {
|
||||
|
||||
private ColumnGroupModel columnGroupModel;
|
||||
private IDataProvider dataProvider;
|
||||
|
||||
private IContextManager manager;
|
||||
|
||||
EventDataValueValidator(IDataProvider bodyDataProvider, IContextManager manager, ColumnGroupModel columnGroupModel) {
|
||||
this.dataProvider = bodyDataProvider;
|
||||
this.manager = manager;
|
||||
this.columnGroupModel = columnGroupModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validate(int columnIndex, int rowIndex, Object newValue) {
|
||||
boolean isValid = true;
|
||||
ContextTreeNode rowNode = ((GlazedListsDataProvider<ContextTreeNode>) dataProvider).getList().get(rowIndex);
|
||||
if (columnGroupModel != null && columnGroupModel.isPartOfAGroup(columnIndex)) {
|
||||
String columnGroupName = columnGroupModel.getColumnGroupByIndex(columnIndex).getName();
|
||||
IContextParameter realPara = ContextNatTableUtils.getRealParameter(manager, columnGroupName, rowNode.getTreeData());
|
||||
if (realPara != null) {
|
||||
isValid = ContextTypeValidator.isMatchType(realPara.getType(), newValue);
|
||||
if (!isValid) {
|
||||
throw new ValidationFailedException(Messages.getString("ContextValidator.ParameterValueNotMatch")); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
}
|
||||
@@ -425,6 +425,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -507,6 +508,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -588,6 +590,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -684,6 +687,7 @@ public class ExtendedContextColumnPropertyAccessor<R> implements IColumnProperty
|
||||
&& jobContextManager.isOriginalParameter(param.getName())) {
|
||||
jobContextManager.setModified(true);
|
||||
manager.fireContextsChangedEvent();
|
||||
modelManager.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.ui.runtime.ITalendThemeService;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
@@ -173,10 +174,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 +185,33 @@ public class TalendTabbedPropertyTitle extends Composite implements ITalendTabbe
|
||||
}
|
||||
}
|
||||
|
||||
private Color getStartColor() {
|
||||
return ITalendThemeService.getColor("org.talend.core.repository.TAB_START_COLOR")
|
||||
.orElse(factory.getColors().getColor(IFormColors.H_GRADIENT_END));
|
||||
}
|
||||
|
||||
private Color getEndColor() {
|
||||
return ITalendThemeService.getColor("org.talend.core.repository.TAB_END_COLOR")
|
||||
.orElse(factory.getColors().getColor(IFormColors.H_GRADIENT_START));
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
@@ -78,6 +78,7 @@ public class RoutinesFunctionProposal implements IContentProposal {
|
||||
message += Messages.getString("RoutinesFunctionProposal.CreatedBy.v1");
|
||||
message += Messages.getString("RoutinesFunctionProposal.ReturnType.v1");
|
||||
message += Messages.getString("RoutinesFunctionProposal.VariableName.v1");
|
||||
message = message.replaceAll("\n", System.getProperty("line.separator", "\n")); // for display on Windows platform
|
||||
|
||||
MessageFormat format = new MessageFormat(message);
|
||||
Object[] args = new Object[] { function.getDescription(),
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package org.talend.core.ui.services;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.codec.binary.StringUtils;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
@@ -11,7 +15,6 @@ import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
import org.talend.core.ui.properties.tab.IDynamicProperty;
|
||||
|
||||
@@ -40,7 +43,7 @@ public interface IGitUIProviderService extends IService {
|
||||
|
||||
void showSwithGitModePopup();
|
||||
|
||||
Map<Project, List<Project>> getInvalidReferencedProjects();
|
||||
List<ProjectBranchNode> getInvalidProjectBranchNodes();
|
||||
|
||||
public static IGitUIProviderService get() {
|
||||
GlobalServiceRegister register = GlobalServiceRegister.getDefault();
|
||||
@@ -50,4 +53,80 @@ public interface IGitUIProviderService extends IService {
|
||||
return register.getService(IGitUIProviderService.class);
|
||||
}
|
||||
|
||||
public static class ProjectBranchNode {
|
||||
|
||||
private String branch;
|
||||
|
||||
private String techLabel;
|
||||
|
||||
private ProjectBranchNode parent;
|
||||
|
||||
private Set<ProjectBranchNode> children = new HashSet<ProjectBranchNode>();
|
||||
|
||||
public ProjectBranchNode(String techLabel, String branch) {
|
||||
this.branch = branch;
|
||||
this.techLabel = techLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the branch
|
||||
*/
|
||||
public String getBranch() {
|
||||
return branch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the techLabel
|
||||
*/
|
||||
public String getTechLabel() {
|
||||
return techLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the parent
|
||||
*/
|
||||
public ProjectBranchNode getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the children
|
||||
*/
|
||||
public Collection<ProjectBranchNode> getChildren() {
|
||||
return Collections.unmodifiableCollection(children);
|
||||
}
|
||||
|
||||
public void addChild(ProjectBranchNode c) {
|
||||
c.parent = this;
|
||||
this.children.add(c);
|
||||
}
|
||||
|
||||
public boolean hasChildren() {
|
||||
return !this.children.isEmpty();
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = hash * 31 + this.techLabel.hashCode();
|
||||
hash = hash * 31 + this.branch.hashCode();
|
||||
return hash;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(o instanceof ProjectBranchNode)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ProjectBranchNode thatObj = (ProjectBranchNode) o;
|
||||
if (!StringUtils.equals(techLabel, thatObj.getTechLabel())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return StringUtils.equals(this.branch, thatObj.getBranch());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.ui.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType;
|
||||
|
||||
public class ContextTypeValidator {
|
||||
|
||||
public static boolean isMatchType(ContextParameterType contextParam) {
|
||||
return isMatchType(contextParam.getType(), contextParam.getValue());
|
||||
}
|
||||
|
||||
public static boolean isMatchType(String type, Object objValue) {
|
||||
String strValue = null;
|
||||
if (objValue == null) {
|
||||
return true;
|
||||
}
|
||||
if (objValue instanceof String) {
|
||||
strValue = (String) objValue;
|
||||
}
|
||||
if (StringUtils.isEmpty(strValue)) {
|
||||
return true;
|
||||
}
|
||||
boolean isValid = true;
|
||||
switch (type) {
|
||||
case "id_Integer": {
|
||||
try {
|
||||
ParserUtils.parseTo_int(strValue);
|
||||
} catch (NumberFormatException ex) {
|
||||
isValid = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "id_Double": {
|
||||
try {
|
||||
ParserUtils.parseTo_double(strValue);
|
||||
} catch (NumberFormatException ex) {
|
||||
isValid = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "id_Float": {
|
||||
try {
|
||||
ParserUtils.parseTo_float(strValue);
|
||||
} catch (NumberFormatException ex) {
|
||||
isValid = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "id_BigDecimal": {
|
||||
try {
|
||||
ParserUtils.parseTo_BigDecimal(strValue);
|
||||
} catch (NumberFormatException ex) {
|
||||
isValid = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "id_Long": {
|
||||
try {
|
||||
ParserUtils.parseTo_long(strValue);
|
||||
} catch (NumberFormatException ex) {
|
||||
isValid = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "id_Short": {
|
||||
try {
|
||||
ParserUtils.parseTo_short(strValue);
|
||||
} catch (NumberFormatException ex) {
|
||||
isValid = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.ui.utils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ParserUtils {
|
||||
|
||||
public static List<String> parseTo_List(String s) {
|
||||
return parseTo_List(s, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* the source should be a string wrapped in chars[ ] which stands for it is a collection
|
||||
*
|
||||
* @param stSrc
|
||||
* @param fieldSep
|
||||
* @return
|
||||
*/
|
||||
public static List<String> parseTo_List(final String strSrc, String fieldSep) {
|
||||
if (strSrc == null) {
|
||||
return null;
|
||||
}
|
||||
List<String> list = new ArrayList<String>();
|
||||
|
||||
// the source string is wrap in [] which means it is a collection
|
||||
if ((fieldSep == null || "".equals(fieldSep)) || !(strSrc.startsWith("[") && strSrc.endsWith("]"))) {
|
||||
list.add(strSrc);
|
||||
return list;
|
||||
}
|
||||
String strTemp = strSrc.substring(1, strSrc.length() - 1); // remove the [ ]
|
||||
for (String str : strTemp.split(fieldSep, -1)) {
|
||||
list.add(str);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static Character parseTo_Character(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return s.charAt(0);
|
||||
}
|
||||
|
||||
public static char parseTo_char(String s) {
|
||||
return parseTo_Character(s);
|
||||
}
|
||||
|
||||
public static Byte parseTo_Byte(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return Byte.decode(s).byteValue();
|
||||
}
|
||||
|
||||
public static Byte parseTo_Byte(String s, boolean isDecode) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
if (isDecode) {
|
||||
return Byte.decode(s).byteValue();
|
||||
} else {
|
||||
return Byte.parseByte(s);
|
||||
}
|
||||
}
|
||||
|
||||
public static byte parseTo_byte(String s) {
|
||||
return parseTo_Byte(s);
|
||||
}
|
||||
|
||||
public static byte parseTo_byte(String s, boolean isDecode) {
|
||||
return parseTo_Byte(s, isDecode);
|
||||
}
|
||||
|
||||
public static Double parseTo_Double(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return Double.parseDouble(s);
|
||||
}
|
||||
|
||||
public static double parseTo_double(String s) {
|
||||
return parseTo_Double(s);
|
||||
}
|
||||
|
||||
public static float parseTo_float(String s) {
|
||||
return Float.parseFloat(s);
|
||||
}
|
||||
|
||||
public static Float parseTo_Float(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return parseTo_float(s);
|
||||
}
|
||||
|
||||
public static int parseTo_int(String s) {
|
||||
return Integer.parseInt(s);
|
||||
}
|
||||
|
||||
public static int parseTo_int(String s, boolean isDecode) {
|
||||
if (isDecode) {
|
||||
return Integer.decode(s).intValue();
|
||||
} else {
|
||||
return Integer.parseInt(s);
|
||||
}
|
||||
}
|
||||
|
||||
public static Integer parseTo_Integer(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return parseTo_int(s);
|
||||
}
|
||||
|
||||
public static Integer parseTo_Integer(String s, boolean isDecode) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return parseTo_int(s, isDecode);
|
||||
}
|
||||
|
||||
public static short parseTo_short(String s) {
|
||||
return Short.parseShort(s);
|
||||
}
|
||||
|
||||
public static short parseTo_short(String s, boolean isDecode) {
|
||||
if (isDecode) {
|
||||
return Short.decode(s).shortValue();
|
||||
} else {
|
||||
return Short.parseShort(s);
|
||||
}
|
||||
}
|
||||
|
||||
public static Short parseTo_Short(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return parseTo_short(s);
|
||||
}
|
||||
|
||||
public static Short parseTo_Short(String s, boolean isDecode) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return parseTo_short(s, isDecode);
|
||||
}
|
||||
|
||||
public static long parseTo_long(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
|
||||
public static long parseTo_long(String s, boolean isDecode) {
|
||||
if (isDecode) {
|
||||
return Long.decode(s).longValue();
|
||||
} else {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}
|
||||
|
||||
public static Long parseTo_Long(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return parseTo_long(s);
|
||||
}
|
||||
|
||||
public static Long parseTo_Long(String s, boolean isDecode) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
return parseTo_long(s, isDecode);
|
||||
}
|
||||
|
||||
public static Boolean parseTo_Boolean(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
if (s.equals("1")) { //$NON-NLS-1$
|
||||
return Boolean.parseBoolean("true"); //$NON-NLS-1$
|
||||
}
|
||||
return Boolean.parseBoolean(s);
|
||||
}
|
||||
|
||||
public static boolean parseTo_boolean(String s) {
|
||||
return parseTo_Boolean(s);
|
||||
}
|
||||
|
||||
public static String parseTo_String(String s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
public static String parseTo_String(final List<String> s, String fieldSep) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
StringBuffer result = new StringBuffer();
|
||||
result.append("[");
|
||||
for (int i = 0; i < s.size(); i++) {
|
||||
if (i != 0) {
|
||||
result.append(fieldSep);
|
||||
}
|
||||
result.append(s.get(i));
|
||||
}
|
||||
result.append("]");
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
public static BigDecimal parseTo_BigDecimal(String s) {
|
||||
if (s == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return new BigDecimal(s);
|
||||
|
||||
} catch (NumberFormatException nfe) {
|
||||
|
||||
if (nfe.getMessage() == null) {
|
||||
|
||||
throw new NumberFormatException("Incorrect input \"" + s + "\" for BigDecimal.");
|
||||
|
||||
} else {
|
||||
|
||||
throw nfe;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -63,6 +63,7 @@ public final class GenerateQueryFactory {
|
||||
case IBMDB2ZOS:
|
||||
case MYSQL:
|
||||
case AMAZON_AURORA:
|
||||
case INGRES:
|
||||
return new NonDatabaseDefaultQueryGenerator(dbType);
|
||||
case ORACLE_OCI:
|
||||
case ORACLEFORSID:
|
||||
|
||||
@@ -99,6 +99,8 @@ public class CorePreferenceInitializer extends AbstractPreferenceInitializer {
|
||||
CorePlugin.getDefault().getPreferenceStore()
|
||||
.setDefault(ITalendCorePrefConstants.FORBIDDEN_MAPPING_LENGTH_PREC_LOGIC, false);
|
||||
|
||||
CorePlugin.getDefault().getPreferenceStore().setDefault(ITalendCorePrefConstants.PERSPECTIVE_PERSIST_SCOPE,
|
||||
ITalendCorePrefConstants.PERSPECTIVE_PERSIST_SCOPE_DEFAULT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user