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() );
/** * Makes the Cancel button visible. * */ protected void showButton() { if (fToolBar != null && !fToolBar.isDisposed()) { fToolBar.setVisible(true); fToolBar.setEnabled(true); fToolBar.setCursor(fStopButtonCursor); fCancelButtonIsVisible = true; } }
/** * Makes the Cancel button visible. * */ protected void showButton() { if (fToolBar != null && !fToolBar.isDisposed()) { fToolBar.setVisible(true); fToolBar.setEnabled(true); fToolBar.setCursor(fStopButtonCursor); fCancelButtonIsVisible = true; } }
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)); } }
/** * 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; } }
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; }
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); }
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; }
/** * @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); }
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); }
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); }
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; }
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; }
/** * @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); }
/** * @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); }
/** * 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; }
/** * @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); }
/** * @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); }
/** * 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; }
ToolBar toolbar = toolBarManager.createControl(section); final Cursor handCursor = Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND); toolbar.setCursor(handCursor); toolBarManager.add(new CollapseAction() { @Override