private static void throwPartInitException(String message, int code) throws PartInitException { IStatus status= new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, code, message, null); throw new PartInitException(status); }
private static void throwPartInitException(String message) throws PartInitException { IStatus status= new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IStatus.OK, message, null); throw new PartInitException(status); }
private static void throwPartInitException(String message, int code) throws PartInitException { IStatus status= new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, code, message, null); throw new PartInitException(status); }
/** * The <code>MultiPageEditorExample</code> implementation of this method * checks that the input is an instance of <code>IFileEditorInput</code>. */ public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException { if (!(editorInput instanceof IFileEditorInput)) throw new PartInitException( "Invalid Input: Must be IFileEditorInput"); super.init(site, editorInput); }
/** * Recreate the context for this participant. This method is invoked when * the participant is restored after a restart. Although it is provided * with a progress monitor, long running operations should be avoided. * @param manager the restored scope * @return the context for this participant * @throws CoreException */ protected MergeContext restoreContext(ISynchronizationScopeManager manager) throws CoreException { throw new PartInitException(NLS.bind(TeamUIMessages.ModelSynchronizeParticipant_1, getId())); }
/** * Recreate the context for this participant. This method is invoked when * the participant is restored after a restart. Although it is provided * with a progress monitor, long running operations should be avoided. * @param manager the restored scope * @return the context for this participant * @throws CoreException */ protected MergeContext restoreContext(ISynchronizationScopeManager manager) throws CoreException { throw new PartInitException(NLS.bind(TeamUIMessages.ModelSynchronizeParticipant_1, getId())); }
/** * The <code>MultiPageEditorExample</code> implementation of this method * checks that the input is an instance of <code>IFileEditorInput</code>. */ public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException { if (!(editorInput instanceof IFileEditorInput)) throw new PartInitException( "Invalid Input: Must be IFileEditorInput"); super.init(site, editorInput); }
@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { if (!(input instanceof IFileEditorInput) && !(input instanceof IURIEditorInput)) throw new PartInitException(NLS.bind(PDEUIMessages.TargetEditor_6, input.getClass().getName())); super.init(site, input); }
private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException { try { IMarker marker= file.createMarker(NewSearchUI.SEARCH_MARKER); HashMap<String, Integer> attributes= new HashMap<>(4); attributes.put(IMarker.CHAR_START, new Integer(offset)); attributes.put(IMarker.CHAR_END, new Integer(offset + length)); marker.setAttributes(attributes); IDE.gotoMarker(editor, marker); marker.delete(); } catch (CoreException e) { throw new PartInitException(SearchMessages.JavaSearchResultPage_error_marker, e); } }
private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException { try { IMarker marker= file.createMarker(NewSearchUI.SEARCH_MARKER); HashMap attributes= new HashMap(4); attributes.put(IMarker.CHAR_START, new Integer(offset)); attributes.put(IMarker.CHAR_END, new Integer(offset + length)); marker.setAttributes(attributes); IDE.gotoMarker(editor, marker); marker.delete(); } catch (CoreException e) { throw new PartInitException(SearchMessages.JavaSearchResultPage_error_marker, e); } }
private void showWithMarker(IEditorPart editor, IFile file, int offset, int length) throws PartInitException { try { IMarker marker= file.createMarker(NewSearchUI.SEARCH_MARKER); HashMap<String, Integer> attributes= new HashMap<>(4); attributes.put(IMarker.CHAR_START, Integer.valueOf(offset)); attributes.put(IMarker.CHAR_END, Integer.valueOf(offset + length)); marker.setAttributes(attributes); IDE.gotoMarker(editor, marker); marker.delete(); } catch (CoreException e) { throw new PartInitException(SearchMessages.JavaSearchResultPage_error_marker, e); } }
@Override public IWorkbenchPart createPart() throws PartInitException { try { if (descriptor == null) { return createErrorPart(); } return descriptor.createView(); } catch (CoreException e) { IStatus status = e.getStatus(); throw new PartInitException(new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, status.getCode(), status.getMessage(), e)); } }
@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { if (!(input instanceof CompareEditorInput)) throw new PartInitException(Utilities.getString("CompareEditor.invalidInput")); //$NON-NLS-1$ setSite(site); setInput(input); }
public void init(IEditorSite site, IEditorInput input) throws PartInitException { if (!(input instanceof CompareEditorInput)) throw new PartInitException(Utilities.getString("CompareEditor.invalidInput")); //$NON-NLS-1$ setSite(site); setInput(input); }
private void initializeContext(ResourceMapping[] mappings) throws PartInitException { try { ISynchronizationScopeManager manager = createScopeManager(mappings); MergeContext context = restoreContext(manager); initializeContext(context); } catch (CoreException e) { TeamUIPlugin.log(e); throw new PartInitException(e.getStatus()); } }
private void initializeContext(ResourceMapping[] mappings) throws PartInitException { try { ISynchronizationScopeManager manager = createScopeManager(mappings); MergeContext context = restoreContext(manager); initializeContext(context); } catch (CoreException e) { TeamUIPlugin.log(e); throw new PartInitException(e.getStatus()); } }
@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { if (!(input instanceof BuildEditorInput)) { throw new PartInitException("Unsupported class for editor input ''" + input.getClass() + "''"); //$NON-NLS-1$ //$NON-NLS-2$ } super.init(site, input); this.plan = ((BuildEditorInput) input).getPlan(); this.build = ((BuildEditorInput) input).getBuild(); setPartName(input.getName()); }
protected void showMatch(Match match, int currentOffset, int currentLength, boolean activate) throws PartInitException { try { IEditorPart editor= fEditorOpener.openMatch(match); if (editor != null && activate) editor.getEditorSite().getPage().activate(editor); if (editor instanceof ITextEditor) { ITextEditor textEditor= (ITextEditor) editor; textEditor.selectAndReveal(currentOffset, currentLength); } } catch (JavaModelException e1) { throw new PartInitException(e1.getStatus()); } }
/** * @see org.eclipse.ui.forms.editor.FormEditor#init(org.eclipse.ui.IEditorSite, * org.eclipse.ui.IEditorInput) */ public void init(IEditorSite site, IEditorInput input) throws PartInitException { if (input.getAdapter(RepositoryCommit.class) == null) throw new PartInitException( "Input could not be adapted to commit object"); //$NON-NLS-1$ super.init(site, input); setPartName(input.getName()); setTitleToolTip(input.getToolTipText()); }
@Override public void initialize(IWorkbenchPart part) throws PartInitException { ViewSite viewSite = new ViewSite(getModel(), part, this, descriptor == null ? null : descriptor.getConfigurationElement()); IViewPart view = (IViewPart) part; view.init(viewSite, memento); if (view.getSite() != viewSite || view.getViewSite() != viewSite) { String id = descriptor == null ? getModel().getElementId() : descriptor.getId(); throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_siteException, id)); } legacyPart = part; addPropertyListeners(); }