Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Open file in view plug-in
Open file in view plug-in [message #1273134] Wed, 19 March 2014 15:11 Go to next message
Vinicius Pereira is currently offline Vinicius PereiraFriend
Messages: 50
Registered: March 2014
Member
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 15:30 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
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 10:44 Go to previous messageGo to next message
Vinicius Pereira is currently offline Vinicius PereiraFriend
Messages: 50
Registered: March 2014
Member
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 15:32 Go to previous message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
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: Thu Mar 28 23:09:45 GMT 2024

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

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

Back to the top