use of org.eclipse.swt.events.DisposeListener in project tdi-studio-se by Talend.
the class Schema2XMLLinker 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() {
@Override
public void widgetDisposed(DisposeEvent e) {
selectedLoopLinkColor.dispose();
selectedRelativeLinkColor.dispose();
getSource().removeDisposeListener(this);
}
});
}
use of org.eclipse.swt.events.DisposeListener in project tdi-studio-se by Talend.
the class TabFolderEditors method addListenersToInputButtons.
/**
* DOC amaumont Comment method "addListenersToInputButtons".
*/
private void addListenersToInputButtons() {
MetadataToolbarEditorView toolBar = inputMetaEditor.getToolBar();
inputToolBarButtons = toolBar.getButtons();
beforeCommandListenerForInputButtons = new IExtendedButtonListener() {
public void handleEvent(ExtendedButtonEvent event) {
TableViewerCreator tableViewerCreator = mapperManager.getUiManager().getCurrentSelectedInputTableView().getTableViewerCreatorForColumns();
if (tableViewerCreator != null) {
tableViewerCreator.applyActivatedCellEditor();
}
}
};
for (ExtendedPushButton extendedPushButton : inputToolBarButtons) {
extendedPushButton.addListener(beforeCommandListenerForInputButtons, true);
}
this.addDisposeListener(new DisposeListener() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
*/
public void widgetDisposed(DisposeEvent e) {
for (ExtendedPushButton extendedPushButton : inputToolBarButtons) {
extendedPushButton.removeListener(beforeCommandListenerForInputButtons, true);
}
}
});
}
use of org.eclipse.swt.events.DisposeListener in project tdi-studio-se by Talend.
the class RadioFieldEditor method getChangeControl.
@Override
protected Button getChangeControl(Composite parent) {
if (radio == null) {
radio = new Button(parent, SWT.RADIO | SWT.LEFT);
radio.setFont(parent.getFont());
radio.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
boolean isSelected = radio.getSelection();
valueChanged(wasSelected, isSelected);
wasSelected = isSelected;
}
});
radio.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
radio = null;
}
});
} else {
checkParent(radio, parent);
}
return radio;
}
use of org.eclipse.swt.events.DisposeListener in project tdi-studio-se by Talend.
the class HL7Tree2SchemaLinker method initColors.
private void initColors(Display display) {
// selectedLoopLinkColor = new Color(display, 255, 131, 0);
selectedRelativeLinkColor = new Color(display, 110, 168, 255);
getTree().addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
// selectedLoopLinkColor.dispose();
selectedRelativeLinkColor.dispose();
getTree().removeDisposeListener(this);
}
});
}
use of org.eclipse.swt.events.DisposeListener in project tdi-studio-se by Talend.
the class JobVMArgumentsComposite method getButtonBoxControl.
/**
* Returns this field editor's button box containing the Add, Remove, Up, and Down button.
*
* @param parent the parent control
* @return the button box
*/
public Composite getButtonBoxControl(Composite parent) {
if (buttonBox == null) {
buttonBox = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
layout.marginWidth = 0;
buttonBox.setLayout(layout);
GridData layoutData = new GridData();
layoutData.widthHint = 100;
layoutData.minimumWidth = 100;
buttonBox.setLayoutData(layoutData);
createButtons(buttonBox);
buttonBox.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
addButton = null;
removeButton = null;
upButton = null;
downButton = null;
buttonBox = null;
}
});
}
selectionChanged();
return buttonBox;
}
Aggregations