use of com.amalto.workbench.editors.DataClusterDialog in project tmdm-studio-se by Talend.
the class TestTriggerAction method doRun.
@Override
protected void doRun() {
com.amalto.workbench.utils.MDMServerDef serverDef = getServerDef();
if (serverDef == null) {
return;
}
boolean canConnect = checkConnection(serverDef.getUrl(), serverDef.getUser(), serverDef.getPasswd());
if (!canConnect) {
MessageDialog.openError(getShell(), Messages.RoutingRuleMainPage2_CheckConnection, Messages.RoutingRuleMainPage2_UnableToConnect);
return;
}
try {
service = Util.getMDMService(new URL(serverDef.getUrl()), serverDef.getUser(), serverDef.getPasswd());
IWorkbenchPartSite site = commonViewer.getCommonNavigator().getSite();
dialog = new DataClusterDialog(getShell(), new TreeObject(), site);
dialog.setDefaultServerDef(serverDef);
dialog.setOkLabel(Messages.TestTriggerAction_Test);
dialog.setCancelLabel(Messages.TestTriggerAction_Close);
dialog.setSelectionListener(this);
dialog.open();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
use of com.amalto.workbench.editors.DataClusterDialog in project tmdm-studio-se by Talend.
the class ComplexTableViewerR method creatTextPortion.
@Override
protected void creatTextPortion(Composite textParent, ComplexTableViewerColumn column) {
Composite righComposite = toolkit.createComposite(textParent, SWT.NONE);
righComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
GridLayout layout = new GridLayout(1, false);
layout.marginHeight = 0;
righComposite.setLayout(layout);
Button readRecordButton = toolkit.createButton(righComposite, Messages.ComplexTableViewerR_PickRecordFromContainer, SWT.PUSH | SWT.CENTER);
readRecordButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
DataClusterDialog dialog = new DataClusterDialog(site.getShell(), new TreeObject(), site);
dialog.create();
Point size = dialog.getShell().getSize();
Rectangle clientArea = Display.getCurrent().getClientArea();
int locx = clientArea.x + (clientArea.width - size.x) / 2;
int locy = clientArea.y + (clientArea.height - size.y) / 2;
dialog.getShell().setLocation(locx, locy);
if (dialog.open() == Dialog.OK) {
String recordContent = dialog.getRecordContent();
if (recordContent != null && recordContent.trim().length() > 0)
text.setText(recordContent);
}
}
public void widgetDefaultSelected(SelectionEvent e) {
//
}
});
readRecordButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
super.creatTextPortion(righComposite, column);
}
Aggregations