/** * Returns the shell to use within actions. */ protected Shell getShell() { return taskList.getSite().getShell(); }
@Override public void selectionChanged(SelectionChangedEvent event) { if (fDisplay == null) fDisplay= getSite().getShell().getDisplay(); if (Display.getCurrent() == fDisplay) fRunnable.run(); else fDisplay.asyncExec(fRunnable); } };
@Override public void run() { BusyIndicator.showWhile(fView.getSite().getShell().getDisplay(), new Runnable() { @Override public void run() { fView.showQualifiedTypeNames(isChecked()); } }); } }
private Shell getShell() { ITextEditor editor= getTextEditor(); if (editor != null) { IWorkbenchPartSite site= editor.getSite(); Shell shell= site.getShell(); if (shell != null && !shell.isDisposed()) { return shell; } } return null; }
public void run() { if (!dirtyModels.isEmpty()) { keepGoing[0] = promptToSave(dirtyModels); } else { keepGoing[0] = MessageDialog.openQuestion( view.getSite().getShell(), TeamUIMessages.RemoveSynchronizeParticipantAction_0, TeamUIMessages.RemoveSynchronizeParticipantAction_1); } } });
private Shell getShell() { ITextEditor editor= getTextEditor(); if (editor != null) { IWorkbenchPartSite site= editor.getSite(); Shell shell= site.getShell(); if (shell != null && !shell.isDisposed()) { return shell; } } return null; }
public void run() { BusyIndicator.showWhile(fView.getSite().getShell().getDisplay(), new Runnable() { public void run() { fView.showMembersInHierarchy(isChecked()); } }); } }
private void beep() { Shell shell= null; if (fWorkbenchPart != null) shell= fWorkbenchPart.getSite().getShell(); else if (fWorkbenchWindow != null) shell= fWorkbenchWindow.getShell(); if (shell != null && !shell.isDisposed()) shell.getDisplay().beep(); }
/** * The <code>SashEditorSite</code> implementation of this * <code>IWorkbenchPartSite</code> method forwards to the multi-page * editor to return the shell. * * @return The shell in which this editor site resides. */ public Shell getShell() { return getSashEditor().getSite().getShell(); }
public boolean ownsFocusShell() { if (fInfoPopup == null) return false; if (fInfoPopup.ownsFocusShell()) { return true; } Shell editorShell= fEditor.getSite().getShell(); Shell activeShell= editorShell.getDisplay().getActiveShell(); if (editorShell == activeShell) return true; return false; }
@Override protected void open(ISelection selection, boolean activate) { if (selection instanceof IStructuredSelection) { for (Iterator<?> iter= ((IStructuredSelection)selection).iterator(); iter.hasNext();) { boolean noError= CallHierarchyUI.openInEditor(iter.next(), getSite().getShell(), OpenStrategy.activateOnOpen()); if (!noError) return; } } }
@Override protected void open(ISelection selection, boolean activate) { if (selection instanceof IStructuredSelection) { for (Iterator<?> iter= ((IStructuredSelection)selection).iterator(); iter.hasNext();) { boolean noError= CallHierarchyUI.openInEditor(iter.next(), getSite().getShell(), OpenStrategy.activateOnOpen()); if (!noError) return; } } }
protected boolean showPreferencePage() { String id = "org.eclipse.wst.server.ui.preferencePage"; final PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(getSite().getShell(), id, new String[] { id }, null); return (dialog.open() == Window.OK); }
/** * @see IActionDelegate#run(IAction) */ @Override public void run(IAction action) { if (this.selection instanceof IStructuredSelection) { final IStructuredSelection structuredSelection = (IStructuredSelection) this.selection; CompareToBaselineWizard wizard = new CompareToBaselineWizard(structuredSelection, ActionMessages.CompareDialogTitle); WizardDialog wdialog = new WizardDialog(workbenchPartSite.getShell(), wizard); wdialog.open(); } }
@Override protected void activate(ISelection selection) { final Object selectedElement= SelectionUtil.getSingleElement(selection); if (selectedElement != null) CallHierarchyUI.openInEditor(selectedElement, getSite().getShell(), true); }
protected Shell getShell() { if (getTargetPart() != null) { return getTargetPart().getSite().getShell(); } return JDIDebugUIPlugin.getActiveWorkbenchShell(); }
/** * Creates a new find/replace dialog accessor anchored at the given part site. * * @param site the part site */ public FindReplaceDialogStub(IWorkbenchPartSite site) { this(site.getShell()); fWindow= site.getWorkbenchWindow(); IPartService service= fWindow.getPartService(); service.addPartListener(this); partActivated(service.getActivePart()); }
private void gotoPackage(IPackageFragment p) { fPackageExplorer.selectReveal(new StructuredSelection(p)); if (!p.equals(getSelectedElement())) { MessageDialog.openInformation(fPackageExplorer.getSite().getShell(), getDialogTitle(), Messages.format(PackagesMessages.PackageExplorer_element_not_present, JavaElementLabels.getElementLabel(p, JavaElementLabels.ALL_DEFAULT))); } }
public PasteAction(IWorkbenchPart part) { super(TeamUIMessages.PasteAction_1); final ISharedImages images = PlatformUI.getWorkbench().getSharedImages(); setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE); setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE)); setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED)); fShell = part.getSite().getShell(); Assert.isNotNull(fShell); fClipboard = new Clipboard(fShell.getDisplay()); setToolTipText(TeamUIMessages.PasteAction_2); setId(ID); }
protected void addMarker() { IResource resource= getResource(); if (resource == null) return; TaskPropertiesDialog dialog = new TaskPropertiesDialog(getTextEditor().getSite().getShell()); dialog.setResource(resource); dialog.setInitialAttributes(getInitialAttributes()); dialog.open(); } }