Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Singleton Editor or View?
Singleton Editor or View? [message #460380] Thu, 21 December 2006 00:16 Go to next message
Eclipse UserFriend
I have a requirement to create a singleton Editor for a log file per
workspace. Should I create a View or a Editor?
The file can be edited, I need to some content markup, syntax highlighting
which are possible in a Editor. But how can
I have a Editor in a View? Or how can I have a singleton Editor?

thanx,
Rajesh
Re: Singleton Editor or View? [message #460472 is a reply to message #460380] Thu, 21 December 2006 04:41 Go to previous message
Eclipse UserFriend
Originally posted by: ssankhua.yahoo.com

Hi Rajesh,

You can create a Singleton editor by making the EditorInput class singleton. For example -

public class TestEditorInput implements IEditorInput {
//Static instance
private static OrderEntryEditorInput instance = null;
private String user = "";

//Private Constructor which ensures singleton instance
private TestEditorInput (String user)
{
this.user = user;
}

//create static instance
public static TestEditorInput getInstance(String user)
{
if (instance == null)
{
instance = new TestEditorInput(user);
}
return instance;
}
....

I hope it works :)

Barnali
Previous Topic:Showing the 'Error Log' view
Next Topic:Table editing using TableViewer
Goto Forum:
  


Current Time: Wed Mar 19 23:08:17 EDT 2025

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

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

Back to the top