Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.hop.pipeline.transform.ITransformMeta;
import org.apache.hop.pipeline.transform.TransformMeta;
import org.apache.hop.ui.core.ConstUi;
import org.apache.hop.ui.core.FormDataBuilder;
import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.database.dialog.DatabaseExplorerDialog;
import org.apache.hop.ui.core.database.dialog.SqlEditor;
Expand Down Expand Up @@ -65,7 +66,6 @@
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
Expand Down Expand Up @@ -144,7 +144,7 @@ public String open() {

ModifyListener lsMod = e -> input.setChanged();
ModifyListener lsTableMod =
arg0 -> {
event -> {
input.setChanged();
setTableFieldCombo();
};
Expand Down Expand Up @@ -200,13 +200,9 @@ private void addAdvancedTab(
BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.AdvancedTab.TabTitle"));

Composite wAdvancedComp = new Composite(wTabFolder, SWT.NONE);
wAdvancedComp.setLayout(props.createFormLayout());
PropsUi.setLook(wAdvancedComp);

FormLayout advancedLayout = new FormLayout();
advancedLayout.marginWidth = 3;
advancedLayout.marginHeight = 3;
wAdvancedComp.setLayout(advancedLayout);

// ///////////////////////////////
// START OF OPERATION ORDER GROUP //
// ///////////////////////////////
Expand All @@ -216,18 +212,16 @@ private void addAdvancedTab(
wOperationOrder.setText(
BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.OperationOrder.Label"));

FormLayout originFilesgroupLayout = new FormLayout();
originFilesgroupLayout.marginWidth = 10;
originFilesgroupLayout.marginHeight = 10;
wOperationOrder.setLayout(originFilesgroupLayout);
wOperationOrder.setLayout(props.createFormLayout());
wOperationOrder.setLayoutData(new FormDataBuilder().top().left().fullWidth().result());

Label wlOperationField = new Label(wOperationOrder, SWT.RIGHT);
wlOperationField.setText(
BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.OperationField.Label"));
PropsUi.setLook(wlOperationField);
FormData fdlOperationField = new FormData();
fdlOperationField.left = new FormAttachment(0, 0);
fdlOperationField.top = new FormAttachment(wTableField, margin);
fdlOperationField.top = new FormAttachment(0, 0);
fdlOperationField.right = new FormAttachment(middle, -margin);
wlOperationField.setLayoutData(fdlOperationField);
wOperationField = new CCombo(wOperationOrder, SWT.BORDER | SWT.READ_ONLY);
Expand All @@ -236,7 +230,7 @@ private void addAdvancedTab(
wOperationField.addModifyListener(lsMod);
FormData fdOperationField = new FormData();
fdOperationField.left = new FormAttachment(middle, 0);
fdOperationField.top = new FormAttachment(wTableField, margin);
fdOperationField.top = new FormAttachment(0, 0);
fdOperationField.right = new FormAttachment(100, 0);
wOperationField.setLayoutData(fdOperationField);
wOperationField.addFocusListener(
Expand Down Expand Up @@ -343,23 +337,10 @@ public void focusGained(FocusEvent e) {
fdPerformLookup.right = new FormAttachment(100, 0);
wbPerformLookup.setLayoutData(fdPerformLookup);

FormData fdOperationOrder = new FormData();
fdOperationOrder.left = new FormAttachment(0, margin);
fdOperationOrder.top = new FormAttachment(wSpacer, margin);
fdOperationOrder.right = new FormAttachment(100, -margin);
wOperationOrder.setLayoutData(fdOperationOrder);

// ///////////////////////////////////////////////////////////
// / END OF Operation order GROUP
// ///////////////////////////////////////////////////////////

FormData fdAdvancedComp = new FormData();
fdAdvancedComp.left = new FormAttachment(0, 0);
fdAdvancedComp.top = new FormAttachment(0, 0);
fdAdvancedComp.right = new FormAttachment(100, 0);
fdAdvancedComp.bottom = new FormAttachment(100, 0);
wAdvancedComp.setLayoutData(fdAdvancedComp);

wAdvancedComp.layout();
wAdvancedTab.setControl(wAdvancedComp);
PropsUi.setLook(wAdvancedComp);
Expand All @@ -372,20 +353,16 @@ private void addUpdatesTab(CTabFolder wTabFolder, ModifyListener lsMod) {
BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.UpdatesTab.TabTitle"));

Composite wUpdatesComp = new Composite(wTabFolder, SWT.NONE);
wUpdatesComp.setLayout(props.createFormLayout());
PropsUi.setLook(wUpdatesComp);

FormLayout updatesLayout = new FormLayout();
updatesLayout.marginWidth = 3;
updatesLayout.marginHeight = 3;
wUpdatesComp.setLayout(updatesLayout);

// THE UPDATE/INSERT TABLE
Label wlReturn = new Label(wUpdatesComp, SWT.NONE);
wlReturn.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.UpdateFields.Label"));
PropsUi.setLook(wlReturn);
FormData fdlReturn = new FormData();
fdlReturn.left = new FormAttachment(0, 0);
fdlReturn.top = new FormAttachment(wKey, margin);
fdlReturn.top = new FormAttachment(0, 0);
wlReturn.setLayoutData(fdlReturn);

int upInsCols = 3;
Expand Down Expand Up @@ -433,7 +410,7 @@ private void addUpdatesTab(CTabFolder wTabFolder, ModifyListener lsMod) {
fdReturn.left = new FormAttachment(0, 0);
fdReturn.top = new FormAttachment(wlReturn, margin);
fdReturn.right = new FormAttachment(100, 0);
fdReturn.bottom = new FormAttachment(wbGetLU, -2 * margin);
fdReturn.bottom = new FormAttachment(wbGetLU, -margin);
wReturn.setLayoutData(fdReturn);

Button wbDoMapping = new Button(wUpdatesComp, SWT.PUSH);
Expand All @@ -443,7 +420,9 @@ private void addUpdatesTab(CTabFolder wTabFolder, ModifyListener lsMod) {
fdDoMapping.top = new FormAttachment(wbGetLU, margin);
fdDoMapping.right = new FormAttachment(100, 0);
wbDoMapping.setLayoutData(fdDoMapping);
wbDoMapping.addListener(SWT.Selection, arg0 -> generateMappings());
wbDoMapping.addListener(SWT.Selection, event -> generateMappings());

setButtonPositions(new Button[] {wbGetLU, wbDoMapping}, margin, null);

//
// Search the fields in the background
Expand All @@ -470,14 +449,6 @@ private void addUpdatesTab(CTabFolder wTabFolder, ModifyListener lsMod) {
};
new Thread(runnable).start();

FormData fdUpdatesComp = new FormData();
fdUpdatesComp.left = new FormAttachment(0, 0);
fdUpdatesComp.top = new FormAttachment(0, 0);
fdUpdatesComp.right = new FormAttachment(100, 0);
fdUpdatesComp.bottom = new FormAttachment(100, 0);
wUpdatesComp.setLayoutData(fdUpdatesComp);

wUpdatesComp.layout();
wUpdatesTab.setControl(wUpdatesComp);
PropsUi.setLook(wUpdatesComp);
}
Expand All @@ -488,19 +459,15 @@ private void addKeysTab(CTabFolder wTabFolder, ModifyListener lsMod) {
wKeysTab.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.KeysTab.TabTitle"));

Composite wKeysComp = new Composite(wTabFolder, SWT.NONE);
wKeysComp.setLayout(props.createFormLayout());
PropsUi.setLook(wKeysComp);

FormLayout keysLayout = new FormLayout();
keysLayout.marginWidth = 3;
keysLayout.marginHeight = 3;
wKeysComp.setLayout(keysLayout);

Label wlKey = new Label(wKeysComp, SWT.NONE);
wlKey.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.Keys.Label"));
PropsUi.setLook(wlKey);
FormData fdlKey = new FormData();
fdlKey.left = new FormAttachment(0, 0);
fdlKey.top = new FormAttachment(wTableField, margin);
fdlKey.top = new FormAttachment(0, 0);
wlKey.setLayoutData(fdlKey);

int nrKeyCols = 4;
Expand Down Expand Up @@ -551,27 +518,16 @@ private void addKeysTab(CTabFolder wTabFolder, ModifyListener lsMod) {

wGet = new Button(wKeysComp, SWT.PUSH);
wGet.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.GetFields.Button"));
fdGet = new FormData();
fdGet.left = new FormAttachment(0, 0);
fdGet.bottom = new FormAttachment(100, -2 * margin);
wGet.setLayoutData(fdGet);
wGet.addListener(SWT.Selection, e -> get());
setButtonPositions(new Button[] {wGet}, margin, null);

FormData fdKey = new FormData();
fdKey.left = new FormAttachment(0, 0);
fdKey.top = new FormAttachment(wlKey, margin);
fdKey.right = new FormAttachment(100, 0);
fdKey.bottom = new FormAttachment(wGet, -2 * margin);
fdKey.bottom = new FormAttachment(wGet, -margin);
wKey.setLayoutData(fdKey);

FormData fdKeysComp = new FormData();
fdKeysComp.left = new FormAttachment(0, 0);
fdKeysComp.top = new FormAttachment(0, 0);
fdKeysComp.right = new FormAttachment(100, 0);
fdKeysComp.bottom = new FormAttachment(100, 0);
wKeysComp.setLayoutData(fdKeysComp);

wKeysComp.layout();
wKeysTab.setControl(wKeysComp);
PropsUi.setLook(wKeysComp);
}
Expand All @@ -588,15 +544,11 @@ private void addGeneralTab(
BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.GeneralTab.TabTitle"));

Composite wGeneralComp = new Composite(wTabFolder, SWT.NONE);
wGeneralComp.setLayout(props.createFormLayout());
PropsUi.setLook(wGeneralComp);

FormLayout generalLayout = new FormLayout();
generalLayout.marginWidth = 3;
generalLayout.marginHeight = 3;
wGeneralComp.setLayout(generalLayout);

// Connection line
wConnection = addConnectionLine(wGeneralComp, wSpacer, input.getConnection(), lsMod);
wConnection = addConnectionLine(wGeneralComp, null, input.getConnection(), lsMod);
wConnection.addSelectionListener(lsSelection);

// Schema line...
Expand Down Expand Up @@ -639,7 +591,7 @@ private void addGeneralTab(

wbTable = new Button(wGeneralComp, SWT.PUSH | SWT.CENTER);
PropsUi.setLook(wbTable);
wbTable.setText(BaseMessages.getString(PKG, "SynchronizeAfterMergeDialog.Browse.Button"));
wbTable.setText(BaseMessages.getString(PKG, "System.Button.Browse"));
FormData fdbTable = new FormData();
fdbTable.right = new FormAttachment(100, 0);
fdbTable.top = new FormAttachment(wbSchema, margin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ SynchronizeAfterMergeDialog.AvailableSchemas.Message=Please select a schema name
SynchronizeAfterMergeDialog.AvailableSchemas.Title=Available schemas
SynchronizeAfterMergeDialog.Batch.Label=Use batch update
SynchronizeAfterMergeDialog.Batch.Tooltip=Use batch update for inserts and updates
SynchronizeAfterMergeDialog.Browse.Button=&Browse...
SynchronizeAfterMergeDialog.ColumnInfo.Comparator=Comparator
SynchronizeAfterMergeDialog.ColumnInfo.StreamField=Stream field
SynchronizeAfterMergeDialog.ColumnInfo.StreamField1=Stream field1
Expand Down Expand Up @@ -111,15 +110,13 @@ SynchronizeAfterMergeDialog.OrderUpdate.ToolTip=If the operation field contain's
SynchronizeAfterMergeDialog.PerformLookup.Label=Perform lookup
SynchronizeAfterMergeDialog.PerformLookup.Tooltip=Perform lookup before updating or deleting.\nIf the record is missing, Apache Hop will throw an exception.
SynchronizeAfterMergeDialog.Shell.Title=Synchronize after merge
SynchronizeAfterMergeDialog.SQL.Button=\ &SQL
SynchronizeAfterMergeDialog.SQLError.DialogTitle=ERROR
SynchronizeAfterMergeDialog.TableField.Label=Tablename field
SynchronizeAfterMergeDialog.TablenameInField.Label=Tablename is defined in a field
SynchronizeAfterMergeDialog.TablenameInField.Tooltip=Tablename is defined in a field
SynchronizeAfterMergeDialog.TargetSchema.Label=Target schema
SynchronizeAfterMergeDialog.TargetTable.Label=Target table
SynchronizeAfterMergeDialog.TransformMeta.Title=CombinationLookup
SynchronizeAfterMergeDialog.TransformName.Label=Transform name
SynchronizeAfterMergeDialog.UpdateFields.Label=Update fields\:
SynchronizeAfterMergeMeta.CheckResult.AllFieldsFoundInInput=All fields found in the input stream.
SynchronizeAfterMergeMeta.CheckResult.AllFieldsFoundInInput2=All insert/update fields found in the input stream.
Expand Down
Loading