Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » StyledText contents
StyledText contents [message #661439] Thu, 24 March 2011 16:40
Uhlersoth 872325412 is currently offline Uhlersoth 872325412Friend
Messages: 8
Registered: July 2009
Junior Member
I have a Swing app that I'm trying to convert to an Eclipse plug-in. In the app, I have a tabbed document editor with two tabs - one with rendered HTML text (a JEditorPane), and the other with the plain source (a JTextArea).

I'd like to use a similar approach as a plug-in, but I can't seem to figure out the appropriate way to create and populate the styled editor. So far my code looks like this:

	@Override
	protected void addPages() {
		// Editor title
		setPartName(getEditorInput().getName());
		
		// Page 1
		Composite composite = new Composite(getContainer(), SWT.NONE);
		compose = new StyledText(composite, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
		
		// Page 2
		text = new TextEditor();
		
		try {
			int index = addPage(composite);
			setPageText(index, "Compose");
			
			index = addPage(text, getEditorInput());
			setPageText(index, "Source");
		} 
		catch (PartInitException e) {
			Utility.showThrowable(e);
		}
	}


Page 2 shows up just fine. Page 1 of course is empty, but for the life of me I can't figure out how to convert the IEditorInput to a StyledTextContent, or even to a string.

Any suggestions? Although I live and breathe Java, I'm a complete n00b with regard to Eclipse plug-in development, so thanks for your patience!







Previous Topic:Telling My view to refresh after a build and get also the markers
Next Topic:Cross platform export issue with SVN metadata
Goto Forum:
  


Current Time: Mon Nov 24 18:19:34 GMT 2014

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

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