/** * @return Returns <code>true</code> iff the current reconcile is canceled. * <p> * NOTE: Also called from background thread. * </p> */ public boolean isCanceled() { IDocument document= fSourceViewer != null ? fSourceViewer.getDocument() : null; if (document == null) return fIsCanceled; synchronized (getLockObject(document)) { return fIsCanceled; } }
/** * @return Returns <code>true</code> iff the current reconcile is canceled. * <p> * NOTE: Also called from background thread. * </p> */ public boolean isCanceled() { IDocument document= fSourceViewer != null ? fSourceViewer.getDocument() : null; if (document == null) return fIsCanceled; synchronized (getLockObject(document)) { return fIsCanceled; } }
/** * Set whether or not the current reconcile is canceled. * * @param isCanceled <code>true</code> iff the current reconcile is canceled */ public void setCanceled(boolean isCanceled) { IDocument document= fSourceViewer != null ? fSourceViewer.getDocument() : null; if (document == null) { fIsCanceled= isCanceled; return; } synchronized (getLockObject(document)) { fIsCanceled= isCanceled; } }
@Override public void lineGetSegments(BidiSegmentEvent event) { if (redraws()) { try { event.segments= getBidiLineSegments(getDocument(), baseLevel, widgetOffset2ModelOffset(event.lineOffset), event.lineText); } catch (BadLocationException e) { // don't touch the segments } } } });
@Override public void lineGetSegments(BidiSegmentEvent event) { if (redraws()) { try { event.segments= getBidiLineSegments(getDocument(), baseLevel, widgetOffset2ModelOffset(event.lineOffset), event.lineText); } catch (BadLocationException e) { // don't touch the segments } } } });
/** * Install this presenter on the given source viewer and background presentation * reconciler. * * @param sourceViewer the source viewer * @param backgroundPresentationReconciler the background presentation reconciler, * can be <code>null</code>, in that case {@link SemanticHighlightingPresenter#createPresentation(List, List)} * should not be called */ public void install(JavaSourceViewer sourceViewer, JavaPresentationReconciler backgroundPresentationReconciler) { fSourceViewer= sourceViewer; fPresentationReconciler= backgroundPresentationReconciler; fSourceViewer.prependTextPresentationListener(this); fSourceViewer.addTextInputListener(this); manageDocument(fSourceViewer.getDocument()); }
private void createMethodSignature(Composite parent) { JavaSourceViewer signatureViewer= InputPageUtil.createSignaturePreview(parent); String signatureLabel= JavaElementLabels.getElementLabel(fRefactoring.getMethod(), LABEL_FLAGS); signatureViewer.getDocument().set(signatureLabel); }
private void createMethodSignature(Composite parent) { JavaSourceViewer signatureViewer= InputPageUtil.createSignaturePreview(parent); String signatureLabel= JavaElementLabels.getElementLabel(fRefactoring.getMethod(), LABEL_FLAGS); signatureViewer.getDocument().set(signatureLabel); }
private void updatePreview(String text) { if (fSignaturePreview == null) return; if (text.length() == 0) text= "someMethodName"; //$NON-NLS-1$ int top= fSignaturePreview.getTextWidget().getTopPixel(); String signature; try { signature= fRefactoring.getSignature(text); } catch (IllegalArgumentException e) { signature= ""; //$NON-NLS-1$ } fSignaturePreview.getDocument().set(signature); fSignaturePreview.getTextWidget().setTopPixel(top); }
private void textModified(String text) { fRefactoring.setMethodName(text); RefactoringStatus status= validatePage(true); if (!status.hasFatalError()) { updatePreview(text); } else { fSignaturePreview.getDocument().set(""); //$NON-NLS-1$ } setPageComplete(status); }
private void textModified(String text) { fRefactoring.setMethodName(text); RefactoringStatus status= validatePage(true); if (!status.hasFatalError()) { updatePreview(text); } else { fSignaturePreview.getDocument().set(""); //$NON-NLS-1$ } setPageComplete(status); }
/** * Uninstall this presenter. */ public void uninstall() { setCanceled(true); if (fSourceViewer != null) { fSourceViewer.removeTextPresentationListener(this); releaseDocument(fSourceViewer.getDocument()); invalidateTextPresentation(); resetState(); fSourceViewer.removeTextInputListener(this); fSourceViewer= null; } }
/** * Uninstall this presenter. */ public void uninstall() { setCanceled(true); if (fSourceViewer != null) { fSourceViewer.removeTextPresentationListener(this); releaseDocument(fSourceViewer.getDocument()); invalidateTextPresentation(); resetState(); fSourceViewer.removeTextInputListener(this); fSourceViewer= null; } }
/** * Uninstall this presenter. */ public void uninstall() { setCanceled(true); if (fSourceViewer != null) { fSourceViewer.removeTextPresentationListener(this); releaseDocument(fSourceViewer.getDocument()); invalidateTextPresentation(); resetState(); fSourceViewer.removeTextInputListener(this); fSourceViewer= null; } }
private void updateSignaturePreview() { try { int top= fSignaturePreview.getTextWidget().getTopPixel(); fSignaturePreview.getDocument().set(fProcessor.getNewMethodSignature()); fSignaturePreview.getTextWidget().setTopPixel(top); } catch (JavaModelException e) { ExceptionHandler.handle(e, RefactoringMessages.IntroduceParameterObjectWizard_error_title, RefactoringMessages.IntroduceParameterObjectWizard_error_description); } }
private void updateSignaturePreview() { try { int top= fSignaturePreview.getTextWidget().getTopPixel(); fSignaturePreview.getDocument().set(fProcessor.getNewMethodSignature()); fSignaturePreview.getTextWidget().setTopPixel(top); } catch (JavaModelException e) { ExceptionHandler.handle(e, RefactoringMessages.IntroduceParameterObjectWizard_error_title, RefactoringMessages.IntroduceParameterObjectWizard_error_description); } }
private void updateSignaturePreview() { try{ int top= fSignaturePreview.getTextWidget().getTopPixel(); fSignaturePreview.getDocument().set(getChangeMethodSignatureProcessor().getNewMethodSignature()); fSignaturePreview.getTextWidget().setTopPixel(top); } catch (JavaModelException e){ ExceptionHandler.handle(e, RefactoringMessages.ChangeSignatureRefactoring_modify_Parameters, RefactoringMessages.ChangeSignatureInputPage_exception); } } }
private void updateSignaturePreview() { try{ int top= fSignaturePreview.getTextWidget().getTopPixel(); fSignaturePreview.getDocument().set(getIntroduceParameterRefactoring().getMethodSignaturePreview()); fSignaturePreview.getTextWidget().setTopPixel(top); } catch (JavaModelException e){ ExceptionHandler.handle(e, RefactoringMessages.IntroduceParameterWizard_defaultPageTitle, RefactoringMessages.ChangeSignatureInputPage_exception); } }
private void updateSignaturePreview() { try{ int top= fSignaturePreview.getTextWidget().getTopPixel(); fSignaturePreview.getDocument().set(getChangeMethodSignatureProcessor().getNewMethodSignature()); fSignaturePreview.getTextWidget().setTopPixel(top); } catch (JavaModelException e){ ExceptionHandler.handle(e, RefactoringMessages.ChangeSignatureRefactoring_modify_Parameters, RefactoringMessages.ChangeSignatureInputPage_exception); } } }
private void updateSignaturePreview() { try{ int top= fSignaturePreview.getTextWidget().getTopPixel(); fSignaturePreview.getDocument().set(getIntroduceParameterRefactoring().getMethodSignaturePreview()); fSignaturePreview.getTextWidget().setTopPixel(top); } catch (JavaModelException e){ ExceptionHandler.handle(e, RefactoringMessages.IntroduceParameterWizard_defaultPageTitle, RefactoringMessages.ChangeSignatureInputPage_exception); } }