Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Replace default StyledText to create a custom text editor
Replace default StyledText to create a custom text editor [message #1330257] Sat, 03 May 2014 15:08
Error Segfault is currently offline Error SegfaultFriend
Messages: 1
Registered: May 2014
Junior Member
Hello,

I would like to write a plugin modifying the behavior of the default text editor. The code that I need to change is located in org.eclipse.swt.custom.StyledText, so the idea would be to create a copy of this class and to instantiate it in in org.eclipse.jface.text.TextViewer instead of the StyledText:

protected CustomStyledText createTextWidget(Composite parent, int styles) {
		CustomStyledText styledText= new CustomStyledText(parent, styles);
		styledText.setLeftMargin(Math.max(styledText.getLeftMargin(), 2));
		return styledText;
}


It seems that the best way to modify TextViewer is to make my own version of the org.eclipse.jface plugin and to release it wrapped into a feature project.

But adding a class to swt package seems hard, first because there is different jars depending on the operating system used (org.eclipse.swt.cocoa, org.eclipse.swt.gtk ....) and also because copy pasting the code of StyledText is not that easy since there is call to external methods waiting for a strict StyledText.
Any ideas ?

[Updated on: Sun, 04 May 2014 12:00]

Report message to a moderator

Previous Topic:Recursive PDE headless build
Next Topic:ATL Abstract class
Goto Forum:
  


Current Time: Fri Apr 19 01:11:23 GMT 2024

Powered by FUDForum. Page generated in 0.02288 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top