Search in sources :

Example 1 with InputTablesZoneView

use of org.talend.designer.mapper.ui.visualmap.zone.scrollable.InputTablesZoneView in project tdi-studio-se by Talend.

the class MapperUI method createInputZoneWithTables.

private void createInputZoneWithTables(MapperModel mapperModel, final Display display) {
    inputsZone = new InputsZone(datasFlowViewSashForm, SWT.NONE, mapperManager);
    inputsZone.createHeaderZoneComponents();
    sc1 = new ScrolledComposite(inputsZone, getBorder() | SWT.H_SCROLL | SWT.V_SCROLL);
    // this.dropTargetOperationListener.addControl(sc1);
    GridData sc1GridData = new GridData(GridData.FILL_BOTH);
    sc1.setLayoutData(sc1GridData);
    sc1.setBackgroundMode(SWT.INHERIT_DEFAULT);
    sc1.addControlListener(new ControlListener() {

        public void controlMoved(ControlEvent e) {
        // System.out.println("sc1 controlMoved");
        }

        public void controlResized(ControlEvent e) {
            // System.out.println("sc1 controlResized");
            onSashResized(display);
        }
    });
    // add for auto scroll
    new DragNDrop(mapperManager, sc1, true, true);
    inputTablesZoneView = new InputTablesZoneView(sc1, getBorder(), mapperManager);
    // this.dropTargetOperationListener.addControl(inputTablesZoneView);
    inputTablesZoneView.setBackgroundMode(SWT.INHERIT_DEFAULT);
    sc1.setExpandHorizontal(true);
    sc1.setContent(inputTablesZoneView);
    sc1MSListener = new MouseScrolledListener(mapperManager.getUiManager(), sc1);
    inputTablesZoneView.initInsertionIndicator();
    Control previousControl = null;
    List<InputTable> tables = mapperModel.getInputDataMapTables();
    Boolean minimizeStateOfTables = getMinimizedButtonState(tables);
    if (minimizeStateOfTables != null) {
        inputsZone.getToolbar().setMinimizeButtonState(minimizeStateOfTables.booleanValue());
    }
    for (InputTable inputTable : tables) {
        InputDataMapTableView dataMapTableView = new InputDataMapTableView(inputTablesZoneView, SWT.BORDER, inputTable, mapperManager);
        FormData formData = new FormData();
        formData.left = new FormAttachment(0, 0);
        formData.right = new FormAttachment(100, 0);
        formData.top = new FormAttachment(previousControl);
        dataMapTableView.setLayoutData(formData);
        previousControl = dataMapTableView;
        boolean tableIsMinimized = inputTable.isMinimized();
        dataMapTableView.minimizeTable(tableIsMinimized);
        dataMapTableView.registerStyledExpressionEditor(getTabFolderEditors().getStyledTextHandler());
        dataMapTableView.loaded();
    // dataMapTableView.fillMinimumSize(false);
    }
    inputTablesZoneView.setSize(inputTablesZoneView.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    sc1MSListener.addMouseWheelListener(sc1);
}
Also used : FormData(org.eclipse.swt.layout.FormData) InputDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.InputDataMapTableView) MouseScrolledListener(org.talend.designer.abstractmap.ui.listener.MouseScrolledListener) InputTable(org.talend.designer.mapper.model.table.InputTable) Control(org.eclipse.swt.widgets.Control) InputsZone(org.talend.designer.mapper.ui.visualmap.zone.InputsZone) DragNDrop(org.talend.designer.mapper.ui.dnd.DragNDrop) InputTablesZoneView(org.talend.designer.mapper.ui.visualmap.zone.scrollable.InputTablesZoneView) GridData(org.eclipse.swt.layout.GridData) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ControlListener(org.eclipse.swt.events.ControlListener) ControlEvent(org.eclipse.swt.events.ControlEvent) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)1 ControlEvent (org.eclipse.swt.events.ControlEvent)1 ControlListener (org.eclipse.swt.events.ControlListener)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 GridData (org.eclipse.swt.layout.GridData)1 Control (org.eclipse.swt.widgets.Control)1 MouseScrolledListener (org.talend.designer.abstractmap.ui.listener.MouseScrolledListener)1 InputTable (org.talend.designer.mapper.model.table.InputTable)1 DragNDrop (org.talend.designer.mapper.ui.dnd.DragNDrop)1 InputDataMapTableView (org.talend.designer.mapper.ui.visualmap.table.InputDataMapTableView)1 InputsZone (org.talend.designer.mapper.ui.visualmap.zone.InputsZone)1 InputTablesZoneView (org.talend.designer.mapper.ui.visualmap.zone.scrollable.InputTablesZoneView)1