Search in sources :

Example 56 with Control

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

the class WidgetFactory method adapt.

@Override
public void adapt(Composite composite) {
    composite.setBackground(getColors().getBackground());
    MouseAdapter listener = new MouseAdapter() {

        public void mouseDown(MouseEvent e) {
            Control control = (Control) e.widget;
            if (control instanceof Composite) {
                Composite parent = (Composite) control;
                setChildFocus(parent);
            } else {
                control.setFocus();
            }
        }
    };
    composite.addMouseListener(listener);
    composite.getParent().addMouseListener(listener);
    composite.setMenu(composite.getParent().getMenu());
}
Also used : Control(org.eclipse.swt.widgets.Control) MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) MouseAdapter(org.eclipse.swt.events.MouseAdapter)

Example 57 with Control

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

the class StatsAndLogsView method createEmptyPartControl.

/**
     * Creates a empty composite if no job opened.
     * 
     * @param parent
     */
private void createEmptyPartControl(Composite parent) {
    if (parent != null && !parent.isDisposed()) {
        Control[] children = parent.getChildren();
        for (Control control : children) {
            control.dispose();
        }
    }
    Composite alertComposite = new Composite(parent, SWT.NONE);
    alertComposite.setLayout(new GridLayout());
    alertComposite.setLayoutData(new GridData());
    Text alertText = new Text(alertComposite, SWT.NONE);
    //$NON-NLS-1$
    alertText.setText(Messages.getString("StatsAndLogsView.dataNotAvailable"));
    alertText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    parent.layout();
}
Also used : Control(org.eclipse.swt.widgets.Control) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.draw2d.GridData) Text(org.eclipse.swt.widgets.Text)

Example 58 with Control

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

the class StatsAndLogsView method createFullPartControl.

/**
     * Creates a full composite if job is opened.
     * 
     * @param parent
     */
private void createFullPartControl(Composite parentComposite, Process process) {
    if (parentComposite != null && !parentComposite.isDisposed()) {
        Control[] children = parentComposite.getChildren();
        for (Control control : children) {
            control.dispose();
        }
    }
    statsAndLogsViewComposite = new StatsAndLogsComposite(parentComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS, EComponentCategory.STATSANDLOGS, process);
    statsAndLogsViewComposite.refresh();
}
Also used : Control(org.eclipse.swt.widgets.Control)

Example 59 with Control

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

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

the class MapperUI method createVarsZoneWithTables.

private void createVarsZoneWithTables(MapperModel mapperModel, final Display display) {
    Control previousControl;
    // Feature TDI-26691 : Add search option
    SearchZone searchZone = new SearchZone(datasFlowViewSashForm, SWT.NONE, mapperManager);
    searchZone.createSearchZone();
    sc2 = new ScrolledComposite(searchZone, getBorder() | SWT.H_SCROLL | SWT.V_SCROLL);
    GridData sc2GridData = new GridData(GridData.FILL_BOTH);
    sc2.setLayoutData(sc2GridData);
    varsTableZoneView = new VarsTableZoneView(sc2, getBorder(), mapperManager);
    sc2.setContent(varsTableZoneView);
    sc2.setBackgroundMode(SWT.INHERIT_DEFAULT);
    sc2.setExpandHorizontal(true);
    sc2.addControlListener(new ControlListener() {

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

        public void controlResized(ControlEvent e) {
            // System.out.println("sc2 controlResized");
            onSashResized(display);
        }
    });
    sc2MSListener = new MouseScrolledListener(mapperManager.getUiManager(), sc2);
    varsTableZoneView.initInsertionIndicator();
    // final Composite finalTablesZoneViewVars = tablesZoneViewVars;
    previousControl = null;
    for (VarsTable varsTable : mapperModel.getVarsDataMapTables()) {
        DataMapTableView dataMapTableView = new VarsDataMapTableView(varsTableZoneView, SWT.BORDER, varsTable, 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;
        dataMapTableView.minimizeTable(varsTable.isMinimized());
        dataMapTableView.registerStyledExpressionEditor(getTabFolderEditors().getStyledTextHandler());
    // dataMapTableView.fillMinimumSize(false);
    }
    varsTableZoneView.setSize(varsTableZoneView.computeSize(SWT.DEFAULT, SWT.DEFAULT));
    sc2MSListener.addMouseWheelListener(sc2);
}
Also used : FormData(org.eclipse.swt.layout.FormData) VarsTable(org.talend.designer.mapper.model.table.VarsTable) OutputDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.OutputDataMapTableView) InputDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.InputDataMapTableView) VarsDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.VarsDataMapTableView) DataMapTableView(org.talend.designer.mapper.ui.visualmap.table.DataMapTableView) MouseScrolledListener(org.talend.designer.abstractmap.ui.listener.MouseScrolledListener) SearchZone(org.talend.designer.mapper.ui.visualmap.zone.SearchZone) VarsDataMapTableView(org.talend.designer.mapper.ui.visualmap.table.VarsDataMapTableView) Control(org.eclipse.swt.widgets.Control) 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) VarsTableZoneView(org.talend.designer.mapper.ui.visualmap.zone.scrollable.VarsTableZoneView)

Aggregations

Control (org.eclipse.swt.widgets.Control)475 Point (org.eclipse.swt.graphics.Point)149 Composite (org.eclipse.swt.widgets.Composite)141 GridData (org.eclipse.swt.layout.GridData)102 Button (org.eclipse.swt.widgets.Button)93 Label (org.eclipse.swt.widgets.Label)73 GridLayout (org.eclipse.swt.layout.GridLayout)71 Text (org.eclipse.swt.widgets.Text)70 FormData (org.eclipse.swt.layout.FormData)62 FormAttachment (org.eclipse.swt.layout.FormAttachment)61 Node (org.talend.designer.core.ui.editor.nodes.Node)46 DecoratedField (org.eclipse.jface.fieldassist.DecoratedField)45 SelectionEvent (org.eclipse.swt.events.SelectionEvent)44 StyledText (org.eclipse.swt.custom.StyledText)42 GC (org.eclipse.swt.graphics.GC)41 CLabel (org.eclipse.swt.custom.CLabel)38 ArrayList (java.util.ArrayList)36 Shell (org.eclipse.swt.widgets.Shell)35 FieldDecoration (org.eclipse.jface.fieldassist.FieldDecoration)33 CCombo (org.eclipse.swt.custom.CCombo)32