Compare commits
179 Commits
release/8.
...
release/8.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82174dc5ea | ||
|
|
c942e2ee35 | ||
|
|
51f3e07528 | ||
|
|
1af34cb93f | ||
|
|
d575088589 | ||
|
|
cbd9486931 | ||
|
|
c2511328fd | ||
|
|
5c629d27b8 | ||
|
|
b63ff6f17f | ||
|
|
e6d3e2b37a | ||
|
|
d5716b9d63 | ||
|
|
aa3e090f18 | ||
|
|
6e31236ae2 | ||
|
|
ae5f950a78 | ||
|
|
23b5df5c4f | ||
|
|
98ee4f4ba1 | ||
|
|
ffc70af105 | ||
|
|
5e59f89dea | ||
|
|
0e697d0ef6 | ||
|
|
9a2e7c2381 | ||
|
|
8b4f177efc | ||
|
|
4ff907bf75 | ||
|
|
abfd3b7c1b | ||
|
|
4ef6f6a95e | ||
|
|
0ae7943cf2 | ||
|
|
a2ce928d6a | ||
|
|
85f2664512 | ||
|
|
452ef9896a | ||
|
|
81da114430 | ||
|
|
8b34d91c2a | ||
|
|
14673efa17 | ||
|
|
efd8c964b8 | ||
|
|
fc0aa30340 | ||
|
|
3c056baeb7 | ||
|
|
e0d5352efa | ||
|
|
440effae2d | ||
|
|
0e399e778f | ||
|
|
5e798295ea | ||
|
|
177287eebf | ||
|
|
c4ee889b3e | ||
|
|
26ead1e043 | ||
|
|
5553ce8694 | ||
|
|
caa99b5658 | ||
|
|
057580aa9e | ||
|
|
d66aa2af38 | ||
|
|
95f7b845b3 | ||
|
|
21d1ea7f84 | ||
|
|
d3a6096bc0 | ||
|
|
5705ca4789 | ||
|
|
4a7a831c77 | ||
|
|
e169b49a01 | ||
|
|
d302023eea | ||
|
|
2256de6b73 | ||
|
|
c2162b4074 | ||
|
|
2ee30fecd0 | ||
|
|
340a06876c | ||
|
|
f3c39d14d5 | ||
|
|
9c2e26bcab | ||
|
|
65e7cfb71e | ||
|
|
b338afee4c | ||
|
|
87d7a849ac | ||
|
|
73a2ac7971 | ||
|
|
e22dfb1215 | ||
|
|
9781e2fe08 | ||
|
|
60cc7742ad | ||
|
|
5369ee2142 | ||
|
|
4406d35a69 | ||
|
|
33d797e16c | ||
|
|
c282d32a80 | ||
|
|
543c5a29f8 | ||
|
|
f91f791c24 | ||
|
|
be96adb142 | ||
|
|
33d1276627 | ||
|
|
f6d544c5e3 | ||
|
|
2b8777269d | ||
|
|
fb360093a8 | ||
|
|
38fdc62738 | ||
|
|
8f1cc68be3 | ||
|
|
f34bb8520c | ||
|
|
888c3281f6 | ||
|
|
db614cc415 | ||
|
|
5210b033d0 | ||
|
|
e91b347450 | ||
|
|
ea459b8710 | ||
|
|
2ee58ac9d0 | ||
|
|
0e668b3239 | ||
|
|
1fe8bec5cf | ||
|
|
74d5eb4d90 | ||
|
|
12a842a565 | ||
|
|
9419f94c07 | ||
|
|
0beef6b531 | ||
|
|
d19f0dbce7 | ||
|
|
6ff18c0449 | ||
|
|
4c93a1bed0 | ||
|
|
2462a7a792 | ||
|
|
e18ffe5f0f | ||
|
|
b22b9decce | ||
|
|
9a3307bace | ||
|
|
dd5400af61 | ||
|
|
505609aa4b | ||
|
|
99da8e2286 | ||
|
|
239ece2966 | ||
|
|
ce4740ce83 | ||
|
|
7c795f724c | ||
|
|
67784188df | ||
|
|
248a7d74dc | ||
|
|
c09c406c32 | ||
|
|
bd5b8b0f51 | ||
|
|
eb7c195d3e | ||
|
|
33162c8be4 | ||
|
|
7169a3101a | ||
|
|
192e47b6a3 | ||
|
|
28eda4c880 | ||
|
|
309c2ac056 | ||
|
|
64c530b6b4 | ||
|
|
71f93b5165 | ||
|
|
41b50e16c1 | ||
|
|
b7711e1dd5 | ||
|
|
8ed759c0d8 | ||
|
|
3ff40da876 | ||
|
|
da6a983f29 | ||
|
|
2913c80aef | ||
|
|
fa2abaf8f3 | ||
|
|
81e63ecab0 | ||
|
|
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 |
@@ -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"/>
|
||||
@@ -17,7 +16,7 @@
|
||||
<import plugin="org.apache.commons.lang" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.commons.lang3" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.log4j" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.apache.servicemix.bundles.avro" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="avro" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.junit" version="4.13.2" match="greaterOrEqual"/>
|
||||
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.slf4j.binding.log4j12" version="0.0.0" match="greaterOrEqual"/>
|
||||
|
||||
BIN
main/plugins/org.talend.common.ui.runtime/icons/moreInfo.png
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/moreInfo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 288 B |
Binary file not shown.
|
After Width: | Height: | Size: 627 B |
@@ -37,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);
|
||||
|
||||
@@ -55,12 +57,17 @@ public interface ColorConstants {
|
||||
|
||||
static Color getTableBackgroundColor() {
|
||||
return ITalendThemeService.getColor(ColorConstants.BUNDLE_ID_COMMON_UI_RUNTIME, ColorConstants.KEY_TABLE_BACKGROUND)
|
||||
.orElse(WHITE_COLOR);
|
||||
.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_BLACK));
|
||||
.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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ 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;
|
||||
@@ -29,6 +30,8 @@ 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
|
||||
@@ -132,6 +135,8 @@ public interface ITalendThemeService {
|
||||
|
||||
void removePropertyChangeListenerFor(String bundleId, IPropertyChangeListener listener);
|
||||
|
||||
IPreferenceStore getThemePreferenceStore();
|
||||
|
||||
static ITalendThemeService get() {
|
||||
try {
|
||||
BundleContext bc = FrameworkUtil.getBundle(ITalendThemeService.class).getBundleContext();
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -115,6 +115,8 @@ public enum ECoreImage implements IImage {
|
||||
|
||||
METADATA_SAPCONNECTION_ICON("/icons1/sapconnection.png"), //$NON-NLS-1$
|
||||
METADATA_SAPCONNECTION_WIZ("/icons1/connection_wiz.gif"), //$NON-NLS-1$
|
||||
|
||||
METADATA_BIGQUERYCONNECTION_ICON("/icons1/bigqueryconnection.png"), //$NON-NLS-1$
|
||||
|
||||
METADATA_HEADERFOOTER_ICON("/icons1/headerfooter_icon32.png"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ public enum EImage implements IImage {
|
||||
READ_ICON("/icons/read_obj.gif"), //$NON-NLS-1$
|
||||
|
||||
QUESTION_ICON("/icons/question.gif"), //$NON-NLS-1$
|
||||
|
||||
HELP_ICON("/icons/help.png"), //$NON-NLS-1$
|
||||
MOREINFO_ICON("/icons/moreInfo.png"), //$NON-NLS-1$
|
||||
|
||||
CREATE_CONNECTION_ICON("/icons/connection.gif"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>2.12.0</version>
|
||||
<version>2.12.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.reload4j</groupId>
|
||||
@@ -125,7 +125,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
<version>32.0.1-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -145,7 +145,30 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
*/
|
||||
@Override
|
||||
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException {
|
||||
return new DB2ForZosResultSet();
|
||||
ResultSet rs = super.getPrimaryKeys(catalog, schema, table);
|
||||
if (rs == null) {
|
||||
rs = new DB2ForZosResultSet();
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeDatabaseMetaData#getExportedKeys(java.lang.String, java.lang.String,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException {
|
||||
ResultSet rs = super.getExportedKeys(catalog, schema, table);
|
||||
if (rs == null) {
|
||||
if (this.metaData != null) {
|
||||
rs = this.metaData.getExportedKeys(catalog, schema, table);
|
||||
} else {
|
||||
rs = new DB2ForZosResultSet();
|
||||
}
|
||||
}
|
||||
return rs;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -174,17 +197,6 @@ public class DB2ForZosDataBaseMetadata extends PackageFakeDatabaseMetadata {
|
||||
return tableResultSet;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.utils.database.FakeDatabaseMetaData#getExportedKeys(java.lang.String, java.lang.String,
|
||||
* java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException {
|
||||
return new DB2ForZosResultSet();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
@@ -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;
|
||||
|
||||
@@ -20,7 +20,8 @@ Require-Bundle: org.eclipse.core.runtime,
|
||||
org.talend.commons.runtime,
|
||||
org.talend.common.ui.runtime;visibility:=reexport,
|
||||
org.talend.libraries.ui;visibility:=reexport,
|
||||
org.eclipse.ui.workbench
|
||||
org.eclipse.ui.workbench,
|
||||
org.eclipse.jface.notifications
|
||||
Eclipse-LazyStart: true
|
||||
Bundle-Vendor: .Talend SA.
|
||||
Export-Package: org.talend.commons.ui.command,
|
||||
@@ -28,6 +29,7 @@ Export-Package: org.talend.commons.ui.command,
|
||||
org.talend.commons.ui.gmf.util,
|
||||
org.talend.commons.ui.html,
|
||||
org.talend.commons.ui.i18n,
|
||||
org.talend.commons.ui.nofitication,
|
||||
org.talend.commons.ui.swt.actions,
|
||||
org.talend.commons.ui.swt.advanced.composite,
|
||||
org.talend.commons.ui.swt.advanced.dataeditor,
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.nofitication;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.notifications.AbstractNotificationPopup;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Monitor;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
public abstract class ArrangedNotificationPopup extends AbstractNotificationPopup {
|
||||
|
||||
protected static final int MAX_WIDTH = 400;
|
||||
|
||||
protected static final int MIN_HEIGHT = 100;
|
||||
|
||||
protected static final int PADDING_EDGE = 5;
|
||||
|
||||
private static NotificationManager manager;
|
||||
|
||||
public ArrangedNotificationPopup(Display display) {
|
||||
super(display);
|
||||
}
|
||||
|
||||
public ArrangedNotificationPopup(Display display, int style) {
|
||||
super(display, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createContentArea(Composite parent) {
|
||||
createControl(parent);
|
||||
afterCreate();
|
||||
}
|
||||
|
||||
protected abstract void createControl(Composite parent);
|
||||
|
||||
@Override
|
||||
protected Shell getParentShell() {
|
||||
return getNotificationManager().getParentShell();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initializeBounds() {
|
||||
Rectangle clArea = getPrimaryClientArea();
|
||||
Point initialSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
int height = Math.max(initialSize.y, MIN_HEIGHT);
|
||||
int width = Math.min(initialSize.x, MAX_WIDTH);
|
||||
|
||||
Point size = new Point(width, height);
|
||||
getShell().setLocation(clArea.width + clArea.x - size.x - PADDING_EDGE, clArea.height + clArea.y - size.y - PADDING_EDGE);
|
||||
getShell().setSize(size);
|
||||
}
|
||||
|
||||
private Rectangle getPrimaryClientArea() {
|
||||
Shell parentShell = getParentShell();
|
||||
if (parentShell != null) {
|
||||
// calculate client area in display-relative coordinates
|
||||
// (i.e. without window border / decorations)
|
||||
Rectangle bounds = parentShell.getBounds();
|
||||
Rectangle trim = parentShell.computeTrim(0, 0, 0, 0);
|
||||
List<Window> toasts = getNotificationManager().getWindows();
|
||||
Rectangle rect = new Rectangle(bounds.x - trim.x, bounds.y - trim.y, bounds.width - trim.width,
|
||||
bounds.height - trim.height);
|
||||
if (!toasts.isEmpty()) {
|
||||
int index = 0;
|
||||
if (toasts.contains(this)) {
|
||||
// parent shell resize or move
|
||||
index = toasts.indexOf(this);
|
||||
if (index == 0) {
|
||||
// return parent shell rectangle if it's the first one at bottom
|
||||
return rect;
|
||||
}
|
||||
// the one under current toast
|
||||
index -= 1;
|
||||
} else {
|
||||
// toast creation
|
||||
// the one on the top
|
||||
index = toasts.size() - 1;
|
||||
}
|
||||
Rectangle toastRect = toasts.get(index).getShell().getBounds();
|
||||
rect = new Rectangle(rect.x, rect.y, rect.width, toastRect.y - rect.y);
|
||||
}
|
||||
return rect;
|
||||
}
|
||||
// else display on primary monitor
|
||||
Monitor primaryMonitor = this.getShell().getDisplay().getPrimaryMonitor();
|
||||
return (primaryMonitor != null) ? primaryMonitor.getClientArea() : this.getShell().getDisplay().getClientArea();
|
||||
}
|
||||
|
||||
protected void afterCreate() {
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public int open() {
|
||||
int open = super.open();
|
||||
// add after open
|
||||
getNotificationManager().add(this);
|
||||
return open;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean close() {
|
||||
boolean close = super.close();
|
||||
getNotificationManager().remove(this);
|
||||
getNotificationManager().refresh();
|
||||
return close;
|
||||
}
|
||||
|
||||
private NotificationManager getNotificationManager() {
|
||||
if (manager == null) {
|
||||
manager = NotificationManager.getInstance();
|
||||
}
|
||||
return manager;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.ui.nofitication;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.jface.window.WindowManager;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public class NotificationManager implements Listener {
|
||||
|
||||
private static NotificationManager notificationManager;
|
||||
|
||||
private WindowManager windowManager = new WindowManager();
|
||||
|
||||
private NotificationManager() {
|
||||
Shell shell = getParentShell();
|
||||
if (shell != null) {
|
||||
shell.addListener(SWT.Resize, this);
|
||||
shell.addListener(SWT.Move, this);
|
||||
}
|
||||
}
|
||||
|
||||
public static NotificationManager getInstance() {
|
||||
if (notificationManager == null) {
|
||||
notificationManager = new NotificationManager();
|
||||
}
|
||||
return notificationManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleEvent(Event event) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
Stream.of(windowManager.getWindows()).map(ArrangedNotificationPopup.class::cast)
|
||||
.forEach(ArrangedNotificationPopup::initializeBounds);
|
||||
}
|
||||
|
||||
public List<Window> getWindows() {
|
||||
return Stream.of(windowManager.getWindows()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void add(Window window) {
|
||||
windowManager.add(window);
|
||||
}
|
||||
|
||||
public void remove(Window window) {
|
||||
windowManager.remove(window);
|
||||
}
|
||||
|
||||
public Shell getParentShell() {
|
||||
Shell shell = null;
|
||||
if (PlatformUI.getWorkbench().getActiveWorkbenchWindow() != null) {
|
||||
shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
|
||||
if (shell == null) {
|
||||
shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
|
||||
}
|
||||
}
|
||||
return shell;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -130,11 +130,10 @@ public abstract class ExportPushButtonForExtendedTable extends ExportPushButton
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
boolean enabled = false;
|
||||
if (extendedTableModel != null && extendedTableModel.isDataRegistered()
|
||||
&& extendedTableModel.getBeansList().size() > 0) {
|
||||
if (extendedTableModel != null && extendedTableModel.isDataRegistered() && extendedTableModel.getBeansList().size() > 0) {
|
||||
enabled = true;
|
||||
}
|
||||
return super.getEnabledState() && enabled;
|
||||
return extendedTableModel != null || enabled;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
/**
|
||||
* DOC Administrator class global comment. Detailled comment <br/>
|
||||
@@ -33,4 +34,11 @@ public abstract class SaveAsGenericSchemaPushButton extends ExtendedPushButton {
|
||||
|
||||
@Override
|
||||
protected abstract Command getCommandToExecute();
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
return extendedTableModel != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -127,14 +127,13 @@ JobletReferenceDialog.NodeTotalsTip=The totals of node reference
|
||||
JobletReferenceDialog.project=Project
|
||||
JobletReferenceDialog.ReferenceJob=Reference Job
|
||||
JobletReferenceDialog.Title=Delete the joblet failure
|
||||
ContextReferenceDialog.Title=Delete Context Group
|
||||
ContextReferenceDialog.DeleteContext.Title=Delete Context
|
||||
ContextReferenceDialog.Recycle=in Recycle Bin
|
||||
ContextReferenceDialog.ReferenceJob=Reference Objects
|
||||
ContextReferenceDialog.Types=Type
|
||||
ContextReferenceDialog.NodeTypeTip=The type of node reference
|
||||
ContextReferenceDialog.Messages=Context({0} {1}) is referenced from\:\n
|
||||
ContextReferenceDialog.kindMessages=The context group of {0} {1} is referred by the following list, if you really want to delete it, the context group is used in job will be changed to built-in when job is opened again. Would you still like to delete it?
|
||||
ContextReferenceDialog.kindMessages1=The context group of {0} {1} is referred by the following list, Would you still like to delete it?
|
||||
ContextReferenceDialog.kindMessages2=The context of {0} {1} is referred by the following list, would you still like to delete it?
|
||||
CopyToGenericSchemaHelper.cannotGenarateItem=Cannot generate pasted item label.
|
||||
ProxyRepositoryFactory.ReplaceJobHazardDescription=\nDependence on the original connection may be lost\!
|
||||
ItemReferenceDialog.title=Items which cannot be deleted
|
||||
@@ -156,6 +155,7 @@ ProjectRepositoryNode.invalidItem=Invalid item
|
||||
ProjectRepositoryNode.columns=Columns
|
||||
ProjectRepositoryNode.validationRules=Validation Rules
|
||||
ProjectRepositoryNode.cdcFoundation=CDC Foundation
|
||||
ProjectRepositoryNode.cdcFoundation.deprecated=CDC Foundation (deprecated)
|
||||
ProjectRepositoryNode.genericSchema=Generic schemas
|
||||
ProjectRepositoryNode.queries=Queries
|
||||
ProjectRepositoryNode.synonymSchemas=Synonym schemas
|
||||
@@ -175,6 +175,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
ProjectRepositoryNode.sapBWInfoObject=SAP InfoObject
|
||||
ProjectRepositoryNode.sapContentExtractor=SAP BI Content Extractor
|
||||
ProjectRepositoryNode.sapCDSView=SAP CDS View
|
||||
RepositoryDropAdapter_copyingItems=Copying items...
|
||||
RepositoryDropAdapter_errorMsg=This directory contains the locked item,it can not be moved now
|
||||
RepositoryDropAdapter_lockedByOthers=This item is locked by other users, it can not be moved now.
|
||||
@@ -204,3 +205,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.
|
||||
|
||||
@@ -127,14 +127,13 @@ JobletReferenceDialog.NodeTotalsTip=Total des r\u00E9f\u00E9rences des noeuds
|
||||
JobletReferenceDialog.project=Projet
|
||||
JobletReferenceDialog.ReferenceJob=Job de r\u00E9f\u00E9rence
|
||||
JobletReferenceDialog.Title=Supprimer l'\u00E9chec du Joblet
|
||||
ContextReferenceDialog.Title=Supprimer le groupe de contextes
|
||||
ContextReferenceDialog.DeleteContext.Title=Supprimer le contexte
|
||||
ContextReferenceDialog.Recycle=dans la Corbeille
|
||||
ContextReferenceDialog.ReferenceJob=Objets de r\u00E9f\u00E9rence
|
||||
ContextReferenceDialog.Types=Type
|
||||
ContextReferenceDialog.NodeTypeTip=Type de r\u00E9f\u00E9rences du n\u0153ud
|
||||
ContextReferenceDialog.Messages=Le contexte({0} {1}) est r\u00E9f\u00E9renc\u00E9 dans :\n
|
||||
ContextReferenceDialog.kindMessages=Le groupe de contextes de {0} {1} est r\u00E9f\u00E9renc\u00E9 par la liste suivante. Si vous souhaitez le supprimer, le groupe de contextes du Job sera chang\u00E9 en Built-In \u00E0 la prochaine ouverture du Job. Le supprimer malgr\u00E9 tout ?
|
||||
ContextReferenceDialog.kindMessages1=Le groupe de contextes {0} {1} est r\u00E9f\u00E9renc\u00E9 par la liste suivante. Le supprimer malgr\u00E9 tout ?
|
||||
ContextReferenceDialog.kindMessages2=Les \u00E9l\u00E9ments de la liste suivante font r\u00E9f\u00E9rence au contexte de {0} {1} . Souhaitez-vous quand m\u00EAme le supprimer\u00A0?
|
||||
CopyToGenericSchemaHelper.cannotGenarateItem=Impossible de g\u00E9n\u00E9rer le libell\u00E9 de l'\u00E9l\u00E9ment coll\u00E9.
|
||||
ProxyRepositoryFactory.ReplaceJobHazardDescription=\nLes d\u00E9pendances envers la connexion originale peuvent \u00EAtre perdues.
|
||||
ItemReferenceDialog.title=\u00C9lements ne pouvant \u00EAtre supprim\u00E9s
|
||||
@@ -156,6 +155,7 @@ ProjectRepositoryNode.invalidItem=\u00C9l\u00E9ment invalide
|
||||
ProjectRepositoryNode.columns=Colonnes
|
||||
ProjectRepositoryNode.validationRules=R\u00E8gles de validation
|
||||
ProjectRepositoryNode.cdcFoundation=Fondation CDC
|
||||
ProjectRepositoryNode.cdcFoundation.deprecated=Fondation CDC (d\u00E9pr\u00E9ci\u00E9)
|
||||
ProjectRepositoryNode.genericSchema=Sch\u00E9mas g\u00E9n\u00E9riques
|
||||
ProjectRepositoryNode.queries=Requ\u00EAtes
|
||||
ProjectRepositoryNode.synonymSchemas=Sch\u00E9mas synonymes
|
||||
@@ -175,6 +175,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=Objet Data Store SAP
|
||||
ProjectRepositoryNode.sapBWInfoCube=InfoCube SAP
|
||||
ProjectRepositoryNode.sapBWInfoObject=InfoObject SAP
|
||||
ProjectRepositoryNode.sapContentExtractor=Extracteur SAP BI Content
|
||||
ProjectRepositoryNode.sapCDSView=Vue SAP CDS
|
||||
RepositoryDropAdapter_copyingItems=Copie des \u00E9l\u00E9ments...
|
||||
RepositoryDropAdapter_errorMsg=Ce r\u00E9pertoire contient l'\u00E9l\u00E9ment verrouill\u00E9, il ne peut \u00EAtre d\u00E9plac\u00E9
|
||||
RepositoryDropAdapter_lockedByOthers=Cet \u00E9l\u00E9ment est verrouill\u00E9 par d'autres utilisateurs, impossible de le d\u00E9placer.
|
||||
@@ -204,3 +205,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.
|
||||
|
||||
@@ -127,14 +127,13 @@ JobletReferenceDialog.NodeTotalsTip=\u30CE\u30FC\u30C9\u53C2\u7167\u306E\u5408\u
|
||||
JobletReferenceDialog.project=\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8
|
||||
JobletReferenceDialog.ReferenceJob=\u53C2\u7167\u30B8\u30E7\u30D6
|
||||
JobletReferenceDialog.Title=\u30B8\u30E7\u30D6\u30EC\u30C3\u30C8\u306E\u5931\u6557\u3092\u524A\u9664
|
||||
ContextReferenceDialog.Title=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B0\u30EB\u30FC\u30D7\u3092\u524A\u9664
|
||||
ContextReferenceDialog.DeleteContext.Title=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u524A\u9664
|
||||
ContextReferenceDialog.Recycle=\u3054\u307F\u7BB1\u5185
|
||||
ContextReferenceDialog.ReferenceJob=\u53C2\u7167\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8
|
||||
ContextReferenceDialog.Types=\u30BF\u30A4\u30D7
|
||||
ContextReferenceDialog.NodeTypeTip=\u30CE\u30FC\u30C9\u53C2\u7167\u306E\u30BF\u30A4\u30D7
|
||||
ContextReferenceDialog.Messages=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8({0} {1})\u306E\u53C2\u7167\u5143:\n
|
||||
ContextReferenceDialog.kindMessages={0} {1}\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B0\u30EB\u30FC\u30D7\u306F\u6B21\u306E\u30EA\u30B9\u30C8\u306B\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u524A\u9664\u3057\u305F\u3044\u5834\u5408\u306F\u3001\u30B8\u30E7\u30D6\u304C\u3082\u3046\u4E00\u5EA6\u958B\u304B\u308C\u305F\u6642\u306B\u3001\u30B8\u30E7\u30D6\u3067\u4F7F\u7528\u3055\u308C\u308B\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B0\u30EB\u30FC\u30D7\u306F\u7D44\u307F\u8FBC\u307F\u306B\u5909\u63DB\u3055\u308C\u307E\u3059\u3002\u524A\u9664\u3057\u307E\u3059\u304B?
|
||||
ContextReferenceDialog.kindMessages1={0} {1}\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B0\u30EB\u30FC\u30D7\u304C\u4EE5\u4E0B\u306E\u30EA\u30B9\u30C8\u306B\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u524A\u9664\u3057\u307E\u3059\u304B?
|
||||
ContextReferenceDialog.kindMessages2={0}{1}\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304C\u6B21\u306E\u30EA\u30B9\u30C8\u306B\u53C2\u7167\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u524A\u9664\u3057\u307E\u3059\u304B?
|
||||
CopyToGenericSchemaHelper.cannotGenarateItem=\u8CBC\u4ED8\u3051\u3055\u308C\u305F\u30A2\u30A4\u30C6\u30E0\u30E9\u30D9\u30EB\u3092\u751F\u6210\u3067\u304D\u307E\u305B\u3093\u3002
|
||||
ProxyRepositoryFactory.ReplaceJobHazardDescription=\n\u5143\u306E\u63A5\u7D9A\u3078\u306E\u4F9D\u5B58\u304C\u5931\u308F\u308C\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059!
|
||||
ItemReferenceDialog.title=\u524A\u9664\u3067\u304D\u306A\u3044\u30A2\u30A4\u30C6\u30E0
|
||||
@@ -156,7 +155,8 @@ 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.cdcFoundation.deprecated=CDC Foundation (\u975E\u63A8\u5968)
|
||||
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
|
||||
@@ -175,6 +175,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
ProjectRepositoryNode.sapBWInfoObject=SAP InfoObject
|
||||
ProjectRepositoryNode.sapContentExtractor=SAP BI\u30B3\u30F3\u30C6\u30F3\u30C4\u30A8\u30AF\u30B9\u30C8\u30E9\u30AF\u30BF\u30FC
|
||||
ProjectRepositoryNode.sapCDSView=SAP CDS\u30D3\u30E5\u30FC
|
||||
RepositoryDropAdapter_copyingItems=\u30A2\u30A4\u30C6\u30E0\u3092\u30B3\u30D4\u30FC\u4E2D...
|
||||
RepositoryDropAdapter_errorMsg=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC\u306B\u30ED\u30C3\u30AF\u3055\u308C\u305F\u30A2\u30A4\u30C6\u30E0\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\u3002\u73FE\u5728\u3001\u79FB\u52D5\u3067\u304D\u307E\u305B\u3093,
|
||||
RepositoryDropAdapter_lockedByOthers=\u3053\u306E\u30A2\u30A4\u30C6\u30E0\u304C\u4ED6\u306E\u30E6\u30FC\u30B6\u30FC\u306B\u3088\u3063\u3066\u30ED\u30C3\u30AF\u3055\u308C\u307E\u3057\u305F\u3002\u73FE\u5728\u3001\u79FB\u52D5\u3067\u304D\u307E\u305B\u3093\u3002
|
||||
@@ -204,3 +205,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
|
||||
|
||||
@@ -127,14 +127,13 @@ JobletReferenceDialog.NodeTotalsTip=\u8282\u70B9\u5F15\u7528\u603B\u6570
|
||||
JobletReferenceDialog.project=\u5DE5\u7A0B
|
||||
JobletReferenceDialog.ReferenceJob=\u5F15\u7528\u4F5C\u4E1A
|
||||
JobletReferenceDialog.Title=\u5220\u9664\u5C0F\u4F5C\u4E1A\u5931\u8D25
|
||||
ContextReferenceDialog.Title=\u5220\u9664\u73AF\u5883\u7EC4
|
||||
ContextReferenceDialog.DeleteContext.Title=\u5220\u9664\u4E0A\u4E0B\u6587
|
||||
ContextReferenceDialog.Recycle=\u5728\u56DE\u6536\u7AD9
|
||||
ContextReferenceDialog.ReferenceJob=\u5F15\u7528\u5BF9\u8C61
|
||||
ContextReferenceDialog.Types=\u7C7B\u578B
|
||||
ContextReferenceDialog.NodeTypeTip=\u8282\u70B9\u5F15\u7528\u7684\u7C7B\u578B
|
||||
ContextReferenceDialog.Messages=\u4E0A\u4E0B\u6587 ({0} {1}) \u5F15\u7528\u81EA\uFF1A\n
|
||||
ContextReferenceDialog.kindMessages={0} {1} \u7684\u4E0A\u4E0B\u6587\u7EC4\u88AB\u4EE5\u4E0B\u5217\u8868\u5F15\u7528\uFF0C\u5982\u679C\u786E\u5B9E\u60F3\u8981\u5C06\u5176\u5220\u9664\uFF0C\u518D\u6B21\u6253\u5F00\u4F5C\u4E1A\u65F6\uFF0C\u4F5C\u4E1A\u4E2D\u6240\u7528\u7684\u4E0A\u4E0B\u6587\u7EC4\u5C06\u6539\u4E3A\u5185\u7F6E\u3002\u662F\u5426\u4ECD\u60F3\u5C06\u5176\u5220\u9664\uFF1F
|
||||
ContextReferenceDialog.kindMessages1={0} {1} \u7684\u4E0A\u4E0B\u6587\u7EC4\u88AB\u4EE5\u4E0B\u5217\u8868\u5F15\u7528\uFF0C\u662F\u5426\u4ECD\u60F3\u5C06\u5176\u5220\u9664\uFF1F
|
||||
ContextReferenceDialog.kindMessages2={0} {1} \u7684\u4E0A\u4E0B\u6587\u7EC4\u4EE5\u4E0B\u5217\u8868\u5F15\u7528\uFF0C\u662F\u5426\u4ECD\u60F3\u5C06\u5176\u5220\u9664\uFF1F
|
||||
CopyToGenericSchemaHelper.cannotGenarateItem=\u65E0\u6CD5\u751F\u6210\u7C98\u8D34\u9879\u76EE\u6807\u7B7E\u3002
|
||||
ProxyRepositoryFactory.ReplaceJobHazardDescription=\n\u5BF9\u539F\u59CB\u8FDE\u63A5\u7684\u4F9D\u8D56\u53EF\u80FD\u4F1A\u4E22\u5931\uFF01
|
||||
ItemReferenceDialog.title=\u65E0\u6CD5\u5220\u9664\u7684\u9879\u76EE
|
||||
@@ -156,6 +155,7 @@ ProjectRepositoryNode.invalidItem=\u65E0\u6548\u9879\u76EE
|
||||
ProjectRepositoryNode.columns=\u5217
|
||||
ProjectRepositoryNode.validationRules=\u9A8C\u8BC1\u89C4\u5219
|
||||
ProjectRepositoryNode.cdcFoundation=CDC Foundation
|
||||
ProjectRepositoryNode.cdcFoundation.deprecated=CDC Foundation (\u5DF2\u5F03\u7528)
|
||||
ProjectRepositoryNode.genericSchema=\u901A\u7528 schema
|
||||
ProjectRepositoryNode.queries=\u67E5\u8BE2
|
||||
ProjectRepositoryNode.synonymSchemas=\u540C\u4E49\u5B57 schema
|
||||
@@ -175,6 +175,7 @@ ProjectRepositoryNode.sapBWDataStoreObject=SAP DSO
|
||||
ProjectRepositoryNode.sapBWInfoCube=SAP InfoCube
|
||||
ProjectRepositoryNode.sapBWInfoObject=SAP InfoObject
|
||||
ProjectRepositoryNode.sapContentExtractor=SAP BI \u5185\u5BB9\u63D0\u53D6\u5668
|
||||
ProjectRepositoryNode.sapCDSView=SAP CDS \u89C6\u56FE
|
||||
RepositoryDropAdapter_copyingItems=\u6B63\u5728\u590D\u5236\u9879\u76EE...
|
||||
RepositoryDropAdapter_errorMsg=\u6B64\u76EE\u5F55\u5305\u542B\u9501\u5B9A\u7684\u9879\u76EE\uFF0C\u73B0\u5728\u65E0\u6CD5\u79FB\u52A8
|
||||
RepositoryDropAdapter_lockedByOthers=\u6B64\u9879\u76EE\u88AB\u5176\u4ED6\u7528\u6237\u9501\u5B9A\uFF0C\u73B0\u5728\u65E0\u6CD5\u79FB\u52A8\u3002
|
||||
@@ -204,3 +205,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,7 +67,6 @@ 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;
|
||||
@@ -131,7 +130,7 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
ERepositoryObjectType.METADATA_FILE_RULES, ERepositoryObjectType.METADATA_FILE_HL7,
|
||||
ERepositoryObjectType.METADATA_FILE_FTP, ERepositoryObjectType.METADATA_FILE_BRMS,
|
||||
ERepositoryObjectType.METADATA_MDMCONNECTION, ERepositoryObjectType.METADATA_HEADER_FOOTER,
|
||||
ERepositoryObjectType.JOB_SCRIPT };
|
||||
ERepositoryObjectType.JOB_SCRIPT, ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS };
|
||||
|
||||
List<IRepositoryViewObject> deletedItems = new ArrayList<IRepositoryViewObject>();
|
||||
for (ERepositoryObjectType type : types) {
|
||||
@@ -874,25 +873,38 @@ public abstract class AbstractEMFRepositoryFactory extends AbstractRepositoryFac
|
||||
@Override
|
||||
public IRepositoryViewObject getLastVersion(Project project, String id, String relativeFolder, ERepositoryObjectType type)
|
||||
throws PersistenceException {
|
||||
List<IRepositoryViewObject> serializableAllVersion = null;
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
List<IRepositoryViewObject> serializableAllVersion = new ArrayList<>();
|
||||
if (lastFolderForItemMap.containsKey(id)) {
|
||||
ERepositoryObjectType itemType = lastRepositoryTypeForItemMap.get(id);
|
||||
String currentPath = lastFolderForItemMap.get(id);
|
||||
Object fullFolder = getFullFolder(project, itemType, currentPath);
|
||||
try {
|
||||
if (fullFolder != null && (fullFolder instanceof FolderItem || ((IFolder) fullFolder).exists())) {
|
||||
serializableAllVersion.addAll(getSerializableFromFolder(project, fullFolder, id, itemType, false, false, true, true));
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// do nothing.
|
||||
// if any exception happen or can't find the item, just try to look for it everywhere.
|
||||
}
|
||||
}
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
// look in all folders for this item type
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
|
||||
Object fullFolder = getFullFolder(project, type, relativeFolder);
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, false, true, true);
|
||||
if (serializableAllVersion.isEmpty()) {
|
||||
// look in all folders for this item type
|
||||
serializableAllVersion = getSerializableFromFolder(project, fullFolder, id, type, false, true, true, true, true);
|
||||
}
|
||||
}
|
||||
int size = serializableAllVersion.size();
|
||||
|
||||
if (size > 1) {
|
||||
String message = getItemsMessages(serializableAllVersion, size);
|
||||
|
||||
throw new PersistenceException(Messages.getString(
|
||||
"AbstractEMFRepositoryFactory.presistenceException.OnlyOneOccurenceMustbeFound", message)); //$NON-NLS-1$
|
||||
} else if (size == 1) {
|
||||
return serializableAllVersion.get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (size == 1) {
|
||||
return serializableAllVersion.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void computePropertyMaxInformationLevel(Property property) {
|
||||
|
||||
@@ -184,6 +184,7 @@ public abstract class AbstractRepositoryFactory implements IRepositoryFactory {
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_FILE_LDIF), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_CONNECTIONS), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_SAPCONNECTIONS), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_HEADER_FOOTER), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_LDAP_SCHEMA), result);
|
||||
collect(getMetadata(project, ERepositoryObjectType.METADATA_GENERIC_SCHEMA), result);
|
||||
|
||||
@@ -102,6 +102,7 @@ import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.SAPBWTableHelper;
|
||||
import org.talend.cwm.helper.SubItemHelper;
|
||||
import org.talend.cwm.helper.TableHelper;
|
||||
import org.talend.cwm.helper.TaggedValueHelper;
|
||||
import org.talend.designer.core.IDesignerCoreService;
|
||||
import org.talend.repository.ProjectManager;
|
||||
import org.talend.repository.model.BinRepositoryNode;
|
||||
@@ -1349,6 +1350,8 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
connection = dbMetadataConnection;
|
||||
} else if (type == ERepositoryObjectType.METADATA_SAPCONNECTIONS) {
|
||||
connection = ((ConnectionItem) repositoryObject.getProperty().getItem()).getConnection();
|
||||
} else if (type == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS) {
|
||||
connection = ((ConnectionItem) repositoryObject.getProperty().getItem()).getConnection();
|
||||
} else if (type == ERepositoryObjectType.METADATA_FILE_DELIMITED) {
|
||||
connection = ((ConnectionItem) repositoryObject.getProperty().getItem()).getConnection();
|
||||
} else if (type == ERepositoryObjectType.METADATA_FILE_POSITIONAL) {
|
||||
@@ -1700,11 +1703,11 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
DatabaseConnectionItem connectionItem = (DatabaseConnectionItem) item;
|
||||
DatabaseConnection connection = (DatabaseConnection) connectionItem.getConnection();
|
||||
if (PluginChecker.isCDCPluginLoaded()) {
|
||||
ICDCProviderService service = GlobalServiceRegister.getDefault()
|
||||
.getService(ICDCProviderService.class);
|
||||
ICDCProviderService service = GlobalServiceRegister.getDefault().getService(ICDCProviderService.class);
|
||||
|
||||
if (service != null && service.canCreateCDCConnection(connection)) {
|
||||
RepositoryNode cdcNode = new StableRepositoryNode(node,
|
||||
Messages.getString("ProjectRepositoryNode.cdcFoundation"), //$NON-NLS-1$
|
||||
Messages.getString("ProjectRepositoryNode.cdcFoundation.deprecated"), //$NON-NLS-1$
|
||||
ECoreImage.FOLDER_CLOSE_ICON);
|
||||
node.getChildren().add(cdcNode);
|
||||
service.createCDCTypes(recBinNode, cdcNode, connection.getCdcConns());
|
||||
@@ -1751,6 +1754,9 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
|
||||
// 10. BW Business Content Extractor:
|
||||
createSAPContentExtractorNodes(repObj, metadataConnection, node, validationRules);
|
||||
|
||||
// 11. CDS views:
|
||||
createSAPCDSViewNodes(repObj, metadataConnection, node, validationRules);
|
||||
} else if (metadataConnection instanceof SalesforceSchemaConnection) {
|
||||
createSalesforceModuleNodes(repObj, metadataConnection, node, validationRules);
|
||||
} else {
|
||||
@@ -1784,7 +1790,9 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
for (MetadataTable tablesWithOrder : tablesWithOrders) {
|
||||
EMap<String, String> properties = tablesWithOrder.getAdditionalProperties();
|
||||
String partitionKey = properties.get(EProperties.CONTENT_TYPE.name());
|
||||
if (!ERepositoryObjectType.METADATA_SAP_CONTENT_EXTRACTOR.name().equals(partitionKey)) {
|
||||
String cdsType = TaggedValueHelper.getValueString(EProperties.CONTENT_TYPE.name(), tablesWithOrder);
|
||||
if (!ERepositoryObjectType.METADATA_SAP_CONTENT_EXTRACTOR.name().equals(partitionKey)
|
||||
&& !ERepositoryObjectType.METADATA_SAP_CDS_VIEW.name().equals(cdsType)) {
|
||||
tables.add(tablesWithOrder);
|
||||
}
|
||||
}
|
||||
@@ -1967,6 +1975,32 @@ public class ProjectRepositoryNode extends RepositoryNode implements IProjectRep
|
||||
createTables(tableContainer, repObj, tables, ERepositoryObjectType.METADATA_CON_TABLE, validationRules);
|
||||
}
|
||||
|
||||
private void createSAPCDSViewNodes(IRepositoryViewObject repObj, Connection metadataConnection, RepositoryNode node,
|
||||
List<IRepositoryViewObject> validationRules) {
|
||||
StableRepositoryNode tableContainer = new StableRepositoryNode(node,
|
||||
Messages.getString("ProjectRepositoryNode.sapCDSView"), ECoreImage.FOLDER_CLOSE_ICON); //$NON-NLS-1$
|
||||
tableContainer.setChildrenObjectType(ERepositoryObjectType.METADATA_CON_TABLE);
|
||||
tableContainer.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_SAP_CDS_VIEW);
|
||||
IRepositoryNode cacheNode = nodeCache.getCache(tableContainer);
|
||||
if (cacheNode != null && cacheNode instanceof StableRepositoryNode) {
|
||||
tableContainer = (StableRepositoryNode) cacheNode;
|
||||
tableContainer.getChildren().clear();
|
||||
} else {
|
||||
nodeCache.addCache(tableContainer, true);
|
||||
}
|
||||
|
||||
node.getChildren().add(tableContainer);
|
||||
List<MetadataTable> tablesWithOrders = ConnectionHelper.getTablesWithOrders(metadataConnection);
|
||||
EList<MetadataTable> tables = new BasicEList<>();
|
||||
for (MetadataTable tablesWithOrder : tablesWithOrders) {
|
||||
String cdsType = TaggedValueHelper.getValueString(EProperties.CONTENT_TYPE.name(), tablesWithOrder);
|
||||
if (ERepositoryObjectType.METADATA_SAP_CDS_VIEW.name().equals(cdsType)) {
|
||||
tables.add(tablesWithOrder);
|
||||
}
|
||||
}
|
||||
createTables(tableContainer, repObj, tables, ERepositoryObjectType.METADATA_CON_TABLE, validationRules);
|
||||
}
|
||||
|
||||
private void createSalesforceModuleNodes(IRepositoryViewObject rebObj, Connection metadataConnection,
|
||||
RepositoryNode connectionNode, List<IRepositoryViewObject> validationRules) {
|
||||
EList modules = ((SalesforceSchemaConnection) metadataConnection).getModules();
|
||||
|
||||
@@ -54,9 +54,7 @@ import org.eclipse.jface.dialogs.InputDialog;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.osgi.internal.serviceregistry.ServiceReferenceImpl;
|
||||
import org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.MessageBox;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.navigator.CommonNavigator;
|
||||
import org.eclipse.ui.navigator.CommonViewer;
|
||||
@@ -240,14 +238,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);
|
||||
}
|
||||
@@ -352,7 +350,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.
|
||||
@@ -447,12 +445,10 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
if (currentShell == null) {
|
||||
currentShell = DisplayUtils.getDefaultShell(false);
|
||||
}
|
||||
MessageBox box = new MessageBox(currentShell, SWT.ICON_WARNING | SWT.OK | SWT.CANCEL);
|
||||
box.setText(Messages.getString("ProxyRepositoryFactory.JobNameErroe")); //$NON-NLS-1$
|
||||
box.setMessage(Messages.getString("ProxyRepositoryFactory.Label") + " " + name + " " + Messages.getString("ProxyRepositoryFactory.ReplaceJob")); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$//$NON-NLS-4$
|
||||
|
||||
if (box.open() == SWT.OK) {
|
||||
|
||||
if (MessageDialog.openQuestion(currentShell,
|
||||
Messages.getString("ProxyRepositoryFactory.JobNameErroe"), //$NON-NLS-1$
|
||||
Messages.getString("ProxyRepositoryFactory.Label") + " " + name + " " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
+ Messages.getString("ProxyRepositoryFactory.ReplaceJob"))) { //$NON-NLS-1$
|
||||
ok[0] = true;
|
||||
}
|
||||
}
|
||||
@@ -1849,7 +1845,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);
|
||||
@@ -2211,6 +2207,13 @@ public final class ProxyRepositoryFactory implements IProxyRepositoryFactory {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
|
||||
if (IHadoopDistributionService.get() != null) {
|
||||
try {
|
||||
IHadoopDistributionService.get().checkAndMigrateDistributionProxyCredential(project);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
// init dynamic distirbution after `beforeLogon`, before loading libraries.
|
||||
initDynamicDistribution(monitor);
|
||||
|
||||
@@ -2528,7 +2531,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()) {
|
||||
@@ -3026,4 +3029,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -606,6 +606,8 @@ public class DuplicateAction extends AContextualAction {
|
||||
item = PropertiesFactory.eINSTANCE.createSalesforceSchemaConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.METADATA_SAPCONNECTIONS) {
|
||||
item = PropertiesFactory.eINSTANCE.createSAPConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS) {
|
||||
item = PropertiesFactory.eINSTANCE.createBigQueryConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.METADATA_WSDL_SCHEMA) {
|
||||
item = PropertiesFactory.eINSTANCE.createWSDLSchemaConnectionItem();
|
||||
} else if (repositoryType == ERepositoryObjectType.PROCESS) {
|
||||
|
||||
@@ -129,7 +129,7 @@ public class ContextReferenceDialog extends SelectionDialog {
|
||||
Item item = objToDelete.getProperty().getItem();
|
||||
if (item != null) {
|
||||
setMessage(Messages.getString(
|
||||
"ContextReferenceDialog.kindMessages1", item.getProperty().getLabel(), item.getProperty().getVersion())); //$NON-NLS-1$
|
||||
"ContextReferenceDialog.kindMessages2", item.getProperty().getLabel(), item.getProperty().getVersion())); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
setHelpAvailable(false);
|
||||
@@ -138,7 +138,7 @@ public class ContextReferenceDialog extends SelectionDialog {
|
||||
@Override
|
||||
protected void configureShell(Shell newShell) {
|
||||
super.configureShell(newShell);
|
||||
newShell.setText(Messages.getString("ContextReferenceDialog.Title")); //$NON-NLS-1$
|
||||
newShell.setText(Messages.getString("ContextReferenceDialog.DeleteContext.Title")); //$NON-NLS-1$
|
||||
newShell.setSize(650, 250);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ import org.talend.core.model.utils.CloneConnectionUtils;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
import org.talend.cwm.helper.ConnectionHelper;
|
||||
import org.talend.cwm.helper.StudioEncryptionHelper;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ContextType;
|
||||
import org.talend.model.bridge.ReponsitoryContextBridge;
|
||||
|
||||
@@ -67,6 +68,7 @@ public class StandaloneConnectionContextUtils {
|
||||
String server = getOriginalValue(contextProperties, dbConn.getServerName());
|
||||
String username = getOriginalValue(contextProperties, dbConn.getUsername());
|
||||
String password = getOriginalValue(contextProperties, dbConn.getRawPassword());
|
||||
String originEncryptedPassword = getOriginalValue(contextProperties, dbConn.getPassword());
|
||||
String port = getOriginalValue(contextProperties, dbConn.getPort());
|
||||
String sidOrDatabase = getOriginalValue(contextProperties, dbConn.getSID());
|
||||
String datasource = getOriginalValue(contextProperties, dbConn.getDatasourceName());
|
||||
@@ -87,6 +89,8 @@ public class StandaloneConnectionContextUtils {
|
||||
cloneConn.setDatasourceName(datasource);
|
||||
cloneConn.setDBRootPath(dbRootPath);
|
||||
cloneConn.setFileFieldName(filePath);
|
||||
//To avoid encrypt the same value
|
||||
cloneConn.setPassword(originEncryptedPassword);
|
||||
cloneConn.setRawPassword(password); // the password is raw.
|
||||
cloneConn.setPort(port);
|
||||
cloneConn.setUiSchema(schemaOracle);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Manifest-Version: 1.0
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Core Runtime Plug-in
|
||||
Bundle-SymbolicName: org.talend.core.runtime;singleton:=true
|
||||
@@ -125,12 +125,25 @@ Require-Bundle: org.eclipse.jdt.core,
|
||||
org.talend.commons.ui,
|
||||
org.ops4j.pax.url.mvn,
|
||||
org.talend.components.api,
|
||||
org.apache.servicemix.bundles.avro,
|
||||
jackson-core-asl,
|
||||
org.talend.libraries.jackson,
|
||||
org.eclipse.m2e.core,
|
||||
org.talend.libraries.apache.common,
|
||||
org.talend.signon.util
|
||||
org.talend.signon.util,
|
||||
org.eclipse.core.runtime,
|
||||
org.talend.studio.studio-utils,
|
||||
org.eclipse.emf.ecore,
|
||||
org.eclipse.core.resources,
|
||||
org.eclipse.emf.ecore.xmi,
|
||||
org.talend.common.ui.runtime,
|
||||
org.talend.cwm.mip,
|
||||
org.talend.daikon,
|
||||
org.talend.libraries.apache,
|
||||
org.apache.commons.lang3,
|
||||
com.fasterxml.jackson.core.jackson-annotations,
|
||||
com.fasterxml.jackson.core.jackson-databind,
|
||||
com.fasterxml.jackson.core.jackson-core,
|
||||
avro;bundle-version="1.11.2"
|
||||
Bundle-Activator: org.talend.core.runtime.CoreRuntimePlugin
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .,
|
||||
@@ -139,3 +152,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
|
||||
|
||||
@@ -43,6 +43,8 @@ public class PluginChecker {
|
||||
private static final String CDC_PLUGIN_ID = "org.talend.designer.cdc"; //$NON-NLS-1$
|
||||
|
||||
private static final String SAP_WZIARD_PLUGIN_ID = "org.talend.repository.sap"; //$NON-NLS-1$
|
||||
|
||||
private static final String BIGQUERY_WZIARD_PLUGIN_ID = "org.talend.repository.bigquery"; //$NON-NLS-1$
|
||||
|
||||
private static final String EBCDIC_PLUGIN_ID = "org.talend.repository.ebcdic"; //$NON-NLS-1$
|
||||
|
||||
@@ -246,6 +248,10 @@ public class PluginChecker {
|
||||
public static boolean isSAPWizardPluginLoaded() {
|
||||
return isPluginLoaded(SAP_WZIARD_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isBigQueryWizardPluginLoaded() {
|
||||
return isPluginLoaded(BIGQUERY_WZIARD_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isEBCDICPluginLoaded() {
|
||||
return isPluginLoaded(EBCDIC_PLUGIN_ID);
|
||||
@@ -267,10 +273,6 @@ public class PluginChecker {
|
||||
return isPluginLoaded(MDM_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isExchangeSystemLoaded() {
|
||||
return isPluginLoaded(EXCHANGE_SYSTEM_PLUGIN_ID);
|
||||
}
|
||||
|
||||
public static boolean isRulesPluginLoaded() { // added by hyWang
|
||||
return isPluginLoaded(RULES_PLUGIN_ID);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ public enum EDatabase4DriverClassName {
|
||||
MYSQL8(EDatabaseTypeName.MYSQL, "com.mysql.cj.jdbc.Driver"), //$NON-NLS-1$
|
||||
MARIADB(EDatabaseTypeName.MYSQL, "org.mariadb.jdbc.Driver"), //$NON-NLS-1$
|
||||
AMAZON_AURORA(EDatabaseTypeName.AMAZON_AURORA, "org.gjt.mm.mysql.Driver"), //$NON-NLS-1$
|
||||
AMAZON_AURORA_3(EDatabaseTypeName.AMAZON_AURORA, "com.mysql.cj.jdbc.Driver"), //$NON-NLS-1$
|
||||
NETEZZA(EDatabaseTypeName.NETEZZA, "org.netezza.Driver"), //$NON-NLS-1$
|
||||
|
||||
ORACLEFORSID(EDatabaseTypeName.ORACLEFORSID, "oracle.jdbc.OracleDriver", "oracle.jdbc.driver.OracleDriver"), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
@@ -87,8 +88,8 @@ public enum EDatabase4DriverClassName {
|
||||
// MOD klliu 2010-06-04 bug 12819: upgrade jdbc driver class used in sql explorer
|
||||
TERADATA(EDatabaseTypeName.TERADATA, "com.teradata.jdbc.TeraDriver"), //$NON-NLS-1$
|
||||
|
||||
VERTICA(EDatabaseTypeName.VERTICA, "com.vertica.Driver"), //$NON-NLS-1$
|
||||
VERTICA2(EDatabaseTypeName.VERTICA, "com.vertica.jdbc.Driver"), //$NON-NLS-1$
|
||||
// VERTICA(EDatabaseTypeName.VERTICA, "com.vertica.Driver"), //$NON-NLS-1$
|
||||
VERTICA(EDatabaseTypeName.VERTICA, "com.vertica.jdbc.Driver"), //$NON-NLS-1$
|
||||
|
||||
HIVE(EDatabaseTypeName.HIVE, "org.apache.hadoop.hive.jdbc.HiveDriver"), //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -252,6 +252,8 @@ public class ConnParameterKeys {
|
||||
|
||||
public static final String CONN_PARA_KEY_EXECUTOR_MEMORY = "CONN_PARA_KEY_EXECUTOR_MEMORY"; //$NON-NLS-1$
|
||||
|
||||
public static final String CONN_PARA_KEY_EXECUTOR_CORES = "CONN_PARA_KEY_EXECUTOR_CORES";
|
||||
|
||||
public static final String CONN_PARA_KEY_TUNING_PROPERTIES = "CONN_PARA_KEY_TUNING_PROPERTIES"; //$NON-NLS-1$
|
||||
|
||||
/******************************************/
|
||||
@@ -366,7 +368,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
|
||||
*/
|
||||
@@ -403,6 +455,9 @@ public class ConnParameterKeys {
|
||||
public static final String CONN_PARA_KEY_UNIV_STANDALONE_EXEC_MEMORY="CONN_PARA_KEY_UNIV_STANDALONE_EXEC_MEMORY";
|
||||
public static final String CONN_PARA_KEY_UNIV_STANDALONE_EXEC_CORE="CONN_PARA_KEY_UNIV_STANDALONE_EXEC_CORE";
|
||||
|
||||
|
||||
// Spark Submit Scripts
|
||||
public static final String CONN_PARA_KEY_UNIV_SPARK_SUBMIT_SCRIPT_HOME="CONN_PARA_KEY_UNIV_SPARK_SUBMIT_SCRIPT_HOME";
|
||||
/**
|
||||
* Redshift
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ public enum EDatabaseVersion4Drivers {
|
||||
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")),
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 18 and above", "ORACLE_18", "ojdbc8-19.19.0.0.jar")),
|
||||
ORACLE_12(new DbVersion4Drivers(new EDatabaseTypeName[] { EDatabaseTypeName.ORACLEFORSID, EDatabaseTypeName.ORACLESN,
|
||||
EDatabaseTypeName.ORACLE_OCI, EDatabaseTypeName.ORACLE_CUSTOM }, "Oracle 12 (Deprecated)", "ORACLE_12",
|
||||
"ojdbc7.jar")),
|
||||
@@ -69,9 +69,9 @@ public enum EDatabaseVersion4Drivers {
|
||||
"SAS 9.2", "SAS_9.2", new String[] { "sas.core.jar", "sas.security.sspi.jar", "sas.svc.connection.jar", "reload4j-1.2.22.jar" })), //$NON-NLS-1$ //$NON-NLS-2$
|
||||
SAPHana(new DbVersion4Drivers(EDatabaseTypeName.SAPHana, "HDB 1.0", "HDB_1_0", "ngdbc.jar")), //$NON-NLS-1$
|
||||
// MYSQL, add for 9594
|
||||
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-java-8.0.18.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_8(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 8", "MYSQL_8", "mysql-connector-j-8.0.33.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MYSQL_5(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MySQL 5", "MYSQL_5", "mysql-connector-java-5.1.49.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MARIADB(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MariaDB", "MARIADB", "mariadb-java-client-2.5.3.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MARIADB(new DbVersion4Drivers(EDatabaseTypeName.MYSQL, "MariaDB", "MARIADB", "mariadb-java-client-3.1.4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// add for 9594
|
||||
MSSQL(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,"Open source JTDS", "JTDS", "jtds-1.3.1-patch-20190523.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
MSSQL_2012(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
@@ -79,23 +79,26 @@ public enum EDatabaseVersion4Drivers {
|
||||
MSSQL_PROP(new DbVersion4Drivers(EDatabaseTypeName.MSSQL,
|
||||
"Microsoft", "MSSQL_PROP", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
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",
|
||||
"oauth2-oidc-sdk-9.7.jar", "reload4j-1.2.22.jar", "jackson-core-2.14.3.jar",
|
||||
"jackson-databind-2.14.3.jar", "jackson-annotations-2.14.3.jar", "jcip-annotations-1.0-1.jar",
|
||||
"json-smart-2.4.11.jar", "nimbus-jose-jwt-9.22.jar", "accessors-smart-2.4.11.jar", "asm-9.5.jar",
|
||||
"content-type-2.1.jar", "lang-tag-1.5.jar" })),
|
||||
|
||||
VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
// VERTICA_9(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 9.X (Deprecated)", "VERTICA_9_0", "vertica-jdbc-9.3.1-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
//https://mvnrepository.com/artifact/com.vertica.jdbc/vertica-jdbc/12.0.4-0
|
||||
VERTICA_12(new DbVersion4Drivers(EDatabaseTypeName.VERTICA, "VERTICA 12.X", "VERTICA_12_0", "vertica-jdbc-12.0.4-0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
// for bug 0017930
|
||||
GREENPLUM_PSQL(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"PostgreSQL", "POSTGRESQL", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$
|
||||
GREENPLUM(new DbVersion4Drivers(EDatabaseTypeName.GREENPLUM,"Greenplum", "GREENPLUM", "greenplum-5.1.4.000275.jar")), //$NON-NLS-1$
|
||||
// PSQL_V10(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v10", "V10", "postgresql-42.2.5.jar")),
|
||||
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.2.26.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "v9 and later", "V9_X", "postgresql-42.6.0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PSQL, "Prior to v9 (Deprecated)", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|
||||
PLUSPSQL_PRIOR_TO_V9(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL,
|
||||
"Prior to v9", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.2.26.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"Prior to v9 (Deprecated)", "PRIOR_TO_V9", "postgresql-8.4-703.jdbc4.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
PLUSPSQL_V9_X(new DbVersion4Drivers(EDatabaseTypeName.PLUSPSQL, "v9 and later", "V9_X", "postgresql-42.6.0.jar")), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
IBMDB2(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
"db2jcc_license_cisuz.jar" })), //$NON-NLS-1$
|
||||
IBMDB2ZOS(new DbVersion4Drivers(EDatabaseTypeName.IBMDB2ZOS, new String[] { "db2jcc4.jar", "db2jcc_license_cu.jar", //$NON-NLS-1$ //$NON-NLS-2$
|
||||
@@ -150,12 +153,16 @@ 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$
|
||||
new String[] { "redshift-jdbc42-no-awssdk-1.2.55.1083.jar", "antlr4-runtime-4.8-1.jar", "jackson-core-2.14.3.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
"jackson-databind-2.14.3.jar", "jackson-annotations-2.14.3.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$
|
||||
"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$
|
||||
AMAZON_AURORA(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "MySQL 5", "MYSQL_5", //$NON-NLS-1$
|
||||
"mysql-connector-java-5.1.49.jar")),
|
||||
AMAZON_AURORA_3(new DbVersion4Drivers(EDatabaseTypeName.AMAZON_AURORA, "MySQL 8", "MYSQL_8", //$NON-NLS-1$
|
||||
"mysql-connector-j-8.0.33.jar"));
|
||||
|
||||
private DbVersion4Drivers dbVersionBean;
|
||||
|
||||
|
||||
@@ -15,8 +15,10 @@ package org.talend.core.hadoop;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.common.util.EMap;
|
||||
import org.talend.commons.exception.CommonExceptionHandler;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
@@ -25,6 +27,9 @@ import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.properties.Property;
|
||||
import org.talend.core.runtime.hd.IDynamicDistributionManager;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.ElementParameterType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.NodeType;
|
||||
import org.talend.designer.core.model.utils.emf.talendfile.TalendFileFactory;
|
||||
|
||||
/**
|
||||
* created by cmeng on Jul 20, 2015 Detailled comment
|
||||
@@ -145,4 +150,58 @@ public class BigDataBasicUtil {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static String getDistributionByVersion(String version) {
|
||||
if (StringUtils.isEmpty(version))
|
||||
return null;
|
||||
if (version.startsWith("EMR")) {
|
||||
return "AMAZON_EMR";
|
||||
} else if (version.equals("SYNAPSE")) {
|
||||
return "AZURE_SYNAPSE";
|
||||
} else if (version.contains("CDH") || version.contains("CDP")) {
|
||||
return "CLOUDERA";
|
||||
} else if (version.startsWith("Databricks")) {
|
||||
return "DATABRICKS";
|
||||
} else if (version.contains("HDP")) {
|
||||
return "HORTONWORKS";
|
||||
} else if (version.startsWith("MICROSOFT_HD_INSIGHT")) {
|
||||
return "MICROSOFT_HD_INSIGHT";
|
||||
} else if (version.startsWith("SPARK")) {
|
||||
return "SPARK";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void setDistribution(NodeType node, String dbVersionName) {
|
||||
if (node == null || dbVersionName == null) {
|
||||
return;
|
||||
}
|
||||
EList<ElementParameterType> elementParameters = node.getElementParameter();
|
||||
String distribution = null;
|
||||
String dbVersion = null;
|
||||
// Iterate over the item elementParameters in order to find the "DISTRIBUTION" and "SPARK_VERSION"
|
||||
// parameters values.
|
||||
for (int i = 0; i < elementParameters.size(); i++) {
|
||||
ElementParameterType param = elementParameters.get(i);
|
||||
if (dbVersionName.equals(param.getName())) {
|
||||
dbVersion = param.getValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
try {
|
||||
ElementParameterType property = TalendFileFactory.eINSTANCE.createElementParameterType();
|
||||
distribution = BigDataBasicUtil.getDistributionByVersion(dbVersion);
|
||||
if (distribution != null) {
|
||||
property.setName("DISTRIBUTION"); //$NON-NLS-1$
|
||||
property.setField("CLOSED_LIST"); //$NON-NLS-1$
|
||||
property.setValue(distribution);
|
||||
elementParameters.add(property);
|
||||
} else {
|
||||
ExceptionHandler.log("no matched distribution for version " + dbVersion);//$NON-NLS-1$
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.log(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,10 @@ 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 SPARK_MODE_HDI = "HDI";
|
||||
|
||||
public static final String FRAMEWORK = "FRAMEWORK";
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.Map;
|
||||
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.IService;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.runtime.hd.IDistributionsManager;
|
||||
import org.talend.core.runtime.hd.IDynamicDistributionManager;
|
||||
import org.talend.core.runtime.hd.IHDistribution;
|
||||
@@ -132,6 +133,8 @@ public interface IHadoopDistributionService extends IService {
|
||||
|
||||
IDynamicDistributionManager getDynamicDistributionManager();
|
||||
|
||||
void checkAndMigrateDistributionProxyCredential(Project project) throws Exception;
|
||||
|
||||
public static IHadoopDistributionService get() {
|
||||
GlobalServiceRegister gsr = GlobalServiceRegister.getDefault();
|
||||
if (gsr.isServiceRegistered(IHadoopDistributionService.class)) {
|
||||
|
||||
@@ -142,6 +142,8 @@ public enum EHadoopProperties {
|
||||
|
||||
SPARK_EXECUTOR_MEMORY,
|
||||
|
||||
SPARK_EXECUTOR_CORES,
|
||||
|
||||
DATABRICKS_ENDPOINT,
|
||||
|
||||
DATABRICKS_CLOUD_PROVIDER,
|
||||
@@ -153,6 +155,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,
|
||||
|
||||
@@ -166,7 +214,9 @@ public enum EHadoopProperties {
|
||||
|
||||
UNIV_STANDALONE_EXEC_MEMORY,
|
||||
|
||||
UNIV_STANDALONE_EXEC_CORE;
|
||||
UNIV_STANDALONE_EXEC_CORE,
|
||||
|
||||
UNIV_SPARK_SUBMIT_SCRIPT_HOME;
|
||||
|
||||
public String getName() {
|
||||
return this.name();
|
||||
|
||||
@@ -93,8 +93,8 @@ public final class ComponentUtilities {
|
||||
// TODO SML Use getNodeProperty
|
||||
EList elementParameter = node.getElementParameter();
|
||||
Iterator iterator = elementParameter.iterator();
|
||||
for (Object o = iterator.next(); iterator.hasNext(); o = iterator.next()) {
|
||||
ElementParameterType t = (ElementParameterType) o;
|
||||
while (iterator.hasNext()) {
|
||||
ElementParameterType t = (ElementParameterType) iterator.next();
|
||||
if (t.getName().equals(property)) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ public interface IComponent {
|
||||
String SPARK_JOBLET_STREAMING_PID = "org.talend.designer.sparkstreamingjoblet"; //$NON-NLS-1$
|
||||
|
||||
String PROP_NAME = "NAME"; //$NON-NLS-1$
|
||||
|
||||
String PROP_DESCRIPTION = "DESCRIPTION"; //$NON-NLS-1$
|
||||
|
||||
String PROP_LONG_NAME = "LONG_NAME"; //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -522,10 +522,16 @@ public class ContextUtils {
|
||||
return itemMap;
|
||||
}
|
||||
|
||||
|
||||
private static Set<String> missingContexts = new HashSet<>();
|
||||
|
||||
public static void clearMissingContextCache() {
|
||||
missingContexts.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* get the repository context item,now contextId can be either joblet node or context node.
|
||||
*/
|
||||
* get the repository context item, now contextId can be either joblet node or context node.
|
||||
*/
|
||||
public static Item getRepositoryContextItemById(String contextId) {
|
||||
if (IContextParameter.BUILT_IN.equals(contextId)) {
|
||||
return null;
|
||||
@@ -533,6 +539,9 @@ public class ContextUtils {
|
||||
if (checkObject(contextId)) {
|
||||
return null;
|
||||
}
|
||||
if (missingContexts.contains(contextId)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ERepositoryObjectType> possibleTypes = new ArrayList<ERepositoryObjectType>();
|
||||
possibleTypes.add(ERepositoryObjectType.CONTEXT);
|
||||
@@ -547,6 +556,8 @@ public class ContextUtils {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
missingContexts.add(contextId);
|
||||
ExceptionHandler.log("Can't find Context item[id=" + contextId + "].");
|
||||
} catch (PersistenceException e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
@@ -857,6 +868,7 @@ public class ContextUtils {
|
||||
ItemContextLink itemContextLink) {
|
||||
Map<String, String> renamedMap = new HashMap<String, String>();
|
||||
Map<String, Item> tempItemMap = new HashMap<String, Item>();
|
||||
clearMissingContextCache();
|
||||
for (ContextType contextType : contextTypeList) {
|
||||
for (Object obj : contextType.getContextParameter()) {
|
||||
if (obj instanceof ContextParameterType) {
|
||||
@@ -919,6 +931,7 @@ public class ContextUtils {
|
||||
*/
|
||||
public static Map<String, String> calculateRenamedMapFromLinkFile(String projectLabel, String itemId,
|
||||
List<IContext> contextList) {
|
||||
clearMissingContextCache();
|
||||
Map<String, String> renamedMap = new HashMap<String, String>();
|
||||
Map<String, Item> idToItemMap = new HashMap<String, Item>();
|
||||
try {
|
||||
@@ -984,6 +997,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();
|
||||
}
|
||||
@@ -1186,5 +1207,23 @@ public class ContextUtils {
|
||||
}
|
||||
return jobContext;
|
||||
}
|
||||
|
||||
public static boolean isPromptNeeded(List<IContext> contexts, String contextParaName) {
|
||||
for (IContext context : contexts) {
|
||||
List<IContextParameter> list = context.getContextParameterList();
|
||||
if (list != null && list.size() > 0) {
|
||||
for (IContextParameter contextPara : list) {
|
||||
String tempContextParaName = contextPara.getName();
|
||||
if (tempContextParaName.equals(contextParaName)) {
|
||||
if (contextPara.isPromptNeeded()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ public class JobContext implements IContext, Cloneable {
|
||||
|
||||
boolean confirmationNeeded;
|
||||
|
||||
boolean hide;
|
||||
|
||||
public JobContext(String name) {
|
||||
this.name = name;
|
||||
if (this.name == null) {
|
||||
@@ -66,6 +68,14 @@ public class JobContext implements IContext, Cloneable {
|
||||
this.confirmationNeeded = confirmationNeeded;
|
||||
}
|
||||
|
||||
public boolean isHide() {
|
||||
return this.hide;
|
||||
}
|
||||
|
||||
public void setHide(boolean hide) {
|
||||
this.hide = hide;
|
||||
}
|
||||
|
||||
public IContext clone() {
|
||||
IContext clonedContext = null;
|
||||
try {
|
||||
@@ -131,14 +141,16 @@ public class JobContext implements IContext, Cloneable {
|
||||
* @return
|
||||
*/
|
||||
public IContextParameter getContextParameter(String sourceId, String paraName) {
|
||||
if (sourceId == null || paraName == null)
|
||||
if (sourceId == null || paraName == null) {
|
||||
return null;
|
||||
}
|
||||
if (contextParameterList != null && contextParameterList.size() > 0) {
|
||||
for (IContextParameter contextParam : contextParameterList) {
|
||||
String tempSouceId = contextParam.getSource();
|
||||
String tempParaName = contextParam.getName();
|
||||
if (sourceId.equals(tempSouceId) && paraName.equals(tempParaName))
|
||||
if (sourceId.equals(tempSouceId) && paraName.equals(tempParaName)) {
|
||||
return contextParam;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -156,8 +168,9 @@ public class JobContext implements IContext, Cloneable {
|
||||
if (contextParameterList != null && contextParameterList.size() > 0) {
|
||||
for (IContextParameter contextParam : contextParameterList) {
|
||||
String tempParaName = contextParam.getName();
|
||||
if (tempParaName.equals(paraName))
|
||||
if (tempParaName.equals(paraName)) {
|
||||
list.add(contextParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
||||
@@ -56,6 +56,11 @@ public class JobContextManager implements IContextManager {
|
||||
*/
|
||||
private Map<String, String> nameMap = new HashMap<String, String>();
|
||||
|
||||
/*
|
||||
* record rename context for node
|
||||
*/
|
||||
private Map<String, String> nameMapNode = new HashMap<String, String>();
|
||||
|
||||
private Map<ContextItem, Map<String, String>> repositoryRenamedMap = new HashMap<ContextItem, Map<String, String>>();
|
||||
|
||||
/*
|
||||
@@ -299,6 +304,7 @@ public class JobContextManager implements IContextManager {
|
||||
}
|
||||
List<ContextItem> contextItemList = ContextUtils.getAllContextItem();
|
||||
boolean setDefault = false;
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (int i = 0; i < contextTypeList.size(); i++) {
|
||||
contextType = (ContextType) contextTypeList.get(i);
|
||||
String name = contextType.getName();
|
||||
@@ -307,6 +313,7 @@ public class JobContextManager implements IContextManager {
|
||||
}
|
||||
context = new JobContext(name);
|
||||
context.setConfirmationNeeded(contextType.isConfirmationNeeded());
|
||||
context.setHide(contextType.isHide());
|
||||
contextParamList = new ArrayList<IContextParameter>();
|
||||
contextTypeParamList = contextType.getContextParameter();
|
||||
Set<String> paramNamesInCurrentContext = new HashSet<String>();
|
||||
@@ -335,6 +342,8 @@ public class JobContextManager implements IContextManager {
|
||||
} else {
|
||||
contextParam.setType(MetadataTalendType.getDefaultTalendType());
|
||||
}
|
||||
//To avoid encrypt the same value}
|
||||
contextParam.setOriginEncryptedValue(contextParamType.getValue());
|
||||
contextParam.setValue(contextParamType.getRawValue());
|
||||
|
||||
contextParam.setPromptNeeded(contextParamType.isPromptNeeded());
|
||||
@@ -401,6 +410,18 @@ public class JobContextManager implements IContextManager {
|
||||
updateNewParameters(newName, oldName);
|
||||
}
|
||||
|
||||
public void addNameMapForNode(String newName, String oldName) {
|
||||
nameMapNode.put(newName, oldName);
|
||||
}
|
||||
|
||||
public void clearNameMapForNode() {
|
||||
nameMapNode.clear();
|
||||
}
|
||||
|
||||
public Map<String, String> getNameMapNode() {
|
||||
return nameMapNode;
|
||||
}
|
||||
|
||||
public Map<String, String> getNameMap() {
|
||||
return nameMap;
|
||||
}
|
||||
@@ -526,6 +547,7 @@ public class JobContextManager implements IContextManager {
|
||||
|
||||
EList newcontextTypeList = new BasicEList();
|
||||
Map<String, Item> idToItemMap = new HashMap<String, Item>();
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (int i = 0; i < listContext.size(); i++) {
|
||||
IContext context = listContext.get(i);
|
||||
String contextGroupName = renameGroupContext.get(context);
|
||||
@@ -538,6 +560,7 @@ public class JobContextManager implements IContextManager {
|
||||
}
|
||||
contextType.setName(context.getName());
|
||||
contextType.setConfirmationNeeded(context.isConfirmationNeeded());
|
||||
contextType.setHide(context.isHide());
|
||||
newcontextTypeList.add(contextType);
|
||||
|
||||
EList contextTypeParamList = contextType.getContextParameter();
|
||||
@@ -560,7 +583,10 @@ public class JobContextManager implements IContextManager {
|
||||
contextParamType.setName(contextParam.getName());
|
||||
contextParamType.setPrompt(contextParam.getPrompt());
|
||||
contextParamType.setType(contextParam.getType());
|
||||
//To avoid encrypt the same value
|
||||
contextParamType.setValue(contextParam.getOriginEncryptedValue());
|
||||
contextParamType.setRawValue(contextParam.getValue());
|
||||
contextParam.setOriginEncryptedValue(contextParamType.getValue()); // For origin encrypted value is null or encryption key upgrade
|
||||
contextParamType.setPromptNeeded(contextParam.isPromptNeeded());
|
||||
contextParamType.setComment(contextParam.getComment());
|
||||
if (!contextParam.isBuiltIn()) {
|
||||
|
||||
@@ -46,6 +46,9 @@ public class JobContextParameter implements IContextParameter, Cloneable {
|
||||
String[] valueList;
|
||||
|
||||
String internalId;
|
||||
|
||||
/*This value may dirty, only use to cache encrypted value*/
|
||||
String originEncryptedValue;
|
||||
|
||||
/**
|
||||
* change to save id always for bug 13184.
|
||||
@@ -301,6 +304,15 @@ public class JobContextParameter implements IContextParameter, Cloneable {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
public String getOriginEncryptedValue() {
|
||||
return originEncryptedValue;
|
||||
}
|
||||
|
||||
|
||||
public void setOriginEncryptedValue(String originEncryptedValue) {
|
||||
this.originEncryptedValue = originEncryptedValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -51,6 +51,7 @@ public abstract class AbstractItemContextLinkService implements IItemContextLink
|
||||
itemContextLink.setItemId(itemId);
|
||||
Map<String, Item> tempCache = new HashMap<String, Item>();
|
||||
if (contextTypeList != null && contextTypeList.size() > 0) {
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (Object object : contextTypeList) {
|
||||
if (object instanceof ContextType) {
|
||||
ContextType jobContextType = (ContextType) object;
|
||||
|
||||
@@ -206,6 +206,7 @@ public class ContextLinkService {
|
||||
Map<String, Map<String, String>> changedContextParameterId) throws PersistenceException {
|
||||
List<Relation> relationList = RelationshipItemBuilder.getInstance()
|
||||
.getItemsHaveRelationWith(sourceId, RelationshipItemBuilder.LATEST_VERSION, false);
|
||||
ContextUtils.clearMissingContextCache();
|
||||
for (Relation relation : relationList) {
|
||||
String id = relation.getId();
|
||||
IFile linkFile = calContextLinkFile(ProjectManager.getInstance().getCurrentProject().getTechnicalLabel(), id);
|
||||
|
||||
@@ -463,29 +463,31 @@ public final class MetadataTalendType {
|
||||
return list;
|
||||
}
|
||||
|
||||
public static URL getSystemFolderURLOfMappingsFile() throws SystemException {
|
||||
public static File getSystemFolderURLOfMappingsFile() throws SystemException {
|
||||
String dirPath = "/" + INTERNAL_MAPPINGS_FOLDER; //$NON-NLS-1$
|
||||
URL url = null;
|
||||
Path filePath = new Path(dirPath);
|
||||
Bundle b = Platform.getBundle(CoreRuntimePlugin.PLUGIN_ID);
|
||||
if (b != null) {
|
||||
try {
|
||||
// Enumeration<URL> entries = b.findEntries(dirPath, "mapping_*.xml", false);
|
||||
url = FileLocator.toFileURL(FileLocator.find(b, filePath, null));
|
||||
return new File(FileLocator.toFileURL(FileLocator.find(b, filePath, null)).getFile());
|
||||
} catch (IOException e) {
|
||||
throw new SystemException(e);
|
||||
}
|
||||
}
|
||||
return url;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static URL getProjectFolderURLOfMappingsFile() throws SystemException {
|
||||
public static File getProjectFolderURLOfMappingsFile() throws SystemException {
|
||||
try {
|
||||
String dirPath = "/" + INTERNAL_MAPPINGS_FOLDER; //$NON-NLS-1$
|
||||
IProject project = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
|
||||
IPath settingPath = new ProjectScope(project).getLocation();
|
||||
File mappingFolder = settingPath.append(dirPath).toFile();
|
||||
return mappingFolder.toURI().toURL();
|
||||
if (!mappingFolder.exists()) {
|
||||
mappingFolder.mkdirs();
|
||||
}
|
||||
return mappingFolder;
|
||||
} catch (Exception e) {
|
||||
throw new SystemException(e);
|
||||
}
|
||||
@@ -592,8 +594,7 @@ public final class MetadataTalendType {
|
||||
|
||||
public static JSONObject getRevisionObject() {
|
||||
try {
|
||||
File revisonFile = new File(MetadataTalendType.getSystemFolderURLOfMappingsFile().getFile(),
|
||||
MetadataTalendType.FILE_MAPPING_REVISION);
|
||||
File revisonFile = new File(getSystemFolderURLOfMappingsFile(), FILE_MAPPING_REVISION);
|
||||
String jsonStr = new String(Files.readAllBytes(revisonFile.toPath()));
|
||||
return new JSONObject(jsonStr);
|
||||
} catch (Exception e) {
|
||||
@@ -605,13 +606,13 @@ public final class MetadataTalendType {
|
||||
public static boolean restoreMappingFiles() throws Exception {
|
||||
List<File> toDelete = new ArrayList<>();
|
||||
JSONObject revision = getRevisionObject();
|
||||
File projectMappingFolder = new File(getProjectFolderURLOfMappingsFile().getFile());
|
||||
File projectMappingFolder = getProjectFolderURLOfMappingsFile();
|
||||
if (projectMappingFolder.exists()) {
|
||||
File[] projectMappingFiles = projectMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
if (projectMappingFiles != null) {
|
||||
for (File file : projectMappingFiles) {
|
||||
if (revision.has(file.getName())) {
|
||||
String sha1 = MetadataTalendType.getSha1OfFile(file);
|
||||
String sha1 = getSha1OfFile(file);
|
||||
if (revision.getJSONObject(file.getName()).has(sha1)) {
|
||||
toDelete.add(file);
|
||||
}
|
||||
@@ -668,9 +669,9 @@ public final class MetadataTalendType {
|
||||
}
|
||||
|
||||
public static List<File> getWorkingMappingFiles() throws SystemException {
|
||||
File projectMappingFolder = new File(getProjectFolderURLOfMappingsFile().getFile());
|
||||
File projectMappingFolder = getProjectFolderURLOfMappingsFile();
|
||||
File[] projectMappingFiles = projectMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
File systemMappingFolder = new File(getSystemFolderURLOfMappingsFile().getFile());
|
||||
File systemMappingFolder = getSystemFolderURLOfMappingsFile();
|
||||
File[] systemMappingFiles = systemMappingFolder.listFiles(f -> f.getName().matches(MAPPING_FILE_PATTERN));
|
||||
if (projectMappingFiles == null || projectMappingFiles.length == 0) {
|
||||
return Arrays.asList(systemMappingFiles);
|
||||
@@ -686,7 +687,7 @@ public final class MetadataTalendType {
|
||||
|
||||
public static String getSha1OfSystemMappingFile(String fileName) {
|
||||
try {
|
||||
return getSha1OfFile(new File(getSystemFolderURLOfMappingsFile().getFile(), fileName));
|
||||
return getSha1OfFile(new File(getSystemFolderURLOfMappingsFile(), fileName));
|
||||
} catch (SystemException e) {
|
||||
ExceptionHandler.process(e);
|
||||
return null;
|
||||
|
||||
@@ -156,6 +156,7 @@ public final class MetadataToolAvroHelper {
|
||||
copyColumnProperties(fb, in);
|
||||
|
||||
fb.prop(DiSchemaConstants.TALEND6_LABEL, label);
|
||||
|
||||
|
||||
Object defaultValue = null;
|
||||
Expression initialValue = in.getInitialValue();
|
||||
@@ -209,6 +210,8 @@ public final class MetadataToolAvroHelper {
|
||||
// FIXME - this one should go away
|
||||
type = AvroUtils._date();
|
||||
}
|
||||
|
||||
defaultValue = null;
|
||||
}
|
||||
// String-ish types.
|
||||
else if (JavaTypesManager.STRING.getId().equals(tt) || JavaTypesManager.FILE.getId().equals(tt)
|
||||
@@ -369,6 +372,7 @@ public final class MetadataToolAvroHelper {
|
||||
*/
|
||||
private static <T extends PropBuilder<T>> PropBuilder<T> copyColumnProperties(PropBuilder<T> builder,
|
||||
org.talend.core.model.metadata.builder.connection.MetadataColumn in) {
|
||||
|
||||
// Properties common to tables and columns.
|
||||
if (in.getId() != null) {
|
||||
builder.prop(DiSchemaConstants.TALEND6_ID, in.getId());
|
||||
@@ -385,6 +389,8 @@ public final class MetadataToolAvroHelper {
|
||||
builder.prop(DiSchemaConstants.TALEND6_IS_READ_ONLY, tv.getValue());
|
||||
}else if(DiSchemaConstants.AVRO_TECHNICAL_KEY.equals(additionalTag)){
|
||||
builder.prop(DiSchemaConstants.AVRO_TECHNICAL_KEY, tv.getValue());
|
||||
}else if(DiSchemaConstants.LOGICAL_TIME_TYPE_AS.equals(additionalTag)) {
|
||||
builder.prop(DiSchemaConstants.LOGICAL_TIME_TYPE_AS, tv.getValue());
|
||||
}else if (tv.getValue() != null) {
|
||||
builder.prop(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES + additionalTag, tv.getValue());
|
||||
}
|
||||
@@ -462,7 +468,7 @@ public final class MetadataToolAvroHelper {
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(DiSchemaConstants.TALEND6_IS_READ_ONLY, prop);
|
||||
table.getTaggedValue().add(tv);
|
||||
}
|
||||
for (String key : in.getJsonProps().keySet()) {
|
||||
for (String key : in.getObjectProps().keySet()) {
|
||||
if (key.startsWith(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES)) {
|
||||
String originalKey = key.substring(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES.length());
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(originalKey, in.getProp(key));
|
||||
@@ -508,7 +514,7 @@ public final class MetadataToolAvroHelper {
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(DiSchemaConstants.TALEND6_IS_READ_ONLY, prop);
|
||||
col.getTaggedValue().add(tv);
|
||||
}
|
||||
for (String key : schema.getJsonProps().keySet()) {
|
||||
for (String key : schema.getObjectProps().keySet()) {
|
||||
if (key.startsWith(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES)) {
|
||||
String originalKey = key.substring(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES.length());
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(originalKey, schema.getProp(key));
|
||||
@@ -626,6 +632,7 @@ public final class MetadataToolAvroHelper {
|
||||
} else if (AvroUtils.isSameType(nonnullable, AvroUtils._float())) {
|
||||
col.setTalendType(JavaTypesManager.FLOAT.getId());
|
||||
} else if (AvroUtils.isSameType(nonnullable, AvroUtils._int())) {
|
||||
|
||||
if (logicalType == LogicalTypes.date()) {
|
||||
col.setTalendType(JavaTypesManager.DATE.getId());
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(DiSchemaConstants.TALEND6_COLUMN_DATE_DATE, "true");
|
||||
@@ -637,6 +644,8 @@ public final class MetadataToolAvroHelper {
|
||||
String logical_time_type_as = field.getProp(DiSchemaConstants.LOGICAL_TIME_TYPE_AS);
|
||||
if(DiSchemaConstants.AS_TALEND_DATE.equals(logical_time_type_as)) {
|
||||
col.setTalendType(JavaTypesManager.DATE.getId());
|
||||
TaggedValue tv2 = TaggedValueHelper.createTaggedValue(DiSchemaConstants.LOGICAL_TIME_TYPE_AS, DiSchemaConstants.AS_TALEND_DATE);
|
||||
col.getTaggedValue().add(tv2);
|
||||
} else {
|
||||
col.setTalendType(JavaTypesManager.INTEGER.getId());
|
||||
}
|
||||
@@ -681,7 +690,7 @@ public final class MetadataToolAvroHelper {
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(DiSchemaConstants.TALEND6_IS_READ_ONLY, prop);
|
||||
col.getTaggedValue().add(tv);
|
||||
}
|
||||
for (String key : field.getJsonProps().keySet()) {
|
||||
for (String key : field.getObjectProps().keySet()) {
|
||||
if (key.startsWith(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES)) {
|
||||
String originalKey = key.substring(DiSchemaConstants.TALEND6_ADDITIONAL_PROPERTIES.length());
|
||||
TaggedValue tv = TaggedValueHelper.createTaggedValue(originalKey, field.getProp(key));
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.talend.core.database.EDatabaseTypeName;
|
||||
import org.talend.core.database.ERedshiftDriver;
|
||||
import org.talend.core.database.conn.ConnParameterKeys;
|
||||
import org.talend.core.database.conn.template.EDatabaseConnTemplate;
|
||||
import org.talend.core.database.conn.version.EDatabaseVersion4Drivers;
|
||||
import org.talend.core.model.metadata.Dbms;
|
||||
import org.talend.core.model.metadata.DiSchemaConstants;
|
||||
import org.talend.core.model.metadata.IConvertionConstants;
|
||||
@@ -272,7 +273,7 @@ public final class ConvertionHelper {
|
||||
|
||||
}
|
||||
|
||||
private static String getDriverVersionString(DatabaseConnection dbConn) {
|
||||
public static String getDriverVersionString(DatabaseConnection dbConn) {
|
||||
String dbVersionString = dbConn.getDbVersionString();
|
||||
if (EDatabaseTypeName.REDSHIFT.getDisplayName().equals(dbConn.getDatabaseType())
|
||||
|| EDatabaseTypeName.REDSHIFT_SSO.getDisplayName().equals(dbConn.getDatabaseType())) {
|
||||
@@ -286,6 +287,9 @@ public final class ConvertionHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (EDatabaseTypeName.VERTICA.getDisplayName().equals(dbConn.getDatabaseType())) {
|
||||
dbVersionString = EDatabaseVersion4Drivers.VERTICA_12.getVersionValue();
|
||||
}
|
||||
return dbVersionString;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.talend.core.model.metadata.IMetadataTable;
|
||||
import org.talend.core.model.metadata.MetadataTalendType;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.BRMSConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.BigQueryConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
import org.talend.core.model.metadata.builder.connection.ConnectionFactory;
|
||||
import org.talend.core.model.metadata.builder.connection.DatabaseConnection;
|
||||
@@ -213,6 +214,8 @@ public class ComponentToRepositoryProperty {
|
||||
setFileExcelValue((FileExcelConnection) connection, node, param);
|
||||
} else if (connection instanceof SAPConnection) {
|
||||
setSAPValue((SAPConnection) connection, node, param);
|
||||
} else if (connection instanceof BigQueryConnection) {
|
||||
setBigQueryValue((BigQueryConnection) connection, node, param);
|
||||
} else if (connection instanceof SalesforceSchemaConnection) {
|
||||
setSalesforceSchema((SalesforceSchemaConnection) connection, node, param);
|
||||
} else if (connection instanceof MDMConnection) {
|
||||
@@ -1793,6 +1796,30 @@ public class ComponentToRepositoryProperty {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void setBigQueryValue(BigQueryConnection connection, INode node, IElementParameter param) {
|
||||
if ("SERVICE_ACCOUNT_CREDENTIALS_FILE".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setServiceAccountCredentialsFile(value);
|
||||
}
|
||||
} else if ("PROJECT_ID".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setProjectId(value);
|
||||
}
|
||||
} else if ("USE_REGION_ENDPOINT".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setUseRegionEndpoint(Boolean.valueOf(value));
|
||||
}
|
||||
} else if ("REGION_ENDPOINT_BQ".equals(param.getRepositoryValue())) {
|
||||
String value = getParameterValue(connection, node, param);
|
||||
if (value != null) {
|
||||
connection.setRegionEndpoint(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
@@ -47,6 +48,7 @@ import org.talend.core.model.metadata.MultiSchemasUtil;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.AdditionalConnectionProperty;
|
||||
import org.talend.core.model.metadata.builder.connection.BRMSConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.BigQueryConnection;
|
||||
import org.talend.core.model.metadata.builder.connection.Concept;
|
||||
import org.talend.core.model.metadata.builder.connection.ConceptTarget;
|
||||
import org.talend.core.model.metadata.builder.connection.Connection;
|
||||
@@ -148,6 +150,10 @@ public class RepositoryToComponentProperty {
|
||||
if (connection instanceof SAPConnection) {
|
||||
return getSAPValue((SAPConnection) connection, value);
|
||||
}
|
||||
|
||||
if (connection instanceof BigQueryConnection) {
|
||||
return getBigQueryValue((BigQueryConnection) connection, value, table);
|
||||
}
|
||||
|
||||
if (connection instanceof SalesforceSchemaConnection) {
|
||||
return getSalesforceSchemaValue((SalesforceSchemaConnection) connection, value, table);
|
||||
@@ -456,6 +462,62 @@ public class RepositoryToComponentProperty {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Object getBigQueryValue(BigQueryConnection connection, String value, IMetadataTable table) {
|
||||
if ("SERVICE_ACCOUNT_CREDENTIALS_FILE".equals(value)) {
|
||||
if (isContextMode(connection, connection.getServiceAccountCredentialsFile())) {
|
||||
return connection.getServiceAccountCredentialsFile();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getServiceAccountCredentialsFile());
|
||||
}
|
||||
} else if ("PROJECT_ID".equals(value)) {
|
||||
if (isContextMode(connection, connection.getProjectId())) {
|
||||
return connection.getProjectId();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getProjectId());
|
||||
}
|
||||
} else if ("USE_REGION_ENDPOINT".equals(value)) {
|
||||
return connection.isUseRegionEndpoint();
|
||||
} else if ("REGION_ENDPOINT_BQ".equals(value)) {
|
||||
if (isContextMode(connection, connection.getRegionEndpoint())) {
|
||||
return connection.getRegionEndpoint();
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(connection.getRegionEndpoint());
|
||||
}
|
||||
} else if ("DATASET".equals(value)) {
|
||||
if(table!=null) {
|
||||
Map<String, String> properties = table.getAdditionalProperties();
|
||||
if(properties!=null) {
|
||||
String dataSet = properties.get("dataSet");
|
||||
if (isContextMode(connection, dataSet)) {
|
||||
return dataSet;
|
||||
} else {
|
||||
return TalendQuoteUtils.addQuotes(dataSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ("QUERY".equals(value)) {
|
||||
if(table!=null) {
|
||||
Map<String, String> properties = table.getAdditionalProperties();
|
||||
if(properties!=null) {
|
||||
String dataSet = properties.get("dataSet");
|
||||
String tableName = table.getLabel();
|
||||
if(dataSet!=null && tableName!=null) {
|
||||
List<IMetadataColumn> columns = table.getListColumns();
|
||||
StringBuilder strBuilder = new StringBuilder();
|
||||
strBuilder.append("SELECT");
|
||||
if(columns!=null) {
|
||||
strBuilder.append(columns.stream().map(column -> column.getOriginalDbColumnName()).collect(Collectors.joining(",", " ", " ")));
|
||||
}
|
||||
strBuilder.append("FROM ").append(dataSet).append('.').append(tableName);
|
||||
return TalendQuoteUtils.addQuotes(strBuilder.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* DOC gcui Comment method "getHL7Value".
|
||||
@@ -1091,6 +1153,10 @@ public class RepositoryToComponentProperty {
|
||||
if (dbVersionString != null) {
|
||||
return dbVersionString.toUpperCase();
|
||||
}
|
||||
} else if (EDatabaseConnTemplate.AMAZON_AURORA.getDBDisplayName().equals(databaseType)) {
|
||||
if (dbVersionString != null) {
|
||||
return dbVersionString.toUpperCase();
|
||||
}
|
||||
} else if (EDatabaseTypeName.HIVE.getDisplayName().equals(databaseType)) {
|
||||
return connection.getParameters().get(ConnParameterKeys.CONN_PARA_KEY_HIVE_VERSION);
|
||||
} else if (EDatabaseTypeName.HBASE.getDisplayName().equals(databaseType)) {
|
||||
|
||||
@@ -32,6 +32,10 @@ public interface IContext {
|
||||
|
||||
public void setConfirmationNeeded(boolean confirmationNeeded);
|
||||
|
||||
public boolean isHide();
|
||||
|
||||
public void setHide(boolean hide);
|
||||
|
||||
public List<IContextParameter> getContextParameterList();
|
||||
|
||||
public void setContextParameterList(List<IContextParameter> contextParameterList);
|
||||
|
||||
@@ -75,4 +75,9 @@ public interface IContextParameter {
|
||||
public String getInternalId();
|
||||
|
||||
public void setInternalId(String internalId);
|
||||
|
||||
/*This value may dirty, only use to cache encrypted value*/
|
||||
public String getOriginEncryptedValue();
|
||||
|
||||
public void setOriginEncryptedValue(String originEncryptedValue);
|
||||
}
|
||||
|
||||
@@ -234,4 +234,13 @@ public interface IElementParameter {
|
||||
public void setSerialized(boolean isSerialized);
|
||||
|
||||
public boolean isSelectedFromItemValue();
|
||||
|
||||
/*This value may dirty, only use to cache encrypted value*/
|
||||
public String getOrignEncryptedValue();
|
||||
|
||||
public void setOrignEncryptedValue(String value);
|
||||
|
||||
public void setDescription (String description);
|
||||
|
||||
public String getDescription ();
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ public interface IProcess2 extends IRepositoryObject, IProcess {
|
||||
@Override
|
||||
void setActivate(boolean b);
|
||||
|
||||
public boolean isRefactoringToJoblet();
|
||||
|
||||
public void refactoringToJoblet(boolean isRefactoring);
|
||||
/**
|
||||
* DOC qzhang Comment method "checkStartNodes".
|
||||
*/
|
||||
|
||||
@@ -729,7 +729,7 @@ public final class ProcessUtils {
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isRoute(Property property) {
|
||||
public static boolean isRoute(Property property) {
|
||||
return property!= null && (ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE) ||
|
||||
ERepositoryObjectType.getType(property).equals(ERepositoryObjectType.PROCESS_ROUTE_MICROSERVICE));
|
||||
}
|
||||
@@ -768,6 +768,39 @@ public final class ProcessUtils {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public static boolean isRouteWithRoutelets(Item item) {
|
||||
if (item!= null && item instanceof ProcessItem) {
|
||||
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
|
||||
if (obj instanceof NodeType) {
|
||||
if (isRouteletNode((NodeType) obj)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isRouteletNode(NodeType node) {
|
||||
String jobIds = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_PROCESS");
|
||||
String jobVersion = getParameterValue(node.getElementParameter(), "PROCESS_TYPE:PROCESS_TYPE_VERSION"); //$NON-NLS-1$
|
||||
ProcessItem processItem = ItemCacheManager.getProcessItem(jobIds, jobVersion);
|
||||
if (processItem != null) {
|
||||
return ERepositoryObjectType.getType(processItem.getProperty()).equals(
|
||||
ERepositoryObjectType.PROCESS_ROUTELET);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getParameterValue(EList<ElementParameterType> listParamType, String paramName) {
|
||||
for (ElementParameterType pType : listParamType) {
|
||||
if (pType != null && paramName.equals(pType.getName())) {
|
||||
return pType.getValue();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getAssertAmount(IProcess process) {
|
||||
int count = 0;
|
||||
@@ -1058,6 +1091,28 @@ public final class ProcessUtils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isChildRouteProcess(Item item) {
|
||||
|
||||
if (item!= null && item instanceof ProcessItem) {
|
||||
for (Object obj : ((ProcessItem) item).getProcess().getNode()) {
|
||||
if (obj instanceof NodeType) {
|
||||
if (((NodeType) obj).getComponentName().equals("tRouteInput")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
public static boolean isRoutelet(Property p) {
|
||||
if (p != null) {
|
||||
return ERepositoryObjectType.getType(p).equals(ERepositoryObjectType.PROCESS_ROUTELET);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String escapeJava(String input) {
|
||||
return StringEscapeUtils.escapeJava(input);
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.talend.core.IESBService;
|
||||
import org.talend.core.PluginChecker;
|
||||
import org.talend.core.model.general.Project;
|
||||
import org.talend.core.model.properties.BRMSConnectionItem;
|
||||
import org.talend.core.model.properties.BigQueryConnectionItem;
|
||||
import org.talend.core.model.properties.CSVFileConnectionItem;
|
||||
import org.talend.core.model.properties.ConnectionItem;
|
||||
import org.talend.core.model.properties.ContextItem;
|
||||
@@ -334,10 +335,6 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
"SYSTEM_INDICATORS_TEXT_STATISTICS", 97, true, "repository.systemIndicators.textStatistics.alias",
|
||||
new String[] { PROD_DQ }, new String[] {}, false);
|
||||
|
||||
public final static ERepositoryObjectType TDQ_EXCHANGE = new ERepositoryObjectType("repository.tdqExchange", //$NON-NLS-1$
|
||||
"TDQ_Libraries/Exchange", "TDQ_EXCHANGE", 98, true, "repository.tdqExchange.alias", new String[] { PROD_DQ }, //$NON-NLS-1$
|
||||
new String[] {});
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SALESFORCE_MODULE = new ERepositoryObjectType(
|
||||
"repository.metadataSalesforceModule", "METADATA_SALESFORCE_MODULE", 99, true, true, new String[] { PROD_DI }, //$NON-NLS-1$ //$NON-NLS-2$
|
||||
new String[] {}, false);
|
||||
@@ -360,14 +357,17 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAP_TABLE = new ERepositoryObjectType("repository.SAPTable", //$NON-NLS-1$
|
||||
"METADATA_SAP_TABLE", 104, true, true, new String[] { PROD_DI }, new String[] {}, false);
|
||||
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAP_CONTENT_EXTRACTOR = new ERepositoryObjectType("repository.SAPTable", //$NON-NLS-1$
|
||||
"METADATA_SAP_CONTENT_EXTRACTOR", 105, true, true, new String[] { PROD_DI }, new String[] {}, false);
|
||||
|
||||
|
||||
public final static ERepositoryObjectType METADATA_CON_CALCULATION_VIEW = new ERepositoryObjectType(
|
||||
"repository.metadataCalculationView", "METADATA_CON_CALCULATION_VIEW", 106, true, true, new String[] { PROD_DI },
|
||||
new String[] {}, false);
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAP_CDS_VIEW = new ERepositoryObjectType("repository.SAPTable", //$NON-NLS-1$
|
||||
"METADATA_SAP_CDS_VIEW", 107, true, true, new String[] { PROD_DI }, new String[] {}, false);
|
||||
|
||||
private String label;
|
||||
|
||||
private String alias;
|
||||
@@ -505,6 +505,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
public final static ERepositoryObjectType METADATA_FILE_FTP = ERepositoryObjectType.valueOf("METADATA_FILE_FTP");
|
||||
|
||||
public final static ERepositoryObjectType METADATA_SAPCONNECTIONS = ERepositoryObjectType.valueOf("METADATA_SAPCONNECTIONS");
|
||||
|
||||
public final static ERepositoryObjectType METADATA_BIGQUERYCONNECTIONS = ERepositoryObjectType.valueOf("METADATA_BIGQUERYCONNECTIONS");
|
||||
|
||||
public final static ERepositoryObjectType METADATA_FILE_EBCDIC = ERepositoryObjectType.valueOf("METADATA_FILE_EBCDIC");
|
||||
|
||||
@@ -865,6 +867,8 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
return "DB connection"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_SAPCONNECTIONS) {
|
||||
return "SAPconnection"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_BIGQUERYCONNECTIONS) {
|
||||
return "BigQueryconnection"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_FILE_EBCDIC) {
|
||||
return "fileEBCDIC"; //$NON-NLS-1$
|
||||
} else if (type == METADATA_FILE_HL7) {
|
||||
@@ -1076,6 +1080,11 @@ public class ERepositoryObjectType extends DynaEnum<ERepositoryObjectType> {
|
||||
public Object caseSAPConnectionItem(SAPConnectionItem object) {
|
||||
return METADATA_SAPCONNECTIONS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseBigQueryConnectionItem(BigQueryConnectionItem object) {
|
||||
return METADATA_BIGQUERYCONNECTIONS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object caseDelimitedFileConnectionItem(DelimitedFileConnectionItem object) {
|
||||
@@ -1477,12 +1486,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 +1497,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>();
|
||||
|
||||
|
||||
@@ -770,6 +770,15 @@ public abstract class RepositoryUpdateManager {
|
||||
updateConnectionContextParam((ConnectionItem) item, citem, valueMap);
|
||||
}
|
||||
}
|
||||
|
||||
List<IRepositoryViewObject> bigqueryConnList = FACTORY.getAll(ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS, true);
|
||||
for (IRepositoryViewObject obj : bigqueryConnList) {
|
||||
Item item = obj.getProperty().getItem();
|
||||
if (item instanceof ConnectionItem) {
|
||||
updateConnectionContextParam((ConnectionItem) item, citem, valueMap);
|
||||
}
|
||||
}
|
||||
|
||||
for (String updateType : UpdateRepositoryHelper.getAllHadoopConnectionTypes()) {
|
||||
List<IRepositoryViewObject> hadoopConnList = FACTORY
|
||||
.getAll(ERepositoryObjectType.valueOf(ERepositoryObjectType.class, updateType), true);
|
||||
|
||||
@@ -52,9 +52,9 @@ public final class UpdatesConstants {
|
||||
* Category
|
||||
*/
|
||||
|
||||
public static final String CONTEXT = Messages.getString("UpdatesConstants.Context"); //$NON-NLS-1$
|
||||
public static final String CONTEXT = Messages.getString("UpdatesConstants.ContextVariable"); //$NON-NLS-1$
|
||||
|
||||
public static final String CONTEXT_GROUP = Messages.getString("UpdatesConstants.ContextGroup"); //$NON-NLS-1$
|
||||
public static final String CONTEXT_GROUP = Messages.getString("UpdatesConstants.ContextEnvironment"); //$NON-NLS-1$
|
||||
|
||||
public static final String COMPONENT = Messages.getString("UpdatesConstants.Component"); //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -27,17 +27,6 @@ public final class TalendPropertiesUtil {
|
||||
return Boolean.parseBoolean(value);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "isHideExchange".
|
||||
*
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static boolean isHideExchange() {
|
||||
return isEnabled("talend.hide.exchange") || isEnabled("talend.disable.internet"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* DOC ggu Comment method "isHideBuildNumber".
|
||||
@@ -79,4 +68,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$
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
// ============================================================================
|
||||
package org.talend.core.nexus;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
@@ -25,9 +27,9 @@ import org.talend.core.runtime.CoreRuntimePlugin;
|
||||
import org.talend.core.runtime.i18n.Messages;
|
||||
import org.talend.core.runtime.projectsetting.ProjectPreferenceManager;
|
||||
import org.talend.core.service.IRemoteService;
|
||||
import org.talend.core.utils.SecurityStorageUtil;
|
||||
import org.talend.repository.model.IProxyRepositoryFactory;
|
||||
import org.talend.repository.model.RepositoryConstants;
|
||||
import org.talend.utils.security.StudioEncryption;
|
||||
|
||||
/**
|
||||
* created by wchen on 2015年6月16日 Detailled comment
|
||||
@@ -81,6 +83,8 @@ public class TalendLibsServerManager {
|
||||
|
||||
public static final String ENABLE_PROXY_SETTING = "nexus.proxy.enable";
|
||||
|
||||
public static final String NEXUS_PROXY_STORAGE_CATEGORY = "org.talend.artifact.proxy.setting";
|
||||
|
||||
public static final String TALEND_LIB_USER = "";//$NON-NLS-1$
|
||||
|
||||
public static final String TALEND_LIB_PASSWORD = "";//$NON-NLS-1$
|
||||
@@ -255,10 +259,14 @@ public class TalendLibsServerManager {
|
||||
boolean enableProxyFlag = prefManager.getBoolean(TalendLibsServerManager.ENABLE_PROXY_SETTING);
|
||||
if (enableProxyFlag) {
|
||||
serverBean.setServer(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_URL));
|
||||
serverBean.setUserName(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_USERNAME));
|
||||
serverBean.setPassword(StudioEncryption.getStudioEncryption(StudioEncryption.EncryptionKeyName.SYSTEM).decrypt(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_PASSWORD)));
|
||||
serverBean.setRepositoryId(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_REPOSITORY_ID));
|
||||
serverBean.setType(prefManager.getValue(TalendLibsServerManager.NEXUS_PROXY_TYPE));
|
||||
String[] credentials = getProxyArtifactCredentials(serverBean.getServer(), serverBean.getRepositoryId(),
|
||||
NEXUS_PROXY_USERNAME, NEXUS_PROXY_PASSWORD);
|
||||
if (credentials != null) {
|
||||
serverBean.setUserName(credentials[0]);
|
||||
serverBean.setPassword(credentials[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(serverBean.getServer())) {
|
||||
@@ -267,6 +275,89 @@ public class TalendLibsServerManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String[] getProxyArtifactCredentials(String url, String repositoryId, String usernameKey, String passwordKey) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
Map<String, String> storageNodePairs = SecurityStorageUtil.getSecurityStorageNodePairs(path);
|
||||
if (storageNodePairs != null) {
|
||||
String username = storageNodePairs.get(usernameKey);
|
||||
String password = storageNodePairs.get(passwordKey);
|
||||
if (username == null && password == null) {
|
||||
return null;
|
||||
}
|
||||
return new String[] { username, password };
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void saveProxyArtifactCredentials(String url, String repositoryId, String usernameKey, String username,
|
||||
String passwordKey, String password) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, usernameKey, username, false, false);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, passwordKey, password, true, false);
|
||||
SecurityStorageUtil.flushSecurityStorage();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveProxyArtifactCredentialsUserName(String url, String repositoryId, String usernameKey, String username,
|
||||
boolean flush) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, usernameKey, username, false, flush);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveProxyArtifactCredentialsPassword(String url, String repositoryId, String passwordKey, String password,
|
||||
boolean flush) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String path = getStoragePath(url, repositoryId);
|
||||
SecurityStorageUtil.saveToSecurityStorage(path, passwordKey, password, true, flush);
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void flushSecurityStorage() {
|
||||
try {
|
||||
SecurityStorageUtil.flushSecurityStorage();
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
|
||||
private String getStoragePath(String url, String repositoryId) throws Exception {
|
||||
String node = url;
|
||||
if (StringUtils.isNotBlank(repositoryId)) {
|
||||
if (!url.endsWith("/")) {
|
||||
node = node + "/";
|
||||
}
|
||||
node = node + repositoryId;
|
||||
}
|
||||
node = URLEncoder.encode(node, "UTF-8");
|
||||
String path = NEXUS_PROXY_STORAGE_CATEGORY + "/" + node;
|
||||
return path;
|
||||
}
|
||||
|
||||
public ArtifactRepositoryBean getTalentArtifactServer() {
|
||||
ArtifactRepositoryBean serverBean = getProxyArtifactServer();
|
||||
if (serverBean == 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 "";
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.core.runtime.evaluator;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.talend.core.model.utils.ContextParameterUtils;
|
||||
import org.talend.core.runtime.util.GenericTypeUtils;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
@@ -127,6 +128,9 @@ public abstract class AbstractPropertyValueEvaluator implements PropertyValueEva
|
||||
|
||||
if (GenericTypeUtils.isStringType(property)) {
|
||||
if (property.isFlag(Property.Flags.ENCRYPT)) {
|
||||
if (!StringUtils.isEmpty(stringValue)) {
|
||||
stringValue = stringValue.replace("\\\"", "\"");
|
||||
}
|
||||
return TalendQuoteUtils.removeQuotes(stringValue);
|
||||
}
|
||||
return TalendQuoteUtils.removeQuotes(StringEscapeUtils.unescapeJava(stringValue));
|
||||
|
||||
@@ -492,8 +492,8 @@ EUpdateResult.Reload=Reload components
|
||||
EUpdateResult.Rename=Change the name
|
||||
EUpdateResult.Add=Add from repository
|
||||
EUpdateResult.Delete=Delete from repository
|
||||
UpdatesConstants.Context=Context
|
||||
UpdatesConstants.ContextGroup=Context Group
|
||||
UpdatesConstants.ContextVariable=Context variable
|
||||
UpdatesConstants.ContextEnvironment=Context environment
|
||||
UpdatesConstants.Component=Component
|
||||
UpdatesConstants.Joblet=Joblet
|
||||
UpdatesConstants.Spark_Joblet=Spark_Joblet
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -76,5 +78,7 @@ public interface MavenConstants {
|
||||
static final String PACKAGING_JAR = "jar";
|
||||
|
||||
static final String PACKAGING_POM = "pom";
|
||||
|
||||
static final String PACKAGING_BUNDLE = "bundle";
|
||||
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ public class JobInfoProperties extends Properties {
|
||||
public static final String PROJECT_NAME = "project"; //$NON-NLS-1$
|
||||
|
||||
public static final String JOB_ID = "jobId"; //$NON-NLS-1$
|
||||
|
||||
public static final String JOB_PARENT_ID = "jobParentId"; //$NON-NLS-1$
|
||||
|
||||
public static final String JOB_NAME = "job"; //$NON-NLS-1$
|
||||
|
||||
@@ -98,6 +100,10 @@ public class JobInfoProperties extends Properties {
|
||||
setProperty(BRANCH, branchSelection);
|
||||
}
|
||||
|
||||
if (processItem.getProperty() != null && processItem.getProperty().getParentItem() != null) {
|
||||
setProperty(JOB_PARENT_ID, processItem.getProperty().getParentItem().getProperty().getId());
|
||||
}
|
||||
|
||||
setProperty(JOB_ID, jobInfo.getJobId());
|
||||
setProperty(JOB_NAME, jobInfo.getJobName());
|
||||
String jobType = processItem.getProcess().getJobType();
|
||||
|
||||
@@ -22,6 +22,8 @@ public interface IBuildParametes {
|
||||
static final String SERVICE = "Service"; //$NON-NLS-1$
|
||||
|
||||
static final String ITEM = "Item"; //$NON-NLS-1$
|
||||
|
||||
static final String PARENT_ITEM = "ParentItem"; //$NON-NLS-1$
|
||||
|
||||
static final String VERSION = "Version"; //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ public class ModuleAccessHelper {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
private static boolean allowJavaInternalAcess(Property property) {
|
||||
public static boolean allowJavaInternalAcess(Property property) {
|
||||
String allow = System.getProperty(JavaUtils.ALLOW_JAVA_INTERNAL_ACCESS);
|
||||
if (allow != null) {
|
||||
return Boolean.valueOf(allow);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.util.Map;
|
||||
|
||||
import org.talend.core.IProviderService;
|
||||
import org.talend.core.model.process.INode;
|
||||
import org.talend.core.model.properties.BigQueryConnectionItem;
|
||||
import org.talend.repository.model.RepositoryNode;
|
||||
|
||||
public interface IBigQueryProviderService extends IProviderService {
|
||||
|
||||
public BigQueryConnectionItem getRepositoryItem(final INode node);
|
||||
|
||||
public boolean isBigQueryNode(final INode node);
|
||||
|
||||
public boolean isBigQueryNode(final RepositoryNode node);
|
||||
|
||||
public boolean isRepositorySchemaLine(INode node, Map<String, Object> lineValue);
|
||||
}
|
||||
@@ -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,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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,8 +44,26 @@ public interface IMetadataManagmentUiService extends IService {
|
||||
|
||||
public IContext promptConfirmLauch(Shell shell, List<IContext> contexts, IContext defaultContext);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param shell
|
||||
* @param context
|
||||
* @return
|
||||
* @deprecated use instead promptConfirmLauchIterateContexts
|
||||
*/
|
||||
@Deprecated
|
||||
public boolean promptConfirmLauch(Shell shell, IContext context);
|
||||
|
||||
/**
|
||||
* Iterate all variables from each context to check prompt needed
|
||||
*
|
||||
* @param shell
|
||||
* @param contexts
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public boolean promptConfirmLauchIterateContexts(Shell shell, List<IContext> contexts, IContext context);
|
||||
|
||||
public boolean isPromptNeeded(List<IContext> contexts);
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -30,6 +39,8 @@ import org.talend.core.model.update.IStudioUpdateConfig;
|
||||
*/
|
||||
public interface IStudioLiteP2Service extends IService {
|
||||
|
||||
public static final String PROP_CLEARPERSISTEDSTATE = "talend.studio.switchProject.clearPersistedState";
|
||||
|
||||
public static final String CONFIG_STORAGE_FOLDER = "talend/studioLite/";
|
||||
|
||||
public static final String BUNDLES_INFOS_STORAGE_FOLDER = CONFIG_STORAGE_FOLDER + "bundlesInfo/";
|
||||
@@ -128,6 +139,10 @@ public interface IStudioLiteP2Service extends IService {
|
||||
|
||||
void setupTmcUpdate(IProgressMonitor monitor, IStudioUpdateConfig updateConfig) throws Exception;
|
||||
|
||||
void handleTmcUpdateObserve(boolean trunOn);
|
||||
|
||||
boolean isUpdateManagedByTmc(IProgressMonitor monitor);
|
||||
|
||||
boolean removeM2() throws Exception;
|
||||
|
||||
void saveRemoveM2(boolean remove) throws Exception;
|
||||
@@ -201,6 +216,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 +260,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ public class RepositoryImageProvider {
|
||||
return ECoreImage.METADATA_CONNECTION_ICON;
|
||||
} else if (type == ERepositoryObjectType.METADATA_SAPCONNECTIONS || type == ERepositoryObjectType.METADATA_SAP_FUNCTION) {
|
||||
return ECoreImage.METADATA_SAPCONNECTION_ICON;
|
||||
} else if (type == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS) {
|
||||
return ECoreImage.METADATA_BIGQUERYCONNECTION_ICON;
|
||||
} else if (type == ERepositoryObjectType.SQLPATTERNS) {
|
||||
return ECoreImage.METADATA_SQLPATTERN_ICON;
|
||||
} else if (type == ERepositoryObjectType.METADATA_CON_TABLE || type == ERepositoryObjectType.METADATA_SAP_IDOC) {
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.equinox.security.storage.ISecurePreferences;
|
||||
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
|
||||
|
||||
/**
|
||||
* DOC jding class global comment. Detailled comment
|
||||
*/
|
||||
public class SecurityStorageUtil {
|
||||
|
||||
public static void saveToSecurityStorage(String pathName, String key, String value, boolean encrypt) throws Exception {
|
||||
saveToSecurityStorage(pathName, key, value, encrypt, true);
|
||||
}
|
||||
|
||||
public static void saveToSecurityStorage(String pathName, String key, String value, boolean encrypt, boolean flush)
|
||||
throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
ISecurePreferences node = securePreferences.node(pathName);
|
||||
node.put(key, value, encrypt);
|
||||
if (flush) {
|
||||
securePreferences.flush();
|
||||
}
|
||||
}
|
||||
|
||||
public static void flushSecurityStorage() throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
securePreferences.flush();
|
||||
}
|
||||
|
||||
public static String getValueFromSecurityStorage(String pathName, String key) throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
if (!securePreferences.nodeExists(pathName)) {
|
||||
return null;
|
||||
}
|
||||
ISecurePreferences node = securePreferences.node(pathName);
|
||||
return node.get(key, null);
|
||||
}
|
||||
|
||||
public static Map<String, String> getSecurityStorageNodePairs(String pathName) throws Exception {
|
||||
ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault();
|
||||
if (!securePreferences.nodeExists(pathName)) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> keyValuePair = new HashMap<String, String>();
|
||||
ISecurePreferences node = securePreferences.node(pathName);
|
||||
for (String key : node.keys()) {
|
||||
keyValuePair.put(key, node.get(key, null));
|
||||
}
|
||||
return keyValuePair;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,8 +37,6 @@ public class FunctionManager {
|
||||
|
||||
public static final String PURE_PERL_DESC = Messages.getString("FunctionManager.PurePerl.Desc"); //$NON-NLS-1$
|
||||
|
||||
public static final String PURE_PERL_PARAM = Messages.getString("FunctionManager.PurePerl.ParaName"); //$NON-NLS-1$
|
||||
|
||||
private List<TalendType> talendTypes = null;
|
||||
|
||||
public static final String PERL_FUN_PREFIX = "sub{"; //$NON-NLS-1$
|
||||
@@ -55,6 +53,37 @@ public class FunctionManager {
|
||||
|
||||
public static final String EMPTY_STRING = " "; //$NON-NLS-1$
|
||||
|
||||
public static enum EFunctionParameter {
|
||||
|
||||
CUSTOMIZE_PARAM("customize parameter", Messages.getString("FunctionManager.PurePerl.ParaName")); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
private String paramName;
|
||||
|
||||
private String paramDisplayName;
|
||||
|
||||
EFunctionParameter(String paramName, String paramDisplayName) {
|
||||
this.paramName = paramName;
|
||||
this.paramDisplayName = paramDisplayName;
|
||||
}
|
||||
|
||||
public String getParamName() {
|
||||
return paramName;
|
||||
}
|
||||
|
||||
public String getParamDisplayName() {
|
||||
return paramDisplayName;
|
||||
}
|
||||
|
||||
public static String getDisplayNameByName(String name) {
|
||||
for (EFunctionParameter eParameter : values()) {
|
||||
if (eParameter.getParamName().equals(name)) {
|
||||
return eParameter.getParamDisplayName();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* qzhang Comment method "getFunctionByName".
|
||||
*
|
||||
@@ -80,7 +109,7 @@ public class FunctionManager {
|
||||
function.setDescription(PURE_PERL_DESC);
|
||||
StringParameter param = new StringParameter();
|
||||
List<Parameter> params = new ArrayList<Parameter>();
|
||||
param.setName(PURE_PERL_PARAM);
|
||||
param.setName(EFunctionParameter.CUSTOMIZE_PARAM.getParamName());
|
||||
params.add(param);
|
||||
function.setParameters(params);
|
||||
return function;
|
||||
|
||||
@@ -86,43 +86,47 @@ public class RoutineJarsFunctionParser extends AbstractTalendFunctionParser {
|
||||
Set<RoutinesParameterType> rps = new HashSet<RoutinesParameterType>();
|
||||
if (processItem instanceof ProcessItem) {
|
||||
ProcessType pt = ((ProcessItem) processItem).getProcess();
|
||||
if (pt != null) {
|
||||
if (pt.getParameters() != null) {
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
// if it is test process
|
||||
int pidFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 2;
|
||||
int versionFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 4;
|
||||
ProcessTypeImpl pi = (ProcessTypeImpl) pt;
|
||||
if (pi.eClass() != null && StringUtils.equals(pi.eClass().getName(), "TestContainer")) {
|
||||
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
|
||||
// if it is test process
|
||||
int pidFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 2;
|
||||
int versionFeature = TalendFilePackage.PROCESS_TYPE_FEATURE_COUNT + 4;
|
||||
ProcessTypeImpl pi = (ProcessTypeImpl) pt;
|
||||
if (pi.eClass() != null && StringUtils.equals(pi.eClass().getName(), "TestContainer")) {
|
||||
|
||||
try {
|
||||
Object pid = pi.eGet(pidFeature, true, false);
|
||||
Object version = pi.eGet(versionFeature, true, false);
|
||||
if (pid != null) {
|
||||
IProxyRepositoryService svc = IProxyRepositoryService.get();
|
||||
try {
|
||||
List<IRepositoryViewObject> vos = svc.getProxyRepositoryFactory().getAllVersion(pid.toString());
|
||||
for (IRepositoryViewObject vo : vos) {
|
||||
if (StringUtils.equals(vo.getVersion(), String.valueOf(version))) {
|
||||
Item parentProcessItem = vo.getProperty().getItem();
|
||||
if (parentProcessItem instanceof ProcessItem) {
|
||||
pt = ((ProcessItem) parentProcessItem).getProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
try {
|
||||
Object pid = pi.eGet(pidFeature, true, false);
|
||||
Object version = pi.eGet(versionFeature, true, false);
|
||||
if (pid != null) {
|
||||
IProxyRepositoryService svc = IProxyRepositoryService.get();
|
||||
try {
|
||||
List<IRepositoryViewObject> vos = svc.getProxyRepositoryFactory().getAllVersion(pid.toString());
|
||||
for (IRepositoryViewObject vo : vos) {
|
||||
if (StringUtils.equals(vo.getVersion(), String.valueOf(version))) {
|
||||
Item parentProcessItem = vo.getProperty().getItem();
|
||||
if (parentProcessItem instanceof ProcessItem) {
|
||||
pt = ((ProcessItem) parentProcessItem).getProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// ignore
|
||||
}
|
||||
} catch (PersistenceException e) {
|
||||
// ignore
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
} else if (processItem instanceof JobletProcessItem) {
|
||||
ProcessType pt = ((JobletProcessItem) processItem).getJobletProcess();
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
if (pt != null && pt.getParameters() != null) {
|
||||
rps.addAll(pt.getParameters().getRoutinesParameter());
|
||||
}
|
||||
}
|
||||
|
||||
if (!rps.isEmpty()) {
|
||||
|
||||
@@ -149,6 +149,8 @@ public interface IRepositoryService extends IService {
|
||||
|
||||
String getStandardNodeLabel();
|
||||
|
||||
void openProjectSettingsDialog(String pageId);
|
||||
|
||||
public static IRepositoryService get() {
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRepositoryService.class)) {
|
||||
return GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
|
||||
|
||||
@@ -512,6 +512,7 @@ public class RepositoryNodeUtilities {
|
||||
|| curType == ERepositoryObjectType.METADATA_FILE_RULES
|
||||
|| curType == ERepositoryObjectType.METADATA_FILE_LINKRULES
|
||||
|| curType == ERepositoryObjectType.METADATA_SAPCONNECTIONS
|
||||
|| curType == ERepositoryObjectType.METADATA_BIGQUERYCONNECTIONS
|
||||
|| curType == ERepositoryObjectType.METADATA_HEADER_FOOTER) {
|
||||
tmpType = ERepositoryObjectType.METADATA;
|
||||
} else if (curType == ERepositoryObjectType.ROUTINES || curType == ERepositoryObjectType.SNIPPETS) {
|
||||
|
||||
@@ -77,6 +77,7 @@ public class StatusHelper {
|
||||
case PropertiesPackage.CSV_FILE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.DATABASE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.SAP_CONNECTION_ITEM:
|
||||
case PropertiesPackage.BIG_QUERY_CONNECTION_ITEM:
|
||||
case PropertiesPackage.DELIMITED_FILE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.POSITIONAL_FILE_CONNECTION_ITEM:
|
||||
case PropertiesPackage.CONTEXT_ITEM:
|
||||
|
||||
@@ -36,7 +36,9 @@ Require-Bundle: org.apache.commons.lang,
|
||||
org.apache.httpcomponents.httpclient,
|
||||
org.slf4j.api,
|
||||
org.apache.ant,
|
||||
org.eclipse.m2e.maven.runtime
|
||||
org.eclipse.m2e.maven.runtime,
|
||||
org.eclipse.jface.notifications,
|
||||
org.eclipse.swt
|
||||
Import-Package: org.eclipse.jdt.internal.ui.workingsets
|
||||
Export-Package: org.talend.core.ui,
|
||||
org.talend.core.ui.actions,
|
||||
@@ -56,6 +58,7 @@ Export-Package: org.talend.core.ui,
|
||||
org.talend.core.ui.context.model.tree,
|
||||
org.talend.core.ui.context.nattableTree,
|
||||
org.talend.core.ui.context.view,
|
||||
org.talend.core.ui.dialog,
|
||||
org.talend.core.ui.documentation.generation,
|
||||
org.talend.core.ui.editor,
|
||||
org.talend.core.ui.editor.command,
|
||||
|
||||
@@ -104,4 +104,8 @@
|
||||
class="org.talend.core.ui.perspective.RemoveQuickAccessProcessor">
|
||||
</processor>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.startup">
|
||||
<startup class="org.talend.core.ui.notification.Java17NotificationStartupTask" />
|
||||
</extension>
|
||||
</plugin>
|
||||
|
||||
@@ -19,8 +19,8 @@ ContextComposite.treeValue=Values as tree
|
||||
ContextComposite.variable=Variables
|
||||
ContextValueErrorChecker.ErrorTitile=Context value error:
|
||||
ContextProcessSection.1=menuTable
|
||||
ContextProcessSection.12=Rename Context
|
||||
ContextProcessSection.13=Give a new name for the context {0}
|
||||
ContextProcessSection.renameEnvironment.Title=Rename context environment
|
||||
ContextProcessSection.renameEnvironment.Text=New environment name
|
||||
ContextProcessSection.2=Ask for confirmation?
|
||||
ContextProcessSection.29=Error
|
||||
ContextProcessSection.30=This name already exists
|
||||
@@ -28,15 +28,15 @@ ContextProcessSection.4=Add New Context based on ->(
|
||||
ContextProcessSection.49=Default Context
|
||||
ContextProcessSection.50=ContextProcessSection.14
|
||||
ContextProcessSection.51=ContextProcessSection.15
|
||||
ContextProcessSection.6=New Context
|
||||
ContextProcessSection.7=Give a name for the new context
|
||||
ContextProcessSection.createEnvironment.Title=Create context environment
|
||||
ContextProcessSection.createEnvironment.Text=Environment name
|
||||
ContextProcessSection.ParameterNameIsNotValid=Parameter name is not valid.
|
||||
ContextProcessSection.RemoveInformation={0} is default context, it can not be removed.
|
||||
ContextProcessSection.errorTitle=Error
|
||||
ConextTableValuesComposite.nameLabel=Name
|
||||
ConextTemplateComposite.OrderMessages=If you want reorder the variables, it must be selected.
|
||||
ConextTemplateComposite.OrderText=Original order
|
||||
ContextSetConfigurationDialog.nameNotValid=the name is not valid
|
||||
ContextSetConfigurationDialog.required.validName=A valid name is required.
|
||||
ContextTemplateComposite.CommentLabel=Comment
|
||||
ContextTemplateComposite.nameLabel=Name
|
||||
ContextTemplateComposite.scriptCodeLabel=Script code
|
||||
@@ -267,8 +267,8 @@ SelectRepositoryContextDialog.ExpandAll=Expand All
|
||||
SelectRepositoryContextDialog.Title=Select Context Variables
|
||||
SelectRepositoryContextDialog.View=View...
|
||||
SelectRepositoryContextGroupDialog.Default=default
|
||||
SelectRepositoryContextGroupDialog.Messages=In the Job, add a nonexistent context group from the repository context
|
||||
SelectRepositoryContextGroupDialog.Title=Add Context Group
|
||||
SelectRepositoryContextGroupDialog.defaultMessages=In the Job, add a nonexistent context from the repository context
|
||||
SelectRepositoryContextGroupDialog.addTitle=Add Context
|
||||
TalendTabbedPropertyComposite.compactButton.toolTip=compact view
|
||||
TalendTabbedPropertyComposite.tableButton.toolTip=table view
|
||||
TalendType.TypeName=Type name {0}
|
||||
@@ -540,8 +540,8 @@ ContextParameterProposal.ContextVariable.v1=Default context environment: {1}
|
||||
ContextParameterProposal.Type.v1=Type: {2}
|
||||
ContextParameterProposal.VariableName.v1=Value: {3}
|
||||
ArchiveFileExportOperationFullPath.cannotCreateDir=unable to create directory '{0}'
|
||||
WorkingSetConfigurationDialog_new_label=&New...
|
||||
WorkingSetConfigurationDialog_edit_label=&Edit...
|
||||
WorkingSetConfigurationDialog_create_label=&Create...
|
||||
WorkingSetConfigurationDialog_rename_label=&Rename...
|
||||
WorkingSetConfigurationDialog_remove_label=&Remove
|
||||
WorkingSetConfigurationDialog_up_label=&Up
|
||||
WorkingSetConfigurationDialog_down_label=&Down
|
||||
@@ -558,8 +558,12 @@ ContextTreeTable.AddToBuildIn_label=Add to build-in
|
||||
ContextTreeTable.AddToRepository_label=Add to repository context
|
||||
ContextNebulaComposite.ContextsUnAvailable=Context view is not available.
|
||||
ContextNebulaComposite.ContextGroupLabel=Default context environment
|
||||
ContextNebulaComposite.ManageVariablesButtonLabel=Manage variables
|
||||
ContextNebulaComposite.ViewEnvironmentsGroupLabel=View environments
|
||||
ContextNebulaComposite.ManageEnvironmentsGroupLabel=Manage environments
|
||||
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...
|
||||
@@ -582,3 +586,11 @@ I18nPreferencePage.wait_process=The process will hold for several minutes, pleas
|
||||
MetadataPreferencePage.EnableBasic.name=Enable Basic Authentication Header
|
||||
MetadataPreferencePage.MessageDialog.Restart=The Studio needs to restart for this setting to take effect.\nAre you sure?
|
||||
TalendTabbedPropertyTitle.componentHelpTooltip=Open online help
|
||||
Java17NotificationPopup.title=Java 17 compatibility
|
||||
Java17NotificationPopup.info=Enable Java 17 compatibility to take full advantage of your Studio.\n<a>Open Project settings</a>
|
||||
CapabilityCheckDialog.title=Runtime compatibility
|
||||
CapabilityCheckDialog.message=Before publishing, ensure your runtime is using Java 11 or higher.
|
||||
CapabilityCheckDialog.link=<a>Learn more</a>
|
||||
CapabilityCheckDialog.toggle=Don't show this message again
|
||||
CapabilityCheckDialog.cancel=Cancel
|
||||
CapabilityCheckDialog.publish=Publish anyway
|
||||
|
||||
@@ -19,8 +19,8 @@ ContextComposite.treeValue=Valeurs en arbre
|
||||
ContextComposite.variable=Variables
|
||||
ContextValueErrorChecker.ErrorTitile=Erreur de la valeur de contexte\u00A0:
|
||||
ContextProcessSection.1=menuTable
|
||||
ContextProcessSection.12=Renommer le contexte
|
||||
ContextProcessSection.13=Donner un nouveau nom au contexte {0}
|
||||
ContextProcessSection.renameEnvironment.Title=Renommer l'environnement du contexte
|
||||
ContextProcessSection.renameEnvironment.Text=Nom du nouvel environnement
|
||||
ContextProcessSection.2=Demander confirmation ?
|
||||
ContextProcessSection.29=Erreur
|
||||
ContextProcessSection.30=Ce nom existe d\u00E9j\u00E0
|
||||
@@ -28,15 +28,15 @@ ContextProcessSection.4=Ajouter un contexte \u00E0 partir de ->(
|
||||
ContextProcessSection.49=Contexte par d\u00E9faut
|
||||
ContextProcessSection.50=ContextProcessSection.14
|
||||
ContextProcessSection.51=ContextProcessSection.15
|
||||
ContextProcessSection.6=Nouveau contexte
|
||||
ContextProcessSection.7=Nommez le nouveau contexte
|
||||
ContextProcessSection.createEnvironment.Title=Cr\u00E9er l'environnement du contexte
|
||||
ContextProcessSection.createEnvironment.Text=Nom de l'environnement
|
||||
ContextProcessSection.ParameterNameIsNotValid=Le nom du param\u00E8tre est invalide.
|
||||
ContextProcessSection.RemoveInformation={0} est le contexte par d\u00E9faut et ne peut \u00EAtre supprim\u00E9.
|
||||
ContextProcessSection.errorTitle=Erreur
|
||||
ConextTableValuesComposite.nameLabel=Nom
|
||||
ConextTemplateComposite.OrderMessages=Si vous souhaitez r\u00E9organiser les variables, cela doit \u00EAtre s\u00E9lectionn\u00E9.
|
||||
ConextTemplateComposite.OrderText=Ordre d'origine
|
||||
ContextSetConfigurationDialog.nameNotValid=le nom est invalide
|
||||
ContextSetConfigurationDialog.required.validName=Un nom valide est requis.
|
||||
ContextTemplateComposite.CommentLabel=Commentaire
|
||||
ContextTemplateComposite.nameLabel=Nom
|
||||
ContextTemplateComposite.scriptCodeLabel=Code script
|
||||
@@ -267,8 +267,8 @@ SelectRepositoryContextDialog.ExpandAll=Tout d\u00E9velopper
|
||||
SelectRepositoryContextDialog.Title=S\u00E9lectionner les variables de contexte
|
||||
SelectRepositoryContextDialog.View=Voir...
|
||||
SelectRepositoryContextGroupDialog.Default=Par d\u00E9faut
|
||||
SelectRepositoryContextGroupDialog.Messages=Dans le Job, ajoute le groupe de contextes inexistant au Job \u00E0 partir du contexte du R\u00E9f\u00E9rentiel
|
||||
SelectRepositoryContextGroupDialog.Title=Ajouter un groupe de contextes
|
||||
SelectRepositoryContextGroupDialog.defaultMessages=Dans le Job, ajoute un contexte inexistant au Job \u00E0 partir du contexte du R\u00E9f\u00E9rentiel
|
||||
SelectRepositoryContextGroupDialog.addTitle=Ajouter un contexte
|
||||
TalendTabbedPropertyComposite.compactButton.toolTip=vue compacte
|
||||
TalendTabbedPropertyComposite.tableButton.toolTip=vue de la table
|
||||
TalendType.TypeName=Nom du type {0}
|
||||
@@ -540,8 +540,8 @@ ContextParameterProposal.ContextVariable.v1=Environnement du contexte par d\u00E
|
||||
ContextParameterProposal.Type.v1=Type : {2}
|
||||
ContextParameterProposal.VariableName.v1=Valeur : {3}
|
||||
ArchiveFileExportOperationFullPath.cannotCreateDir=impossible de cr\u00E9er le r\u00E9pertoire '{0}'
|
||||
WorkingSetConfigurationDialog_new_label=&Nouveau...
|
||||
WorkingSetConfigurationDialog_edit_label=&Editer
|
||||
WorkingSetConfigurationDialog_create_label=&Cr\u00E9er...
|
||||
WorkingSetConfigurationDialog_rename_label=&Renommer...
|
||||
WorkingSetConfigurationDialog_remove_label=Supp&rimer
|
||||
WorkingSetConfigurationDialog_up_label=Ha&ut
|
||||
WorkingSetConfigurationDialog_down_label=&Descendre
|
||||
@@ -558,8 +558,12 @@ ContextTreeTable.AddToBuildIn_label=Ajouter \u00E0 built-in
|
||||
ContextTreeTable.AddToRepository_label=Ajouter au contexte du r\u00E9f\u00E9rentiel
|
||||
ContextNebulaComposite.ContextsUnAvailable=La vue Contextes n'est pas disponible.
|
||||
ContextNebulaComposite.ContextGroupLabel=Environnement du contexte par d\u00E9faut
|
||||
ContextNebulaComposite.ManageVariablesButtonLabel=G\u00E9rer les variables
|
||||
ContextNebulaComposite.ViewEnvironmentsGroupLabel=Voir les environnements
|
||||
ContextNebulaComposite.ManageEnvironmentsGroupLabel=G\u00E9rer les environnements
|
||||
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...
|
||||
|
||||
@@ -19,8 +19,8 @@ ContextComposite.treeValue=\u30C4\u30EA\u30FC\u3068\u3057\u3066\u306E\u5024
|
||||
ContextComposite.variable=\u5909\u6570
|
||||
ContextValueErrorChecker.ErrorTitile=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u5024\u30A8\u30E9\u30FC:
|
||||
ContextProcessSection.1=menuTable
|
||||
ContextProcessSection.12=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u540D\u524D\u3092\u5909\u66F4
|
||||
ContextProcessSection.13=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8{0}\u306B\u65B0\u3057\u3044\u540D\u524D\u3092\u4ED8\u3051\u308B
|
||||
ContextProcessSection.renameEnvironment.Title=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u74B0\u5883\u540D\u3092\u5909\u66F4
|
||||
ContextProcessSection.renameEnvironment.Text=\u65B0\u3057\u3044\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u74B0\u5883\u540D
|
||||
ContextProcessSection.2=\u78BA\u8A8D\u3057\u307E\u3059\u304B?
|
||||
ContextProcessSection.29=\u30A8\u30E9\u30FC
|
||||
ContextProcessSection.30=\u3053\u306E\u540D\u524D\u306F\u65E2\u306B\u5B58\u5728\u3057\u307E\u3059
|
||||
@@ -28,15 +28,15 @@ ContextProcessSection.4=Add New Context based on ->(
|
||||
ContextProcessSection.49=\u30C7\u30D5\u30A9\u30EB\u30C8\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8
|
||||
ContextProcessSection.50=ContextProcessSection.14
|
||||
ContextProcessSection.51=ContextProcessSection.15
|
||||
ContextProcessSection.6=\u65B0\u3057\u3044\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8
|
||||
ContextProcessSection.7=\u65B0\u898F\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306E\u540D\u524D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044
|
||||
ContextProcessSection.createEnvironment.Title=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u74B0\u5883\u3092\u4F5C\u6210
|
||||
ContextProcessSection.createEnvironment.Text=\u74B0\u5883\u540D
|
||||
ContextProcessSection.ParameterNameIsNotValid=\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u540D\u304C\u7121\u52B9\u3067\u3059\u3002
|
||||
ContextProcessSection.RemoveInformation={0}\u304C\u30C7\u30D5\u30A9\u30EB\u30C8\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3067\u3042\u308B\u305F\u3081\u3001\u524A\u9664\u3067\u304D\u307E\u305B\u3093\u3002
|
||||
ContextProcessSection.errorTitle=\u30A8\u30E9\u30FC
|
||||
ConextTableValuesComposite.nameLabel=\u540D\u524D
|
||||
ConextTemplateComposite.OrderMessages=\u5909\u6570\u3092\u4E26\u3079\u66FF\u3048\u308B\u5834\u5408\u306F\u3001\u9078\u629E\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002
|
||||
ConextTemplateComposite.OrderText=\u5143\u306E\u9806\u5E8F
|
||||
ContextSetConfigurationDialog.nameNotValid=\u540D\u524D\u304C\u7121\u52B9\u3067\u3059
|
||||
ContextSetConfigurationDialog.required.validName=\u6709\u52B9\u306A\u540D\u524D\u304C\u5FC5\u8981\u3067\u3059\u3002
|
||||
ContextTemplateComposite.CommentLabel=\u30B3\u30E1\u30F3\u30C8
|
||||
ContextTemplateComposite.nameLabel=\u540D\u524D
|
||||
ContextTemplateComposite.scriptCodeLabel=\u30B9\u30AF\u30EA\u30D7\u30C8\u30B3\u30FC\u30C9
|
||||
@@ -267,8 +267,8 @@ SelectRepositoryContextDialog.ExpandAll=\u3059\u3079\u3066\u5C55\u958B
|
||||
SelectRepositoryContextDialog.Title=\u30B3\u30F3\u30C6\u30AF\u30B9\u30C8\u5909\u6570\u3092\u9078\u629E
|
||||
SelectRepositoryContextDialog.View=\u8868\u793A...
|
||||
SelectRepositoryContextGroupDialog.Default=\u30C7\u30D5\u30A9\u30EB\u30C8
|
||||
SelectRepositoryContextGroupDialog.Messages=\u30B8\u30E7\u30D6\u3067\u3001\u5B58\u5728\u3057\u306A\u3044\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B0\u30EB\u30FC\u30D7\u3092\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u8FFD\u52A0\u3057\u307E\u3059
|
||||
SelectRepositoryContextGroupDialog.Title=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30B0\u30EB\u30FC\u30D7\u3092\u8FFD\u52A0
|
||||
SelectRepositoryContextGroupDialog.defaultMessages=\u30B8\u30E7\u30D6\u3067\u3001\u5B58\u5728\u3057\u306A\u3044\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u304B\u3089\u8FFD\u52A0
|
||||
SelectRepositoryContextGroupDialog.addTitle=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u3092\u8FFD\u52A0
|
||||
TalendTabbedPropertyComposite.compactButton.toolTip=\u30B3\u30F3\u30D1\u30AF\u30C8\u30D3\u30E5\u30FC
|
||||
TalendTabbedPropertyComposite.tableButton.toolTip=\u30C6\u30FC\u30D6\u30EB\u30D3\u30E5\u30FC
|
||||
TalendType.TypeName=\u30BF\u30A4\u30D7\u540D{0}
|
||||
@@ -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
|
||||
@@ -540,8 +540,8 @@ ContextParameterProposal.ContextVariable.v1=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E
|
||||
ContextParameterProposal.Type.v1=\u30BF\u30A4\u30D7: {2}
|
||||
ContextParameterProposal.VariableName.v1=\u5024: {3}
|
||||
ArchiveFileExportOperationFullPath.cannotCreateDir='{0}'\u3068\u3044\u3046\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30FC\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093
|
||||
WorkingSetConfigurationDialog_new_label=\u65B0\u898F(&N)...
|
||||
WorkingSetConfigurationDialog_edit_label=\u7DE8\u96C6(&E)
|
||||
WorkingSetConfigurationDialog_create_label=\u4F5C\u6210(&C)...
|
||||
WorkingSetConfigurationDialog_rename_label=\u540D\u524D\u3092\u5909\u66F4(&R)...
|
||||
WorkingSetConfigurationDialog_remove_label=\u524A\u9664(&R)
|
||||
WorkingSetConfigurationDialog_up_label=\u4E0A\u3078(&U)
|
||||
WorkingSetConfigurationDialog_down_label=\u4E0B\u3078(&D)
|
||||
@@ -558,8 +558,12 @@ ContextTreeTable.AddToBuildIn_label=\u8FFD\u52A0\u3057\u3066\u7D44\u307F\u8FBC\u
|
||||
ContextTreeTable.AddToRepository_label=\u30EA\u30DD\u30B8\u30C8\u30EA\u30FC\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u8FFD\u52A0
|
||||
ContextNebulaComposite.ContextsUnAvailable=\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30D3\u30E5\u30FC\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002
|
||||
ContextNebulaComposite.ContextGroupLabel=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u74B0\u5883
|
||||
ContextNebulaComposite.ManageVariablesButtonLabel=\u5909\u6570\u3092\u7BA1\u7406
|
||||
ContextNebulaComposite.ViewEnvironmentsGroupLabel=\u74B0\u5883\u3092\u8868\u793A
|
||||
ContextNebulaComposite.ManageEnvironmentsGroupLabel=\u74B0\u5883\u3092\u7BA1\u7406
|
||||
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 +583,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
|
||||
|
||||
@@ -19,8 +19,8 @@ ContextComposite.treeValue=\u6811\u683C\u5F0F\u503C
|
||||
ContextComposite.variable=\u53D8\u91CF
|
||||
ContextValueErrorChecker.ErrorTitile=\u4E0A\u4E0B\u6587\u503C\u9519\u8BEF:
|
||||
ContextProcessSection.1=menuTable
|
||||
ContextProcessSection.12=\u91CD\u547D\u540D\u4E0A\u4E0B\u6587
|
||||
ContextProcessSection.13=\u4E3A\u4E0A\u4E0B\u6587\u6307\u5B9A\u65B0\u540D\u79F0 {0}
|
||||
ContextProcessSection.renameEnvironment.Title=\u91CD\u547D\u540D\u4E0A\u4E0B\u6587\u73AF\u5883
|
||||
ContextProcessSection.renameEnvironment.Text=\u65B0\u73AF\u5883\u540D\u79F0
|
||||
ContextProcessSection.2=\u8981\u6C42\u786E\u8BA4\uFF1F
|
||||
ContextProcessSection.29=\u9519\u8BEF
|
||||
ContextProcessSection.30=\u6B64\u540D\u79F0\u5DF2\u5B58\u5728
|
||||
@@ -28,15 +28,15 @@ ContextProcessSection.4=\u6DFB\u52A0\u65B0\u7684\u4E0A\u4E0B\u6587\uFF0C\u57FA\u
|
||||
ContextProcessSection.49=\u9ED8\u8BA4\u4E0A\u4E0B\u6587
|
||||
ContextProcessSection.50=ContextProcessSection.14
|
||||
ContextProcessSection.51=ContextProcessSection.15
|
||||
ContextProcessSection.6=\u65B0\u7684\u4E0A\u4E0B\u6587
|
||||
ContextProcessSection.7=\u4E3A\u65B0\u7684\u4E0A\u4E0B\u6587\u6307\u5B9A\u540D\u79F0
|
||||
ContextProcessSection.createEnvironment.Title=\u521B\u5EFA\u4E0A\u4E0B\u6587\u73AF\u5883
|
||||
ContextProcessSection.createEnvironment.Text=\u73AF\u5883\u540D\u79F0
|
||||
ContextProcessSection.ParameterNameIsNotValid=\u53C2\u6570\u540D\u79F0\u65E0\u6548\u3002
|
||||
ContextProcessSection.RemoveInformation={0} \u4E3A\u9ED8\u8BA4\u4E0A\u4E0B\u6587\uFF0C\u4E0D\u80FD\u79FB\u9664\u3002
|
||||
ContextProcessSection.errorTitle=\u9519\u8BEF
|
||||
ConextTableValuesComposite.nameLabel=\u540D\u79F0
|
||||
ConextTemplateComposite.OrderMessages=\u5982\u679C\u60A8\u60F3\u91CD\u65B0\u6392\u5217\u53D8\u91CF\uFF0C\u5219\u5FC5\u987B\u9009\u4E2D\u5B83\u3002
|
||||
ConextTemplateComposite.OrderText=\u539F\u59CB\u987A\u5E8F
|
||||
ContextSetConfigurationDialog.nameNotValid=\u540D\u79F0\u65E0\u6548
|
||||
ContextSetConfigurationDialog.required.validName=\u9700\u8981\u6709\u6548\u540D\u79F0\u3002
|
||||
ContextTemplateComposite.CommentLabel=\u6CE8\u91CA
|
||||
ContextTemplateComposite.nameLabel=\u540D\u79F0
|
||||
ContextTemplateComposite.scriptCodeLabel=\u811A\u672C\u4EE3\u7801
|
||||
@@ -267,8 +267,8 @@ SelectRepositoryContextDialog.ExpandAll=\u5C55\u5F00\u5168\u90E8
|
||||
SelectRepositoryContextDialog.Title=\u9009\u62E9\u4E0A\u4E0B\u6587\u53D8\u91CF
|
||||
SelectRepositoryContextDialog.View=\u67E5\u770B...
|
||||
SelectRepositoryContextGroupDialog.Default=\u9ED8\u8BA4
|
||||
SelectRepositoryContextGroupDialog.Messages=\u5728\u4F5C\u4E1A\u4E2D\uFF0C\u4ECE\u5B58\u50A8\u5E93\u4E0A\u4E0B\u6587\u6DFB\u52A0\u4E00\u4E2A\u4E0D\u5B58\u5728\u7684\u4E0A\u4E0B\u6587\u7EC4
|
||||
SelectRepositoryContextGroupDialog.Title=\u6DFB\u52A0\u4E0A\u4E0B\u6587\u7EC4
|
||||
SelectRepositoryContextGroupDialog.defaultMessages=\u5728\u4F5C\u4E1A\u4E2D\uFF0C\u4ECE\u5B58\u50A8\u5E93\u4E0A\u4E0B\u6587\u6DFB\u52A0\u4E00\u4E2A\u4E0D\u5B58\u5728\u7684\u4E0A\u4E0B\u6587\u7EC4
|
||||
SelectRepositoryContextGroupDialog.addTitle=\u6DFB\u52A0\u4E0A\u4E0B\u6587
|
||||
TalendTabbedPropertyComposite.compactButton.toolTip=\u7F29\u653E\u89C6\u56FE
|
||||
TalendTabbedPropertyComposite.tableButton.toolTip=\u8868\u89C6\u56FE
|
||||
TalendType.TypeName=\u7C7B\u578B\u540D\u79F0 {0}
|
||||
@@ -540,8 +540,8 @@ ContextParameterProposal.ContextVariable.v1=\u9ED8\u8BA4\u4E0A\u4E0B\u6587\u73AF
|
||||
ContextParameterProposal.Type.v1=\u7C7B\u578B\uFF1A {2}
|
||||
ContextParameterProposal.VariableName.v1=\u503C: {3}
|
||||
ArchiveFileExportOperationFullPath.cannotCreateDir=\u65E0\u6CD5\u521B\u5EFA\u76EE\u5F55 '{0}'
|
||||
WorkingSetConfigurationDialog_new_label=\u65B0\u5EFA(&N)...
|
||||
WorkingSetConfigurationDialog_edit_label=\u7F16\u8F91
|
||||
WorkingSetConfigurationDialog_create_label=&\u521B\u5EFA...
|
||||
WorkingSetConfigurationDialog_rename_label=&\u91CD\u547D\u540D...
|
||||
WorkingSetConfigurationDialog_remove_label=\u79FB\u9664(&R)
|
||||
WorkingSetConfigurationDialog_up_label=\u5411\u4E0A(&U)
|
||||
WorkingSetConfigurationDialog_down_label=\u5411\u4E0B(&D)
|
||||
@@ -558,8 +558,12 @@ ContextTreeTable.AddToBuildIn_label=\u6DFB\u52A0\u5230\u6784\u5EFA\u4E2D
|
||||
ContextTreeTable.AddToRepository_label=\u6DFB\u52A0\u5230\u5B58\u50A8\u5E93\u4E0A\u4E0B\u6587
|
||||
ContextNebulaComposite.ContextsUnAvailable=\u4E0A\u4E0B\u6587\u89C6\u56FE\u4E0D\u53EF\u7528
|
||||
ContextNebulaComposite.ContextGroupLabel=\u9ED8\u8BA4\u4E0A\u4E0B\u6587\u73AF\u5883
|
||||
ContextNebulaComposite.ManageVariablesButtonLabel=\u7BA1\u7406\u53D8\u91CF
|
||||
ContextNebulaComposite.ViewEnvironmentsGroupLabel=\u67E5\u770B\u73AF\u5883
|
||||
ContextNebulaComposite.ManageEnvironmentsGroupLabel=\u7BA1\u7406\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)...
|
||||
|
||||
@@ -20,16 +20,26 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.action.MenuManager;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.layout.GridDataFactory;
|
||||
import org.eclipse.jface.layout.GridLayoutFactory;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CCombo;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
import org.eclipse.swt.events.MouseListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.events.SelectionListener;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.graphics.Rectangle;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
@@ -39,6 +49,7 @@ import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Listener;
|
||||
import org.eclipse.swt.widgets.Menu;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.commons.ui.runtime.image.ECoreImage;
|
||||
@@ -56,11 +67,19 @@ import org.talend.core.model.metadata.types.ContextParameterJavaTypeManager;
|
||||
import org.talend.core.model.process.IContext;
|
||||
import org.talend.core.model.process.IContextManager;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.process.IProcess2;
|
||||
import org.talend.core.model.properties.Item;
|
||||
import org.talend.core.model.update.EUpdateItemType;
|
||||
import org.talend.core.model.update.IUpdateItemType;
|
||||
import org.talend.core.model.update.IUpdateManager;
|
||||
import org.talend.core.model.update.UpdateManagerHelper;
|
||||
import org.talend.core.model.update.UpdateResult;
|
||||
import org.talend.core.model.update.extension.UpdateManagerProviderDetector;
|
||||
import org.talend.core.prefs.ITalendCorePrefConstants;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
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.ContextTableTabChildModel;
|
||||
import org.talend.core.ui.context.model.table.ContextTableTabParentModel;
|
||||
import org.talend.core.ui.context.nattableTree.ContextNatTableUtils;
|
||||
@@ -81,11 +100,13 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
|
||||
private IContextModelManager modelManager = null;
|
||||
|
||||
private ConfigureContextAction configContext;
|
||||
private ConfigureContextAction manageEnvironmentsContext;
|
||||
|
||||
private Combo contextsCombo;
|
||||
|
||||
private Button contextConfigButton;
|
||||
private CCombo viewEnvironmentsCombo;
|
||||
|
||||
private Button manageEnvironmentsButton;
|
||||
|
||||
private ContextManagerHelper helper;
|
||||
|
||||
@@ -99,7 +120,7 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
|
||||
private Button moveDownButton;
|
||||
|
||||
private Button selectContextVariablesButton;
|
||||
private Button manageVariablesButton;
|
||||
|
||||
private Composite contextTableComp;
|
||||
|
||||
@@ -107,12 +128,11 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
|
||||
private Composite messageComp;
|
||||
|
||||
private Composite contextsSelectComp;
|
||||
|
||||
private Composite buttonsComp;
|
||||
|
||||
private ContextTreeTable treeTable;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
@@ -157,12 +177,20 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
if (!ContextNatTableUtils.checkIsInstallExternalJar()) {
|
||||
createMessageGroup(this);
|
||||
} else {
|
||||
createNatTableGroup(this);
|
||||
boolean isRepositoryContext = (modelManager instanceof ContextComposite)
|
||||
&& ((ContextComposite) modelManager).isRepositoryContext();
|
||||
if (isRepositoryContext) {
|
||||
createNatTableGroup(this);
|
||||
|
||||
createButtonsGroup(this);
|
||||
} else {
|
||||
createButtonsGroup(this);
|
||||
|
||||
createNatTableGroup(this);
|
||||
}
|
||||
|
||||
createNatTable();
|
||||
|
||||
createButtonsGroup(this);
|
||||
|
||||
addListener(SWT.Resize, resizeListener);
|
||||
}
|
||||
}
|
||||
@@ -198,26 +226,11 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
private void createNatTable() {
|
||||
ContextTreeTable.TControl tControl = treeTable.createTable(contextTableComp);
|
||||
GridDataFactory.fillDefaults().grab(true, true).applyTo(tControl.getControl());
|
||||
|
||||
configContext = new ConfigureContextAction(modelManager, this.getShell());
|
||||
contextConfigButton = new Button(contextTableComp, SWT.NULL);
|
||||
GridData addContextGridData = new GridData();
|
||||
addContextGridData.verticalAlignment = SWT.TOP;
|
||||
contextConfigButton.setLayoutData(addContextGridData);
|
||||
contextConfigButton.setImage(ImageProvider.getImage(EImage.ADD_ICON));
|
||||
contextConfigButton.setToolTipText(configContext.getText());
|
||||
contextConfigButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
configContext.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createButtonsGroup(Composite parentComposite) {
|
||||
buttonsComp = new Composite(parentComposite, SWT.NULL);
|
||||
buttonsComp.setLayout(GridLayoutFactory.swtDefaults().spacing(0, 0).margins(0, 0).numColumns(7).create());
|
||||
buttonsComp.setLayout(GridLayoutFactory.swtDefaults().spacing(5, 0).margins(5, 0).numColumns(7).create());
|
||||
GridDataFactory.swtDefaults().align(SWT.FILL, SWT.DOWN).grab(true, false).applyTo(buttonsComp);
|
||||
buttonList.clear();
|
||||
addButton = createAddPushButton(buttonsComp);
|
||||
@@ -233,59 +246,154 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
moveDownButton = createMoveDownPushButton(buttonsComp);
|
||||
buttonList.add(moveDownButton);
|
||||
}
|
||||
|
||||
if ((modelManager instanceof ContextComposite) && !((ContextComposite) modelManager).isRepositoryContext()
|
||||
&& !PluginChecker.isOnlyTopLoaded()) {
|
||||
selectContextVariablesButton = createSelectContextVariablesPushButton(buttonsComp);
|
||||
buttonList.add(selectContextVariablesButton);
|
||||
manageVariablesButton = createManageVariablesPushButton(buttonsComp);
|
||||
buttonList.add(manageVariablesButton);
|
||||
}
|
||||
// move the context group from the top to the bottom
|
||||
Composite layoutComposite = new Composite(buttonsComp, SWT.NULL);
|
||||
layoutComposite.setLayout(GridLayoutFactory.swtDefaults().spacing(0, 0).numColumns(1).create());
|
||||
GridDataFactory.swtDefaults().align(SWT.CENTER, SWT.DOWN).grab(true, false).applyTo(layoutComposite);
|
||||
|
||||
createContextsGroup(layoutComposite);
|
||||
createEnvironmentsGroup(buttonsComp);
|
||||
}
|
||||
|
||||
private void createContextsGroup(Composite parentComposite) {
|
||||
contextsSelectComp = new Composite(parentComposite, SWT.NULL);
|
||||
contextsSelectComp.setLayout(GridLayoutFactory.swtDefaults().spacing(10, 0).margins(0, 0).numColumns(2).create());
|
||||
GridDataFactory.swtDefaults().align(SWT.RIGHT, SWT.DOWN).grab(true, false).applyTo(contextsSelectComp);
|
||||
GridLayout layout2 = (GridLayout) contextsSelectComp.getLayout();
|
||||
layout2.marginHeight = 0;
|
||||
layout2.marginTop = 0;
|
||||
layout2.marginBottom = 0;
|
||||
private void createEnvironmentsGroup(Composite parentComposite) {
|
||||
Composite environmentsComp = new Composite(parentComposite, SWT.NULL);
|
||||
environmentsComp.setLayout(new GridLayout(2, false));
|
||||
GridData contextComboData = new GridData();
|
||||
contextComboData.grabExcessHorizontalSpace = true;
|
||||
contextComboData.horizontalAlignment = GridData.END;
|
||||
environmentsComp.setLayoutData(contextComboData);
|
||||
|
||||
Label contextSeletLabel = new Label(contextsSelectComp, SWT.NULL);
|
||||
contextSeletLabel.setText(Messages.getString("ContextNebulaComposite.ContextGroupLabel")); //$NON-NLS-1$
|
||||
contextsCombo = new Combo(contextsSelectComp, SWT.READ_ONLY);
|
||||
contextsCombo.addSelectionListener(new SelectionListener() {
|
||||
viewEnvironmentsCombo = new CCombo(environmentsComp, SWT.BORDER);
|
||||
viewEnvironmentsCombo.setVisibleItemCount(0);
|
||||
viewEnvironmentsCombo.setListVisible(false);
|
||||
viewEnvironmentsCombo.setText(Messages.getString("ContextNebulaComposite.ViewEnvironmentsGroupLabel")); //$NON-NLS-1$
|
||||
viewEnvironmentsCombo.addMouseListener(new MouseListener() {
|
||||
|
||||
@Override
|
||||
public void mouseDoubleClick(MouseEvent e) {
|
||||
updateViewEnvironments(viewEnvironmentsCombo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDown(MouseEvent e) {
|
||||
updateViewEnvironments(viewEnvironmentsCombo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseUp(MouseEvent e) {
|
||||
}
|
||||
});
|
||||
|
||||
manageEnvironmentsContext = new ConfigureContextAction(modelManager, this.getShell());
|
||||
manageEnvironmentsButton = new Button(environmentsComp, SWT.NULL);
|
||||
manageEnvironmentsButton.setText(Messages.getString("ContextNebulaComposite.ManageEnvironmentsGroupLabel")); //$NON-NLS-1$
|
||||
manageEnvironmentsButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
Object obj = e.getSource();
|
||||
String selectContext = ((Combo) obj).getText();
|
||||
IContext defaultContext = modelManager.getContextManager().getDefaultContext();
|
||||
if (selectContext.equals(defaultContext.getName())) {
|
||||
} else {
|
||||
IContext newSelContext = null;
|
||||
for (IContext enviroContext : modelManager.getContextManager().getListContext()) {
|
||||
if (selectContext.equals(enviroContext.getName())) {
|
||||
newSelContext = enviroContext;
|
||||
}
|
||||
}
|
||||
modelManager.onContextChangeDefault(modelManager.getContextManager(), newSelContext);
|
||||
refresh();
|
||||
}
|
||||
|
||||
manageEnvironmentsContext.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateViewEnvironments(CCombo combo) {
|
||||
MenuManager menuMgr = new MenuManager(""); //$NON-NLS-1$
|
||||
List<IContext> contexts = modelManager.getContextManager().getListContext();
|
||||
IContext defaultContext = modelManager.getContextManager().getDefaultContext();
|
||||
for (IContext context : contexts) {
|
||||
String contextName = context.getName();
|
||||
if (contextName.equalsIgnoreCase(defaultContext.getName())) {
|
||||
contextName = contextName + ContextTableConstants.CONTEXT_DEFAULT;
|
||||
}
|
||||
StagingAction action = new StagingAction(contextName, IAction.AS_CHECK_BOX) {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
viewEnvironmentsCombo.setVisibleItemCount(0);
|
||||
viewEnvironmentsCombo.setListVisible(false);
|
||||
String name = getText();
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
updateContextStatus(name, isChecked());
|
||||
}
|
||||
}
|
||||
};
|
||||
action.setChecked(!context.isHide());
|
||||
menuMgr.add(action);
|
||||
}
|
||||
Menu menu = menuMgr.createContextMenu(combo);
|
||||
combo.setMenu(menu);
|
||||
Rectangle bounds = combo.getBounds();
|
||||
Point point = combo.getParent().toDisplay(bounds.x, bounds.y + bounds.height);
|
||||
menu.setLocation(point);
|
||||
menu.setVisible(true);
|
||||
}
|
||||
|
||||
private void updateContextStatus(String name, boolean isChecked) {
|
||||
List<IContext> contexts = modelManager.getContextManager().getListContext();
|
||||
for (IContext context : contexts) {
|
||||
if (name.equalsIgnoreCase(context.getName())
|
||||
|| name.equalsIgnoreCase(context.getName() + ContextTableConstants.CONTEXT_DEFAULT)) {
|
||||
context.setHide(!isChecked);
|
||||
break;
|
||||
}
|
||||
}
|
||||
refreshContextView();
|
||||
}
|
||||
|
||||
private void refreshContextView() {
|
||||
Command command = new Command() {
|
||||
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
|
||||
public void execute() {
|
||||
if (modelManager.getProcess() != null && modelManager.getProcess() instanceof IProcess2) {
|
||||
IUpdateManager updateManager = modelManager.getProcess().getUpdateManager();
|
||||
if (updateManager != null) {
|
||||
List<UpdateResult> updatesNeeded = new ArrayList<UpdateResult>();
|
||||
updatesNeeded.addAll(updateManager.getUpdatesNeeded(EUpdateItemType.CONTEXT));
|
||||
final IUpdateItemType jobletContextType = UpdateManagerProviderDetector.INSTANCE
|
||||
.getUpdateItemType(UpdateManagerHelper.TYPE_JOBLET_CONTEXT);
|
||||
if (jobletContextType != null) {
|
||||
updatesNeeded.addAll(updateManager.getUpdatesNeeded(jobletContextType));
|
||||
}
|
||||
updateManager.executeUpdates(updatesNeeded);
|
||||
}
|
||||
} else {
|
||||
// set the report editor dirty according to the manager(TdqContextViewComposite)
|
||||
IContextManager contextManager = modelManager.getContextManager();
|
||||
if (contextManager instanceof JobContextManager) {
|
||||
JobContextManager jobContextManager = (JobContextManager) contextManager;
|
||||
jobContextManager.setModified(true);
|
||||
}
|
||||
}
|
||||
// refresh both
|
||||
modelManager.refresh();
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
if (modelManager.getCommandStack() == null) {
|
||||
command.execute();
|
||||
} else {
|
||||
modelManager.getCommandStack().execute(command);
|
||||
}
|
||||
}
|
||||
|
||||
private class StagingAction extends Action {
|
||||
|
||||
protected StagingAction() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected StagingAction(String text, ImageDescriptor image) {
|
||||
super(text, image);
|
||||
}
|
||||
|
||||
protected StagingAction(String text) {
|
||||
super(text);
|
||||
}
|
||||
|
||||
protected StagingAction(String text, int style) {
|
||||
super(text, style);
|
||||
}
|
||||
}
|
||||
|
||||
private Button createAddPushButton(final Composite parent) {
|
||||
@@ -404,7 +512,7 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
return moveDownPushButton;
|
||||
}
|
||||
|
||||
private Button createSelectContextVariablesPushButton(final Composite parent) {
|
||||
private Button createManageVariablesPushButton(final Composite parent) {
|
||||
Button selectContextVariablesPushButton = new Button(parent, SWT.PUSH);
|
||||
Image image = ImageProvider.getImage(ECoreImage.CONTEXT_ICON);
|
||||
selectContextVariablesPushButton.addSelectionListener(new SelectionAdapter() {
|
||||
@@ -435,6 +543,7 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
|
||||
});
|
||||
selectContextVariablesPushButton.setImage(image);
|
||||
selectContextVariablesPushButton.setText(Messages.getString("ContextNebulaComposite.ManageVariablesButtonLabel")); //$NON-NLS-1$
|
||||
return selectContextVariablesPushButton;
|
||||
}
|
||||
|
||||
@@ -452,11 +561,11 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
if (this.moveDownButton != null) {
|
||||
this.moveDownButton.setEnabled(enableState);
|
||||
}
|
||||
if (this.selectContextVariablesButton != null) {
|
||||
this.selectContextVariablesButton.setEnabled(enableState);
|
||||
if (this.manageVariablesButton != null) {
|
||||
this.manageVariablesButton.setEnabled(enableState);
|
||||
}
|
||||
if (contextConfigButton != null) {
|
||||
this.contextConfigButton.setEnabled(enableState);
|
||||
if (manageEnvironmentsButton != null) {
|
||||
this.manageEnvironmentsButton.setEnabled(enableState);
|
||||
}
|
||||
if (contextsCombo != null) {
|
||||
this.contextsCombo.setEnabled(enableState);
|
||||
@@ -542,8 +651,8 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
if (configContext != null) {
|
||||
configContext.setEnabled(enabled);
|
||||
if (manageEnvironmentsContext != null) {
|
||||
manageEnvironmentsContext.setEnabled(enabled);
|
||||
}
|
||||
if (contextTableComp != null && !contextTableComp.isDisposed()) {
|
||||
contextTableComp.setEnabled(enabled);
|
||||
@@ -708,9 +817,6 @@ public class ContextNebulaGridComposite extends AbstractContextTabEditComposite
|
||||
}
|
||||
|
||||
private void disposeNatTableComp() {
|
||||
if (contextsSelectComp != null && !contextsSelectComp.isDisposed()) {
|
||||
contextsSelectComp.dispose();
|
||||
}
|
||||
if (contextTableComp != null && !contextTableComp.isDisposed()) {
|
||||
contextTableComp.dispose();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.talend.repository.model.RepositoryConstants;
|
||||
*/
|
||||
public class ContextSetConfigurationDialog extends ObjectSelectionDialog<IContext> {
|
||||
|
||||
private static String defaultMesage = "Configure Contexts for Job. Click to Set Default Context. "; //$NON-NLS-1$
|
||||
private static String defaultMesage = "Create as many environments as necessary and select a default one:"; //$NON-NLS-1$
|
||||
|
||||
IContextModelManager manager = null;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ContextSetConfigurationDialog extends ObjectSelectionDialog<IContex
|
||||
|
||||
@SuppressWarnings("restriction")
|
||||
public ContextSetConfigurationDialog(Shell parentShell, IContextModelManager manager) {
|
||||
super(parentShell, "Configure Contexts", defaultMesage, null); //$NON-NLS-1$
|
||||
super(parentShell, "Manage context environments", defaultMesage, null); //$NON-NLS-1$
|
||||
this.manager = manager;
|
||||
setLabelProvider(getLabelProvider());
|
||||
List<IContext> list = new ArrayList<IContext>(manager.getContextManager().getListContext());
|
||||
@@ -135,7 +135,7 @@ public class ContextSetConfigurationDialog extends ObjectSelectionDialog<IContex
|
||||
|
||||
private String toValid(String newText) {
|
||||
if (newText.equals("") || !newText.matches(RepositoryConstants.CODE_ITEM_PATTERN)) { //$NON-NLS-1$
|
||||
return Messages.getString("ContextSetConfigurationDialog.nameNotValid"); //$NON-NLS-1$
|
||||
return Messages.getString("ContextSetConfigurationDialog.required.validName"); //$NON-NLS-1$
|
||||
}
|
||||
for (IContext context : getAllContexts()) {
|
||||
if (context.getName().equalsIgnoreCase(newText)) {
|
||||
@@ -156,8 +156,8 @@ public class ContextSetConfigurationDialog extends ObjectSelectionDialog<IContex
|
||||
}
|
||||
};
|
||||
|
||||
InputDialog inputDial = new InputDialog(getShell(), Messages.getString("ContextProcessSection.6"), //$NON-NLS-1$
|
||||
Messages.getString("ContextProcessSection.7"), "", validator); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
InputDialog inputDial = new InputDialog(getShell(), Messages.getString("ContextProcessSection.createEnvironment.Title"), //$NON-NLS-1$
|
||||
Messages.getString("ContextProcessSection.createEnvironment.Text"), "", validator); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
inputDial.open();
|
||||
String returnValue = inputDial.getValue();
|
||||
@@ -278,8 +278,8 @@ public class ContextSetConfigurationDialog extends ObjectSelectionDialog<IContex
|
||||
|
||||
IContext selectedContext = (IContext) (getSelection()).getFirstElement();
|
||||
String contextName = selectedContext.getName();
|
||||
InputDialog inputDial = new InputDialog(getShell(), Messages.getString("ContextProcessSection.12"), //$NON-NLS-1$
|
||||
Messages.getString("ContextProcessSection.13", contextName), "", validator); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
InputDialog inputDial = new InputDialog(getShell(), Messages.getString("ContextProcessSection.renameEnvironment.Title"), //$NON-NLS-1$
|
||||
Messages.getString("ContextProcessSection.renameEnvironment.Text"), "", validator); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
inputDial.open();
|
||||
String returnValue = inputDial.getValue();
|
||||
if (returnValue == null || "".equals(returnValue)) {
|
||||
|
||||
@@ -56,9 +56,9 @@ import org.eclipse.nebula.widgets.nattable.group.ColumnGroupModel.ColumnGroup;
|
||||
import org.eclipse.nebula.widgets.nattable.group.ColumnGroupReorderLayer;
|
||||
import org.eclipse.nebula.widgets.nattable.hideshow.ColumnHideShowLayer;
|
||||
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;
|
||||
@@ -93,7 +93,6 @@ 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;
|
||||
import org.talend.core.model.process.IContextParameter;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.repository.IRepositoryViewObject;
|
||||
@@ -103,7 +102,6 @@ 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.context.nattableTree.ContextAutoResizeTextPainter;
|
||||
import org.talend.core.ui.context.nattableTree.ContextColumnGroupConfiguration;
|
||||
import org.talend.core.ui.context.nattableTree.ContextColumnHeaderDecorator;
|
||||
import org.talend.core.ui.context.nattableTree.ContextNatTableBackGroudPainter;
|
||||
import org.talend.core.ui.context.nattableTree.ContextNatTableConfiguration;
|
||||
@@ -111,6 +109,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;
|
||||
@@ -130,7 +129,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<>();
|
||||
@@ -146,11 +145,9 @@ public class ContextTreeTable {
|
||||
|
||||
private IContextModelManager manager;
|
||||
|
||||
private final static int fixedCheckBoxWidth = 90;
|
||||
private final static int fixedCheckBoxWidth = 100;
|
||||
|
||||
private final static int fixedTypeWidth = 90;
|
||||
|
||||
private final static int fixedHidePromptWidth = 1;
|
||||
private final static int fixedTypeWidth = 100;
|
||||
|
||||
public ContextTreeTable(IContextModelManager manager) {
|
||||
this.manager = manager;
|
||||
@@ -170,14 +167,6 @@ public class ContextTreeTable {
|
||||
currentNatTabSel = null;
|
||||
}
|
||||
|
||||
public List<IContext> getContexts(IContextManager contextManger) {
|
||||
List<IContext> contexts = new ArrayList<IContext>();
|
||||
if (contextManger != null) {
|
||||
contexts = contextManger.getListContext();
|
||||
}
|
||||
return contexts;
|
||||
}
|
||||
|
||||
public void refresh() {
|
||||
if (natTable == null) {
|
||||
return;
|
||||
@@ -195,7 +184,7 @@ public class ContextTreeTable {
|
||||
ConfigRegistry configRegistry = new ConfigRegistry();
|
||||
ColumnGroupModel columnGroupModel = new ColumnGroupModel();
|
||||
configRegistry.registerConfigAttribute(SortConfigAttributes.SORT_COMPARATOR, DefaultComparator.getInstance());
|
||||
String[] propertyNames = ContextRowDataListFixture.getPropertyNames(manager);
|
||||
String[] propertyNames = ContextRowDataListFixture.getPropertyNameToLabels(manager);
|
||||
int comWidth = parent.getParent().getClientArea().width - 15;
|
||||
// the data source for the context
|
||||
if (propertyNames.length > 0) {
|
||||
@@ -249,9 +238,6 @@ public class ContextTreeTable {
|
||||
|
||||
ColumnGroupHeaderLayer columnGroupHeaderLayer = new ColumnGroupHeaderLayer(columnHeaderLayer, selectionLayer,
|
||||
columnGroupModel);
|
||||
addContextColumnGroupsBehaviour(columnGroupHeaderLayer,
|
||||
ContextRowDataListFixture.getContexts(manager.getContextManager()));
|
||||
columnGroupHeaderLayer.addConfiguration(new ContextColumnGroupConfiguration(columnGroupModel));
|
||||
|
||||
// Register labels
|
||||
SortHeaderLayer<ContextTreeNode> sortHeaderLayer = new SortHeaderLayer<ContextTreeNode>(columnGroupHeaderLayer,
|
||||
@@ -272,7 +258,8 @@ 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(), manager);
|
||||
bodyDataLayer.setConfigLabelAccumulator(labelAccumulator);
|
||||
registerColumnLabels(labelAccumulator, ContextRowDataListFixture.getContexts(manager.getContextManager()));
|
||||
|
||||
@@ -291,8 +278,6 @@ public class ContextTreeTable {
|
||||
|
||||
addCustomColumnHeaderStyleBehaviour();
|
||||
|
||||
List<Integer> hideColumnsPos = addCustomHideColumnsBehaviour(manager, columnGroupModel, bodyDataLayer);
|
||||
|
||||
List<Integer> checkColumnPos = getAllCheckPosBehaviour(manager, columnGroupModel);
|
||||
|
||||
int dataColumnsWidth = bodyDataLayer.getWidth();
|
||||
@@ -301,7 +286,7 @@ public class ContextTreeTable {
|
||||
|
||||
// for caculate the suitable column size for when maxmum or minmum the context tab
|
||||
|
||||
addCustomColumnsResizeBehaviour(bodyDataLayer, hideColumnsPos, checkColumnPos, cornerLayer.getWidth(), maxWidth);
|
||||
addCustomColumnsResizeBehaviour(bodyDataLayer, checkColumnPos, cornerLayer.getWidth(), maxWidth);
|
||||
|
||||
NatGridLayerPainter layerPainter = new NatGridLayerPainter(natTable);
|
||||
natTable.setLayerPainter(layerPainter);
|
||||
@@ -350,7 +335,7 @@ public class ContextTreeTable {
|
||||
}
|
||||
|
||||
private void constructContextTreeNodes() {
|
||||
List<IContext> contextList = getContexts(manager.getContextManager());
|
||||
List<IContext> contextList = ContextRowDataListFixture.getContexts(manager.getContextManager());
|
||||
List<IContextParameter> contextDatas = ContextTemplateComposite.computeContextTemplate(contextList);
|
||||
List<ContextTableTabParentModel> listofData = ContextNatTableUtils.constructContextDatas(contextDatas);
|
||||
contructContextTrees(listofData);
|
||||
@@ -441,18 +426,19 @@ public class ContextTreeTable {
|
||||
private List<Integer> getAllCheckPosBehaviour(IContextModelManager manager, ColumnGroupModel contextGroupModel) {
|
||||
List<Integer> checkPos = new ArrayList<Integer>();
|
||||
if (manager.getContextManager() != null) {
|
||||
List<IContext> contexts = manager.getContextManager().getListContext();
|
||||
List<IContext> contexts = ContextRowDataListFixture.getContexts(manager.getContextManager());
|
||||
for (IContext envContext : contexts) {
|
||||
ColumnGroup group = contextGroupModel.getColumnGroupByName(envContext.getName());
|
||||
int checkIndex = group.getMembers().get(1);
|
||||
checkPos.add(checkIndex);
|
||||
if (group != null) {
|
||||
checkPos.add(3);
|
||||
}
|
||||
}
|
||||
}
|
||||
return checkPos;
|
||||
}
|
||||
|
||||
private void addCustomColumnsResizeBehaviour(DataLayer dataLayer, List<Integer> hideColumnsPos,
|
||||
List<Integer> checkColumnsPos, int cornerWidth, int maxWidth) {
|
||||
private void addCustomColumnsResizeBehaviour(DataLayer dataLayer, List<Integer> checkColumnsPos, int cornerWidth,
|
||||
int maxWidth) {
|
||||
dataLayer.setColumnsResizableByDefault(true);
|
||||
int dataColumnsCount = dataLayer.getPreferredColumnCount();
|
||||
|
||||
@@ -464,10 +450,9 @@ public class ContextTreeTable {
|
||||
} else {
|
||||
int typeColumnPos = dataLayer.getColumnPositionByIndex(1);
|
||||
|
||||
int leftWidth = maxWidth - fixedTypeWidth - fixedCheckBoxWidth * checkColumnsPos.size() - cornerWidth * 2
|
||||
- fixedHidePromptWidth;
|
||||
int leftWidth = maxWidth - fixedTypeWidth - fixedCheckBoxWidth * checkColumnsPos.size() - cornerWidth * 2;
|
||||
|
||||
int currentColumnsCount = dataColumnsCount - hideColumnsPos.size() - checkColumnsPos.size() - 1;
|
||||
int currentColumnsCount = dataColumnsCount - checkColumnsPos.size() - 1;
|
||||
int averageWidth = leftWidth / currentColumnsCount;
|
||||
for (int i = 0; i < dataLayer.getColumnCount(); i++) {
|
||||
boolean findHide = false;
|
||||
@@ -477,12 +462,6 @@ public class ContextTreeTable {
|
||||
findType = true;
|
||||
dataLayer.setColumnWidthByPosition(i, fixedTypeWidth);
|
||||
}
|
||||
for (int hidePos : hideColumnsPos) {
|
||||
if (hidePos == i) {
|
||||
findHide = true;
|
||||
dataLayer.setColumnWidthByPosition(i, fixedHidePromptWidth);
|
||||
}
|
||||
}
|
||||
for (int checkPos : checkColumnsPos) {
|
||||
if (checkPos == i) {
|
||||
findCheck = true;
|
||||
@@ -521,35 +500,6 @@ public class ContextTreeTable {
|
||||
return colWidth > max ? colWidth : max;
|
||||
}
|
||||
|
||||
private List<Integer> addCustomHideColumnsBehaviour(IContextModelManager modelManager, ColumnGroupModel contextGroupModel,
|
||||
DataLayer dataLayer) {
|
||||
List<Integer> hidePos = new ArrayList<Integer>();
|
||||
if (modelManager.getContextManager() != null) {
|
||||
List<IContext> contexts = modelManager.getContextManager().getListContext();
|
||||
for (IContext envContext : contexts) {
|
||||
boolean needHidePrompt = true;
|
||||
ColumnGroup group = contextGroupModel.getColumnGroupByName(envContext.getName());
|
||||
// get every context's prompt to see if need to hide or not,decide by the check of prompt
|
||||
int promptIndex = group.getMembers().get(2);
|
||||
List<IContextParameter> list = envContext.getContextParameterList();
|
||||
if (list != null && list.size() > 0) {
|
||||
for (IContextParameter contextPara : list) {
|
||||
if (contextPara.isPromptNeeded()) {
|
||||
needHidePrompt = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (needHidePrompt) {
|
||||
int hidePosition = dataLayer.getColumnPositionByIndex(promptIndex);
|
||||
hidePos.add(hidePosition);
|
||||
natTable.doCommand(new ColumnHideCommand(dataLayer, hidePosition));
|
||||
}
|
||||
}
|
||||
}
|
||||
return hidePos;
|
||||
}
|
||||
|
||||
private void addCustomSelectionBehaviour(SelectionLayer layer) {
|
||||
// need control the selection style when select the rows.
|
||||
DefaultSelectionStyleConfiguration selectStyleConfig = new DefaultSelectionStyleConfiguration();
|
||||
@@ -581,26 +531,14 @@ public class ContextTreeTable {
|
||||
natTable.addConfiguration(new ContextParaModeChangeMenuConfiguration(natTable, bodyDataProvider, selection));
|
||||
}
|
||||
|
||||
private void addContextColumnGroupsBehaviour(ColumnGroupHeaderLayer columnHeaderLayer, List<IContext> contexts) {
|
||||
// 0=Name,1=Type,2=Comment.
|
||||
int i = 2;
|
||||
for (IContext context : contexts) {
|
||||
String evnContext = context.getName();
|
||||
columnHeaderLayer.addColumnsIndexesToGroup(evnContext, new int[] { ++i, ++i, ++i });
|
||||
}
|
||||
}
|
||||
|
||||
private void registerColumnLabels(ColumnOverrideLabelAccumulator columnLabelAccumulator, List<IContext> contexts) {
|
||||
columnLabelAccumulator.registerColumnOverrides(0, new String[] { ContextTableConstants.COLUMN_NAME_PROPERTY });
|
||||
columnLabelAccumulator.registerColumnOverrides(1, new String[] { ContextTableConstants.COLUMN_TYPE_PROPERTY });
|
||||
columnLabelAccumulator.registerColumnOverrides(2, new String[] { ContextTableConstants.COLUMN_COMMENT_PROPERTY });
|
||||
// the columns after "type" will caculated by the contexts
|
||||
// 0=Name,1=Type,2=Comment.
|
||||
int j = 3;
|
||||
columnLabelAccumulator.registerColumnOverrides(3, new String[] { ContextTableConstants.COLUMN_CHECK_PROPERTY });
|
||||
int j = 4;
|
||||
for (IContext context : contexts) {
|
||||
columnLabelAccumulator.registerColumnOverrides(j++, new String[] { ContextTableConstants.COLUMN_CONTEXT_VALUE });
|
||||
columnLabelAccumulator.registerColumnOverrides(j++, new String[] { ContextTableConstants.COLUMN_CHECK_PROPERTY });
|
||||
columnLabelAccumulator.registerColumnOverrides(j++, new String[] { ContextTableConstants.COLUMN_PROMPT_PROPERTY });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,12 +742,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
|
||||
|
||||
@@ -166,7 +166,8 @@ public abstract class ObjectSelectionDialog<B> extends SelectionDialog {
|
||||
// fNewButton = createButton(buttonComposite, nextButtonId++,
|
||||
// WorkingSetMessages.WorkingSetConfigurationDialog_new_label,
|
||||
// false);
|
||||
fNewButton = createButton(buttonComposite, nextButtonId++, Messages.getString("WorkingSetConfigurationDialog_new_label"), //$NON-NLS-1$
|
||||
fNewButton = createButton(buttonComposite, nextButtonId++,
|
||||
Messages.getString("WorkingSetConfigurationDialog_create_label"), //$NON-NLS-1$
|
||||
false);
|
||||
fNewButton.setFont(composite.getFont());
|
||||
fNewButton.addSelectionListener(new SelectionAdapter() {
|
||||
@@ -181,7 +182,7 @@ public abstract class ObjectSelectionDialog<B> extends SelectionDialog {
|
||||
// WorkingSetMessages.WorkingSetConfigurationDialog_edit_label,
|
||||
// false);
|
||||
fEditButton = createButton(buttonComposite, nextButtonId++,
|
||||
Messages.getString("WorkingSetConfigurationDialog_edit_label"), false); //$NON-NLS-1$
|
||||
Messages.getString("WorkingSetConfigurationDialog_rename_label"), false); //$NON-NLS-1$
|
||||
fEditButton.setFont(composite.getFont());
|
||||
fEditButton.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user