@Override public void run() { if (!isClosed()) fDocument.set(fContents); }
protected void setupDocument(Object element, IDocument document) { String content = getString(element); document.set(content); IDocumentPartitioner partitioner = documentPartitioner.get(); partitioner.connect(document); document.setDocumentPartitioner(partitioner); XtextResource resource = createResource(element); loadResource(element, resource); if (resource!=null) { ((XtextDocument) document).setInput(resource); } }
@Override public void run() { if (!isClosed()) fDocument.set(fContents); }
public void updateEditorInput(Object input) { fIgnoreChange = true; String text = ""; //$NON-NLS-1$ if (input instanceof ISchemaObject) text = ((ISchemaObject) input).getDescription(); fDocument.set(text == null ? "" : text); //$NON-NLS-1$ fElement = input; fIgnoreChange = false; }
XMLOutputter xmlOutput = new XMLOutputter(Format.getPrettyFormat()); String contents = xmlOutput.outputString(document); IDocumentProvider provider = srcObj.getDocumentProvider(); IDocument idocument = provider.getDocument(srcObj.getEditorInput()); idocument.set(contents);
/** * @see IDataDisplay#clear() */ public void clear() { IDocument document= getTextViewer().getDocument(); if (document != null) { document.set(""); //$NON-NLS-1$ } }
/** * Update the pattern viewer to show the current template. * <p> * Subclasses can extend this method to update their own pattern viewer. * </p> * * @param template the template */ protected void updatePatternViewer(Template template) { String pattern= template != null ? template.getPattern() : ""; //$NON-NLS-1$ fPatternViewer.getDocument().set(pattern); }
/** * Clears the source viewer, removes all text. */ protected void clearSourceViewer(){ if (fDetailJob != null) { fDetailJob.cancel(); } fLastDisplayed = null; fDetailDocument.set(IInternalDebugCoreConstants.EMPTY_STRING); fSourceViewer.setEditable(false); }
public void refreshFromDatabase(Object element, IControlConnection controlCon, ProcIdentifier proc) throws CoreException, SQLException { IDocument document = getDocument(element); document.set(controlCon.getProcSource(proc)); }
public void run() { if (fIOConsole == null) { IDocument document = fViewer.getDocument(); if (document != null) { document.set(""); //$NON-NLS-1$ } fViewer.setSelectedRange(0, 0); } else { fIOConsole.clearConsole(); } } });
private MessageConsole getConsole() { if (console == null) { ConsolePlugin plugin = ConsolePlugin.getDefault(); IConsoleManager conMan = plugin.getConsoleManager(); final ImageDescriptor infiniTestIconDescriptor = InfinitestPlugin.imageDescriptorFromPlugin(InfinitestPlugin.PLUGIN_ID, "icons/infinitest-icon.png"); console = new MessageConsole("Infinitest Console", infiniTestIconDescriptor); console.getDocument().set(""); conMan.addConsoles(new IConsole[] { console }); } return console; }
/** * @param viewer * @param preferenceStore */ private void format(final SourceViewer sourceViewer, final IPreferenceStore store) { String contents = sourceViewer.getDocument().get(); FormattingPreferences prefs = new FormattingPreferences(); prefs.setPreferenceStore(store); contents = XmlFormatter.format(contents, prefs); viewer.getDocument().set(contents); } };
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); }
public void updateDescriptionViewer(ISchemaObject obj) { if (obj != null) { String text = obj.getDescription(); fDescriptionViewer.getDocument().set(text == null ? "" : text); //$NON-NLS-1$ fDescriptionViewer.getViewer().setEditable(obj.getSchema().isEditable()); } }
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(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(getChangeMethodSignatureProcessor().getNewMethodSignature()); fSignaturePreview.getTextWidget().setTopPixel(top); } catch (JavaModelException e){ ExceptionHandler.handle(e, RefactoringMessages.ChangeSignatureRefactoring_modify_Parameters, RefactoringMessages.ChangeSignatureInputPage_exception); } } }
private void setTextAttribute( SyntaxItem item ) { ldifEditorWidget.getSourceViewerConfiguration().setTextAttribute( item.key, item.rgb, item.getStyle() ); int topIndex = ldifEditorWidget.getSourceViewer().getTopIndex(); // ldifEditorWidget.getSourceViewer().getDocument().set(""); ldifEditorWidget.getSourceViewer().getDocument().set( LDIF_INITIAL ); ldifEditorWidget.getSourceViewer().setTopIndex( topIndex ); }