use of org.talend.designer.dbmap.managers.UIManager in project tdi-studio-se by Talend.
the class FooterComposite method createComponents.
/**
* DOC amaumont Comment method "createComponents".
*/
private void createComponents() {
final UIManager uiManager = mapperManager.getUiManager();
GridData footerCompositeGridData = new GridData(GridData.FILL_HORIZONTAL);
this.setLayoutData(footerCompositeGridData);
FormLayout formLayout = new FormLayout();
formLayout.spacing = 15;
this.setLayout(formLayout);
Button okButton = new Button(this, SWT.NONE);
//$NON-NLS-1$
okButton.setText(Messages.getString("FooterComposite.button.OK"));
FormData okFormData = new FormData();
okFormData.width = 100;
okButton.setLayoutData(okFormData);
okButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
uiManager.closeMapper(SWT.OK);
}
});
// final Button applyButton = new Button(this, SWT.NONE);
// applyButton.setText("Apply");
// FormData applyFormData = new FormData();
// applyButton.setLayoutData(applyFormData);
// applyButton.addSelectionListener(new SelectionListener() {
//
// public void widgetDefaultSelected(SelectionEvent e) {
// }
//
// public void widgetSelected(SelectionEvent e) {
// MessageBox messageBox = new MessageBox(uiManager.retrieveShellParent(footerComposite));
// messageBox.setText("Info");
// messageBox.setMessage("Not implemented yet !");
// messageBox.open();
// }
//
// });
Button cancelButton = new Button(this, SWT.NONE);
//$NON-NLS-1$
cancelButton.setText(Messages.getString("FooterComposite.button.Cancel"));
cancelButton.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
uiManager.closeMapper(SWT.CANCEL);
}
});
FormData cancelFormData = new FormData();
cancelFormData.width = 100;
cancelButton.setLayoutData(cancelFormData);
// applyFormData.right = new FormAttachment(100);
// cancelFormData.right = new FormAttachment(applyButton, -5);
cancelFormData.right = new FormAttachment(100, -5);
okFormData.right = new FormAttachment(cancelButton, -5);
}
use of org.talend.designer.dbmap.managers.UIManager in project tdi-studio-se by Talend.
the class DataMapTableView method changeSize.
/**
*
* Change size of the DataMapTableView.
*
* @param newWidth
* @param newHeight
* @param refreshNow refresh background with links if true
* @param recalculateParentSize
*/
public void changeSize(Point newSize, boolean refreshNow, boolean recalculateParentSize) {
if (newSize.y < getHeaderHeight()) {
newSize.y = getHeaderHeight();
}
FormData formData = (FormData) DataMapTableView.this.getLayoutData();
formData.width = newSize.x;
formData.height = newSize.y;
DataMapTableView.this.setSize(newSize);
UIManager uiManager = mapperManager.getUiManager();
if (recalculateParentSize) {
uiManager.resizeTablesZoneViewAtComputedSize(getZone());
}
if (refreshNow) {
uiManager.refreshBackground(true, false);
} else {
uiManager.refreshBackground(true, TIME_BEFORE_NEW_REFRESH_BACKGROUND, true);
}
// dataMapTableView.redraw();
// dataMapTableView.layout(true, true);
}
use of org.talend.designer.dbmap.managers.UIManager in project tdi-studio-se by Talend.
the class CompleteDropTargetListener method updateExpressionsOfInsertedEntries.
/**
* DOC amaumont Comment method "updateExpressionsOfInsertedEntries".
*
* @param uiManager
* @param currentLanguage
* @param metadataEditorView
* @param currentIndex
* @param sourceEntriesOfEntriesBeingAdded
* @param targetTableIsConstraintsTable
* @param tableViewerCreatorTarget
* @param metadataColumnsBeingAdded
* @param metadataEditorEvent
*/
@SuppressWarnings("unchecked")
private void updateExpressionsOfInsertedEntries(IDbLanguage currentLanguage, MetadataTableEditorView metadataEditorView, int currentIndex, ArrayList<ITableEntry> sourceEntriesOfEntriesBeingAdded, boolean targetTableIsConstraintsTable, TableViewerCreator tableViewerCreatorTarget, ArrayList<IMetadataColumn> metadataColumnsBeingAdded) // , MetadataEditorEvent metadataEditorEvent
{
UIManager uiManager = getUiManager();
if (metadataEditorView != null && !targetTableIsConstraintsTable) {
metadataEditorView.getMetadataTableEditor().addAll(currentIndex, metadataColumnsBeingAdded);
// metadataEditorEvent.indexStartInsert = currentIndex;
// IAction action = MetadataEditorActionFactory.getInstance().getAction(metadataEditorView,
// metadataEditorEvent);
// action.run(metadataEditorEvent);
Zone zoneTarget = getMapperManager().retrieveDataMapTableView(tableViewerCreatorTarget.getTable()).getZone();
List<IColumnEntry> lastCreatedTableEntries = uiManager.getLastCreatedInOutColumnEntries();
for (int i = 0; i < lastCreatedTableEntries.size(); i++) {
ITableEntry tableEntrySource = sourceEntriesOfEntriesBeingAdded.get(i);
ITableEntry dataMapTableEntry = lastCreatedTableEntries.get(i);
if (zoneTarget == Zone.INPUTS) {
setDefaultOperator((InputColumnTableEntry) dataMapTableEntry);
}
DataMapTableView dataMapTableView = getMapperManager().retrieveIDataMapTableView(tableEntrySource.getParent());
Zone zoneSource = dataMapTableView.getZone();
String location = null;
if (zoneSource == Zone.OUTPUTS) {
location = tableEntrySource.getExpression();
} else {
location = currentLanguage.getLocation(tableEntrySource.getParentName(), tableEntrySource.getName());
}
if (location != null) {
//$NON-NLS-1$
dataMapTableEntry.setExpression(location + " ");
}
}
}
tableViewerCreatorTarget.getTableViewer().refresh();
List<ITableEntry> refreshedTableEntriesList = tableViewerCreatorTarget.getInputList();
for (ITableEntry tableEntry : refreshedTableEntriesList) {
uiManager.parseExpression(tableEntry.getExpression(), tableEntry, false, true, false);
}
}
use of org.talend.designer.dbmap.managers.UIManager in project tdi-studio-se by Talend.
the class AliasDialog method open.
public boolean open() {
UIManager uiManager = this.mapperManager.getUiManager();
// String inputTableName = getCurrentSelectedInputTableView().getDataMapTable().getName();
//
//$NON-NLS-1$
String proposedAlias = "";
IInputValidator inputValidator = new //$NON-NLS-1$
IInputValidator() {
public String isValid(String newText) {
String selectedPhysicalTable = aliasInternalDialog.getTableName();
if (newText.length() == 0 && isSameAsVisibleTableName(selectedPhysicalTable)) {
//$NON-NLS-1$
return Messages.getString("AliasDialog.aliasAlreadyExists", new Object[] { selectedPhysicalTable });
}
if (selectedPhysicalTable == null || selectedPhysicalTable.length() == 0) {
//$NON-NLS-1$
return Messages.getString("AliasDialog.TableMustBeSelected");
}
if (isSameAsVisibleTableName(newText)) {
//$NON-NLS-1$
return Messages.getString("AliasDialog.aliasAlreadyExists", new Object[] { newText });
}
if (KeywordsValidator.isKeyword(newText) || KeywordsValidator.isSqlKeyword(newText)) {
//$NON-NLS-1$
return Messages.getString("AliasDialog.inputValid");
}
return null;
}
};
aliasInternalDialog = new AliasInternalDialog(mapperManager.getUiManager().getShell(), Messages.getString(//$NON-NLS-1$
"AliasDialog.addNewAlias"), Messages.getString("AliasDialog.typeAliasOfTable"), proposedAlias, //$NON-NLS-1$
inputValidator);
int response = aliasInternalDialog.open();
if (response == InputDialog.OK) {
this.tableName = aliasInternalDialog.getTableName();
this.alias = aliasInternalDialog.getValue();
return true;
}
return false;
}
use of org.talend.designer.dbmap.managers.UIManager in project tdi-studio-se by Talend.
the class ToolbarZone method addCommonsComponentListeners.
/**
* DOC amaumont Comment method "addListeners".
*/
private void addCommonsComponentListeners() {
final UIManager uiManager = mapperManager.getUiManager();
upTableButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
uiManager.moveSelectedTable(getZone(), true);
}
});
downTableButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
uiManager.moveSelectedTable(getZone(), false);
}
});
minimizeButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
setMinimizeButtonState(!minimized);
uiManager.minimizeAllTables(getZone(), minimized, minimizeButton);
}
});
}
Aggregations