Search in sources :

Example 36 with Cursor

use of org.eclipse.swt.graphics.Cursor in project tdi-studio-se by Talend.

the class DataMapTableView method setDefaultCursor.

private void setDefaultCursor() {
    Cursor cursor = new Cursor(DataMapTableView.this.getDisplay(), 0);
    DataMapTableView.this.setCursor(cursor);
}
Also used : Cursor(org.eclipse.swt.graphics.Cursor)

Example 37 with Cursor

use of org.eclipse.swt.graphics.Cursor 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);
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) GarbageCollectorAction(org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageCollectorAction) Action(org.eclipse.jface.action.Action) RefreshAction(org.talend.designer.runtime.visualization.internal.actions.RefreshAction) ToolBar(org.eclipse.swt.widgets.ToolBar) Cursor(org.eclipse.swt.graphics.Cursor) DisposeEvent(org.eclipse.swt.events.DisposeEvent) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ToolBarManager(org.eclipse.jface.action.ToolBarManager)

Example 38 with Cursor

use of org.eclipse.swt.graphics.Cursor 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);
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) LoadChartAction(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.LoadChartAction) GarbageAction(org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageAction) Action(org.eclipse.jface.action.Action) Button(org.eclipse.swt.widgets.Button) GarbageAction(org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageAction) ToolBar(org.eclipse.swt.widgets.ToolBar) Cursor(org.eclipse.swt.graphics.Cursor) DisposeEvent(org.eclipse.swt.events.DisposeEvent) ToolBarManager(org.eclipse.jface.action.ToolBarManager)

Aggregations

Cursor (org.eclipse.swt.graphics.Cursor)38 DisposeEvent (org.eclipse.swt.events.DisposeEvent)26 DisposeListener (org.eclipse.swt.events.DisposeListener)26 SelectionEvent (org.eclipse.swt.events.SelectionEvent)22 Image (org.eclipse.swt.graphics.Image)22 ToolBar (org.eclipse.swt.widgets.ToolBar)22 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)21 GridData (org.eclipse.swt.layout.GridData)21 ToolItem (org.eclipse.swt.widgets.ToolItem)20 Composite (org.eclipse.swt.widgets.Composite)7 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)4 TSWizardDialog (net.heartsome.cat.common.ui.wizard.TSWizardDialog)3 Action (org.eclipse.jface.action.Action)2 ToolBarManager (org.eclipse.jface.action.ToolBarManager)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Button (org.eclipse.swt.widgets.Button)2 Display (org.eclipse.swt.widgets.Display)2 Label (org.eclipse.swt.widgets.Label)2 Shell (org.eclipse.swt.widgets.Shell)2 RecoverableException (edu.cmu.cs.hcii.cogtool.util.RecoverableException)1