public void addLineStyleListener( LineStyleListener lineStyler ) { styledText.addLineStyleListener( lineStyler ); }
inputCmd.addLineStyleListener(new LineStyleListener()
/** * Applies {@link LineNumbersStyleListener} to given text. * * @param styledText * Text to apply the line style to. */ public static void apply(StyledText styledText) { styledText.addLineStyleListener(new LineNumbersStyleListener(styledText)); } }
public static void attach(StyledText styledText){ StyledTextLineNumber sl = new StyledTextLineNumber(); styledText.addLineStyleListener(sl); styledText.addModifyListener(sl); }
void createStyledText() { text = new StyledText (shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); GridData spec = new GridData(); spec.horizontalAlignment = GridData.FILL; spec.grabExcessHorizontalSpace = true; spec.verticalAlignment = GridData.FILL; spec.grabExcessVerticalSpace = true; text.setLayoutData(spec); text.addLineStyleListener(lineStyler); text.setEditable(false); Color bg = Display.getDefault().getSystemColor(SWT.COLOR_GRAY); text.setBackground(bg); }
/** * Constructs a new viewer in the given parent for the specified console. * * @param parent * containing widget * @param console * text console */ public TextConsoleViewer(Composite parent, TextConsole console) { super(parent, null, SWT.V_SCROLL | SWT.H_SCROLL); this.console = console; IDocument document = console.getDocument(); setDocument(document); StyledText styledText = getTextWidget(); styledText.setDoubleClickEnabled(true); styledText.addLineStyleListener(this); styledText.addLineBackgroundListener(this); styledText.setEditable(true); setFont(console.getFont()); styledText.addMouseTrackListener(this); styledText.addListener(SWT.MouseUp, mouseUpListener); ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); propertyChangeListener = new HyperlinkColorChangeListener(); colorRegistry.addListener(propertyChangeListener); revealJob.setSystem(true); document.addDocumentListener(documentListener); document.addPositionUpdater(positionUpdater); }
styledText.addLineStyleListener (event -> log (eventName, event));
styledText.addLineStyleListener(this); styledText.addLineBackgroundListener(this); styledText.setEditable(true);