@Override protected IJavaElement getElementAt(int offset) { if (getEditorInput() instanceof IClassFileEditorInput) { try { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); return input.getClassFile().getElementAt(offset); } catch (JavaModelException x) { } } return null; }
protected IJavaElement getElementAt(int offset) { if (getEditorInput() instanceof IClassFileEditorInput) { try { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); return input.getClassFile().getElementAt(offset); } catch (JavaModelException x) { } } return null; }
@Override protected IJavaElement getElementAt(int offset) { if (getEditorInput() instanceof IClassFileEditorInput) { try { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); return input.getClassFile().getElementAt(offset); } catch (JavaModelException x) { } } return null; }
@Override protected IJavaElement getCorrespondingElement(IJavaElement element) { if (getEditorInput() instanceof IClassFileEditorInput) { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); IJavaElement parent= element.getAncestor(IJavaElement.CLASS_FILE); if (input.getClassFile().equals(parent)) return element; } return null; }
@Override protected IJavaElement getCorrespondingElement(IJavaElement element) { if (getEditorInput() instanceof IClassFileEditorInput) { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); IJavaElement parent= element.getAncestor(IJavaElement.CLASS_FILE); if (input.getClassFile().equals(parent)) return element; } return null; }
protected IJavaElement getCorrespondingElement(IJavaElement element) { if (getEditorInput() instanceof IClassFileEditorInput) { IClassFileEditorInput input= (IClassFileEditorInput) getEditorInput(); IJavaElement parent= element.getAncestor(IJavaElement.CLASS_FILE); if (input.getClassFile().equals(parent)) return element; } return null; }
/** * Posts this runnable into the event queue if not already there. * * @param input the input to be set when executed */ public void post(IClassFileEditorInput input) { synchronized(this) { if (fPosted) { if (input != null && input.equals(fClassFileEditorInput)) fClassFileEditorInput= input; return; } } if (input != null && input.equals(getEditorInput())) { ISourceViewer viewer= getSourceViewer(); if (viewer != null) { StyledText textWidget= viewer.getTextWidget(); if (textWidget != null && !textWidget.isDisposed()) { synchronized (this) { fPosted= true; fClassFileEditorInput= input; } textWidget.getDisplay().asyncExec(this); } } } } }
public void createPartControl(Composite parent) { fParent= new Composite(parent, SWT.NONE); fStackLayout= new StackLayout(); fParent.setLayout(fStackLayout); fViewerComposite= new Composite(fParent, SWT.NONE); fViewerComposite.setLayout(new FillLayout()); super.createPartControl(fViewerComposite); fStackLayout.topControl= fViewerComposite; fParent.layout(); try { verifyInput(getEditorInput()); } catch (CoreException e) { String title= JavaEditorMessages.ClassFileEditor_error_title; String message= JavaEditorMessages.ClassFileEditor_error_message; ExceptionHandler.handle(e, fParent.getShell(), title, message); } }
@Override public void createPartControl(Composite parent) { fParent= new Composite(parent, SWT.NONE); fStackLayout= new StackLayout(); fParent.setLayout(fStackLayout); fViewerComposite= new Composite(fParent, SWT.NONE); fViewerComposite.setLayout(new FillLayout()); super.createPartControl(fViewerComposite); fStackLayout.topControl= fViewerComposite; fParent.layout(); try { verifyInput(getEditorInput()); } catch (CoreException e) { String title= JavaEditorMessages.ClassFileEditor_error_title; String message= JavaEditorMessages.ClassFileEditor_error_message; ExceptionHandler.handle(e, fParent.getShell(), title, message); } }
@Override public void createPartControl(Composite parent) { fParent= new Composite(parent, SWT.NONE); fStackLayout= new StackLayout(); fParent.setLayout(fStackLayout); fViewerComposite= new Composite(fParent, SWT.NONE); fViewerComposite.setLayout(new FillLayout()); super.createPartControl(fViewerComposite); fStackLayout.topControl= fViewerComposite; fParent.layout(); try { verifyInput(getEditorInput()); } catch (CoreException e) { String title= JavaEditorMessages.ClassFileEditor_error_title; String message= JavaEditorMessages.ClassFileEditor_error_message; ExceptionHandler.handle(e, fParent.getShell(), title, message); } }
/** * Posts this runnable into the event queue if not already there. * * @param input the input to be set when executed */ public void post(IClassFileEditorInput input) { synchronized(this) { if (fPosted) { if (isEqualInput(input, fClassFileEditorInput)) fClassFileEditorInput= input; return; } } if (isEqualInput(input, getEditorInput())) { ISourceViewer viewer= getSourceViewer(); if (viewer != null) { StyledText textWidget= viewer.getTextWidget(); if (textWidget != null && !textWidget.isDisposed()) { synchronized (this) { fPosted= true; fClassFileEditorInput= input; } textWidget.getDisplay().asyncExec(this); } } } }
/** * Posts this runnable into the event queue if not already there. * * @param input the input to be set when executed */ public void post(IClassFileEditorInput input) { synchronized(this) { if (fPosted) { if (isEqualInput(input, fClassFileEditorInput)) fClassFileEditorInput= input; return; } } if (isEqualInput(input, getEditorInput())) { ISourceViewer viewer= getSourceViewer(); if (viewer != null) { StyledText textWidget= viewer.getTextWidget(); if (textWidget != null && !textWidget.isDisposed()) { synchronized (this) { fPosted= true; fClassFileEditorInput= input; } textWidget.getDisplay().asyncExec(this); } } } }
@Override public void widgetSelected(SelectionEvent event) { Shell shell= getSite().getShell(); try { IClasspathEntry result= BuildPathDialogAccess.configureSourceAttachment(shell, entry, canEditEncoding); if (result != null) { applySourceAttachment(shell, result, jproject, containerPath, entry.getReferencingEntry() != null); verifyInput(getEditorInput()); } } catch (CoreException e) { String title= JavaEditorMessages.SourceAttachmentForm_error_title; String message= JavaEditorMessages.SourceAttachmentForm_error_message; ExceptionHandler.handle(e, shell, title, message); } }
@Override public void widgetSelected(SelectionEvent event) { Shell shell= getSite().getShell(); try { IClasspathEntry result= BuildPathDialogAccess.configureSourceAttachment(shell, entry, canEditEncoding); if (result != null) { applySourceAttachment(shell, result, jproject, containerPath, entry.getReferencingEntry() != null); verifyInput(getEditorInput()); } } catch (CoreException e) { String title= JavaEditorMessages.SourceAttachmentForm_error_title; String message= JavaEditorMessages.SourceAttachmentForm_error_message; ExceptionHandler.handle(e, shell, title, message); } }
((ClassFileDocumentProvider) documentProvider).addInputChangeListener(this); verifyInput(getEditorInput());
((ClassFileDocumentProvider) documentProvider).addInputChangeListener(this); verifyInput(getEditorInput());
((ClassFileDocumentProvider) documentProvider).addInputChangeListener(this); verifyInput(getEditorInput());