Skip to main content



      Home
Home » Newcomers » Newcomers » Open file in view plug-in
Open file in view plug-in [message #1273134] Wed, 19 March 2014 11:11 Go to next message
Eclipse UserFriend
Hi everyone,

I'm new in Eclipse plug-in area. I know how open files and how create a Sample View, but I want to create a Trace view (for example) that open (load) a trace file in TXT.
How I do this?

thank you
Re: Open file in view plug-in [message #1275142 is a reply to message #1273134] Sat, 22 March 2014 11:30 Go to previous messageGo to next message
Eclipse UserFriend
I think no one has answered your question yet because you are not being specific. You said that you know how to open files and create a view, but that you can't open a file in a view. What have you tried? Can you include some sample code?
Re: Open file in view plug-in [message #1276286 is a reply to message #1275142] Mon, 24 March 2014 06:44 Go to previous messageGo to next message
Eclipse UserFriend
Andrew Eisenberg wrote on Sat, 22 March 2014 11:30
I think no one has answered your question yet because you are not being specific. You said that you know how to open files and create a view, but that you can't open a file in a view. What have you tried? Can you include some sample code?



Hi Andrew!

Actually it was a little of "newbie" from myself. When I saw the Sample View and try to understand I get a little lost.

Later, I saw that I could delete almost every code I just open a file and put the content in a label (for example). Then put that label in the Sample View.

File fileDir = new File("PATH");
BufferedReader in = new BufferedReader(new FileReader(fileDir));
			
String str = "";
styledText.setText(""); 
			
while ((str = in.readLine()) != null) {
        //Just to see if was right
        System.out.println(str);

        //to write each line of the file in the styledText
	styledText.setText(styledText.getText() + "\n" + str);
}
			
in.close();


I used the styledText to later create links and other stuffs.

But thanks for your answer Smile
Re: Open file in view plug-in [message #1276456 is a reply to message #1276286] Mon, 24 March 2014 11:32 Go to previous message
Eclipse UserFriend
Glad you were able to get this working.
Previous Topic:FileReader() constructor issue in Eclipse??
Next Topic:What file contains my unfortunately non-global display preferences?
Goto Forum:
  


Current Time: Wed Jun 18 15:09:11 EDT 2025

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

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

Back to the top