use of org.eclipse.jface.dialogs.TrayDialog in project tdi-studio-se by Talend.
the class XmlMapFilterContainer method addButtonListener.
@Override
protected void addButtonListener() {
IService expressionBuilderDialogService = GlobalServiceRegister.getDefault().getService(IExpressionBuilderDialogService.class);
final IExpressionBuilderDialogController dialog = ((IExpressionBuilderDialogService) expressionBuilderDialogService).getExpressionBuilderInstance(parent, null, null);
button.addMouseListener(new MouseListener() {
@Override
public void mousePressed(MouseEvent me) {
if (dialog instanceof TrayDialog) {
TrayDialog parentDialog = (TrayDialog) dialog;
// if press the button ,should apply ExpressionCellEditor value
MapperManager mapperManger = (MapperManager) tableManager.getMapperManger();
mapperManger.fireCurrentDirectEditApply();
dialog.setDefaultExpression(tableManager.getExpressionFilter());
if (Window.OK == parentDialog.open()) {
String expressionForTable = dialog.getExpressionForTable();
tableManager.setExpressionFilter(expressionForTable);
tableManager.getEditPart().getViewer().getEditDomain().getCommandStack().execute(getFilterChangeCommand(tableManager.getModel(), expressionForTable));
}
}
}
@Override
public void mouseReleased(MouseEvent me) {
// TODO Auto-generated method stub
}
@Override
public void mouseDoubleClicked(MouseEvent me) {
// TODO Auto-generated method stub
}
});
}
Aggregations