Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » PropertyDialog for e4 app(How to open a PropertDialog with code)
PropertyDialog for e4 app [message #1093935] Sat, 24 August 2013 22:59
Don Smyth is currently offline Don SmythFriend
Messages: 35
Registered: April 2013
Member
Rather than create my own dialog that displays properties of a node in tree I am trying to open a E3.x PropertyDialog. My application is otherwise all e4.

Online tutorials (eg Vogella) and the book by Blewitt, A (2013) 'Eclipse plugin development by example', have examples with PreferenceDialog (which is apparently similar to PropertyDialog) that require an activator to work. My project is an 'Eclipse 4 Application Project' and does not have an activator so I used a plugin with an activator to hold the PreferenceDialog (MyPreferencePage1 below).

In the e4 application I could access the plugin and get the preferences to display using:

@Execute
public void execute(Shell shell){
IPreferencePage page = new MyPreferencePage1();
page.setTitle("Custom Configurations");
PreferenceNode node = new PreferenceNode("1", page);
PreferenceManager pm = new PreferenceManager();
pm.addToRoot(node); //add the node in the PreferenceManager
PreferenceDialog pd = new PreferenceDialog(shell, pm);
pd.setPreferenceStore(Activator.getDefault().getPreferenceStore());
pd.create();
pd.open();
}

I am now trying to use a PropertyDialog that can show properties of nodes in a tree but am stuck as how to implement it. What is the best way to do this:
1) create an Object that extends PropertyPage - but how to I link it in to the application? - can I do this using java code instead of an .xml extension point? (I find configuring via .xml either really easy or really hard if something is not configured exactly right).
1a) Should this be implemented in the Eclipse 4 Application Project - which does not have an activator? (do I need one and if so how to I add one to a functioning application?) or in a seperate plugin with an activator?
2) Use a PreferenceDialog as a pseudo PropertyDialog?

Thanks
Previous Topic:MPart contribution to Outline view and Properties view
Next Topic:XML editor Part in CTabItem
Goto Forum:
  


Current Time: Sat Dec 20 21:00:46 GMT 2014

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

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