Search in sources :

Example 51 with Cursor

use of org.eclipse.swt.graphics.Cursor in project otertool by wuntee.

the class SWTResourceManager method getCursor.

/**
	 * Returns the system cursor matching the specific ID.
	 * 
	 * @param id
	 *            int The ID value for the cursor
	 * @return Cursor The system cursor matching the specific ID
	 */
public static Cursor getCursor(int id) {
    Integer key = Integer.valueOf(id);
    Cursor cursor = m_idToCursorMap.get(key);
    if (cursor == null) {
        cursor = new Cursor(Display.getDefault(), id);
        m_idToCursorMap.put(key, cursor);
    }
    return cursor;
}
Also used : Cursor(org.eclipse.swt.graphics.Cursor)

Example 52 with Cursor

use of org.eclipse.swt.graphics.Cursor in project MonjaDB by Kanatoko.

the class SWTResourceManager method getCursor.

/**
	 * Returns the system cursor matching the specific ID.
	 * 
	 * @param id
	 *            int The ID value for the cursor
	 * @return Cursor The system cursor matching the specific ID
	 */
public static Cursor getCursor(int id) {
    Integer key = Integer.valueOf(id);
    Cursor cursor = m_idToCursorMap.get(key);
    if (cursor == null) {
        cursor = new Cursor(Display.getDefault(), id);
        m_idToCursorMap.put(key, cursor);
    }
    return cursor;
}
Also used : Cursor(org.eclipse.swt.graphics.Cursor)

Example 53 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 54 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)

Example 55 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)

Aggregations

Cursor (org.eclipse.swt.graphics.Cursor)64 DisposeEvent (org.eclipse.swt.events.DisposeEvent)26 DisposeListener (org.eclipse.swt.events.DisposeListener)26 Image (org.eclipse.swt.graphics.Image)24 GridData (org.eclipse.swt.layout.GridData)23 SelectionEvent (org.eclipse.swt.events.SelectionEvent)22 ToolBar (org.eclipse.swt.widgets.ToolBar)22 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)21 ToolItem (org.eclipse.swt.widgets.ToolItem)20 ImageData (org.eclipse.swt.graphics.ImageData)8 Composite (org.eclipse.swt.widgets.Composite)8 SWTException (org.eclipse.swt.SWTException)7 Point (org.eclipse.swt.graphics.Point)7 Test (org.junit.Test)6 InputStream (java.io.InputStream)5 SWTError (org.eclipse.swt.SWTError)5 ImageLoader (org.eclipse.swt.graphics.ImageLoader)5 FileDialog (org.eclipse.swt.widgets.FileDialog)5 IOException (java.io.IOException)4 URL (java.net.URL)4