use of org.eclipse.swt.graphics.Color in project tdi-studio-se by Talend.
the class SchemaXMLLinker method initColors.
/**
* amaumont Comment method "initColors".
*
* @param display
*/
private void initColors(Display display) {
// selectedLoopLinkColor = new Color(display, 255, 131, 255);
// light blue
selectedLoopLinkColor = new Color(display, 110, 168, 255);
selectedRelativeLinkColor = new Color(display, 110, 168, 0);
getSource().addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
selectedLoopLinkColor.dispose();
selectedRelativeLinkColor.dispose();
getSource().removeDisposeListener(this);
}
});
}
use of org.eclipse.swt.graphics.Color in project tdi-studio-se by Talend.
the class ColorCombo method popupEvent.
void popupEvent(Event event) {
switch(event.type) {
case SWT.Paint:
// draw black rectangle around list
Rectangle listRect = list.getBounds();
Color black = getDisplay().getSystemColor(SWT.COLOR_BLACK);
event.gc.setForeground(black);
event.gc.drawRectangle(0, 0, listRect.width + 1, listRect.height + 1);
break;
case SWT.Close:
event.doit = false;
dropDown(false);
break;
case SWT.Deactivate:
/*
* Bug in GTK. When the arrow button is pressed the popup control receives a deactivate event and then the
* arrow button receives a selection event. If we hide the popup in the deactivate event, the selection
* event will show it again. To prevent the popup from showing again, we will let the selection event of the
* arrow button hide the popup. In Windows, hiding the popup during the deactivate causes the deactivate to
* be called twice and the selection event to be disappear.
*/
if (!"carbon".equals(SWT.getPlatform())) {
//$NON-NLS-1$
Point point = arrow.toControl(getDisplay().getCursorLocation());
Point size = arrow.getSize();
Rectangle rect = new Rectangle(0, 0, size.x, size.y);
if (!rect.contains(point)) {
dropDown(false);
}
} else {
dropDown(false);
}
break;
}
}
use of org.eclipse.swt.graphics.Color in project tdi-studio-se by Talend.
the class ImportItemWizardPage method createItemList.
private void createItemList(Composite workArea) {
Composite labelComposite = new Composite(workArea, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.marginWidth = 0;
layout.makeColumnsEqualWidth = false;
labelComposite.setLayout(layout);
Label title = new Label(labelComposite, SWT.NONE);
//$NON-NLS-1$
title.setText(Messages.getString("ImportItemWizardPage.ItemsList"));
itemListInfo = new Label(labelComposite, SWT.NONE);
// red
itemListInfo.setForeground(new Color(null, 255, 0, 0));
//$NON-NLS-1$
itemListInfo.setText(Messages.getString("ImportItemWizardPage.NoValidItems"));
itemListInfo.setVisible(false);
Composite listComposite = new Composite(workArea, SWT.NONE);
GridLayout layout2 = new GridLayout();
layout2.numColumns = 2;
layout2.marginWidth = 0;
layout2.makeColumnsEqualWidth = false;
listComposite.setLayout(layout2);
GridData gridData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
gridData.heightHint = 250;
gridData.widthHint = 600;
listComposite.setLayoutData(gridData);
checkTreeViewer = (CheckboxTreeViewer) createTreeViewer(listComposite);
createSelectionButtons(listComposite);
}
use of org.eclipse.swt.graphics.Color in project tdi-studio-se by Talend.
the class DummyConnectionFigure method setConnectionProperty.
protected void setConnectionProperty(IConnectionProperty connectionProperty) {
if (connectionProperty == null) {
return;
}
setLineStyle(connectionProperty.getLineStyle());
Color color = ColorUtils.getCacheColor(connectionProperty.getRGB());
ResourceDisposeUtil.setAndCheckColor(this, color, true);
if (!DesignerPlugin.getDefault().getPreferenceStore().getBoolean(TalendDesignerPrefConstants.EDITOR_LINESTYLE)) {
this.setLineWidth(1);
} else {
this.setLineWidth(2);
}
}
use of org.eclipse.swt.graphics.Color in project tdi-studio-se by Talend.
the class ColorProviderMapper method releaseColor.
public static void releaseColor(ColorInfo colorInfo) {
Color color = colorsCache.get(colorInfo);
if (!color.isDisposed()) {
color.dispose();
}
colorsCache.remove(colorInfo);
}
Aggregations