Search in sources :

Example 1 with TrayDialog

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
        }
    });
}
Also used : IExpressionBuilderDialogService(org.talend.core.runtime.services.IExpressionBuilderDialogService) MouseListener(org.eclipse.draw2d.MouseListener) MouseEvent(org.eclipse.draw2d.MouseEvent) MapperManager(org.talend.designer.xmlmap.ui.tabs.MapperManager) IExpressionBuilderDialogController(org.talend.commons.ui.runtime.expressionbuilder.IExpressionBuilderDialogController) TrayDialog(org.eclipse.jface.dialogs.TrayDialog) IService(org.talend.core.IService)

Aggregations

MouseEvent (org.eclipse.draw2d.MouseEvent)1 MouseListener (org.eclipse.draw2d.MouseListener)1 TrayDialog (org.eclipse.jface.dialogs.TrayDialog)1 IExpressionBuilderDialogController (org.talend.commons.ui.runtime.expressionbuilder.IExpressionBuilderDialogController)1 IService (org.talend.core.IService)1 IExpressionBuilderDialogService (org.talend.core.runtime.services.IExpressionBuilderDialogService)1 MapperManager (org.talend.designer.xmlmap.ui.tabs.MapperManager)1