Compare commits
9 Commits
bhe/bugfix
...
APPINT-330
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0d4145514 | ||
|
|
9628d3377a | ||
|
|
cea69e78d5 | ||
|
|
6063838154 | ||
|
|
ba13aa44e0 | ||
|
|
df65549c46 | ||
|
|
87f5232e74 | ||
|
|
1fcea62d28 | ||
|
|
77833ed44c |
@@ -8,7 +8,7 @@
|
||||
<discovery label="Talend web site" url="http://www.talend.com"/>
|
||||
</url>
|
||||
<requires>
|
||||
<import plugin="org.bouncycastle.bcprov" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.bouncycastle.bcprov" version="1.68.0" match="greaterOrEqual"/>
|
||||
<import plugin="com.fasterxml.jackson.core.jackson-databind" version="2.9.8" match="greaterOrEqual"/>
|
||||
<import plugin="jackson-core-asl" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="jackson-mapper-asl" version="0.0.0" match="greaterOrEqual"/>
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<import plugin="org.eclipse.compare" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.compare.core" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.ops4j.pax.url.mvn" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.collections" version="0.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
<plugin id="org.talend.core" download-size="0" install-size="0" version="0.0.0" unpack="false"/>
|
||||
<plugin id="org.talend.core.nl" download-size="0" install-size="0" version="0.0.0" fragment="true" unpack="false"/>
|
||||
|
||||
@@ -38,5 +38,7 @@
|
||||
<import plugin="org.slf4j.api" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.slf4j.impl.log4j12" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.wst.server.discovery" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.ui.genericeditor" version="0.0.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.e4.ui.ide" version="0.0.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
</feature>
|
||||
|
||||
BIN
main/plugins/org.talend.common.ui.runtime/icons/lowercase.jpg
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/lowercase.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
BIN
main/plugins/org.talend.common.ui.runtime/icons/uppercase.jpg
Normal file
BIN
main/plugins/org.talend.common.ui.runtime/icons/uppercase.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -132,3 +132,8 @@ GlobalServiceRegister.ServiceNotRegistered=The service {0} has not been register
|
||||
MessageBoxExceptionHandler.showMessageForSchemaImportXml.unParseXML.title=The xml can't parse.
|
||||
MessageBoxExceptionHandler.showMessageForSchemaImportXml.unParseXML.msg=The xml can't parse in this format.
|
||||
HibernateUtils.auditDBIsNotUsable=The audit database must be empty or only contains tables related to audit.
|
||||
CasePushButton.CaseButton.Tip=Uppercase/Lowercase Db column
|
||||
QuotePushButton.QuoteButton.Tip=Add/Remove Quote on Db column
|
||||
QuoteManipulateDialog.title=Add/Remove quote on Db column
|
||||
QuoteManipulateDialog.addQuote=Add quote
|
||||
QuoteManipulateDialog.removeQuote=Remove quote
|
||||
|
||||
@@ -88,6 +88,8 @@ public enum EImage implements IImage {
|
||||
LEFTX_ICON("/icons/leftx.png"), //$NON-NLS-1$
|
||||
RIGHT_ICON("/icons/right.gif"), //$NON-NLS-1$
|
||||
RIGHTX_ICON("/icons/rightx.png"), //$NON-NLS-1$
|
||||
LOWERCASE_ICON("/icons/lowercase.jpg"), //$NON-NLS-1$
|
||||
UPPERCASE_ICON("/icons/uppercase.jpg"), //$NON-NLS-1$
|
||||
|
||||
KEY_ICON("/icons/key.gif"), //$NON-NLS-1$
|
||||
HIERARCHY_ICON("/icons/hierarchicalLayout.gif"), //$NON-NLS-1$
|
||||
|
||||
@@ -14,7 +14,7 @@ package org.talend.commons.ui.runtime.swt.celleditor;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.CellEditor;
|
||||
import org.eclipse.jface.viewers.ComboBoxCellEditor;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.CellEditor;
|
||||
import org.eclipse.jface.viewers.ColumnLayoutData;
|
||||
import org.eclipse.jface.viewers.ColumnPixelData;
|
||||
|
||||
@@ -22,7 +22,7 @@ package org.talend.commons.ui.runtime.swt.tableviewer.behavior;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.viewers.ColumnLayoutData;
|
||||
import org.eclipse.jface.viewers.ColumnPixelData;
|
||||
import org.eclipse.jface.viewers.ColumnWeightData;
|
||||
|
||||
@@ -29,6 +29,8 @@ public interface IExtendedList<T> extends List<T> {
|
||||
public void swapElements(List<Integer> indicesOrigin, List<Integer> indicesTarget);
|
||||
|
||||
public void swapElement(T object1, T object2);
|
||||
|
||||
public void replaceElement(int index, T object2);
|
||||
|
||||
/**
|
||||
* Getter for useEquals.
|
||||
|
||||
@@ -537,6 +537,11 @@ public class ListenableList<T> implements IExtendedList<T> {
|
||||
fireReplacedEvent(index, replacedObject, element, false);
|
||||
return replacedObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replaceElement(int index, T element) {
|
||||
this.list.set(index, element);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -76,6 +76,8 @@ ExtendedTableMoveCommand.MoveLabel=Move up or down, one or more table entries
|
||||
ExtendedTablePasteCommand.Paste.Label=Paste data from the internal clipoard
|
||||
ExtendedTableRemoveCommand.Romve.Label=Remove table entries
|
||||
ExtendedTableResetDBTypesCommand.ResetDBTypes.Label=Reset all DB Types to get the defaults
|
||||
ExtendedTableCaseCommand.case.Label=Change selected DB columns to uppercase/lowercase
|
||||
ExtendedTableQuoteCommand.Quote.Label=Quote selected DB columns
|
||||
ImportPushButton.ImportButton.Tip=Replace all rows by import from xml file
|
||||
ImportPushButtonForExtendedTable.ErrorMsg.Text=Error occurred
|
||||
LabelledFileField.BrowseButton.Text=Browse...
|
||||
|
||||
@@ -27,11 +27,13 @@ import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveDownPushButtonFo
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveUpPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.MoveUpPushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.PastePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.RemovePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.RemovePushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.ResetDBTypesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.SaveAsGenericSchemaPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.SelectContextVariablesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
|
||||
@@ -67,7 +69,11 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
protected ResetDBTypesPushButton resetDBTypesButton;
|
||||
|
||||
protected SelectContextVariablesPushButton selectContextVariablesButton;
|
||||
|
||||
protected CasePushButton caseButton;
|
||||
|
||||
protected QuotePushButton quoteButton;
|
||||
|
||||
/**
|
||||
* DOC amaumont MatadataToolbarEditor constructor comment.
|
||||
*
|
||||
@@ -103,7 +109,11 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
pasteButton = createPastePushButton();
|
||||
|
||||
addallButton = createAddAllPushButton();
|
||||
|
||||
|
||||
caseButton = createCasePushButton();
|
||||
|
||||
quoteButton = createQuotePushButton();
|
||||
|
||||
exportButton = createExportPushButton();
|
||||
|
||||
importButton = createImportPushButton();
|
||||
@@ -169,6 +179,14 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
protected SelectContextVariablesPushButton createSelectContextVariablesPushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected CasePushButton createCasePushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected QuotePushButton createQuotePushButton() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for addButton.
|
||||
@@ -327,6 +345,14 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
if (getAddallButton() != null) {
|
||||
list.add(getAddallButton());
|
||||
}
|
||||
|
||||
if (getCaseButton() != null) {
|
||||
list.add(getCaseButton());
|
||||
}
|
||||
|
||||
if (getQuoteButton() != null) {
|
||||
list.add(getQuoteButton());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
@@ -348,6 +374,26 @@ public class ExtendedToolbarView extends AbstractExtendedToolbar {
|
||||
public AddAllPushButton getAddallButton() {
|
||||
return this.addallButton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for caseButton.
|
||||
*
|
||||
* @return the caseButton
|
||||
*/
|
||||
public CasePushButton getCaseButton() {
|
||||
return this.caseButton;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for quoteButton.
|
||||
*
|
||||
* @return the quoteButton
|
||||
*/
|
||||
public QuotePushButton getQuoteButton() {
|
||||
return this.quoteButton;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.advanced.dataeditor.button;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
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.AbstractExtendedControlViewer;
|
||||
|
||||
public abstract class CasePushButton extends ExtendedPushButton {
|
||||
|
||||
/**
|
||||
* DOC CasePushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public CasePushButton(Composite parent, AbstractExtendedControlViewer extendedControlViewer) {
|
||||
super(parent, extendedControlViewer,
|
||||
Messages.getString("CasePushButton.CaseButton.Tip"), ImageProvider.getImage(EImage.UPPERCASE_ICON)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#getEnabledState()
|
||||
*/
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && !getExtendedControlViewer().isReadOnly();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.advanced.dataeditor.button;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class CasePushButtonForExtendedTable extends CasePushButton implements IExtendedTablePushButton {
|
||||
|
||||
private EnableStateListenerForTableButton enableStateHandler;
|
||||
private boolean isUpperCase = true;
|
||||
|
||||
/**
|
||||
* DOC CasePushButtonForExtendedTable constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public CasePushButtonForExtendedTable(Composite parent, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, extendedTableViewer);
|
||||
this.enableStateHandler = new EnableStateListenerForTableButton(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void afterCommandExecution(Command executedCommand) {
|
||||
super.afterCommandExecution(executedCommand);
|
||||
if (isUpperCase) {
|
||||
this.getButton().setToolTipText( Messages.getString("CasePushButton.CaseButton.Tip"));
|
||||
this.getButton().setImage(ImageProvider.getImage(EImage.LOWERCASE_ICON));
|
||||
this.isUpperCase = false;
|
||||
} else {
|
||||
this.getButton().setToolTipText( Messages.getString("CasePushButton.CaseButton.Tip"));
|
||||
this.getButton().setImage(ImageProvider.getImage(EImage.UPPERCASE_ICON));
|
||||
this.isUpperCase = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Command getCommandToExecute() {
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
TableViewer tableViewer = extendedTableViewer.getTableViewerCreator().getTableViewer();
|
||||
ISelection selection = tableViewer.getSelection();
|
||||
StructuredSelection structuredSelection = (StructuredSelection) selection;
|
||||
Object[] objects = structuredSelection.toArray();
|
||||
int[] selectionIndices = extendedTableViewer.getTableViewerCreator().getTable().getSelectionIndices();
|
||||
return getCommandToExecute(extendedTableModel, Arrays.asList(objects), selectionIndices, isUpperCase);
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, boolean isUpperCase);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.ui.extended.button.IExtendedTablePushButton#getExtendedTableViewer()
|
||||
*/
|
||||
public AbstractExtendedTableViewer getExtendedTableViewer() {
|
||||
return (AbstractExtendedTableViewer) getExtendedControlViewer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && this.enableStateHandler.getEnabledState();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.advanced.dataeditor.button;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
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.AbstractExtendedControlViewer;
|
||||
|
||||
public abstract class QuotePushButton extends ExtendedPushButton {
|
||||
|
||||
private String dbmsId = null;
|
||||
|
||||
/**
|
||||
* DOC QuotePushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public QuotePushButton(Composite parent, AbstractExtendedControlViewer extendedControlViewer) {
|
||||
super(parent, extendedControlViewer,
|
||||
Messages.getString("QuotePushButton.QuoteButton.Tip"), ImageProvider.getImage(EImage.EDIT_ICON)); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#getEnabledState()
|
||||
*/
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && !getExtendedControlViewer().isReadOnly();
|
||||
}
|
||||
|
||||
|
||||
public String getDbmsId() {
|
||||
return dbmsId;
|
||||
}
|
||||
|
||||
|
||||
public void setDbmsId(String dbmsId) {
|
||||
this.dbmsId = dbmsId;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.advanced.dataeditor.button;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.StructuredSelection;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class QuotePushButtonForExtendedTable extends QuotePushButton implements IExtendedTablePushButton {
|
||||
|
||||
private String quote = null;
|
||||
private boolean isAddingQuote = true;
|
||||
private EnableStateListenerForTableButton enableStateHandler;
|
||||
|
||||
/**
|
||||
* DOC SchemaTargetAddPushButton constructor comment.
|
||||
*
|
||||
* @param parent
|
||||
* @param extendedControlViewer
|
||||
*/
|
||||
public QuotePushButtonForExtendedTable(Composite parent, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, extendedTableViewer);
|
||||
this.enableStateHandler = new EnableStateListenerForTableButton(this);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton#beforeCommandExecution()
|
||||
*/
|
||||
@Override
|
||||
protected void beforeCommandExecution() {
|
||||
QuoteManipulateDialog dlg = new QuoteManipulateDialog(getButton().getShell());
|
||||
if (dlg.open() == Window.OK) {
|
||||
this.quote = dlg.getQuote();
|
||||
this.isAddingQuote = dlg.isAddingQuote();
|
||||
}
|
||||
}
|
||||
|
||||
protected Command getCommandToExecute() {
|
||||
if (quote == null) return null;
|
||||
AbstractExtendedTableViewer extendedTableViewer = (AbstractExtendedTableViewer) extendedControlViewer;
|
||||
ExtendedTableModel extendedTableModel = extendedTableViewer.getExtendedTableModel();
|
||||
TableViewer tableViewer = extendedTableViewer.getTableViewerCreator().getTableViewer();
|
||||
ISelection selection = tableViewer.getSelection();
|
||||
StructuredSelection structuredSelection = (StructuredSelection) selection;
|
||||
Object[] objects = structuredSelection.toArray();
|
||||
int[] selectionIndices = extendedTableViewer.getTableViewerCreator().getTable().getSelectionIndices();
|
||||
return getCommandToExecute(extendedTableModel, Arrays.asList(objects), selectionIndices, quote, isAddingQuote );
|
||||
}
|
||||
|
||||
protected abstract Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, String quote, boolean isAddingQuote);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.core.ui.extended.button.IExtendedTablePushButton#getExtendedTableViewer()
|
||||
*/
|
||||
public AbstractExtendedTableViewer getExtendedTableViewer() {
|
||||
return (AbstractExtendedTableViewer) getExtendedControlViewer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getEnabledState() {
|
||||
return super.getEnabledState() && this.enableStateHandler.getEnabledState();
|
||||
}
|
||||
|
||||
class QuoteManipulateDialog extends Dialog {
|
||||
|
||||
private Button addBtn;
|
||||
private Button removeBtn;
|
||||
private Text quoteTxt;
|
||||
private Button okBtn;
|
||||
boolean isAddingQuote = true;
|
||||
String quote = "";
|
||||
|
||||
public QuoteManipulateDialog(Shell parentShel) {
|
||||
super(parentShel);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
shell.setText(Messages.getString("QuoteManipulateDialog.title"));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
|
||||
*/
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
// create OK and Cancel buttons by default
|
||||
okBtn = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||
okBtn.setEnabled(false);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc) Method declared on Dialog.
|
||||
*/
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout();
|
||||
layout.numColumns = 4;
|
||||
composite.setLayout(layout);
|
||||
GridData layoutData = new GridData(GridData.FILL_BOTH);
|
||||
layoutData.widthHint = 400;
|
||||
composite.setLayoutData(layoutData);
|
||||
addBtn = new Button(composite, SWT.RADIO);
|
||||
addBtn.setSelection(true);
|
||||
Label label = new Label(composite, SWT.WRAP);
|
||||
label.setText(Messages.getString("QuoteManipulateDialog.addQuote")); //$NON-NLS-1$
|
||||
|
||||
removeBtn = new Button(composite, SWT.RADIO);
|
||||
Label label1 = new Label(composite, SWT.WRAP);
|
||||
label1.setText(Messages.getString("QuoteManipulateDialog.removeQuote")); //$NON-NLS-1$
|
||||
|
||||
quoteTxt = new Text(composite, SWT.SINGLE | SWT.BORDER);
|
||||
layoutData = new GridData(GridData.FILL_HORIZONTAL);
|
||||
layoutData.horizontalSpan = 4;
|
||||
quoteTxt.setLayoutData(layoutData);
|
||||
quoteTxt.setText("");
|
||||
quoteTxt.setFocus();
|
||||
|
||||
addBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
isAddingQuote = true;
|
||||
quoteTxt.setFocus();
|
||||
quote = quoteTxt.getText();
|
||||
}
|
||||
});
|
||||
|
||||
removeBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
isAddingQuote = false;
|
||||
quoteTxt.setFocus();
|
||||
quote = quoteTxt.getText();
|
||||
}
|
||||
});
|
||||
|
||||
quoteTxt.addModifyListener(new ModifyListener() {
|
||||
|
||||
public void modifyText(ModifyEvent e) {
|
||||
quote = quoteTxt.getText();
|
||||
if ( quote != null && quote.length() > 0) {
|
||||
okBtn.setEnabled(true);
|
||||
} else {
|
||||
okBtn.setEnabled(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return composite;
|
||||
}
|
||||
|
||||
public boolean isAddingQuote() {
|
||||
return this.isAddingQuote;
|
||||
}
|
||||
|
||||
public String getQuote() {
|
||||
return this.quote;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.advanced.dataeditor.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class ExtendedTableCaseCommand extends Command implements IExtendedTableCommand {
|
||||
|
||||
private ExtendedTableModel extendedTable;
|
||||
|
||||
private List beansToCovertCase;
|
||||
|
||||
private int[] selectionIndices;
|
||||
|
||||
private boolean isUpperCase;
|
||||
|
||||
|
||||
public static final String LABEL = Messages.getString("ExtendedTableCaseCommand.case.Label"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC ExtendedTableCaseCommand constructor comment.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
public ExtendedTableCaseCommand(ExtendedTableModel extendedTable, List beansToCovertCase, int[] selectionIndices, boolean isUpperCase) {
|
||||
super(LABEL);
|
||||
this.extendedTable = extendedTable;
|
||||
this.beansToCovertCase = new ArrayList(beansToCovertCase);
|
||||
this.selectionIndices = selectionIndices;
|
||||
this.isUpperCase = isUpperCase;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
convertCase(extendedTable, beansToCovertCase, selectionIndices, isUpperCase);
|
||||
|
||||
}
|
||||
|
||||
public abstract void convertCase(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, boolean isUpperCase);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#canUndo()
|
||||
*/
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#redo()
|
||||
*/
|
||||
@Override
|
||||
public void redo() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#undo()
|
||||
*/
|
||||
@Override
|
||||
public void undo() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// 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.advanced.dataeditor.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.talend.commons.ui.runtime.i18n.Messages;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
|
||||
public abstract class ExtendedTableQuoteCommand extends Command implements IExtendedTableCommand {
|
||||
|
||||
private ExtendedTableModel extendedTable;
|
||||
|
||||
private List beansToQuote;
|
||||
|
||||
private int[] selectionIndices;
|
||||
|
||||
private String quote;
|
||||
|
||||
boolean isAddingQuote;
|
||||
|
||||
|
||||
public static final String LABEL = Messages.getString("ExtendedTableQuoteCommand.Quote.Label"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* DOC ExtendedTableQuoteCommand constructor comment.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")//$NON-NLS-1$
|
||||
public ExtendedTableQuoteCommand(ExtendedTableModel extendedTable, List beansToQuote, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
super(LABEL);
|
||||
this.extendedTable = extendedTable;
|
||||
this.beansToQuote = new ArrayList(beansToQuote);
|
||||
this.selectionIndices = selectionIndices;
|
||||
this.quote = quote;
|
||||
this.isAddingQuote = isAddingQuote;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.gef.commands.Command#execute()
|
||||
*/
|
||||
@Override
|
||||
public void execute() {
|
||||
toQuote(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
|
||||
|
||||
}
|
||||
|
||||
public abstract void toQuote(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, String quote, boolean isAddingQuote);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#canUndo()
|
||||
*/
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#redo()
|
||||
*/
|
||||
@Override
|
||||
public void redo() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.talend.commons.ui.command.CommonCommand#undo()
|
||||
*/
|
||||
@Override
|
||||
public void undo() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,12 +15,12 @@ package org.talend.commons.ui.swt.colorstyledtext.rules;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.rules.ICharacterScanner;
|
||||
import org.eclipse.jface.text.rules.IRule;
|
||||
import org.eclipse.jface.text.rules.IToken;
|
||||
import org.eclipse.jface.text.rules.IWordDetector;
|
||||
import org.eclipse.jface.text.rules.Token;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
|
||||
/**
|
||||
* An implementation of <code>IRule</code> capable of detecting words Word rules also allow for the association of
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.swt.colorstyledtext.rules;
|
||||
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.jedit.Rule;
|
||||
import org.talend.commons.ui.swt.colorstyledtext.jedit.Type;
|
||||
|
||||
|
||||
@@ -178,6 +178,23 @@ public class ExtendedTableModel<B> extends AbstractExtendedControlModel {
|
||||
public void setUseEquals(boolean useEquals) {
|
||||
beansList.setUseEquals(useEquals);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Replace bean.
|
||||
*
|
||||
* @param bean
|
||||
* @param index can be null
|
||||
*/
|
||||
public void replace(B bean, Integer index) {
|
||||
|
||||
if (tableViewer != null && !tableViewer.getTable().isDisposed()) {
|
||||
tableViewer.replace(bean, index);
|
||||
tableViewer.refresh(bean, true, true);
|
||||
}
|
||||
this.beansList.replaceElement(index, bean);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DOC amaumont Comment method "remove".
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.apache.oro.text.regex.PatternCompiler;
|
||||
import org.apache.oro.text.regex.PatternMatcher;
|
||||
import org.apache.oro.text.regex.Perl5Compiler;
|
||||
import org.apache.oro.text.regex.Perl5Matcher;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.core.runtime.ListenerList;
|
||||
import org.eclipse.jface.bindings.keys.KeyStroke;
|
||||
import org.eclipse.jface.dialogs.PopupDialog;
|
||||
@@ -34,7 +35,6 @@ import org.eclipse.jface.fieldassist.IContentProposal;
|
||||
import org.eclipse.jface.fieldassist.IContentProposalListener;
|
||||
import org.eclipse.jface.fieldassist.IContentProposalProvider;
|
||||
import org.eclipse.jface.fieldassist.IControlContentAdapter;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.StyledText;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.utils.data.text.rules;
|
||||
|
||||
import org.eclipse.jface.text.Assert;
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.text.rules.ICharacterScanner;
|
||||
import org.eclipse.jface.text.rules.IPredicateRule;
|
||||
import org.eclipse.jface.text.rules.IRule;
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
// ============================================================================
|
||||
package org.talend.commons.ui.utils.workbench.preferences;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.preference.FieldEditor;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
|
||||
@@ -146,7 +146,7 @@ public class TalendMavenResolver {
|
||||
getMavenResolver();
|
||||
}
|
||||
|
||||
private static MavenResolver getMavenResolver() throws RuntimeException {
|
||||
public static MavenResolver getMavenResolver() throws RuntimeException {
|
||||
if (mavenResolver == null) {
|
||||
final BundleContext context = CoreRuntimePlugin.getInstance().getBundle().getBundleContext();
|
||||
ServiceReference<org.ops4j.pax.url.mvn.MavenResolver> mavenResolverService = context
|
||||
|
||||
@@ -103,6 +103,8 @@ public class RepositoryConstants {
|
||||
public static final String REPOSITORY_CLOUD_APAC_ID = "cloud_apac"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_US_WEST_ID = "cloud_us_west"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_AUS_ID = "cloud_aus"; //$NON-NLS-1$
|
||||
|
||||
public static final String REPOSITORY_CLOUD_CUSTOM_ID = "cloud_custom"; //$NON-NLS-1$
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ Require-Bundle: org.apache.commons.lang,
|
||||
org.apache.httpcomponents.httpcore,
|
||||
org.apache.httpcomponents.httpclient,
|
||||
org.slf4j.api,
|
||||
org.apache.ant
|
||||
org.apache.ant,
|
||||
org.eclipse.m2e.maven.runtime
|
||||
Import-Package: org.eclipse.jdt.internal.ui.workingsets
|
||||
Export-Package: org.talend.core.ui,
|
||||
org.talend.core.ui.actions,
|
||||
|
||||
@@ -9,21 +9,7 @@
|
||||
</parent>
|
||||
<artifactId>org.talend.core.ui</artifactId>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>5.2.5</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -32,17 +18,33 @@
|
||||
<version>3.0.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-dependencies</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeScope>runtime</includeScope>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<stripVersion>true</stripVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
<id>copy</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.basedir}/lib</outputDirectory>
|
||||
<stripVersion>true</stripVersion>
|
||||
<artifactItems>
|
||||
<artifactItem>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
<version>5.2.5</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna</artifactId>
|
||||
<version>5.6.0</version>
|
||||
</artifactItem>
|
||||
<artifactItem>
|
||||
<groupId>net.java.dev.jna</groupId>
|
||||
<artifactId>jna-platform</artifactId>
|
||||
<version>5.6.0</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@@ -15,13 +15,13 @@ package org.talend.core.ui.advanced.composite;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.text.StringMatcher;
|
||||
import org.eclipse.jface.viewers.AbstractTreeViewer;
|
||||
import org.eclipse.jface.viewers.ILabelProvider;
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
import org.eclipse.jface.viewers.StructuredViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerFilter;
|
||||
import org.eclipse.ui.internal.misc.StringMatcher;
|
||||
|
||||
/**
|
||||
* DOC ggu class global comment. Detailled comment
|
||||
|
||||
@@ -644,11 +644,6 @@ public class ContextTreeTable {
|
||||
super(treeList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String formatDataForDepth(int depth, ContextTreeNode object) {
|
||||
return object.getName();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class ContextExpansionModel implements TreeList.ExpansionModel<ContextTreeNode> {
|
||||
|
||||
@@ -14,10 +14,10 @@ package org.talend.core.ui.context;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.util.Assert;
|
||||
import org.eclipse.jface.viewers.CellEditor;
|
||||
import org.eclipse.jface.viewers.DialogCellEditor;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.talend.core.ui.i18n.Messages;
|
||||
* created by ldong on Aug 14, 2014 Detailled comment
|
||||
*
|
||||
*/
|
||||
public class ContextMenuItemProviders extends MenuItemProviders {
|
||||
public class ContextMenuItemProviders {
|
||||
|
||||
// the item of change the context parameter's mode such as from repositroy to build-in
|
||||
public static IMenuItemProvider changeModeMenuItemProvider(final IDataProvider dataProvider,
|
||||
@@ -122,7 +122,7 @@ public class ContextMenuItemProviders extends MenuItemProviders {
|
||||
}
|
||||
|
||||
private static ContextTreeNode getTreeNodeByRightClickPostion(final IDataProvider dataProvider, SelectionEvent e) {
|
||||
NatEventData natEventData = getNatEventData(e);
|
||||
NatEventData natEventData = MenuItemProviders.getNatEventData(e);
|
||||
NatTable nt = natEventData.getNatTable();
|
||||
int rowPosition = natEventData.getRowPosition();
|
||||
int rowIndex = nt.getRowIndexByPosition(rowPosition);
|
||||
|
||||
@@ -14,10 +14,10 @@ package org.talend.core.ui.context.nattableTree;
|
||||
|
||||
import org.eclipse.nebula.widgets.nattable.NatTable;
|
||||
import org.eclipse.nebula.widgets.nattable.data.IDataProvider;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.action.CellEditDragMode;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.action.MouseEditAction;
|
||||
import org.eclipse.nebula.widgets.nattable.edit.config.DefaultEditBindings;
|
||||
import org.eclipse.nebula.widgets.nattable.layer.LabelStack;
|
||||
import org.eclipse.nebula.widgets.nattable.selection.action.CellSelectionDragMode;
|
||||
import org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry;
|
||||
import org.eclipse.nebula.widgets.nattable.ui.matcher.CellEditorMouseEventMatcher;
|
||||
import org.eclipse.swt.events.MouseEvent;
|
||||
@@ -53,6 +53,6 @@ public class ContextSelectBindings extends DefaultEditBindings {
|
||||
|
||||
};
|
||||
pUiBindingRegistry.registerSingleClickBinding(mouseEventMatcher, new MouseEditAction());
|
||||
pUiBindingRegistry.registerFirstMouseDragMode(mouseEventMatcher, new CellEditDragMode());
|
||||
pUiBindingRegistry.registerFirstMouseDragMode(mouseEventMatcher, new CellSelectionDragMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorColumnNotModifiable;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.behavior.DefaultTableLabelProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.ResetDBTypesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.tableviewer.TableViewerCreator;
|
||||
@@ -88,6 +90,14 @@ public class CustomTableManager {
|
||||
if (resetDBTypesButton != null) {
|
||||
resetDBTypesButton.getButton().setEnabled(false);
|
||||
}
|
||||
CasePushButton caseButton = tableEditorView.getExtendedToolbar().getCaseButton();
|
||||
if (caseButton != null) {
|
||||
caseButton.getButton().setEnabled(false);
|
||||
}
|
||||
QuotePushButton quoteButton = tableEditorView.getExtendedToolbar().getQuoteButton();
|
||||
if (quoteButton != null) {
|
||||
quoteButton.getButton().setEnabled(false);
|
||||
}
|
||||
} else {
|
||||
tableEditorView.getToolBar().getAddButton().getButton().addSelectionListener(new SelectionListener() {
|
||||
|
||||
@@ -170,6 +180,14 @@ public class CustomTableManager {
|
||||
if (resetDBTypesButton != null) {
|
||||
resetDBTypesButton.getButton().setEnabled(false);
|
||||
}
|
||||
CasePushButton caseButton = tableEditorView.getExtendedToolbar().getCaseButton();
|
||||
if (caseButton != null) {
|
||||
caseButton.getButton().setEnabled(false);
|
||||
}
|
||||
QuotePushButton quoteButton = tableEditorView.getExtendedToolbar().getQuoteButton();
|
||||
if (quoteButton != null) {
|
||||
quoteButton.getButton().setEnabled(false);
|
||||
}
|
||||
}
|
||||
if (linkedTable != null) {
|
||||
if (linkedTable.isReadOnly() && linkedTableEditorView != null) {
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.talend.commons.ui.command.CommandStackForComposite;
|
||||
import org.talend.commons.ui.runtime.image.EImage;
|
||||
import org.talend.commons.ui.runtime.image.ImageProvider;
|
||||
import org.talend.commons.ui.swt.advanced.composite.ThreeCompositesSashForm;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.ExtendedToolbarView;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.commons.ui.swt.tableviewer.IModifiedBeanListener;
|
||||
import org.talend.commons.ui.swt.tableviewer.ModifiedBeanEvent;
|
||||
@@ -67,6 +68,7 @@ import org.talend.core.model.utils.NodeUtil;
|
||||
import org.talend.core.ui.CoreUIPlugin;
|
||||
import org.talend.core.ui.i18n.Messages;
|
||||
import org.talend.core.ui.metadata.editor.AbstractMetadataTableEditorView;
|
||||
import org.talend.core.ui.metadata.editor.MetadataQuoteToolbarEditorView;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditor;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditorView;
|
||||
import org.talend.core.utils.TalendQuoteUtils;
|
||||
@@ -376,8 +378,19 @@ public class MetadataDialog extends Dialog {
|
||||
} else {
|
||||
metadataTableEditor = new MetadataTableEditor(outputMetaTable, titleOutput);
|
||||
}
|
||||
outputMetaView = new DialogMetadataTableEditorView(composite, SWT.NONE, metadataTableEditor, outputReadOnly, true,
|
||||
true, false);
|
||||
//enable dbcolumn manipulate feature only on Database output component
|
||||
String nodeFamily = "", rootFamily = "";
|
||||
if ( outputNode != null && outputNode.getComponent() != null ) {
|
||||
nodeFamily = outputNode.getComponent().getOriginalFamilyName();
|
||||
rootFamily = nodeFamily != null ? nodeFamily.split("/")[0] : "";
|
||||
}
|
||||
if (rootFamily.equals("Databases")) {
|
||||
outputMetaView = new DialogMetadataDBOutputTableEditorView(composite, SWT.NONE, metadataTableEditor, outputReadOnly, true,
|
||||
true, false);
|
||||
} else {
|
||||
outputMetaView = new DialogMetadataTableEditorView(composite, SWT.NONE, metadataTableEditor, outputReadOnly, true,
|
||||
true, false);
|
||||
}
|
||||
outputMetaView.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(outputNode));
|
||||
outputMetaView.setIsRepository(isRepository(outputNode, outputMetaTable));
|
||||
initializeMetadataTableView(outputMetaView, outputNode, outputMetaTable);
|
||||
@@ -544,8 +557,21 @@ public class MetadataDialog extends Dialog {
|
||||
} else {
|
||||
metadataTableEditorForOutput = new MetadataTableEditor(outputMetaTable, titleOutput + " (Output)");
|
||||
}
|
||||
outputMetaView = new DialogMetadataTableEditorView(compositesSachForm.getRightComposite(), SWT.NONE,
|
||||
metadataTableEditorForOutput, outputReadOnly, true, true, false);
|
||||
//Enable dbcolumn manipulate feature only on Database output component
|
||||
String nodeFamily = "", rootFamily = "";
|
||||
if ( outputNode != null && outputNode.getComponent() != null ) {
|
||||
nodeFamily = outputNode.getComponent().getOriginalFamilyName();
|
||||
rootFamily = nodeFamily != null ? nodeFamily.split("/")[0] : "";
|
||||
}
|
||||
if (rootFamily.equals("Databases")) {
|
||||
outputMetaView = new DialogMetadataDBOutputTableEditorView(compositesSachForm.getRightComposite(), SWT.NONE,
|
||||
metadataTableEditorForOutput, outputReadOnly, true, true, false);
|
||||
} else {
|
||||
outputMetaView = new DialogMetadataTableEditorView(compositesSachForm.getRightComposite(), SWT.NONE,
|
||||
metadataTableEditorForOutput, outputReadOnly, true, true, false);
|
||||
}
|
||||
|
||||
|
||||
outputMetaView.setMetadataTalendTypeFilter(NodeUtil.createMetadataTalendTypeFilter(outputNode));
|
||||
outputMetaView.setIsRepository(isRepository(outputNode, outputMetaTable));
|
||||
initializeMetadataTableView(outputMetaView, outputNode, outputMetaTable);
|
||||
@@ -799,7 +825,22 @@ public class MetadataDialog extends Dialog {
|
||||
newTableViewerCreator.setLazyLoad(TableViewerCreator.getRecommandLazyLoad());
|
||||
}
|
||||
}
|
||||
|
||||
class DialogMetadataDBOutputTableEditorView extends MetadataTableEditorView {
|
||||
|
||||
public DialogMetadataDBOutputTableEditorView(Composite parentComposite, int mainCompositeStyle,
|
||||
ExtendedTableModel<IMetadataColumn> extendedTableModel, boolean readOnly, boolean toolbarVisible,
|
||||
boolean labelVisible, boolean initGraphicsComponents) {
|
||||
super(parentComposite, mainCompositeStyle, extendedTableModel, readOnly, toolbarVisible, labelVisible,
|
||||
initGraphicsComponents);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ExtendedToolbarView initToolBar() {
|
||||
return new MetadataQuoteToolbarEditorView(getMainComposite(), SWT.NONE, this.getExtendedTableViewer(), this.getCurrentDbms());
|
||||
}
|
||||
}
|
||||
|
||||
public static void setSingleAndStruct(boolean isSingle) {
|
||||
isSingleAndStruct = isSingle;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.editor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.gef.commands.Command;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButtonForExtendedTable;
|
||||
import org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.core.ui.metadata.extended.command.MetadataCaseCommand;
|
||||
import org.talend.core.ui.metadata.extended.command.MetadataQuoteCommand;
|
||||
|
||||
|
||||
public class MetadataQuoteToolbarEditorView extends MetadataToolbarEditorView {
|
||||
|
||||
|
||||
public MetadataQuoteToolbarEditorView(Composite parent, int style, AbstractExtendedTableViewer extendedTableViewer) {
|
||||
super(parent, style, extendedTableViewer);
|
||||
}
|
||||
|
||||
public MetadataQuoteToolbarEditorView(Composite parent, int style, AbstractExtendedTableViewer extendedTableViewer, String dbmsId) {
|
||||
super(parent, style, extendedTableViewer, dbmsId);
|
||||
this.getQuoteButton().setDbmsId(dbmsId);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CasePushButton createCasePushButton() {
|
||||
return new CasePushButtonForExtendedTable(toolbar, extendedTableViewer) {
|
||||
|
||||
@Override
|
||||
protected Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToConvertCase, int[] selectionIndices, boolean isUpperCase) {
|
||||
return new MetadataCaseCommand(extendedTable, beansToConvertCase, selectionIndices, isUpperCase);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected QuotePushButton createQuotePushButton() {
|
||||
return new QuotePushButtonForExtendedTable(toolbar, extendedTableViewer) {
|
||||
|
||||
@Override
|
||||
protected Command getCommandToExecute(ExtendedTableModel extendedTable, List beansToQuote, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
return new MetadataQuoteCommand(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.extended.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.commands.ExtendedTableCaseCommand;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.connection.impl.ConnectionFactoryImpl;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditor;
|
||||
|
||||
public class MetadataCaseCommand extends ExtendedTableCaseCommand {
|
||||
|
||||
|
||||
/**
|
||||
* DOC MetadataCaseCommand constructor comment.
|
||||
*
|
||||
* @param extendedTableModel
|
||||
* @param beansToUppercase
|
||||
* @param selectionIndices
|
||||
* @param isUpperCase
|
||||
*/
|
||||
public MetadataCaseCommand(ExtendedTableModel extendedTable, List beansToUppercase, int[] selectionIndices, boolean isUpperCase) {
|
||||
super(extendedTable, beansToUppercase, selectionIndices, isUpperCase);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertCase(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, boolean isUpperCase) {
|
||||
int index = 0;
|
||||
for (Object current : copiedObjectsList) {
|
||||
//get refreshed element
|
||||
current = extendedTable.getTableViewer().getElementAt(selectionIndices[index]);
|
||||
if (current instanceof IMetadataColumn) {
|
||||
IMetadataColumn copy = ((IMetadataColumn) current).clone();
|
||||
copy.setUsefulColumn(true);
|
||||
if (copy.getOriginalDbColumnName() != null && !StringUtils.isEmpty(copy.getOriginalDbColumnName())) {
|
||||
copy.setOriginalDbColumnName(isUpperCase ? copy.getOriginalDbColumnName().toUpperCase() : copy.getOriginalDbColumnName().toLowerCase());
|
||||
}
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
// Add a new statement to fix the MetadataColumn type.
|
||||
else if (current instanceof MetadataColumn) {
|
||||
MetadataTableEditor tableEditor = (MetadataTableEditor) extendedTable;
|
||||
MetadataColumn metadataColumn = (MetadataColumn) current;
|
||||
MetadataColumn newColumnCopy = new ConnectionFactoryImpl().copy(metadataColumn,
|
||||
isUpperCase ? StringUtils.upperCase(metadataColumn.getName()) : StringUtils.lowerCase(metadataColumn.getName()));
|
||||
IMetadataColumn copy = (ConvertionHelper.convertToIMetaDataColumn(newColumnCopy)).clone();
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
extendedTable.getTableViewer().getTable().select(selectionIndices);
|
||||
extendedTable.getTableViewer().getTable().notifyListeners(SWT.Selection, new Event());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// ============================================================================
|
||||
//
|
||||
// Copyright (C) 2006-2021 Talend Inc. - www.talend.com
|
||||
//
|
||||
// This source code is available under agreement available at
|
||||
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
|
||||
//
|
||||
// You should have received a copy of the agreement
|
||||
// along with this program; if not, write to Talend SA
|
||||
// 9 rue Pages 92150 Suresnes, France
|
||||
//
|
||||
// ============================================================================
|
||||
package org.talend.core.ui.metadata.extended.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.widgets.Event;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.commands.ExtendedTableQuoteCommand;
|
||||
import org.talend.commons.ui.swt.extended.table.ExtendedTableModel;
|
||||
import org.talend.core.model.metadata.IMetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.ConvertionHelper;
|
||||
import org.talend.core.model.metadata.builder.connection.MetadataColumn;
|
||||
import org.talend.core.model.metadata.builder.connection.impl.ConnectionFactoryImpl;
|
||||
import org.talend.core.ui.metadata.editor.MetadataTableEditor;
|
||||
|
||||
public class MetadataQuoteCommand extends ExtendedTableQuoteCommand {
|
||||
|
||||
|
||||
/**
|
||||
* DOC MetadataQuoteCommand constructor comment.
|
||||
*
|
||||
* @param extendedTableModel
|
||||
* @param beansToQuote
|
||||
* @param selectionIndices
|
||||
*/
|
||||
public MetadataQuoteCommand(ExtendedTableModel extendedTable, List beansToQuote, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
super(extendedTable, beansToQuote, selectionIndices, quote, isAddingQuote);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toQuote(ExtendedTableModel extendedTable, List copiedObjectsList, int[] selectionIndices, String quote, boolean isAddingQuote) {
|
||||
int index = 0;
|
||||
for (Object current : copiedObjectsList) {
|
||||
//get refreshed element
|
||||
current = extendedTable.getTableViewer().getElementAt(selectionIndices[index]);
|
||||
if (current instanceof IMetadataColumn) {
|
||||
IMetadataColumn copy = ((IMetadataColumn) current).clone();
|
||||
copy.setUsefulColumn(true);
|
||||
String oldDbColumnName = copy.getOriginalDbColumnName();
|
||||
if (oldDbColumnName != null) {
|
||||
String newDbColumnName = oldDbColumnName;
|
||||
if (isAddingQuote) {
|
||||
newDbColumnName = quote + newDbColumnName + quote;
|
||||
} else {
|
||||
newDbColumnName = StringUtils.removeStart(oldDbColumnName, quote);
|
||||
newDbColumnName = StringUtils.removeEnd(newDbColumnName, quote);
|
||||
}
|
||||
copy.setOriginalDbColumnName(newDbColumnName);
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
}
|
||||
// Add a new statement to fix the MetadataColumn type.
|
||||
else if (current instanceof MetadataColumn) {
|
||||
MetadataTableEditor tableEditor = (MetadataTableEditor) extendedTable;
|
||||
MetadataColumn metadataColumn = (MetadataColumn) current;
|
||||
String oldName = metadataColumn.getName();
|
||||
if (oldName != null) {
|
||||
String newName = oldName;
|
||||
if (isAddingQuote) {
|
||||
newName = quote + oldName + quote;
|
||||
} else {
|
||||
newName = StringUtils.removeStart(oldName, quote);
|
||||
newName = StringUtils.removeEnd(newName, quote);
|
||||
}
|
||||
MetadataColumn newColumnCopy = new ConnectionFactoryImpl().copy(metadataColumn, newName);
|
||||
IMetadataColumn copy = (ConvertionHelper.convertToIMetaDataColumn(newColumnCopy)).clone();
|
||||
extendedTable.replace(copy, selectionIndices[index]);
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
extendedTable.getTableViewer().getTable().select(selectionIndices);
|
||||
extendedTable.getTableViewer().getTable().notifyListeners(SWT.Selection, new Event());
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,10 @@
|
||||
<exclusion>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
@@ -93,7 +93,12 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.19</version>
|
||||
<version>1.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
@@ -137,7 +142,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.20</version>
|
||||
<version>2.22.2</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
|
||||
@@ -892,16 +892,31 @@ public class AggregatorPomsHelper {
|
||||
} else {
|
||||
model.getModules().addAll(collectRefProjectModules(null));
|
||||
}
|
||||
boolean isCIMode = false;
|
||||
if (IRunProcessService.get() != null) {
|
||||
isCIMode = IRunProcessService.get().isCIMode();
|
||||
}
|
||||
|
||||
createRootPom(model, true, monitor);
|
||||
installRootPom(true);
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// codes pom
|
||||
monitor.subTask("Synchronize code poms"); //$NON-NLS-1$
|
||||
updateCodeProjects(monitor, true, true);
|
||||
|
||||
if (isCIMode) {
|
||||
System.setProperty("ignore.ci.mode", Boolean.TRUE.toString());
|
||||
updateCodeProjects(monitor, true, true);
|
||||
System.setProperty("ignore.ci.mode", Boolean.FALSE.toString());
|
||||
} else {
|
||||
updateCodeProjects(monitor, true, true);
|
||||
}
|
||||
|
||||
CodesJarM2CacheManager.updateCodesJarProject(monitor, true, true, true);
|
||||
|
||||
monitor.worked(1);
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
@@ -957,6 +972,15 @@ public class AggregatorPomsHelper {
|
||||
if (monitor.isCanceled()) {
|
||||
return;
|
||||
}
|
||||
if (isCIMode) {
|
||||
for (ERepositoryObjectType codeType : ERepositoryObjectType.getAllTypesOfCodes()) {
|
||||
ITalendProcessJavaProject codeProject = getCodesProject(codeType);
|
||||
if (codeProject != null) {
|
||||
updateCodeProjectPom(monitor, codeType, codeProject.getProjectPom());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
monitor.done();
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,11 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
|
||||
existedDependencies = new ArrayList<Dependency>();
|
||||
model.setDependencies(existedDependencies);
|
||||
}
|
||||
|
||||
boolean isCIMode = false;
|
||||
if (IRunProcessService.get() != null) {
|
||||
isCIMode = IRunProcessService.get().isCIMode();
|
||||
}
|
||||
boolean ignoreCIMode = Boolean.getBoolean("ignore.ci.mode");
|
||||
for (ModuleNeeded module : needModules) {
|
||||
Dependency dependency = null;
|
||||
// TDI-37032 add dependency only if jar available in maven
|
||||
@@ -117,11 +121,8 @@ public abstract class AbstractMavenCodesTemplatePom extends AbstractMavenGeneral
|
||||
} else {
|
||||
isDeployed = true;
|
||||
}
|
||||
boolean isCIMode = false;
|
||||
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
|
||||
IRunProcessService runProcessService = GlobalServiceRegister.getDefault()
|
||||
.getService(IRunProcessService.class);
|
||||
isCIMode = runProcessService.isCIMode();
|
||||
if (!isDeployed && ignoreCIMode) {
|
||||
continue;
|
||||
}
|
||||
if (isCIMode || ignoreModuleInstallationStatus() || isDeployed) {
|
||||
dependency = PomUtil.createModuleDependency(module.getMavenUri());
|
||||
|
||||
@@ -15,6 +15,7 @@ package org.talend.librariesmanager.ui.views;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import org.eclipse.core.text.StringMatcher;
|
||||
import org.eclipse.jface.layout.GridDataFactory;
|
||||
import org.eclipse.jface.viewers.ITableLabelProvider;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
@@ -30,7 +31,6 @@ import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.internal.misc.StringMatcher;
|
||||
|
||||
/**
|
||||
* A TableViewer wrapper use to wrap an exist TableViewer, and provider a text field to filter item with displayed
|
||||
|
||||
@@ -14,9 +14,9 @@ package org.talend.librariesmanager.nexus;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -24,14 +24,17 @@ import java.util.List;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.HttpHeaders;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.fluent.Request;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import org.apache.http.params.CoreConnectionPNames;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.talend.commons.CommonsPlugin;
|
||||
import org.talend.commons.exception.ExceptionHandler;
|
||||
import org.talend.commons.utils.network.IProxySelectorProvider;
|
||||
@@ -55,6 +58,8 @@ import net.sf.json.JSONObject;
|
||||
*/
|
||||
public class ArtifacoryRepositoryHandler extends AbstractArtifactRepositoryHandler {
|
||||
|
||||
private static Logger LOGGER = Logger.getLogger(ArtifacoryRepositoryHandler.class);
|
||||
|
||||
private String SEARCH_SERVICE = "api/search/gavc?"; //$NON-NLS-1$
|
||||
|
||||
private static final String SEARCH_NAME = "api/search/artifact?";
|
||||
@@ -199,18 +204,9 @@ public class ArtifacoryRepositoryHandler extends AbstractArtifactRepositoryHandl
|
||||
}
|
||||
query = query + "v=" + versionToSearch;//$NON-NLS-1$
|
||||
}
|
||||
searchUrl = searchUrl + query;
|
||||
Request request = Request.Get(searchUrl);
|
||||
String userPass = serverBean.getUserName() + ":" + serverBean.getPassword(); //$NON-NLS-1$
|
||||
String basicAuth = "Basic " + new String(new Base64().encode(userPass.getBytes())); //$NON-NLS-1$
|
||||
Header authority = new BasicHeader("Authorization", basicAuth); //$NON-NLS-1$
|
||||
request.addHeader(authority);
|
||||
Header resultDetailHeader = new BasicHeader("X-Result-Detail", "info"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
request.addHeader(resultDetailHeader);
|
||||
List<MavenArtifact> resultList = new ArrayList<MavenArtifact>();
|
||||
|
||||
HttpResponse response = request.execute().returnResponse();
|
||||
String content = EntityUtils.toString(response.getEntity());
|
||||
searchUrl = searchUrl + query;
|
||||
String content = doRequest(searchUrl);//
|
||||
if (content.isEmpty()) {
|
||||
return resultList;
|
||||
}
|
||||
@@ -307,19 +303,9 @@ public class ArtifacoryRepositoryHandler extends AbstractArtifactRepositoryHandl
|
||||
}
|
||||
q += "repos=" + repositoryId;//$NON-NLS-1$
|
||||
}
|
||||
|
||||
searchUrl = searchUrl + q;
|
||||
Request request = Request.Get(searchUrl);
|
||||
String userPass = serverBean.getUserName() + ":" + serverBean.getPassword(); //$NON-NLS-1$
|
||||
String basicAuth = "Basic " + new String(new Base64().encode(userPass.getBytes())); //$NON-NLS-1$
|
||||
Header authority = new BasicHeader("Authorization", basicAuth); //$NON-NLS-1$
|
||||
request.addHeader(authority);
|
||||
Header resultDetailHeader = new BasicHeader("X-Result-Detail", "info"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
request.addHeader(resultDetailHeader);
|
||||
List<MavenArtifact> resultList = new ArrayList<MavenArtifact>();
|
||||
|
||||
HttpResponse response = request.execute().returnResponse();
|
||||
String content = EntityUtils.toString(response.getEntity());
|
||||
searchUrl = searchUrl + q;
|
||||
String content = doRequest(searchUrl);//
|
||||
if (content.isEmpty()) {
|
||||
return resultList;
|
||||
}
|
||||
@@ -498,4 +484,34 @@ public class ArtifacoryRepositoryHandler extends AbstractArtifactRepositoryHandl
|
||||
return doSearch(query, SEARCH_NAME, true, fromSnapshot);
|
||||
}
|
||||
|
||||
public String doRequest(final String url) throws URISyntaxException, Exception {
|
||||
final StringBuffer sb = new StringBuffer();
|
||||
new HttpClientTransport(url, serverBean.getUserName(), serverBean.getPassword()) {
|
||||
|
||||
@Override
|
||||
protected HttpResponse execute(IProgressMonitor monitor, DefaultHttpClient httpClient, URI targetURI)
|
||||
throws Exception {
|
||||
HttpGet httpGet = new HttpGet(targetURI);
|
||||
String userName = serverBean.getUserName();
|
||||
if (StringUtils.isNotBlank(userName) && !Boolean.getBoolean("talend.studio.search.nexus3.disableBasicAuth")) {
|
||||
String auth = userName + ":" + serverBean.getPassword();
|
||||
String authHeader = "Basic " + new String(Base64.encodeBase64(auth.getBytes(StandardCharsets.UTF_8)));
|
||||
httpGet.setHeader(HttpHeaders.AUTHORIZATION, authHeader);
|
||||
Header resultDetailHeader = new BasicHeader("X-Result-Detail", "info"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
httpGet.addHeader(resultDetailHeader);
|
||||
httpClient.setCredentialsProvider(null);
|
||||
}
|
||||
HttpResponse response = httpClient.execute(httpGet);
|
||||
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
||||
sb.append(EntityUtils.toString(response.getEntity()));
|
||||
} else {
|
||||
LOGGER.info("Try to search " + url + " failed!");
|
||||
throw new Exception(response.toString());
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
}.doRequest(null, new URI(url));
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,28 +150,32 @@ public class ShareLibrariesUtil {
|
||||
*/
|
||||
public static void seachArtifacts(IProgressMonitor monitor, IRepositoryArtifactHandler artifactHandler,
|
||||
Map<String, List<MavenArtifact>> snapshotArtifactMap, Map<String, List<MavenArtifact>> releaseArtifactMap,
|
||||
Set<String> snapshotGroupIdSet, Set<String> releaseGroupIdSet) throws Exception {
|
||||
Set<String> snapshotGroupIdSet, Set<String> releaseGroupIdSet) {
|
||||
if (artifactHandler != null) {
|
||||
checkCancel(monitor);
|
||||
List<MavenArtifact> searchResults = new ArrayList<MavenArtifact>();
|
||||
for (String groupId : releaseGroupIdSet) {
|
||||
searchResults = artifactHandler.search(groupId, null, null, true, false);
|
||||
if (searchResults != null) {
|
||||
for (MavenArtifact result : searchResults) {
|
||||
checkCancel(monitor);
|
||||
ShareLibrariesUtil.putArtifactToMap(result, releaseArtifactMap, false);
|
||||
try {
|
||||
checkCancel(monitor);
|
||||
List<MavenArtifact> searchResults = new ArrayList<MavenArtifact>();
|
||||
for (String groupId : releaseGroupIdSet) {
|
||||
searchResults = artifactHandler.search(groupId, null, null, true, false);
|
||||
if (searchResults != null) {
|
||||
for (MavenArtifact result : searchResults) {
|
||||
checkCancel(monitor);
|
||||
ShareLibrariesUtil.putArtifactToMap(result, releaseArtifactMap, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
checkCancel(monitor);
|
||||
for (String groupId : snapshotGroupIdSet) {
|
||||
searchResults = artifactHandler.search(groupId, null, null, false, true);
|
||||
if (searchResults != null) {
|
||||
for (MavenArtifact result : searchResults) {
|
||||
checkCancel(monitor);
|
||||
ShareLibrariesUtil.putArtifactToMap(result, snapshotArtifactMap, true);
|
||||
checkCancel(monitor);
|
||||
for (String groupId : snapshotGroupIdSet) {
|
||||
searchResults = artifactHandler.search(groupId, null, null, false, true);
|
||||
if (searchResults != null) {
|
||||
for (MavenArtifact result : searchResults) {
|
||||
checkCancel(monitor);
|
||||
ShareLibrariesUtil.putArtifactToMap(result, snapshotArtifactMap, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
ExceptionHandler.process(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.TableViewerCreatorColumnNotModifiable;
|
||||
import org.talend.commons.ui.runtime.swt.tableviewer.behavior.DefaultTableLabelProvider;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.CasePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.QuotePushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.button.ResetDBTypesPushButton;
|
||||
import org.talend.commons.ui.swt.advanced.dataeditor.control.ExtendedPushButton;
|
||||
import org.talend.commons.ui.swt.tableviewer.TableViewerCreator;
|
||||
@@ -89,6 +91,14 @@ public class CustomTableManagerOnlyForGenericSchema {
|
||||
if (resetDBTypesButton != null) {
|
||||
resetDBTypesButton.getButton().setEnabled(false);
|
||||
}
|
||||
CasePushButton caseButton = tableEditorView.getExtendedToolbar().getCaseButton();
|
||||
if (caseButton != null) {
|
||||
caseButton.getButton().setEnabled(false);
|
||||
}
|
||||
QuotePushButton quoteButton = tableEditorView.getExtendedToolbar().getQuoteButton();
|
||||
if (quoteButton != null) {
|
||||
quoteButton.getButton().setEnabled(false);
|
||||
}
|
||||
} else {
|
||||
tableEditorView.getExtendedToolbar().getAddButton().getButton().addSelectionListener(new SelectionListener() {
|
||||
|
||||
@@ -169,6 +179,14 @@ public class CustomTableManagerOnlyForGenericSchema {
|
||||
if (resetDBTypesButton != null) {
|
||||
resetDBTypesButton.getButton().setEnabled(false);
|
||||
}
|
||||
CasePushButton caseButton = tableEditorView.getExtendedToolbar().getCaseButton();
|
||||
if (caseButton != null) {
|
||||
caseButton.getButton().setEnabled(false);
|
||||
}
|
||||
QuotePushButton quoteButton = tableEditorView.getExtendedToolbar().getQuoteButton();
|
||||
if (quoteButton != null) {
|
||||
quoteButton.getButton().setEnabled(false);
|
||||
}
|
||||
}
|
||||
if (linkedTable != null) {
|
||||
if (linkedTable.isReadOnly()) {
|
||||
|
||||
@@ -8,7 +8,8 @@ Bundle-Vendor: .Talend SA.
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.talend.utils,
|
||||
org.apache.log4j
|
||||
org.apache.log4j,
|
||||
org.apache.xerces
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Eclipse-BuddyPolicy: global
|
||||
Eclipse-RegisterBuddy: org.apache.log4j
|
||||
|
||||
@@ -19,7 +19,8 @@ Require-Bundle: org.apache.log4j,
|
||||
org.eclipse.ui.intro,
|
||||
org.eclipse.ui.workbench,
|
||||
org.talend.libraries.jackson,
|
||||
org.w3c.css.sac
|
||||
org.w3c.css.sac,
|
||||
org.apache.commons.lang
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: org.talend.presentation.onboarding.interfaces,
|
||||
org.talend.presentation.onboarding.ui.managers,
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.eclipse.e4.ui.css.core.utils.StringUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.eclipse.ui.internal.intro.impl.model.url.IntroURL;
|
||||
import org.eclipse.ui.internal.intro.impl.util.Log;
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ Require-Bundle: org.eclipse.core.runtime,
|
||||
org.apache.log4j,
|
||||
org.talend.commons.runtime,
|
||||
org.talend.core.runtime,
|
||||
org.eclipse.e4.ui.workbench
|
||||
org.eclipse.e4.ui.workbench,
|
||||
javax.inject
|
||||
Eclipse-LazyStart: true
|
||||
Export-Package: org.talend.rcp,
|
||||
org.talend.rcp.intro,
|
||||
|
||||
@@ -26,8 +26,11 @@ import org.eclipse.ui.application.IWorkbenchConfigurer;
|
||||
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
|
||||
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
|
||||
import org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor;
|
||||
import org.talend.commons.exception.LoginException;
|
||||
import org.talend.commons.exception.PersistenceException;
|
||||
import org.talend.commons.utils.system.EclipseCommandLine;
|
||||
import org.talend.core.GlobalServiceRegister;
|
||||
import org.talend.core.repository.model.ProxyRepositoryFactory;
|
||||
import org.talend.core.repository.utils.LoginTaskRegistryReader;
|
||||
import org.talend.core.ui.branding.IBrandingConfiguration;
|
||||
import org.talend.core.ui.branding.IBrandingService;
|
||||
@@ -36,6 +39,7 @@ import org.talend.designer.runprocess.RunProcessPlugin;
|
||||
import org.talend.login.ILoginTask;
|
||||
import org.talend.rcp.TalendSplashHandler;
|
||||
import org.talend.registration.register.RegisterManagement;
|
||||
import org.talend.repository.RepositoryWorkUnit;
|
||||
|
||||
/**
|
||||
* DOC ccarbone class global comment. Detailled comment <br/>
|
||||
@@ -109,13 +113,19 @@ public class ApplicationWorkbenchAdvisor extends IDEWorkbenchAdvisor {
|
||||
SubMonitor subMonitor = SubMonitor.convert(monitor, allLoginTasks.length + 1);
|
||||
|
||||
// handle the login tasks created using the extension point org.talend.core.repository.login.task
|
||||
for (ILoginTask toBeRun : allLoginTasks) {
|
||||
try {
|
||||
toBeRun.run(subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE));
|
||||
} catch (Exception e) {
|
||||
log.error("Error while execution a login task.", e); //$NON-NLS-1$
|
||||
ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(new RepositoryWorkUnit<Void>("Applying login tasks") {
|
||||
|
||||
@Override
|
||||
protected void run() throws LoginException, PersistenceException {
|
||||
for (ILoginTask toBeRun : allLoginTasks) {
|
||||
try {
|
||||
toBeRun.run(subMonitor.newChild(1, SubMonitor.SUPPRESS_NONE));
|
||||
} catch (Exception e) {
|
||||
log.error("Error while execution a login task.", e); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
super.preStartup();
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ Require-Bundle: org.eclipse.core.runtime,
|
||||
org.talend.core.repository,
|
||||
org.eclipse.osgi.services,
|
||||
org.talend.libraries.apache,
|
||||
org.talend.core
|
||||
org.talend.core,
|
||||
javax.inject
|
||||
Export-Package: org.talend.repository,
|
||||
org.talend.repository.navigator,
|
||||
org.talend.repository.tester,
|
||||
|
||||
Reference in New Issue
Block a user