本文整理了Java中org.eclipse.swt.widgets.ToolBar.setCursor()
方法的一些代码示例,展示了ToolBar.setCursor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ToolBar.setCursor()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ToolBar
类名称:ToolBar
方法名:setCursor
暂无
代码示例来源:origin: pentaho/pentaho-kettle
fdToolbarLeft.top = new FormAttachment( 0, MARGIN );
toolbarLeft.setLayoutData( fdToolbarLeft );
toolbarLeft.setCursor( cursorEnabled );
toolbarLeft.setBackground( toolbarLeft.getParent().getBackground() );
fdToolbarRight.right = new FormAttachment( 100, -1 * TOOL_ITEM_SPACING );
toolbarRight.setLayoutData( fdToolbarRight );
toolbarRight.setCursor( cursorEnabled );
toolbarRight.setBackground( toolbarRight.getParent().getBackground() );
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
/**
* Makes the Cancel button visible.
*
*/
protected void showButton() {
if (fToolBar != null && !fToolBar.isDisposed()) {
fToolBar.setVisible(true);
fToolBar.setEnabled(true);
fToolBar.setCursor(fStopButtonCursor);
fCancelButtonIsVisible = true;
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
/**
* Makes the Cancel button visible.
*
*/
protected void showButton() {
if (fToolBar != null && !fToolBar.isDisposed()) {
fToolBar.setVisible(true);
fToolBar.setEnabled(true);
fToolBar.setCursor(fStopButtonCursor);
fCancelButtonIsVisible = true;
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
private void track(MouseEvent e) {
// Create and track the feedback overlay
if (dragShell == null)
createFeedback();
// Move the drag shell
Rectangle b = dragItem.getBounds();
Point p = new Point(e.x, e.y);
p = dragShell.getDisplay().map(dragItem.getParent(), null, p);
dragShell.setLocation(p.x - (b.width / 2), p.y - (b.height / 2));
// Set the cursor feedback
ToolBar bar = (ToolBar) e.widget;
ToolItem curItem = bar.getItem(new Point(e.x, e.y));
if (curItem != null && curItem.getData() instanceof MPerspective) {
perspSwitcherToolbar.setCursor(perspSwitcherToolbar.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
} else {
perspSwitcherToolbar.setCursor(perspSwitcherToolbar.getDisplay().getSystemCursor(SWT.CURSOR_NO));
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
/**
* Makes the Cancel button visible.
*
*/
protected void showButton() {
if (fToolBar != null && !fToolBar.isDisposed()) {
fToolBar.setVisible(true);
fToolBar.setEnabled(true);
fToolBar.setCursor(getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
fCancelButtonIsVisible = true;
}
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.runtime
private ToolBarManager createSectionToolbar(Section section) {
Object object = section.getData("toolbarmanager"); //$NON-NLS-1$
if (object instanceof ToolBarManager) {
return (ToolBarManager) object;
}
ToolBarManager manager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = manager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
section.setTextClient(toolbar);
section.setData("toolbarmanager", manager); //$NON-NLS-1$
return manager;
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Add sort action to the tool bar
fSortAction = new SortAction(fImportViewer, PDEUIMessages.RequiresSection_sortAlpha, null, null, this);
toolBarManager.add(fSortAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
private ToolBar createHelpImageButton(Composite parent, Image image) {
ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
((GridLayout) parent.getLayout()).numColumns++;
toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
toolBar.setCursor(parent.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
fHelpButton = new ToolItem(toolBar, SWT.CHECK);
fHelpButton.setImage(image);
fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
fHelpButton.addSelectionListener(widgetSelectedAdapter(e -> helpPressed()));
return toolBar;
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
/**
* @param section
* @param toolkit
*/
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Add collapse action to the tool bar
fCollapseAction = new CollapseAction(fTreeViewer, PDEUIMessages.ExtensionsPage_collapseAll);
toolBarManager.add(fCollapseAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
fNewPluginAction = new NewPluginAction();
fNewFragmentAction = new NewFragmentAction();
toolBarManager.add(fNewPluginAction);
toolBarManager.add(fNewFragmentAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Add sort action to the tool bar
fSortAction = new SortAction(getTablePart().getTableViewer(), PDEUIMessages.RequiresSection_sortAlpha, null, null, this);
toolBarManager.add(fSortAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
private ToolBar createHelpImageButton(Composite parent, Image image) {
ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
((GridLayout) parent.getLayout()).numColumns++;
toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
toolBar.setCursor(cursor);
toolBar.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
cursor.dispose();
}
});
fHelpButton = new ToolItem(toolBar, SWT.CHECK);
fHelpButton.setImage(image);
fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
fHelpButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
helpPressed();
}
});
return toolBar;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
private ToolBar createHelpImageButton(Composite parent, Image image) {
ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
((GridLayout) parent.getLayout()).numColumns++;
toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
toolBar.setCursor(cursor);
toolBar.addDisposeListener(e -> cursor.dispose());
fHelpButton = new ToolItem(toolBar, SWT.CHECK);
fHelpButton.setImage(image);
fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
fHelpButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
helpPressed();
}
});
return toolBar;
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
/**
* @param section
* @param toolkit
*/
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Add sort action to the tool bar
fSortAction = new SortAction(getStructuredViewerPart().getViewer(), PDEUIMessages.FeatureEditor_RequiresSection_sortAlpha, ListUtil.NAME_COMPARATOR, null, null);
toolBarManager.add(fSortAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
/**
* @param section
* @param toolkit
*/
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Add sort action to the tool bar
fSortAction = new SortAction(getStructuredViewerPart().getViewer(), PDEUIMessages.FeatureEditor_PluginSection_sortAlpha, ListUtil.NAME_COMPARATOR, null, null);
toolBarManager.add(fSortAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
/**
* Returns the tool bar manager that is used to manage tool items in the
* form's title area.
*
* @return form tool bar manager
*/
public IToolBarManager getToolBarManager() {
if (toolBarManager == null) {
toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(this);
toolbar.setBackground(getBackground());
toolbar.setForeground(getForeground());
toolbar.setCursor(FormsResources.getHandCursor());
addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
if (toolBarManager != null) {
toolBarManager.dispose();
toolBarManager = null;
}
}
});
}
return toolBarManager;
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
/**
* @param section
* @param toolkit
*/
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
// Add sort action to the tool bar
fSortAction = new SortAction(getStructuredViewerPart().getViewer(), PDEUIMessages.FeatureEditor_IncludedFeatures_sortAlpha, ListUtil.NAME_COMPARATOR, null, this);
toolBarManager.add(fSortAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
/**
* @param section
* @param toolkit
*/
private void createSectionToolbar(Section section, FormToolkit toolkit) {
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
fNewFeatureAction = new NewFeatureAction();
toolBarManager.add(fNewFeatureAction);
fSortAction = new SortAction(fFeatureTable, PDEUIMessages.Product_FeatureSection_sortAlpha, null, null, this);
toolBarManager.add(fSortAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
/**
* Returns the tool bar manager that is used to manage tool items in the
* form's title area.
*
* @return form tool bar manager
*/
public IToolBarManager getToolBarManager() {
if (toolBarManager == null) {
toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(this);
toolbar.setBackground(getBackground());
toolbar.setForeground(getForeground());
toolbar.setCursor(FormsResources.getHandCursor());
addDisposeListener(e -> {
if (toolBarManager != null) {
toolBarManager.dispose();
toolBarManager.removeAll();
toolBarManager = null;
}
});
}
return toolBarManager;
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
ToolBar toolbar = toolBarManager.createControl(section);
final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND);
toolbar.setCursor(handCursor);
toolBarManager.add(new CollapseAction() {
@Override
内容来源于网络,如有侵权,请联系作者删除!