public void run() { dialog.open(); } });
public void run() { ErrorDialog dialog = new ErrorDialog(getShell(), TeamUIMessages.ModelMergeOperation_0, TeamUIMessages.ModelMergeOperation_1, status, IStatus.ERROR | IStatus.WARNING | IStatus.INFO) { protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false); createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true); createDetailsButton(parent); } /* (non-Javadoc) * @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int) */ protected void buttonPressed(int id) { if (id == IDialogConstants.YES_ID) super.buttonPressed(IDialogConstants.OK_ID); else if (id == IDialogConstants.NO_ID) super.buttonPressed(IDialogConstants.CANCEL_ID); super.buttonPressed(id); } }; int code = dialog.open(); result[0] = code == 0; } };
ErrorDialog dialog = new ErrorDialog(parentShell, title, message, status, displayMask); return dialog.open();
ErrorDialog dialog = new ErrorDialog(parentShell, title, message, status, displayMask); return dialog.open();
ErrorDialog dialog = new ErrorDialog(parentShell, title, message, status, displayMask); return dialog.open();
int code = dialog.open(); result[0] = code == 0; };
private void handleFinishedDropMove(DragSourceEvent event) { MultiStatus status= new MultiStatus( JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource, null); List resources= convertSelection(); for (Iterator iter= resources.iterator(); iter.hasNext();) { IResource resource= (IResource) iter.next(); try { resource.delete(true, null); } catch (CoreException e) { status.add(e.getStatus()); } } if (status.getChildren().length > 0) { Shell parent= SWTUtil.getShell(event.widget); ErrorDialog error= new ErrorDialog(parent, JavaUIMessages.ResourceTransferDragAdapter_moving_resource, JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files, status, IStatus.ERROR); error.open(); } } }
private void handleFinishedDropMove(DragSourceEvent event) { MultiStatus status= new MultiStatus( JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource, null); List<IResource> resources= convertSelection(); for (Iterator<IResource> iter= resources.iterator(); iter.hasNext();) { IResource resource= iter.next(); try { resource.delete(true, null); } catch (CoreException e) { status.add(e.getStatus()); } } int childrenCount= status.getChildren().length; if (childrenCount > 0) { Shell parent= SWTUtil.getShell(event.widget); ErrorDialog error= new ErrorDialog(parent, JavaUIMessages.ResourceTransferDragAdapter_moving_resource, childrenCount == 1 ? JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_singular : Messages.format( JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_plural, String.valueOf(childrenCount)), status, IStatus.ERROR); error.open(); } } }
private void handleFinishedDropMove(DragSourceEvent event) { MultiStatus status= new MultiStatus( JavaPlugin.getPluginId(), IJavaStatusConstants.INTERNAL_ERROR, JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_resource, null); List<IResource> resources= convertSelection(); for (Iterator<IResource> iter= resources.iterator(); iter.hasNext();) { IResource resource= iter.next(); try { resource.delete(true, null); } catch (CoreException e) { status.add(e.getStatus()); } } int childrenCount= status.getChildren().length; if (childrenCount > 0) { Shell parent= SWTUtil.getShell(event.widget); ErrorDialog error= new ErrorDialog(parent, JavaUIMessages.ResourceTransferDragAdapter_moving_resource, childrenCount == 1 ? JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_singular : Messages.format( JavaUIMessages.ResourceTransferDragAdapter_cannot_delete_files_plural, String.valueOf(childrenCount)), status, IStatus.ERROR); error.open(); } } }
private void handle(Change change, IStatus status) { if (change instanceof CompositeChange) { Change undo= ((CompositeChange)change).getUndoUntilException(); if (undo != null) { JavaPlugin.log(status); final ErrorDialog dialog= new RefactorErrorDialog(fParent, RefactoringMessages.ChangeExceptionHandler_dialog_title, Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); int result= dialog.open(); if (result == IDialogConstants.OK_ID) { performUndo(undo); } return; } } ErrorDialog dialog= new ErrorDialog(fParent, RefactoringMessages.ChangeExceptionHandler_dialog_title, Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); dialog.open(); }
private void handle(Change change, IStatus status) { if (change instanceof CompositeChange) { Change undo= ((CompositeChange)change).getUndoUntilException(); if (undo != null) { RefactoringUIPlugin.log(status); final ErrorDialog dialog= new RefactorErrorDialog(fParent, RefactoringUIMessages.ChangeExceptionHandler_refactoring, Messages.format(RefactoringUIMessages.ChangeExceptionHandler_unexpected_exception, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); int result= dialog.open(); if (result == IDialogConstants.OK_ID) { performUndo(undo); } return; } } ErrorDialog dialog= new ErrorDialog(fParent, RefactoringUIMessages.ChangeExceptionHandler_refactoring, Messages.format(RefactoringUIMessages.ChangeExceptionHandler_unexpected_exception, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); dialog.open(); }
int code = dialog.open(); result[0] = code == 0; };
protected void openSaveErrorDialog(String title, String message, CoreException exception) { IStatus status= exception.getStatus(); if (JavaUI.ID_PLUGIN.equals(status.getPlugin()) && status.getCode() == IJavaStatusConstants.EDITOR_POST_SAVE_NOTIFICATION) { int mask= IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR; ErrorDialog dialog = new ErrorDialog(getSite().getShell(), title, message, status, mask) { protected Control createDialogArea(Composite parent) { parent= (Composite)super.createDialogArea(parent); Link link= new Link(parent, SWT.NONE); link.setText(JavaEditorMessages.CompilationUnitEditor_error_saving_saveParticipant); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { PreferencesUtil.createPreferenceDialogOn(getShell(), "org.eclipse.jdt.ui.preferences.SaveParticipantPreferencePage", null, null).open(); //$NON-NLS-1$ } }); GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false); link.setLayoutData(gridData); return parent; } }; dialog.open(); } else super.openSaveErrorDialog(title, message, exception); }
private void handle(Change change, IStatus status) { if (change instanceof CompositeChange) { Change undo= ((CompositeChange)change).getUndoUntilException(); if (undo != null) { JavaPlugin.log(status); final ErrorDialog dialog= new RefactorErrorDialog(fParent, change.getName(), Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); int result= dialog.open(); if (result == IDialogConstants.OK_ID) { performUndo(undo); } return; } } ErrorDialog dialog= new ErrorDialog(fParent, change.getName(), Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); dialog.open(); }
private void handle(Change change, IStatus status) { if (change instanceof CompositeChange) { Change undo= ((CompositeChange)change).getUndoUntilException(); if (undo != null) { JavaPlugin.log(status); final ErrorDialog dialog= new RefactorErrorDialog(fParent, change.getName(), Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); int result= dialog.open(); if (result == IDialogConstants.OK_ID) { performUndo(undo); } return; } } ErrorDialog dialog= new ErrorDialog(fParent, change.getName(), Messages.format(RefactoringMessages.ChangeExceptionHandler_dialog_message, fName), status, IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR); dialog.open(); }
int code = dialog.open(); result[0] = code == 0; };
int returnCode= errorDialog.open();