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;
}
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;
}
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);
}
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);
}
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);
}
Aggregations