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());
}
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();
}
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();
}
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);
}
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);
}
Aggregations