use of org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageAction 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);
}
Aggregations