Search in sources :

Example 26 with Table

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

the class DropContextAnalyzer method init.

/**
     * DOC amaumont Comment method "init".
     */
private void init() {
    DropTarget dropTarget = (DropTarget) event.widget;
    Control controlTarget = dropTarget.getControl();
    dataMapTableViewTarget = mapperManager.retrieveDataMapTableView(controlTarget);
    if (controlTarget instanceof Table) {
        currentTableTarget = (Table) dropTarget.getControl();
    } else if (controlTarget instanceof StyledText) {
        currentStyledTextTarget = (StyledText) dropTarget.getControl();
    } else {
        //$NON-NLS-1$
        throw new IllegalArgumentException(Messages.getString("DropContextAnalyzer.0", controlTarget.toString()));
    }
    zoneTarget = dataMapTableViewTarget.getZone();
    draggedData = TableEntriesTransfer.getInstance().getDraggedData();
    dataMapTableViewSource = (DataMapTableView) draggedData.getDataMapTableViewSource();
    tableItemSource = draggedData.getTableItemSource();
    zoneSource = dataMapTableViewSource.getZone();
    if (currentTableTarget != null) {
        analyzeCursorOverExpressionCell();
    }
    invalidKeyPressed = hasInvalidKeyPressed();
    isDropValid = checkDropIsValid();
    analyzeForFeedback();
    analyzeForDetail();
// System.out.println("isCursorOverExpressionCell="+isCursorOverExpressionCell);
}
Also used : Control(org.eclipse.swt.widgets.Control) IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) Table(org.eclipse.swt.widgets.Table) InputTable(org.talend.designer.mapper.model.table.InputTable) OutputTable(org.talend.designer.mapper.model.table.OutputTable) StyledText(org.eclipse.swt.custom.StyledText) DropTarget(org.eclipse.swt.dnd.DropTarget)

Example 27 with Table

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

the class DropContextAnalyzer method dropVarsEntryIsValid.

private boolean dropVarsEntryIsValid(TableItem tableItemTarget) {
    Table table = tableItemTarget.getParent();
    TableItem[] tableItems = table.getItems();
    for (TableItem tableItem : tableItems) {
        if (tableItemTarget == tableItem) {
            break;
        }
        if (tableItemSource == tableItem) {
            return true;
        }
    }
    return false;
}
Also used : IDataMapTable(org.talend.designer.abstractmap.model.table.IDataMapTable) Table(org.eclipse.swt.widgets.Table) InputTable(org.talend.designer.mapper.model.table.InputTable) OutputTable(org.talend.designer.mapper.model.table.OutputTable) TableItem(org.eclipse.swt.widgets.TableItem)

Example 28 with Table

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

the class JobVMArgumentsComposite method getTableControl.

/**
     * Returns this field editor's list control.
     * 
     * @param parent the parent control
     * @return the list control
     */
protected TableViewer getTableControl(Composite parent) {
    if (viewer == null) {
        Table table = createTable(parent);
        viewer = new TableViewer(table);
        viewer.setContentProvider(createContentProvider());
        viewer.setLabelProvider(createLabelProvider());
        table.setFont(parent.getFont());
        viewer.addSelectionChangedListener(new ISelectionChangedListener() {

            @Override
            public void selectionChanged(SelectionChangedEvent event) {
                JobVMArgumentsComposite.this.selectionChanged();
            }
        });
        viewer.addDoubleClickListener(new IDoubleClickListener() {

            @Override
            public void doubleClick(DoubleClickEvent event) {
                editItem(event.getSelection());
            }
        });
    }
    // doLoadDefault();
    return viewer;
}
Also used : Table(org.eclipse.swt.widgets.Table) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 29 with Table

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

the class OperationsTab method configureTable.

/**
     * Configure the table adding columns.
     */
private void configureTable() {
    Table table = tableViewer.getTable();
    if (table.isDisposed()) {
        return;
    }
    table.setLinesVisible(true);
    table.setHeaderVisible(true);
    TableColumn column = new TableColumn(table, SWT.NONE);
    column.setText(Messages.operationColumnLabel);
    column.setWidth(300);
    column.setToolTipText(Messages.operationColumnToolTip);
}
Also used : Table(org.eclipse.swt.widgets.Table) TableColumn(org.eclipse.swt.widgets.TableColumn)

Example 30 with Table

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

the class JSONToXPathLinker method initFieldsListeners.

/**
     * DOC amaumont Comment method "initListeners".
     */
private void initFieldsListeners() {
    JSONExtractorFieldModel schemaModel = this.fieldsTableEditorView.getModel();
    final Table fieldsTable = this.fieldsTableEditorView.getTable();
    schemaModelModifiedBeanListener = new IModifiedBeanListener<SchemaTarget>() {

        @Override
        public void handleEvent(ModifiedBeanEvent<SchemaTarget> event) {
            handleModifiedBeanEvent(event);
        }

        private void handleModifiedBeanEvent(ModifiedBeanEvent<SchemaTarget> event) {
            if (event.column == fieldsTableEditorView.getXPathColumn()) {
                onXPathValueChanged(fieldsTable, (String) event.newValue, event.index);
            }
        }
    };
    schemaModel.addModifiedBeanListener(schemaModelModifiedBeanListener);
    schemaModelBeforeListenableListListener = new IListenableListListener<SchemaTarget>() {

        @Override
        public void handleEvent(ListenableListEvent<SchemaTarget> event) {
            handleListenableListBeforeTableViewerRefreshedEvent(event);
        }
    };
    schemaModel.addBeforeOperationListListener(-50, schemaModelBeforeListenableListListener);
    schemaModelAfterListenableListListener = new IListenableListListener<SchemaTarget>() {

        @Override
        public void handleEvent(ListenableListEvent<SchemaTarget> event) {
            handleListenableListAfterTableViewerRefreshedEvent(event);
        }
    };
    schemaModel.addAfterOperationListListener(schemaModelAfterListenableListListener);
    SelectionHelper selectionHelper = this.fieldsTableEditorView.getTableViewerCreator().getSelectionHelper();
    fieldsTableLineSelectionListener = new ILineSelectionListener() {

        @Override
        public void handle(LineSelectionEvent e) {
            updateLinksStyleAndControlsSelection(e.source.getTable(), true);
        }
    };
    selectionHelper.addAfterSelectionListener(fieldsTableLineSelectionListener);
}
Also used : LineSelectionEvent(org.talend.commons.ui.runtime.swt.tableviewer.selection.LineSelectionEvent) Table(org.eclipse.swt.widgets.Table) SelectionHelper(org.talend.commons.ui.runtime.swt.tableviewer.selection.SelectionHelper) ILineSelectionListener(org.talend.commons.ui.runtime.swt.tableviewer.selection.ILineSelectionListener) SchemaTarget(org.talend.repository.model.json.SchemaTarget)

Aggregations

Table (org.eclipse.swt.widgets.Table)770 GridData (org.eclipse.swt.layout.GridData)368 Composite (org.eclipse.swt.widgets.Composite)325 TableColumn (org.eclipse.swt.widgets.TableColumn)324 TableViewer (org.eclipse.jface.viewers.TableViewer)303 GridLayout (org.eclipse.swt.layout.GridLayout)255 TableItem (org.eclipse.swt.widgets.TableItem)210 SelectionEvent (org.eclipse.swt.events.SelectionEvent)204 Label (org.eclipse.swt.widgets.Label)179 Button (org.eclipse.swt.widgets.Button)161 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)145 Point (org.eclipse.swt.graphics.Point)138 Text (org.eclipse.swt.widgets.Text)102 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)96 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)95 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)89 FillLayout (org.eclipse.swt.layout.FillLayout)87 Shell (org.eclipse.swt.widgets.Shell)82 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)81 Event (org.eclipse.swt.widgets.Event)80