Refine search
/** * Creates a new instance of AttributeValueDialog. */ public BinaryAttributeDialog( String initialValue ) { super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); this.initialValue = initialValue; }
public void done(IJobChangeEvent event) { if (PlatformUI.isWorkbenchRunning()) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { if (validateOperation(operation)) performAction(operation, ius); } }); } }
@Override public boolean performOk() { IWorkbenchPage activePage = PlatformUI.getWorkbench() .getActiveWorkbenchWindow() .getActivePage();
/** * Schedule a refresh of this label provider. This method can be called from any thread. */ protected void scheduleRefresh() { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { refresh(); } }); }
@Override public Object handleStatus(IStatus status, Object source) throws CoreException { if (source instanceof String[]) { final String[] data = (String[]) source; PlatformUI.getWorkbench().getDisplay() .asyncExec(() -> MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DebugUIMessages.GroupLaunch_Error, NLS.bind(DebugUIMessages.GroupLaunch_Cannot_launch, data[0], data[1]))); } return null; }
/** * Returns the current active shell * * @return * the current active shell */ protected Shell getShell() { return PlatformUI.getWorkbench().getDisplay().getActiveShell(); }
public static void showError(String title, String message) { Display.getDefault().asyncExec(() -> { MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, null, message, MessageDialog.ERROR, 0, IDialogConstants.OK_LABEL); dialog.setBlockOnOpen(false); dialog.open(); }); }
private void showConflictDialog(final Shell shell) { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { public void run() { MessageDialog.openWarning(shell, UIText.CherryPickHandler_CherryPickConflictsTitle, UIText.CherryPickHandler_CherryPickConflictsMessage); } }); }
@Override public void run () { if ( !display.isDisposed () ) { ErrorDialog.openError ( PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getShell (), "Connection error", "Connection failed", status, IStatus.ERROR ); } } } );
public static void run(IRunnableWithProgress runnable) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().run(true, true, runnable); } catch (InvocationTargetException e) { Utils.handleError(getStandardDisplay().getActiveShell(), e, null, null); } catch (InterruptedException e2) { // Nothing to be done } }
private void showRestartDialog() { if (0 == MessageDialog.open(MessageDialog.CONFIRM, mainPage.getShell(), PreferencesMessages.WizardPreferencesImportRestartDialog_title, PreferencesMessages.WizardPreferencesImportRestartDialog_message, SWT.NONE, PreferencesMessages.WizardPreferencesImportRestartDialog_restart, IDialogConstants.CANCEL_LABEL)) { Display.getDefault().asyncExec(() -> { PlatformUI.getWorkbench().restart(); }); } }
/** * Posts the update code "behind" the running operation. */ protected void postOnDisplayQue(Runnable runnable) { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); if (windows != null && windows.length > 0) { Display display = windows[0].getShell().getDisplay(); display.asyncExec(runnable); } else { runnable.run(); } }
@Override public void run(final IAction action) { if (fWorkbenchPart == null || fSelection == null) return; final IImportWizard wizard= new JarImportWizard(false); final IWorkbenchWindow window= fWorkbenchPart.getSite().getWorkbenchWindow(); wizard.init(window.getWorkbench(), fSelection); final WizardDialog dialog= new WizardDialog(window.getShell(), wizard); dialog.create(); dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH, dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT); PlatformUI.getWorkbench().getHelpSystem().setHelp(dialog.getShell(), IJavaHelpContextIds.JARIMPORT_WIZARD_PAGE); dialog.open(); }
protected Shell getParentShell () { if ( this.parentShell != null ) { return this.parentShell; } final Shell shell = PlatformUI.getWorkbench ().getActiveWorkbenchWindow ().getShell (); if ( shell != null ) { return shell; } return this.display.getActiveShell (); }
public void open() { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); IWorkbenchPage activePage = window.getActivePage(); try { IDE.openEditor(activePage, file); } catch (PartInitException e) { WikiTextUiPlugin.getDefault().log(e); MessageDialog.openError(window.getShell(), Messages.MarkupHyperlinkDetector_unexpectedError, NLS.bind(Messages.MarkupHyperlinkDetector_openException, file.getName(), e.getMessage())); } } }
static boolean isActive() { final AtomicBoolean ret = new AtomicBoolean(); final Display display = PlatformUI.getWorkbench().getDisplay(); if (display.isDisposed()) return false; display.syncExec(new Runnable() { public void run() { ret.set(display.getActiveShell() != null); } }); return ret.get(); }
protected IEditorPart openDefaultEditor(IStorage storage, URI uri) throws PartInitException { XtextReadonlyEditorInput editorInput = new XtextReadonlyEditorInput(storage); IWorkbenchPage page = getWorkbench().getActiveWorkbenchWindow().getActivePage(); return IDE.openEditor(page, editorInput, PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor( uri.lastSegment()).getId()); }
/** * Sets the action's help context id. * * @param contextId the help context id */ public final void setHelpContextId(String contextId) { PlatformUI.getWorkbench().getHelpSystem().setHelp(this, contextId); }
/** Gets the active workbench window. */ public static IWorkbenchWindow getActiveWorkbenchWindow() { return PlatformUI.getWorkbench().getActiveWorkbenchWindow(); }
@Override public final void createPartControl(Composite parent) { internalCreatePartControl(parent); inititalizeColors(); getSite().getWorkbenchWindow().getPartService().addPartListener(fPartListener); createContextMenu(); createActions(); fillActionBars(getViewSite().getActionBars()); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId()); }