This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How  to make a text editor using GEF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How  to make a text editor using GEF" Watch "How  to make a text editor using GEF" New topic
Author

How to make a text editor using GEF

gong he
Greenhorn

Joined: Dec 08, 2004
Posts: 2
Hi,
I'm looking for a way to use GEF with a text editor,I known how to display various sytle of text in a Figure,but I didn't know how to make it editable.
please give me some suggestion.thanks!
[ December 08, 2004: Message edited by: gong he ]
gong he
Greenhorn

Joined: Dec 08, 2004
Posts: 2
is here a wrong place to ask the question?

as I know now,I can use org.eclipse.draw2d.text package to display text,just like this:
private void createComposite() {
LightweightSystem lws = new LightweightSystem(sShell);

FlowPage page=new FlowPage();
BlockFlow blockFlow=new BlockFlow();
page.add(blockFlow);

TextFlow text0=new TextFlow();
text0.setText("test string1 in color green");
text0.setForegroundColor(ColorConstants.green);

TextFlow text1=new TextFlow();
text1.setText("test string1 in color blue");
text1.setForegroundColor(ColorConstants.blue);

blockFlow.add(text0);
blockFlow.add(text1);

lws.setContents(page);

}


but how can make them editable? to define tool and EditPart?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to make a text editor using GEF