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;
}
use of org.eclipse.swt.events.DisposeListener in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method addSectionActions.
private static void addSectionActions(ExpandableComposite expandableComposite, List<Action> actions) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(expandableComposite);
Button button = new Button(expandableComposite, SWT.PUSH);
//$NON-NLS-1$
button.setText("Trigger GC");
button.setVisible(false);
// set cursor
final Cursor cursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
toolbar.setCursor(cursor);
toolbar.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
if (!cursor.isDisposed()) {
cursor.dispose();
}
}
});
// add menus
for (Action action : actions) {
if (action instanceof GarbageAction) {
toolBarManager.add(action);
}
}
toolBarManager.update(true);
expandableComposite.setTextClient(button);
}
use of org.eclipse.swt.events.DisposeListener in project tdi-studio-se by Talend.
the class TimelineSection method addSectionActions.
/**
* Adds the menus on expandable composite.
*
* @param expandableComposite The expandable composite
* @param actions The actions
*/
private static void addSectionActions(ExpandableComposite expandableComposite, List<Action> actions) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(expandableComposite);
// set cursor
final Cursor cursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
toolbar.setCursor(cursor);
toolbar.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
if (!cursor.isDisposed()) {
cursor.dispose();
}
}
});
// add menus
for (Action action : actions) {
toolBarManager.add(action);
}
toolBarManager.update(true);
expandableComposite.setTextClient(toolbar);
}
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() {
@Override
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)
*/
@Override
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 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);
}
});
}
Aggregations