/** * Handles the given <code>CoreException</code>. The workbench shell is used as a parent * for the dialog window. * * @param e the <code>CoreException</code> to be handled * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(CoreException e, String title, String message) { handle(e, CompareUIPlugin.getShell(), title, message); }
/** * Handles the given <code>InvocationTargetException</code>. The workbench shell is used * as a parent for the dialog window. * * @param e the <code>InvocationTargetException</code> to be handled * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(InvocationTargetException e, String title, String message) { handle(e, CompareUIPlugin.getShell(), title, message); }
/** * Handles the given <code>CoreException</code>. The workbench shell is used as a parent * for the dialog window. * * @param e the <code>CoreException</code> to be handled * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(CoreException e, String title, String message) { handle(e, CompareUIPlugin.getShell(), title, message); }
/** * Handles the given <code>InvocationTargetException</code>. The workbench shell is used * as a parent for the dialog window. * * @param e the <code>InvocationTargetException</code> to be handled * @param title the dialog window's window title * @param message message to be displayed by the dialog window */ public static void handle(InvocationTargetException e, String title, String message) { handle(e, CompareUIPlugin.getShell(), title, message); }
/** * Return the parent shell to be used when the wizard is opened. * By default, the site of the part is used to get the shell. * Subclasses may override. * @return the parent shell to be used when the wizard is opened */ protected Shell getShell() { if (part == null) return CompareUIPlugin.getShell(); return part.getSite().getShell(); }
/** * Return the parent shell to be used when the wizard is opened. * By default, the site of the part is used to get the shell. * Subclasses may override. * @return the parent shell to be used when the wizard is opened */ protected Shell getShell() { if (part == null) return CompareUIPlugin.getShell(); return part.getSite().getShell(); }
public void run() { CompareDialog dialog= new CompareDialog(getShell(), input); dialog.open(); } };
/** * Return the parent shell to be used when the wizard is opened. * By default, the site of the part is used to get the shell. * Subclasses may override. * @return the parent shell to be used when the wizard is opened */ protected Shell getShell() { if (part == null) return CompareUIPlugin.getShell(); return part.getSite().getShell(); }
public void run() { MessageDialog.openInformation(getShell(), Utilities.getString("CompareUIPlugin.dialogTitle"), Utilities.getString("CompareUIPlugin.noDifferences")); //$NON-NLS-1$//$NON-NLS-2$ } };
protected void handleNoDifference() { Runnable runnable = () -> MessageDialog.openInformation(getShell(), Utilities.getString("CompareUIPlugin.dialogTitle"), Utilities.getString("CompareUIPlugin.noDifferences")); syncExec(runnable); }
public void run() { if (fCompareEditorInput != null) { Object adapter= fCompareEditorInput.getAdapter(ICompareNavigator.class); if (adapter instanceof ICompareNavigator) { boolean atEnd= ((ICompareNavigator)adapter).selectChange(fNext); Shell shell= CompareUIPlugin.getShell(); if (atEnd && shell != null) { Display display= shell.getDisplay(); if (display != null) display.beep(); String title; String message; if (fNext) { title= CompareMessages.CompareNavigator_atEnd_title; message= CompareMessages.CompareNavigator_atEnd_message; } else { title= CompareMessages.CompareNavigator_atBeginning_title; message= CompareMessages.CompareNavigator_atBeginning_message; } MessageDialog.openInformation(shell, title, message); } } } }
@Override public void run() { if (fCompareEditorInput != null) { Object adapter= fCompareEditorInput.getAdapter(ICompareNavigator.class); if (adapter instanceof ICompareNavigator) { boolean atEnd= ((ICompareNavigator)adapter).selectChange(fNext); Shell shell= CompareUIPlugin.getShell(); if (atEnd && shell != null) { Display display= shell.getDisplay(); if (display != null) display.beep(); String title; String message; if (fNext) { title= CompareMessages.CompareNavigator_atEnd_title; message= CompareMessages.CompareNavigator_atEnd_message; } else { title= CompareMessages.CompareNavigator_atBeginning_title; message= CompareMessages.CompareNavigator_atBeginning_message; } MessageDialog.openInformation(shell, title, message); } } } }
public void run() { if (editor != null && !editor.getSite().getShell().isDisposed()) { // reuse the given editor editor.setInput(input); return; } IWorkbenchPage page = wp; if (page == null) page= getActivePage(); if (page != null) { // open new CompareEditor on page try { page.openEditor(input, COMPARE_EDITOR); } catch (PartInitException e) { MessageDialog.openError(getShell(), Utilities.getString("CompareUIPlugin.openEditorError"), e.getMessage()); //$NON-NLS-1$ } } else { MessageDialog.openError(getShell(), Utilities.getString("CompareUIPlugin.openEditorError"), //$NON-NLS-1$ Utilities.getString("CompareUIPlugin.noActiveWorkbenchPage")); //$NON-NLS-1$ } } };
private void internalOpenEditor(final CompareEditorInput input, final IWorkbenchPage wp, final IReusableEditor editor, final boolean activate) { Runnable runnable = () -> { if (editor != null && !editor.getSite().getShell().isDisposed()) { // reuse the given editor editor.setInput(input); return; } IWorkbenchPage page = wp; if (page == null) page= getActivePage(); if (page != null) { // open new CompareEditor on page try { page.openEditor(input, COMPARE_EDITOR, activate); } catch (PartInitException e) { MessageDialog.openError(getShell(), Utilities.getString("CompareUIPlugin.openEditorError"), e.getMessage()); //$NON-NLS-1$ } } else { MessageDialog.openError(getShell(), Utilities.getString("CompareUIPlugin.openEditorError"), //$NON-NLS-1$ Utilities.getString("CompareUIPlugin.noActiveWorkbenchPage")); //$NON-NLS-1$ } }; syncExec(runnable); }
String title= Utilities.getString(bundle, "title"); //$NON-NLS-1$ Shell parentShell= CompareUIPlugin.getShell(); AddFromHistoryDialog dialog= null;
public boolean compareResultOK(CompareEditorInput input, IRunnableContext context) { final Shell shell= getShell(); try { // run operation in separate thread and make it cancelable if (context == null) context = PlatformUI.getWorkbench().getProgressService(); context.run(true, true, input); String message= input.getMessage(); if (message != null) { MessageDialog.openError(shell, Utilities.getString("CompareUIPlugin.compareFailed"), message); //$NON-NLS-1$ return false; } if (input.getCompareResult() == null) { MessageDialog.openInformation(shell, Utilities.getString("CompareUIPlugin.dialogTitle"), Utilities.getString("CompareUIPlugin.noDifferences")); //$NON-NLS-2$ //$NON-NLS-1$ return false; } return true; } catch (InterruptedException x) { // canceled by user } catch (InvocationTargetException x) { MessageDialog.openError(shell, Utilities.getString("CompareUIPlugin.compareFailed"), x.getTargetException().getMessage()); //$NON-NLS-1$ } return false; }
public boolean compareResultOK(CompareEditorInput input, IRunnableContext context) { final Shell shell= getShell(); try { // run operation in separate thread and make it cancelable if (context == null) context = PlatformUI.getWorkbench().getProgressService(); context.run(true, true, input); String message= input.getMessage(); if (message != null) { MessageDialog.openError(shell, Utilities.getString("CompareUIPlugin.compareFailed"), message); //$NON-NLS-1$ return false; } if (input.getCompareResult() == null) { MessageDialog.openInformation(shell, Utilities.getString("CompareUIPlugin.dialogTitle"), Utilities.getString("CompareUIPlugin.noDifferences")); //$NON-NLS-2$ //$NON-NLS-1$ return false; } return true; } catch (InterruptedException x) { // canceled by user } catch (InvocationTargetException x) { MessageDialog.openError(shell, Utilities.getString("CompareUIPlugin.compareFailed"), x.getTargetException().getMessage()); //$NON-NLS-1$ } return false; }
String title= Utilities.getString(bundle, "title"); //$NON-NLS-1$ Shell parentShell= CompareUIPlugin.getShell(); AddFromHistoryDialog dialog= null;
String title= Utilities.getString(bundle, "title"); //$NON-NLS-1$ Shell parentShell= CompareUIPlugin.getShell();
String title= Utilities.getString(bundle, "title"); //$NON-NLS-1$ Shell parentShell= CompareUIPlugin.getShell();