Search in sources :

Example 21 with Listener

use of org.eclipse.swt.widgets.Listener in project tdi-studio-se by Talend.

the class DataMapTableView method addListeners.

/**
     * DOC amaumont Comment method "addListeners".
     */
protected void addListeners() {
    final UIManager uiManager = mapperManager.getUiManager();
    MouseTrackListener mouseTracker = new MouseTrackListener() {

        @Override
        public void mouseEnter(MouseEvent e) {
        }

        @Override
        public void mouseExit(MouseEvent e) {
            setDefaultCursor();
            resizeHelper.stopDrag();
        }

        @Override
        public void mouseHover(MouseEvent e) {
        }
    };
    this.addMouseTrackListener(mouseTracker);
    SelectionListener scrollListener = new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            uiManager.refreshBackground(true, false);
        }
    };
    tableForEntries.getVerticalBar().addSelectionListener(scrollListener);
    // /////////////////////////////////////////////////////////////////
    addManualTableResizeListeners(uiManager);
    // /////////////////////////////////////////////////////////////////
    // /////////////////////////////////////////////////////////////////
    Listener onSelectDataMapTableViewListener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            switch(event.type) {
                case SWT.MouseDown:
                    onSelectDataMapTableView();
                    break;
                default:
            }
        }
    };
    this.addListener(SWT.MouseDown, onSelectDataMapTableViewListener);
    headerComposite.addListener(SWT.MouseDown, onSelectDataMapTableViewListener);
    nameLabel.addListener(SWT.MouseDown, onSelectDataMapTableViewListener);
    // /////////////////////////////////////////////////////////////////
    // /////////////////////////////////////////////////////////////////
    minimizeButton.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
        // TODO Auto-generated method stub
        }

        @Override
        public void widgetSelected(SelectionEvent e) {
            minimizeTable(!abstractDataMapTable.isMinimized());
        }
    });
    // /////////////////////////////////////////////////////////////////
    initShowMessageErrorListener(tableForEntries);
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) 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) MouseTrackListener(org.eclipse.swt.events.MouseTrackListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) UIManager(org.talend.designer.dbmap.managers.UIManager) 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) SelectionListener(org.eclipse.swt.events.SelectionListener) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener)

Example 22 with Listener

use of org.eclipse.swt.widgets.Listener 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 23 with Listener

use of org.eclipse.swt.widgets.Listener in project tdi-studio-se by Talend.

the class DataMapTableView method addManualTableResizeListeners.

/**
     * DOC amaumont Comment method "addManualTableResizeListeners".
     * 
     * @param uiManager
     */
private void addManualTableResizeListeners(final UIManager uiManager) {
    this.addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            if (currentCursor != null) {
                currentCursor.dispose();
            }
        }
    });
    Listener tableResizerListener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            MousePositionAnalyser mpa = new MousePositionAnalyser(DataMapTableView.this);
            Point eventPoint = new Point(event.x, event.y);
            boolean leftMouseButton = (event.stateMask & SWT.BUTTON1) != 0 || event.button == 1;
            switch(event.type) {
                case SWT.MouseMove:
                    if (resizeHelper.isDragging()) {
                        Point newPoint = convertToParentOrigin(DataMapTableView.this, eventPoint);
                        Point dragPoint = resizeHelper.getLastDragPoint();
                        Point diff = new Point(newPoint.x - dragPoint.x, newPoint.y - dragPoint.y);
                        if (mpa.isOnLeftBorder(eventPoint)) {
                            diff.x *= -1;
                        }
                        Rectangle rect = DataMapTableView.this.getClientArea();
                        rect.width += 2 * DataMapTableView.this.getBorderWidth();
                        rect.height += 2 * DataMapTableView.this.getBorderWidth();
                        RESIZE_MODE currentMode = resizeHelper.getCurrentMode();
                        int newWidth = (currentMode == RESIZE_MODE.HORIZONTAL || currentMode == RESIZE_MODE.BOTH) ? rect.width + diff.x * 2 : rect.width;
                        int newHeight = (currentMode == RESIZE_MODE.VERTICAL || currentMode == RESIZE_MODE.BOTH) ? rect.height + diff.y : rect.height;
                        if (newHeight < MINIMUM_HEIGHT + OFFSET_HEIGHT_TRIGGER && diff.y < 0) {
                            changeMinimizeState(true);
                            newHeight = MINIMUM_HEIGHT;
                        } else if (newHeight > MINIMUM_HEIGHT + OFFSET_HEIGHT_TRIGGER && diff.y > 0) {
                            changeMinimizeState(false);
                        }
                        changeSize(new Point(newWidth, newHeight), false, true);
                        resizeHelper.setLastDragPoint(newPoint);
                    } else if (!resizeHelper.isDragging()) {
                        Cursor cursor = null;
                        if (mpa.isOnLeftBottomCorner(eventPoint)) {
                        // cursor = new Cursor(dataMapTableView.getDisplay(), org.eclipse.swt.SWT.CURSOR_SIZESW);
                        // resizeHelper.setCurrentMode(RESIZE_MODE.BOTH);
                        } else if (mpa.isOnRightBottomCorner(eventPoint)) {
                        // cursor = new Cursor(dataMapTableView.getDisplay(), org.eclipse.swt.SWT.CURSOR_SIZESE);
                        // resizeHelper.setCurrentMode(RESIZE_MODE.BOTH);
                        } else if (mpa.isOnLeftBorder(eventPoint)) {
                        // cursor = new Cursor(dataMapTableView.getDisplay(), org.eclipse.swt.SWT.CURSOR_SIZEE);
                        // resizeHelper.setCurrentMode(RESIZE_MODE.HORIZONTAL);
                        } else if (mpa.isOnRightBorder(eventPoint)) {
                        // cursor = new Cursor(dataMapTableView.getDisplay(), org.eclipse.swt.SWT.CURSOR_SIZEW);
                        // resizeHelper.setCurrentMode(RESIZE_MODE.HORIZONTAL);
                        } else if (mpa.isOnBottomBorder(eventPoint)) {
                            cursor = new Cursor(DataMapTableView.this.getDisplay(), org.eclipse.swt.SWT.CURSOR_SIZES);
                            resizeHelper.setCurrentMode(RESIZE_MODE.VERTICAL);
                        }
                        if (cursor != null) {
                            DataMapTableView.this.setCursor(cursor);
                        } else {
                            setDefaultCursor();
                            resizeHelper.setCurrentMode(RESIZE_MODE.NONE);
                        }
                    }
                    break;
                case SWT.MouseDown:
                    if (leftMouseButton) {
                        if (mpa.isOnLeftBorder(eventPoint) || mpa.isOnRightBorder(eventPoint) || mpa.isOnBottomBorder(eventPoint)) {
                            resizeHelper.startDrag(convertToParentOrigin(DataMapTableView.this, new Point(event.x, event.y)));
                        } else {
                            setDefaultCursor();
                        }
                        parentLayout = DataMapTableView.this.getParent().getLayout();
                        DataMapTableView.this.getParent().setLayout(null);
                    }
                    break;
                case SWT.MouseUp:
                    if (leftMouseButton) {
                        resizeHelper.stopDrag();
                        // gridData = (GridData) dataMapTableView.getLayoutData();
                        // gridData.exclude = false;
                        DataMapTableView.this.getParent().setLayout(parentLayout);
                        DataMapTableView.this.getParent().layout();
                        uiManager.resizeTablesZoneViewAtComputedSize(getZone());
                        uiManager.refreshBackground(true, false);
                    }
                    break;
                case SWT.MouseExit:
                    setDefaultCursor();
                    break;
                default:
            }
        }
    };
    this.addListener(SWT.MouseMove, tableResizerListener);
    this.addListener(SWT.MouseDown, tableResizerListener);
    this.addListener(SWT.MouseUp, tableResizerListener);
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) 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) Rectangle(org.eclipse.swt.graphics.Rectangle) 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) MousePositionAnalyser(org.talend.designer.dbmap.ui.event.MousePositionAnalyser) Point(org.eclipse.swt.graphics.Point) DisposeEvent(org.eclipse.swt.events.DisposeEvent) Cursor(org.eclipse.swt.graphics.Cursor) RESIZE_MODE(org.talend.designer.dbmap.ui.event.ResizeHelper.RESIZE_MODE) Point(org.eclipse.swt.graphics.Point)

Example 24 with Listener

use of org.eclipse.swt.widgets.Listener in project tdi-studio-se by Talend.

the class InsertionIndicator method addListeners.

/**
     * DOC amaumont Comment method "addListeners".
     */
private void addListeners() {
    Listener paintListener = new Listener() {

        public void handleEvent(Event event) {
            Composite composite = (Composite) event.widget;
            Rectangle bounds = composite.getBounds();
            // //////////////////////////////////////////////////////////
            // draw image filled with transparent pixels
            RGB transparentColor = new RGB(0, 255, 0);
            PaletteData paletteData = new PaletteData(new RGB[] { transparentColor });
            ImageData imageData = new ImageData(bounds.width, bounds.height, 1, paletteData);
            int transparentPixelValue = imageData.palette.getPixel(transparentColor);
            imageData.transparentPixel = transparentPixelValue;
            GC gc = event.gc;
            final Image image = new Image(gc.getDevice(), imageData);
            gc.drawImage(image, 0, 0);
            image.dispose();
            // ////////////////////////////////////////////////////////////////////////////
            // //////////////////////////////////////////////////////////
            // draw left arrow
            int yCenter = bounds.height / 2;
            int widthExternalArrow = 10;
            gc.setBackground(colorIndicator);
            gc.setForeground(colorIndicator);
            if (composite == leftArrowDraggingIndicator) {
                // external left arrow
                Point leftCrossPoint = new Point(widthExternalArrow, yCenter);
                gc.fillPolygon(new int[] { 0, 0, leftCrossPoint.x, leftCrossPoint.y, 0, bounds.height });
                gc.drawLine(leftCrossPoint.x, leftCrossPoint.y, bounds.width, leftCrossPoint.y);
            } else {
                // external right arrow
                Point rightCrossPoint = new Point(bounds.width - widthExternalArrow, yCenter);
                gc.fillPolygon(new int[] { bounds.width, 0, rightCrossPoint.x, rightCrossPoint.y, bounds.width, bounds.height });
                gc.drawLine(rightCrossPoint.x, rightCrossPoint.y, -bounds.width, rightCrossPoint.y);
            }
        }
    };
    leftArrowDraggingIndicator.addListener(SWT.Paint, paintListener);
    rightArrowDraggingIndicator.addListener(SWT.Paint, paintListener);
}
Also used : PaletteData(org.eclipse.swt.graphics.PaletteData) Listener(org.eclipse.swt.widgets.Listener) Composite(org.eclipse.swt.widgets.Composite) ImageData(org.eclipse.swt.graphics.ImageData) Rectangle(org.eclipse.swt.graphics.Rectangle) Event(org.eclipse.swt.widgets.Event) Point(org.eclipse.swt.graphics.Point) RGB(org.eclipse.swt.graphics.RGB) GC(org.eclipse.swt.graphics.GC) Image(org.eclipse.swt.graphics.Image) Point(org.eclipse.swt.graphics.Point)

Example 25 with Listener

use of org.eclipse.swt.widgets.Listener in project tdi-studio-se by Talend.

the class TabFolderEditors method createComponents.

/**
     * qzhang Comment method "createComponents".
     */
private void createComponents() {
    CTabItem item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.FunParamTab.TitleText"));
    inOutMetaEditorContainer = new SashForm(tabFolderEditors, SWT.SMOOTH | SWT.HORIZONTAL | SWT.SHADOW_OUT);
    inOutMetaEditorContainer.setLayout(new RowLayout(SWT.HORIZONTAL));
    item.setControl(inOutMetaEditorContainer);
    createTableView();
    item = new CTabItem(tabFolderEditors, SWT.BORDER);
    //$NON-NLS-1$
    item.setText(Messages.getString("TabFolderEditors.PreviewTab.TitleText"));
    Composite composite = new Composite(tabFolderEditors, SWT.BORDER);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 1;
    composite.setLayout(gridLayout);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    createPreview(composite, 700, 210);
    item.setControl(composite);
    tabFolderEditors.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event event) {
            lastSelectedTab = tabFolderEditors.getSelectionIndex();
        }
    });
    tabFolderEditors.setSelection(0);
}
Also used : SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Listener(org.eclipse.swt.widgets.Listener) Composite(org.eclipse.swt.widgets.Composite) RowLayout(org.eclipse.swt.layout.RowLayout) GridData(org.eclipse.swt.layout.GridData) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) CTabItem(org.eclipse.swt.custom.CTabItem)

Aggregations

Listener (org.eclipse.swt.widgets.Listener)876 Event (org.eclipse.swt.widgets.Event)841 SelectionEvent (org.eclipse.swt.events.SelectionEvent)538 Button (org.eclipse.swt.widgets.Button)480 Label (org.eclipse.swt.widgets.Label)452 Text (org.eclipse.swt.widgets.Text)392 ModifyListener (org.eclipse.swt.events.ModifyListener)385 Shell (org.eclipse.swt.widgets.Shell)385 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)382 ModifyEvent (org.eclipse.swt.events.ModifyEvent)376 FormData (org.eclipse.swt.layout.FormData)356 ShellEvent (org.eclipse.swt.events.ShellEvent)354 FormAttachment (org.eclipse.swt.layout.FormAttachment)353 FormLayout (org.eclipse.swt.layout.FormLayout)353 Display (org.eclipse.swt.widgets.Display)342 ShellAdapter (org.eclipse.swt.events.ShellAdapter)325 Composite (org.eclipse.swt.widgets.Composite)295 GridData (org.eclipse.swt.layout.GridData)229 GridLayout (org.eclipse.swt.layout.GridLayout)195 TextVar (org.pentaho.di.ui.core.widget.TextVar)184