public IStatus prepareInput(CompareEditorInput input, IProgressMonitor monitor) { try { input.run(monitor); String message= input.getMessage(); if (message != null) { return new Status(IStatus.ERROR, CompareUIPlugin.PLUGIN_ID, 0, message, null); } if (input.getCompareResult() == null) { return new Status(IStatus.ERROR, CompareUIPlugin.PLUGIN_ID, NO_DIFFERENCE, Utilities.getString("CompareUIPlugin.noDifferences"), null); //$NON-NLS-1$ } return Status.OK_STATUS; } catch (InterruptedException e) { throw new OperationCanceledException(); } catch (InvocationTargetException e) { return new Status(IStatus.ERROR, CompareUIPlugin.PLUGIN_ID, 0, Utilities.getString("CompareUIPlugin.compareFailed"), e.getTargetException()); //$NON-NLS-1$ } }
public IStatus prepareInput(CompareEditorInput input, IProgressMonitor monitor) { try { input.run(monitor); String message= input.getMessage(); if (message != null) { return new Status(IStatus.ERROR, CompareUIPlugin.PLUGIN_ID, 0, message, null); } if (input.getCompareResult() == null) { return new Status(IStatus.ERROR, CompareUIPlugin.PLUGIN_ID, NO_DIFFERENCE, Utilities.getString("CompareUIPlugin.noDifferences"), null); //$NON-NLS-1$ } return Status.OK_STATUS; } catch (InterruptedException e) { throw new OperationCanceledException(); } catch (InvocationTargetException e) { return new Status(IStatus.ERROR, CompareUIPlugin.PLUGIN_ID, 0, Utilities.getString("CompareUIPlugin.compareFailed"), e.getTargetException()); //$NON-NLS-1$ } }
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; }
private static boolean matches(IEditorReference editorRef, IEditorInput input) { if (input instanceof FileEditorInput) { IFile file = ((FileEditorInput) input).getFile(); CompareEditorInput cei = (CompareEditorInput) ((EditorPart) editorRef .getPart(false)).getEditorInput(); Object compareResult = cei.getCompareResult(); if (compareResult instanceof IAdaptable) { IResource r = ((IAdaptable) compareResult).getAdapter(IResource.class); if (r != null) return file.equals(r); } if (compareResult instanceof ICompareInput) { ICompareInput compareInput = (ICompareInput) compareResult; ITypedElement left = compareInput.getLeft(); if (left instanceof ResourceNode) if (file.equals(((ResourceNode) left).getResource())) return true; ITypedElement right = compareInput.getRight(); if (right instanceof ResourceNode) if (file.equals(((ResourceNode) right).getResource())) return true; } } return false; }
((IPropertyChangeNotifier)input).addPropertyChangeListener(this); setState(cei.getCompareResult() == null ? INITIALIZING : INITIALIZED); if (fPageBook != null) createCompareControl(); fControl.setSize(oldSize); boolean hasResult = cei.getCompareResult() != null; if (!hasResult) { initializeInBackground(cei, hadPreviousInput);
((IPropertyChangeNotifier)input).addPropertyChangeListener(this); setState(cei.getCompareResult() == null ? INITIALIZING : INITIALIZED); if (fPageBook != null) createCompareControl(); if (cei.getCompareResult() == null) { initializeInBackground(cei);
if (hasChildren(getCompareResult())) fFocusPane= fStructureInputPane;
if (hasChildren(getCompareResult())) fFocusPane= fStructureInputPane;
if (input instanceof CompareEditorInput) { CompareEditorInput ci = (CompareEditorInput) input; if (ci.getCompareResult() == null) { if (getState() == INITIALIZING) { setPageLater();
if (input instanceof CompareEditorInput) { CompareEditorInput ci = (CompareEditorInput) input; if (ci.getCompareResult() == null) { if (getState() == INITIALIZING) { getSite().setSelectionProvider(new CompareEditorSelectionProvider());