Refine search
/** * Creates a new instance of AttributeValueDialog. */ public BinaryAttributeDialog( String initialValue ) { super( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() ); this.initialValue = initialValue; }
/** * 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); }
/** * 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(); } }); }
private static IWorkbenchWindow getActiveWindow() { IWorkbenchWindow w = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (w == null) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); if (windows.length > 0) { w = windows[0]; } } return w; }
private ViewContextManager() { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow[] workbenchWindows = workbench.getWorkbenchWindows(); for (int i = 0; i < workbenchWindows.length; i++) { IWorkbenchWindow window = workbenchWindows[i]; windowOpened(window); } workbench.addWindowListener(this); }
@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; }
public void done(IJobChangeEvent event) { if (PlatformUI.isWorkbenchRunning()) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { if (validateOperation(operation)) performAction(operation, ius); } }); } }
public CopyToClipboardAction(IWorkbenchSite site) { super(site); setText(InfoViewMessages.CopyAction_label); setToolTipText(InfoViewMessages.CopyAction_tooltip); setDescription(InfoViewMessages.CopyAction_description); ISharedImages workbenchImages= PlatformUI.getWorkbench().getSharedImages(); setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED)); setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IAbstractTextEditorHelpContextIds.COPY_ACTION); update(getSelection()); }
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable); }
@Override public Image getColumnImage(Object obj, int index) { ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages(); return sharedImages.getImage(ISharedImages.IMG_OBJ_FOLDER); } }
@Override public boolean performOk() { IWorkbenchPage activePage = PlatformUI.getWorkbench() .getActiveWorkbenchWindow() .getActivePage();
@Override public ImageDescriptor getImageDescriptor() { IEditorRegistry registry= PlatformUI.getWorkbench().getEditorRegistry(); return registry.getImageDescriptor(getContentType()); }
/** * 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(); }
private void showConflictDialog(final Shell shell) { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { public void run() { MessageDialog.openWarning(shell, UIText.CherryPickHandler_CherryPickConflictsTitle, UIText.CherryPickHandler_CherryPickConflictsMessage); } }); }
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(); }
/** * Returns the current active shell * * @return * the current active shell */ protected Shell getShell() { return PlatformUI.getWorkbench().getDisplay().getActiveShell(); }
/** * Installs this AST provider. */ void install() { // Create and register activation listener fActivationListener= new ActivationListener(); PlatformUI.getWorkbench().addWindowListener(fActivationListener); // Ensure existing windows get connected IWorkbenchWindow[] windows= PlatformUI.getWorkbench().getWorkbenchWindows(); for (int i= 0, length= windows.length; i < length; i++) windows[i].getPartService().addPartListener(fActivationListener); }