Compare commits
7 Commits
feat/TBD-1
...
release/8.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2970bab12b | ||
|
|
5a2cc479ed | ||
|
|
1954f09c18 | ||
|
|
dec6f1b934 | ||
|
|
6409a47cdd | ||
|
|
704a6dcb26 | ||
|
|
1a96cdc0aa |
@@ -1,101 +0,0 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.swt.dnd;
|
||||
|
||||
import org.eclipse.jface.viewers.CellEditor;
|
||||
import org.eclipse.jface.viewers.ICellModifier;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.viewers.ViewerCell;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
import org.eclipse.swt.dnd.DropTarget;
|
||||
import org.eclipse.swt.dnd.DropTargetAdapter;
|
||||
import org.eclipse.swt.dnd.DropTargetEvent;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
import org.eclipse.swt.dnd.Transfer;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.TableItem;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
public class DNDTableViewerHelper {
|
||||
|
||||
public static void addDndSupport(final TableViewer tableViewer) {
|
||||
if(tableViewer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
DropTarget dropTarget = new DropTarget(tableViewer.getTable(), DND.DROP_DEFAULT | DND.DROP_COPY);
|
||||
dropTarget.setTransfer(new Transfer[] { TextTransfer.getInstance()});
|
||||
dropTarget.addDropListener(new DropTargetAdapter() {
|
||||
|
||||
@Override
|
||||
public void dragOver(DropTargetEvent event) {
|
||||
if(!isColumnDroptable(tableViewer, getTargetColumn(event))) {
|
||||
event.detail = DND.DROP_NONE;
|
||||
} else {
|
||||
event.detail = DND.DROP_COPY;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragEnter(DropTargetEvent event) {
|
||||
// Allow dropping text only
|
||||
for (int i = 0, n = event.dataTypes.length; i < n; i++) {
|
||||
if (TextTransfer.getInstance().isSupportedType(event.dataTypes[i])) {
|
||||
event.currentDataType = event.dataTypes[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DropTargetEvent event) {
|
||||
if (ifAnyTextDropped(event)) {
|
||||
pasteToTable(event);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean ifAnyTextDropped(DropTargetEvent event) {
|
||||
return TextTransfer.getInstance().isSupportedType(event.currentDataType);
|
||||
}
|
||||
|
||||
private void pasteToTable(DropTargetEvent event) {
|
||||
int columnIndex = getTargetColumn(event);
|
||||
|
||||
if(isColumnDroptable(tableViewer, columnIndex)) {
|
||||
TableItem item = (TableItem) event.item;
|
||||
String originContext = item.getText(columnIndex);
|
||||
|
||||
String idColmn = (String) tableViewer.getColumnProperties()[columnIndex];
|
||||
ICellModifier cellModifier = tableViewer.getCellModifier();
|
||||
cellModifier.modify(event.item, idColmn, originContext + (String)event.data);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isColumnDroptable(final TableViewer tableViewer, int columnIndex) {
|
||||
CellEditor[] cellEditors = tableViewer.getCellEditors();
|
||||
boolean isTextCellEditor = cellEditors[columnIndex] != null
|
||||
&& cellEditors[columnIndex].getControl() instanceof Text;
|
||||
return isTextCellEditor;
|
||||
}
|
||||
|
||||
private int getTargetColumn(DropTargetEvent event) {
|
||||
Point posInTable = tableViewer.getTable().toControl(event.x, event.y);
|
||||
ViewerCell cell = tableViewer.getCell(posInTable);
|
||||
int columnIndex = 0;
|
||||
if(cell != null) {
|
||||
columnIndex = cell.getColumnIndex();
|
||||
}
|
||||
return columnIndex;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@ import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorColumnNot
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorNotModifiable;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.behavior.ITableCellValueModifiedListener;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.data.AccessorUtils;
|
||||
import org.talend.commons.ui.swt.dnd.DNDTableViewerHelper;
|
||||
import org.talend.commons.ui.swt.extended.table.ModifyBeanValueCommand;
|
||||
import org.talend.commons.ui.swt.proposal.ExtendedTextCellEditorWithProposal;
|
||||
import org.talend.commons.ui.swt.tableviewer.behavior.DefaultCellModifier;
|
||||
@@ -149,9 +148,6 @@ public class TableViewerCreator<B> extends TableViewerCreatorNotModifiable<B> im
|
||||
@Override
|
||||
public Table createTable() {
|
||||
Table table = super.createTable();
|
||||
|
||||
DNDTableViewerHelper.addDndSupport(getTableViewer());
|
||||
|
||||
initCellModifier();
|
||||
|
||||
return table;
|
||||
|
||||
@@ -1085,7 +1085,7 @@ public class ProcessorUtilities {
|
||||
if (childBuildType == null) {
|
||||
Property parentProperty = parentJobInfo.getProcessor().getProperty();
|
||||
String parentBuildType = (String)parentProperty.getAdditionalProperties().get(TalendProcessArgumentConstant.ARG_BUILD_TYPE);
|
||||
if ("ROUTE".equalsIgnoreCase(parentBuildType)) {
|
||||
if (parentBuildType!= null && parentBuildType.contains("ROUTE")) {
|
||||
childProperty.getAdditionalProperties().put(TalendProcessArgumentConstant.ARG_BUILD_TYPE, "OSGI");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<packaging>pom</packaging>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Talend OpenSource Release</id>
|
||||
<id>talend_open</id>
|
||||
<url>https://artifacts-oss.talend.com/nexus/content/repositories/TalendOpenSourceRelease/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
@@ -243,12 +243,7 @@ public class LibraryDataService {
|
||||
}
|
||||
Map<String, Object> properties = resolveDescProperties(artifact, false);
|
||||
if (properties != null && properties.size() > 0) {
|
||||
//if the type is provided in mvnUrl, will not be replaced with the descriptor one.
|
||||
boolean usePomPackingType = true;
|
||||
if (!StringUtils.isBlank(MavenUrlHelper.parseMvnUrl(mvnUrl, false).getType())) {
|
||||
usePomPackingType = false;
|
||||
}
|
||||
parseDescriptorResult(libraryObj, properties, false, usePomPackingType);
|
||||
parseDescriptorResult(libraryObj, properties, false);
|
||||
if (libraryObj.getLicenses().size() == 0) {
|
||||
libraryObj.setLicenseMissing(true);
|
||||
libraryObj.getLicenses().add(unknownLicense);
|
||||
@@ -358,15 +353,10 @@ public class LibraryDataService {
|
||||
}
|
||||
|
||||
private void parseDescriptorResult(Library libraryObj, Map<String, Object> properties, boolean is4Parent) throws Exception {
|
||||
parseDescriptorResult(libraryObj, properties, is4Parent, true);
|
||||
}
|
||||
|
||||
private void parseDescriptorResult(Library libraryObj, Map<String, Object> properties, boolean is4Parent, boolean usePomPackagingType) throws Exception {
|
||||
if (properties.size() == 0) {
|
||||
libraryObj.setPomMissing(true);
|
||||
}
|
||||
//If packaging type is provided in mvnUrl, not use the <packaging> setting in pom.xml.
|
||||
if (!is4Parent && usePomPackagingType) {
|
||||
if (!is4Parent) {
|
||||
String type = String.valueOf(properties.get("type"));
|
||||
libraryObj.setType(MavenConstants.PACKAGING_BUNDLE.equalsIgnoreCase(type) ? MavenConstants.PACKAGING_JAR : type); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@@ -1085,8 +1085,8 @@ public class ExtractMetaDataUtils {
|
||||
} else if (driverJarPathArg.contains("/")) {
|
||||
if (driverJarPathArg.contains(";")) {
|
||||
String jars[] = driverJarPathArg.split(";");
|
||||
List<String> jarNames = new ArrayList<>();
|
||||
for (String jar : jars) {
|
||||
jar = TalendQuoteUtils.removeQuotesIfExist(jar);
|
||||
if (jar.startsWith(MavenUrlHelper.MVN_PROTOCOL)) {
|
||||
setDriverPath(librairesManagerService, jarPathList, jar);
|
||||
} else {
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.talend.core.model.properties.Project;
|
||||
import org.talend.core.model.properties.RoutinesJarItem;
|
||||
import org.talend.core.model.repository.ERepositoryObjectType;
|
||||
import org.talend.core.model.routines.RoutinesUtil;
|
||||
import org.talend.core.repository.utils.RepositoryNodeManager;
|
||||
import org.talend.core.ui.ITestContainerProviderService;
|
||||
import org.talend.repository.items.importexport.handlers.model.EmptyFolderImportItem;
|
||||
import org.talend.repository.items.importexport.handlers.model.ImportItem;
|
||||
@@ -282,7 +283,7 @@ public class ImportNodesBuilder {
|
||||
}
|
||||
|
||||
private TypeImportNode findAndCreateParentTypeNode(ProjectImportNode projectNode, ERepositoryObjectType curType) {
|
||||
if (curType == ERepositoryObjectType.METADATA_TACOKIT_JDBC || curType == ERepositoryObjectType.SNOWFLAKE) {
|
||||
if (curType == ERepositoryObjectType.METADATA_TACOKIT_JDBC || RepositoryNodeManager.isSnowflake(curType)) {
|
||||
curType = ERepositoryObjectType.METADATA_CONNECTIONS;
|
||||
}
|
||||
ERepositoryObjectType parentParentType = ERepositoryObjectType.findParentType(curType);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class TMCRepositoryUtil {
|
||||
|
||||
public static final int ALLOWED_PAT_MAX_DAYS = 60;
|
||||
|
||||
public static final long ALLOWED_PAT_MAX_MILLI_SECONDS = ALLOWED_PAT_MAX_DAYS * 24 * 60 * 1000;
|
||||
public static final long ALLOWED_PAT_MAX_MILLI_SECONDS = 1000L * ALLOWED_PAT_MAX_DAYS * 24 * 60 * 60;
|
||||
|
||||
public static final Pattern DATA_CENTER_PATTERN = Pattern.compile("^http[s?]://tmc\\.(.*)(\\.cloud\\.talend\\.com.*)", Pattern.CASE_INSENSITIVE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user