Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » org.eclipse.jface.text.IDocument
org.eclipse.jface.text.IDocument [message #196902] Wed, 28 February 2007 09:18 Go to next message
Marc is currently offline MarcFriend
Messages: 9
Registered: July 2009
Junior Member
I'm trying to get the following snippet to work but there is something
going wrong with the imports...


"Type org.eclipse.jface.text.IDocument cannot be resolved. It is
inderectly referenced..."

Can someone explain what is going wrong and how I can fix this??

Thanks in advance!

>>>> error here <<< import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.source.CompositeRuler;
import org.eclipse.jface.text.source.LineNumberRulerColumn;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class SourceViewerTest extends ApplicationWindow {

public SourceViewerTest() {
super(null);

}
public static void main(String[] args) {
ApplicationWindow w = new SourceViewerTest();
w.setBlockOnOpen(true);
w.open();
Display.getCurrent().dispose();
}

protected Control createContents(Composite parent) {
getShell().setText("SourceViewerTest");
getShell().setSize(200,100);
Display disp = getShell().getDisplay();

Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout());

CompositeRuler ruler = new CompositeRuler();

LineNumberRulerColumn lineCol = new
LineNumberRulerColumn();
lineCol.setBackground(disp.getSystemColor(SWT.COLOR_GRAY));
lineCol.setForeground(disp.getSystemColor(SWT.COLOR_BLUE));
ruler.addDecorator(0, lineCol);

Document doc = new Document("SourceViewer\n‚Ì\nƒeƒXƒg\n");

SourceViewer sv =
new SourceViewer(
container,
ruler,
SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
sv.setDocument(doc);

return container;
}
}
Re: org.eclipse.jface.text.IDocument [message #196942 is a reply to message #196902] Wed, 28 February 2007 10:34 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Pigna wrote:

> I'm trying to get the following snippet to work but there is something
> going wrong with the imports...
>
>
> "Type org.eclipse.jface.text.IDocument cannot be resolved. It is
> inderectly referenced..."
>
> Can someone explain what is going wrong and how I can fix this??

You are missing a required plug-in. You have to add 'org.eclipse.text'.

Dani

>
> Thanks in advance!
>
>>>>> error here <<< import org.eclipse.jface.text.Document;
>>>>
> import org.eclipse.jface.text.source.CompositeRuler;
> import org.eclipse.jface.text.source.LineNumberRulerColumn;
> import org.eclipse.jface.text.source.SourceViewer;
> import org.eclipse.jface.window.ApplicationWindow;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.*;
> import org.eclipse.swt.widgets.*;
>
> public class SourceViewerTest extends ApplicationWindow {
>
> public SourceViewerTest() {
> super(null);
>
> }
> public static void main(String[] args) {
> ApplicationWindow w = new SourceViewerTest();
> w.setBlockOnOpen(true);
> w.open();
> Display.getCurrent().dispose();
> }
>
> protected Control createContents(Composite parent) {
> getShell().setText("SourceViewerTest");
> getShell().setSize(200,100);
> Display disp = getShell().getDisplay();
> Composite container = new Composite(parent, SWT.NONE);
> container.setLayout(new FillLayout());
>
> CompositeRuler ruler = new CompositeRuler();
>
> LineNumberRulerColumn lineCol = new LineNumberRulerColumn();
> lineCol.setBackground(disp.getSystemColor(SWT.COLOR_GRAY));
> lineCol.setForeground(disp.getSystemColor(SWT.COLOR_BLUE));
> ruler.addDecorator(0, lineCol);
>
> Document doc = new Document("SourceViewer\n�Ì\n�e�X�g\n");
>
> SourceViewer sv =
> new SourceViewer(
> container,
> ruler,
> SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
> sv.setDocument(doc);
>
> return container;
> }
> }
>
Previous Topic:Woots another problem
Next Topic:Can't install VE properly
Goto Forum:
  


Current Time: Fri Apr 26 03:28:48 GMT 2024

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

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

Back to the top