Search in sources :

Example 16 with ITableEntry

use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.

the class UIManager method parseExpression.

/**
     * 
     * 
     * @param expression
     * @param currentModifiedITableEntry
     * @param linkMustHaveSelectedState
     * @param checkInputKeyAutomatically TODO
     * @param inputExpressionAppliedOrCanceled TODO
     * @param newSelectedDataMapTableView
     * @return true if a link has been added or removed, false else
     */
public ParseExpressionResult parseExpression(String expression, ITableEntry currentModifiedITableEntry, boolean linkMustHaveSelectedState, boolean checkInputKeyAutomatically, boolean inputExpressionAppliedOrCanceled) {
    DataMapTableView dataMapTableView = mapperManager.retrieveDataMapTableView(currentModifiedITableEntry);
    boolean linkHasBeenAdded = false;
    boolean linkHasBeenRemoved = false;
    DataMapExpressionParser dataMapExpressionParser = new DataMapExpressionParser(mapperManager.getCurrentLanguage());
    TableEntryLocation[] tableEntriesLocationsSources = dataMapExpressionParser.parseTableEntryLocations(expression);
    Set<TableEntryLocation> alreadyProcessed = new HashSet<TableEntryLocation>();
    Set<ITableEntry> sourcesForTarget = mapperManager.getSourcesForTarget(currentModifiedITableEntry);
    Set<ITableEntry> sourcesForTargetToDelete = new HashSet<ITableEntry>(sourcesForTarget);
    boolean isInputEntry = currentModifiedITableEntry instanceof InputColumnTableEntry;
    for (TableEntryLocation tableEntriesLocationsSource : tableEntriesLocationsSources) {
        TableEntryLocation location = tableEntriesLocationsSource;
        if (!alreadyProcessed.contains(location) && checkSourceLocationIsValid(location, currentModifiedITableEntry)) {
            ITableEntry sourceTableEntry = mapperManager.retrieveTableEntry(location);
            sourcesForTargetToDelete.remove(sourceTableEntry);
            if (sourceTableEntry != null && !sourcesForTarget.contains(sourceTableEntry)) {
                DataMapTableView sourceDataMapTableView = mapperManager.retrieveDataMapTableView(sourceTableEntry);
                IMapperLink link = new Link(new PointLinkDescriptor(sourceTableEntry, sourceDataMapTableView.getZone()), new PointLinkDescriptor(currentModifiedITableEntry, dataMapTableView.getZone()), mapperManager);
                link.setState(linkMustHaveSelectedState ? LinkState.SELECTED : LinkState.UNSELECTED);
                mapperManager.addLink(link);
                linkHasBeenAdded = true;
            }
            alreadyProcessed.add(location);
        }
    }
    Set<IMapperLink> targets = mapperManager.getGraphicalLinksFromTarget(currentModifiedITableEntry);
    Set<IMapperLink> linksFromTarget = new HashSet<IMapperLink>(targets);
    for (IMapperLink link : linksFromTarget) {
        if (sourcesForTargetToDelete.contains(link.getPointLinkDescriptor1().getTableEntry())) {
            mapperManager.removeLink(link, link.getPointLinkDescriptor2().getTableEntry());
            linkHasBeenRemoved = true;
        }
    }
    mapperManager.orderLinks();
    return new ParseExpressionResult(linkHasBeenAdded, linkHasBeenRemoved);
}
Also used : PointLinkDescriptor(org.talend.designer.abstractmap.ui.visualmap.link.PointLinkDescriptor) ITableEntry(org.talend.designer.abstractmap.model.tableentry.ITableEntry) InputDataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.InputDataMapTableView) OutputDataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.OutputDataMapTableView) DataMapTableView(org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView) ParseExpressionResult(org.talend.designer.dbmap.utils.ParseExpressionResult) DataMapExpressionParser(org.talend.designer.dbmap.utils.DataMapExpressionParser) TableEntryLocation(org.talend.designer.dbmap.model.tableentry.TableEntryLocation) IMapperLink(org.talend.designer.abstractmap.ui.visualmap.link.IMapperLink) InputColumnTableEntry(org.talend.designer.dbmap.model.tableentry.InputColumnTableEntry) Link(org.talend.designer.dbmap.ui.visualmap.link.Link) IMapperLink(org.talend.designer.abstractmap.ui.visualmap.link.IMapperLink) HashSet(java.util.HashSet)

Example 17 with ITableEntry

use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.

the class DataMapTableView method createExpressionCellEditor.

protected TextCellEditor createExpressionCellEditor(final TableViewerCreator tableViewerCreator, TableViewerCreatorColumn column, final Zone[] zones, boolean isConstraintExpressionCellEditor) {
    final TextCellEditorWithProposal cellEditor = new TextCellEditorWithProposal(tableViewerCreator.getTable(), SWT.MULTI | SWT.BORDER, column);
    final Text expressionTextEditor = (Text) cellEditor.getControl();
    if (isConstraintExpressionCellEditor) {
    // moved to it's caller to execute
    // constraintExpressionTextEditor = expressionTextEditor;
    } else {
        columnExpressionTextEditor = expressionTextEditor;
    }
    cellEditor.addListener(new ICellEditorListener() {

        Text text = (Text) cellEditor.getControl();

        @Override
        public void applyEditorValue() {
            ModifiedObjectInfo modifiedObjectInfo = tableViewerCreator.getModifiedObjectInfo();
            mapperManager.getUiManager().parseNewExpression(text.getText(), (ITableEntry) modifiedObjectInfo.getCurrentModifiedBean(), true);
        }

        @Override
        public void cancelEditor() {
            ModifiedObjectInfo modifiedObjectInfo = tableViewerCreator.getModifiedObjectInfo();
            text.setText((String) modifiedObjectInfo.getOriginalPropertyBeanValue());
            ITableEntry tableEntry = (ITableEntry) (modifiedObjectInfo.getCurrentModifiedBean() != null ? modifiedObjectInfo.getCurrentModifiedBean() : modifiedObjectInfo.getPreviousModifiedBean());
            String originalExpression = (String) modifiedObjectInfo.getOriginalPropertyBeanValue();
            mapperManager.getUiManager().parseNewExpression(originalExpression, tableEntry, true);
        }

        @Override
        public void editorValueChanged(boolean oldValidState, boolean newValidState) {
            if (expressionTextEditor.isFocusControl() || lastExpressionEditorTextWhichLostFocus == expressionTextEditor) {
                ModifiedObjectInfo modifiedObjectInfo = tableViewerCreator.getModifiedObjectInfo();
                ITableEntry tableEntry = (ITableEntry) (modifiedObjectInfo.getCurrentModifiedBean() != null ? modifiedObjectInfo.getCurrentModifiedBean() : modifiedObjectInfo.getPreviousModifiedBean());
                mapperManager.getUiManager().parseNewExpression(text.getText(), tableEntry, false);
                resizeTextEditor(text, tableViewerCreator);
            }
        }
    });
    expressionTextEditor.addControlListener(new ControlListener() {

        ExecutionLimiter executionLimiter = null;

        @Override
        public void controlMoved(ControlEvent e) {
        }

        @Override
        public void controlResized(ControlEvent e) {
            if (executionLimiter == null) {
                executionLimiter = new ExecutionLimiter(50, true) {

                    @Override
                    public void execute(boolean isFinalExecution, Object data) {
                        if (isFinalExecution && !expressionTextEditor.isDisposed()) {
                            expressionTextEditor.getDisplay().syncExec(new Runnable() {

                                @Override
                                public void run() {
                                    if (expressionTextEditor.isDisposed()) {
                                        return;
                                    }
                                    resizeTextEditor(expressionTextEditor, tableViewerCreator);
                                }
                            });
                        }
                    }
                };
            }
            executionLimiter.startIfExecutable();
        }
    });
    expressionTextEditor.addFocusListener(new FocusListener() {

        @Override
        public void focusGained(FocusEvent e) {
            ITableEntry currentModifiedEntry = (ITableEntry) tableViewerCreator.getModifiedObjectInfo().getCurrentModifiedBean();
            initExpressionProposals(cellEditor, zones, tableViewerCreator, currentModifiedEntry);
            resizeTextEditor(expressionTextEditor, tableViewerCreator);
            StyledTextHandler styledTextHandler = mapperManager.getUiManager().getTabFolderEditors().getStyledTextHandler();
            styledTextHandler.setCurrentEntry(currentModifiedEntry);
            //$NON-NLS-1$
            styledTextHandler.setTextWithoutNotifyListeners(currentModifiedEntry.getExpression() == null ? "" : currentModifiedEntry.getExpression());
        }

        @Override
        public void focusLost(FocusEvent e) {
            expressionEditorTextSelectionBeforeFocusLost = expressionTextEditor.getSelection();
            lastExpressionEditorTextWhichLostFocus = expressionTextEditor;
        }
    });
    column.setCellEditor(cellEditor, new CellEditorValueAdapter() {

        @Override
        public Object getCellEditorTypedValue(CellEditor cellEditor, Object originalTypedValue) {
            return super.getCellEditorTypedValue(cellEditor, originalTypedValue);
        }

        @Override
        public String getColumnText(CellEditor cellEditor, Object bean, Object cellEditorTypedValue) {
            //$NON-NLS-1$ //$NON-NLS-2$
            return super.getColumnText(cellEditor, bean, cellEditorTypedValue).replaceAll("[\r\n\t]+", " ... ");
        }

        @Override
        public Object getOriginalTypedValue(CellEditor cellEditor, Object cellEditorTypedValue) {
            return super.getOriginalTypedValue(cellEditor, cellEditorTypedValue);
        }
    });
    return cellEditor;
}
Also used : TextCellEditorWithProposal(org.talend.commons.ui.swt.proposal.TextCellEditorWithProposal) ITableEntry(org.talend.designer.abstractmap.model.tableentry.ITableEntry) StyledTextHandler(org.talend.designer.dbmap.ui.tabs.StyledTextHandler) CellEditor(org.eclipse.jface.viewers.CellEditor) TextCellEditor(org.eclipse.jface.viewers.TextCellEditor) CellEditorValueAdapter(org.talend.commons.ui.runtime.swt.tableviewer.behavior.CellEditorValueAdapter) StyledText(org.eclipse.swt.custom.StyledText) Text(org.eclipse.swt.widgets.Text) UnnotifiableColorStyledText(org.talend.commons.ui.swt.colorstyledtext.UnnotifiableColorStyledText) FocusEvent(org.eclipse.swt.events.FocusEvent) ICellEditorListener(org.eclipse.jface.viewers.ICellEditorListener) ControlListener(org.eclipse.swt.events.ControlListener) ModifiedObjectInfo(org.talend.commons.ui.runtime.swt.tableviewer.data.ModifiedObjectInfo) ExecutionLimiter(org.talend.commons.utils.threading.ExecutionLimiter) ControlEvent(org.eclipse.swt.events.ControlEvent) FocusListener(org.eclipse.swt.events.FocusListener)

Example 18 with ITableEntry

use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.

the class DataMapTableView method addTablesListeners.

/**
     * DOC amaumont Comment method "addTableForColumnsListeners".
     */
private void addTablesListeners() {
    tableViewerCreatorForColumns.addCellValueModifiedListener(new ITableCellValueModifiedListener() {

        @Override
        public void cellValueModified(TableCellValueModifiedEvent e) {
            unselectAllEntriesIfErrorDetected(e);
        }
    });
    abstractDataMapTable.getTableColumnsEntriesModel().addAfterOperationListListener(new IListenableListListener<FilterTableEntry>() {

        @Override
        public void handleEvent(ListenableListEvent<FilterTableEntry> event) {
            mapperManager.getUiManager().refreshSqlExpression();
        }
    });
    final TableViewer tableViewerForEntries = tableViewerCreatorForColumns.getTableViewer();
    tableViewerForEntries.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            int[] selectionIndices = tableViewerForEntries.getTable().getSelectionIndices();
            if (selectionIndices.length > 0) {
                selectThisDataMapTableView();
                onSelectedEntries(event.getSelection(), selectionIndices);
                // bug 18414
                MetadataTableEditorView metadataTableEditorView = null;
                if (getZone() == Zone.INPUTS) {
                    metadataTableEditorView = mapperManager.getUiManager().getInputMetaEditorView();
                } else if (getZone() == Zone.OUTPUTS) {
                    metadataTableEditorView = mapperManager.getUiManager().getOutputMetaEditorView();
                }
                if (metadataTableEditorView != null) {
                    metadataTableEditorView.getTableViewerCreator().refresh();
                }
            }
        }
    });
    tableForEntries.addListener(SWT.DragDetect, new Listener() {

        @Override
        public void handleEvent(Event event) {
            onSelectedEntries(tableViewerForEntries.getSelection(), tableViewerForEntries.getTable().getSelectionIndices());
        }
    });
    tableViewerCreatorForColumns.getSelectionHelper().addAfterSelectionListener(new ILineSelectionListener() {

        @Override
        public void handle(LineSelectionEvent e) {
            if (forceExecuteSelectionEvent) {
                forceExecuteSelectionEvent = false;
                onSelectedEntries(tableViewerForEntries.getSelection(), tableViewerForEntries.getTable().getSelectionIndices());
            }
        }
    });
    tableForEntries.addListener(SWT.KeyDown, new Listener() {

        @Override
        public void handleEvent(Event event) {
            processEnterKeyDown(tableViewerCreatorForColumns, event);
        }
    });
    abstractDataMapTable.getTableColumnsEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<IColumnEntry>() {

        @Override
        public void handleEvent(ModifiedBeanEvent<IColumnEntry> event) {
            TableViewerCreator tableViewerCreator = tableViewerCreatorForColumns;
            ITableEntry tableEntry = event.bean;
            parseExpressionIfNeeded(event, tableViewerCreator, tableEntry);
            mapperManager.getUiManager().refreshSqlExpression();
        }
    });
    if (abstractDataMapTable instanceof OutputTable) {
        OutputTable outputTable = (OutputTable) abstractDataMapTable;
        outputTable.getWhereTableFiltersEntriesModel().addAfterOperationListListener(new IListenableListListener<FilterTableEntry>() {

            @Override
            public void handleEvent(ListenableListEvent<FilterTableEntry> event) {
                resizeAtExpandedSize();
                mapperManager.getUiManager().refreshSqlExpression();
            }
        });
        outputTable.getWhereTableFiltersEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<FilterTableEntry>() {

            @Override
            public void handleEvent(ModifiedBeanEvent<FilterTableEntry> event) {
                onOutputTableFiltersModified(event, extendedTableViewerForFilters);
                mapperManager.getUiManager().refreshSqlExpression();
            }
        });
        outputTable.getOtherTableFiltersEntriesModel().addAfterOperationListListener(new IListenableListListener<FilterTableEntry>() {

            @Override
            public void handleEvent(ListenableListEvent<FilterTableEntry> event) {
                resizeAtExpandedSize();
                mapperManager.getUiManager().refreshSqlExpression();
            }
        });
        outputTable.getOtherTableFiltersEntriesModel().addModifiedBeanListener(new IModifiedBeanListener<FilterTableEntry>() {

            @Override
            public void handleEvent(ModifiedBeanEvent<FilterTableEntry> event) {
                onOutputTableFiltersModified(event, entendedTableViewerForOtherClauses);
                mapperManager.getUiManager().refreshSqlExpression();
            }
        });
    }
}
Also used : SelectionListener(org.eclipse.swt.events.SelectionListener) ControlListener(org.eclipse.swt.events.ControlListener) Listener(org.eclipse.swt.widgets.Listener) ModifyListener(org.eclipse.swt.events.ModifyListener) DisposeListener(org.eclipse.swt.events.DisposeListener) ITableCellValueModifiedListener(org.talend.commons.ui.runtime.swt.tableviewer.behavior.ITableCellValueModifiedListener) IModifiedBeanListener(org.talend.commons.ui.swt.tableviewer.IModifiedBeanListener) ICellEditorListener(org.eclipse.jface.viewers.ICellEditorListener) MouseListener(org.eclipse.swt.events.MouseListener) MouseTrackListener(org.eclipse.swt.events.MouseTrackListener) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) IListenableListListener(org.talend.commons.utils.data.list.IListenableListListener) FocusListener(org.eclipse.swt.events.FocusListener) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) KeyListener(org.eclipse.swt.events.KeyListener) TableViewerCreator(org.talend.commons.ui.swt.tableviewer.TableViewerCreator) ITableEntry(org.talend.designer.abstractmap.model.tableentry.ITableEntry) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) FilterTableEntry(org.talend.designer.dbmap.model.tableentry.FilterTableEntry) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) TableCellValueModifiedEvent(org.talend.commons.ui.runtime.swt.tableviewer.behavior.TableCellValueModifiedEvent) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) IColumnEntry(org.talend.designer.abstractmap.model.tableentry.IColumnEntry) ITableCellValueModifiedListener(org.talend.commons.ui.runtime.swt.tableviewer.behavior.ITableCellValueModifiedListener) OutputTable(org.talend.designer.dbmap.model.table.OutputTable) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) FocusEvent(org.eclipse.swt.events.FocusEvent) KeyEvent(org.eclipse.swt.events.KeyEvent) MouseEvent(org.eclipse.swt.events.MouseEvent) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) ControlEvent(org.eclipse.swt.events.ControlEvent) ModifiedBeanEvent(org.talend.commons.ui.swt.tableviewer.ModifiedBeanEvent) DisposeEvent(org.eclipse.swt.events.DisposeEvent) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ListenableListEvent(org.talend.commons.utils.data.list.ListenableListEvent) TableCellValueModifiedEvent(org.talend.commons.ui.runtime.swt.tableviewer.behavior.TableCellValueModifiedEvent) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) TableViewer(org.eclipse.jface.viewers.TableViewer) AbstractExtendedTableViewer(org.talend.commons.ui.swt.extended.table.AbstractExtendedTableViewer) MetadataTableEditorView(org.talend.core.ui.metadata.editor.MetadataTableEditorView)

Example 19 with ITableEntry

use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.

the class DataMapTableView method onOutputTableFiltersModified.

protected void onOutputTableFiltersModified(ModifiedBeanEvent<FilterTableEntry> event, AbstractExtendedTableViewer<FilterTableEntry> _extendedTableViewerForFilters) {
    TableViewerCreator tableViewerCreator = _extendedTableViewerForFilters.getTableViewerCreator();
    ITableEntry tableEntry = event.bean;
    parseExpressionIfNeeded(event, tableViewerCreator, tableEntry);
}
Also used : TableViewerCreator(org.talend.commons.ui.swt.tableviewer.TableViewerCreator) ITableEntry(org.talend.designer.abstractmap.model.tableentry.ITableEntry)

Example 20 with ITableEntry

use of org.talend.designer.abstractmap.model.tableentry.ITableEntry in project tdi-studio-se by Talend.

the class DataMapTableView method attachCellExpressionToStyledTextEditor.

/**
     * DOC amaumont Comment method "attachCellExpressionToStyledTextEditor".
     * 
     * @param tableViewerCreator TODO
     * @param styledTextHandler
     * @param expressionEditorText2
     */
protected void attachCellExpressionToStyledTextEditor(final TableViewerCreator tableViewerCreator, final Text expressionTextEditor, final StyledTextHandler styledTextHandler) {
    expressionTextEditor.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            ITableEntry currentModifiedEntry = (ITableEntry) tableViewerCreator.getModifiedObjectInfo().getCurrentModifiedBean();
            styledTextHandler.setCurrentEntry(currentModifiedEntry);
            Text text = (Text) e.widget;
            if (Math.abs(text.getText().length() - styledTextHandler.getStyledText().getText().length()) > 1) {
                styledTextHandler.setTextWithoutNotifyListeners(text.getText());
            // highlightLineAndSetSelectionOfStyledText(expressionTextEditor);
            }
        }
    });
    expressionTextEditor.addKeyListener(new KeyListener() {

        /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.swt.events.KeyListener#keyPressed(org.eclipse.swt.events.KeyEvent)
             */
        @Override
        public void keyPressed(KeyEvent e) {
            // System.out.println("e.character=" + e.character);
            // System.out.println("keyCode=" + e.keyCode);
            boolean ctrl = (e.stateMask & SWT.CTRL) != 0;
            boolean altgr = (e.stateMask & SWT.ALT) != 0;
            if (e.character == '\0' || ctrl && !altgr) {
                highlightLineAndSetSelectionOfStyledText(expressionTextEditor);
            } else {
                UnnotifiableColorStyledText mapperColorStyledText = (UnnotifiableColorStyledText) styledTextHandler.getStyledText();
                Point selection = expressionTextEditor.getSelection();
                if (e.character == '\r' || e.character == '') {
                    e.doit = false;
                    styledTextHandler.setTextWithoutNotifyListeners(expressionTextEditor.getText());
                    highlightLineAndSetSelectionOfStyledText(expressionTextEditor);
                } else {
                    if (e.character == SWT.BS || e.character == SWT.DEL) {
                        if (selection.x == selection.y) {
                            if (e.character == SWT.BS) {
                                if (selection.x - 1 > 0 && mapperColorStyledText.getText().length() > selection.x - 1) {
                                    char previousChar = mapperColorStyledText.getText().charAt(selection.x - 1);
                                    if (previousChar == '\n') {
                                        //$NON-NLS-1$
                                        mapperColorStyledText.replaceTextRangeWithoutNotifyListeners(selection.x - 2, 2, "");
                                    } else {
                                        //$NON-NLS-1$
                                        mapperColorStyledText.replaceTextRangeWithoutNotifyListeners(selection.x - 1, 1, "");
                                    }
                                }
                            } else {
                                if (selection.x < mapperColorStyledText.getText().length()) {
                                    char nextChar = mapperColorStyledText.getText().charAt(selection.x);
                                    if (nextChar == '\r') {
                                        //$NON-NLS-1$
                                        mapperColorStyledText.replaceTextRangeWithoutNotifyListeners(selection.x, 2, "");
                                    } else {
                                        //$NON-NLS-1$
                                        mapperColorStyledText.replaceTextRangeWithoutNotifyListeners(selection.x, 1, "");
                                    }
                                }
                            }
                        } else {
                            if (selection.y <= mapperColorStyledText.getCharCount()) {
                                mapperColorStyledText.replaceTextRangeWithoutNotifyListeners(selection.x, selection.y - selection.x, //$NON-NLS-1$
                                "");
                            }
                            highlightLineAndSetSelectionOfStyledText(expressionTextEditor);
                        }
                    } else {
                        // System.out.println("mapperColorStyledText.getText()="+mapperColorStyledText.getText().length());
                        if (selection.y <= mapperColorStyledText.getCharCount()) {
                            mapperColorStyledText.replaceTextRangeWithoutNotifyListeners(selection.x, selection.y - selection.x, String.valueOf(e.character));
                        }
                        highlightLineAndSetSelectionOfStyledText(expressionTextEditor);
                    }
                }
            }
        }

        @Override
        public void keyReleased(KeyEvent e) {
        // highlightLineOfCursorPosition();
        }
    });
    expressionTextEditor.addMouseListener(new MouseListener() {

        @Override
        public void mouseDoubleClick(MouseEvent e) {
            highlightLineAndSetSelectionOfStyledText(expressionTextEditor);
        }

        @Override
        public void mouseDown(MouseEvent e) {
            highlightLineAndSetSelectionOfStyledText(expressionTextEditor);
        }

        @Override
        public void mouseUp(MouseEvent e) {
        }
    });
}
Also used : KeyEvent(org.eclipse.swt.events.KeyEvent) ModifyEvent(org.eclipse.swt.events.ModifyEvent) MouseListener(org.eclipse.swt.events.MouseListener) MouseEvent(org.eclipse.swt.events.MouseEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) ITableEntry(org.talend.designer.abstractmap.model.tableentry.ITableEntry) StyledText(org.eclipse.swt.custom.StyledText) Text(org.eclipse.swt.widgets.Text) UnnotifiableColorStyledText(org.talend.commons.ui.swt.colorstyledtext.UnnotifiableColorStyledText) KeyListener(org.eclipse.swt.events.KeyListener) UnnotifiableColorStyledText(org.talend.commons.ui.swt.colorstyledtext.UnnotifiableColorStyledText) Point(org.eclipse.swt.graphics.Point)

Aggregations

ITableEntry (org.talend.designer.abstractmap.model.tableentry.ITableEntry)59 ArrayList (java.util.ArrayList)14 IColumnEntry (org.talend.designer.abstractmap.model.tableentry.IColumnEntry)14 Point (org.eclipse.swt.graphics.Point)12 TableViewerCreator (org.talend.commons.ui.swt.tableviewer.TableViewerCreator)11 IMapperLink (org.talend.designer.abstractmap.ui.visualmap.link.IMapperLink)11 List (java.util.List)9 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)9 DataMapTableView (org.talend.designer.mapper.ui.visualmap.table.DataMapTableView)9 TableViewer (org.eclipse.jface.viewers.TableViewer)7 FilterTableEntry (org.talend.designer.dbmap.model.tableentry.FilterTableEntry)7 DataMapTableView (org.talend.designer.dbmap.ui.visualmap.table.DataMapTableView)7 HashMap (java.util.HashMap)6 MetadataTableEditorView (org.talend.core.ui.metadata.editor.MetadataTableEditorView)6 AbstractUIManager (org.talend.designer.abstractmap.managers.AbstractUIManager)6 IDataMapTable (org.talend.designer.abstractmap.model.table.IDataMapTable)6 TableEntryLocation (org.talend.designer.dbmap.model.tableentry.TableEntryLocation)6 Zone (org.talend.designer.mapper.ui.visualmap.zone.Zone)6 HashSet (java.util.HashSet)5 Iterator (java.util.Iterator)4