Java Code Examples for org.eclipse.jface.text.source.SourceViewer#setData()

The following examples show how to use org.eclipse.jface.text.source.SourceViewer#setData() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FormHelper.java    From tlaplus with MIT License 5 votes vote down vote up
public static SourceViewer createFormsSourceViewer(FormToolkit toolkit, Composite parent, int flags, SourceViewerConfiguration config)
{
    SourceViewer sourceViewer = createSourceViewer(parent, flags, config);
    sourceViewer.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);

    sourceViewer.getTextWidget().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    toolkit.adapt(sourceViewer.getTextWidget(), true, true);

    return sourceViewer;
}
 
Example 2
Source File: FormHelper.java    From tlaplus with MIT License 5 votes vote down vote up
/**
 * creates a forms-adopted read-only source viewer
 * @param toolkit
 * @param parent
 * @param flags
 * @return
 */
public static SourceViewer createFormsOutputViewer(FormToolkit toolkit, Composite parent, int flags)
{
    SourceViewer sourceViewer = createOutputViewer(parent, flags);
    sourceViewer.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TREE_BORDER);

    sourceViewer.getTextWidget().setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
    toolkit.adapt(sourceViewer.getTextWidget(), true, true);

    return sourceViewer;
}