Hi Julia,
I think the extension should be changed to
map to the objects that implements the IInstance interface so it is more
generic
<extension
point="org.eclipse.ui.propertyPages">
<page
class="org.eclipse.tml.framework.device.ui.editors.InstancePropertyEditor"
id="org.eclipse.tml.framework.device.ui.editors.InstancePropertyEditorDefault"
name="Instance Properties">
<enabledWhen>
<instanceof
value="org.eclipse.tml.framework.device.model.IInstance">
</instanceof>
</enabledWhen>
</page>
</extension>
For the other issue, you can change the
code in InstanceView
private class MenuPropertiesListener implements Listener {
public void handleEvent(Event event) {
PropertyDialogAction
action = "">new
PropertyDialogAction(
getViewSite(),
getViewSite().getSelectionProvider());
action.run();
}
}
And add
getViewSite().setSelectionProvider(treeViewer);
in createPartControl.
So the property
page id is not hardcoded in the code.
Yufen
From: dsdp-tml-dev-bounces@xxxxxxxxxxx
[mailto:dsdp-tml-dev-bounces@xxxxxxxxxxx] On
Behalf Of Julia Martinez Perdigueiro
Sent: Wednesday, August 06, 2008
9:01 AM
To: Tools
for Mobile Linux
Subject: [dsdp-tml-dev] Device
Instance Property Page
Hi all,
I have been trying to use my own Property Page for my own
Instance implementation but I haven’t been able since the InstanceView
calls directly for the Property Page defined on the
org.eclipse.tml.framework.device.ui plug-in, as follows:
private class
MenuPropertiesListener implements Listener
{
public void handleEvent(Event event)
{
IAdaptable adaptable = InstanceManager.getInstance().getCurrentInstance();
Shell shell = new Shell();
PreferenceDialog dialog =
PreferencesUtil.createPropertyDialogOn(shell,
adaptable,
InstanceView.PROPERTY_EDITOR_ID, new String[0], null);
dialog.open();
}
}
If someone was able to determine what is the correct ID of
Property Page for a selected Instance, that would be great! Is that a way to do
this? Is this a bug?
Also, the Property Page definition on the plugin.xml ties it
up to the Instance being an object of MobileInstance type, as seen below, which
is also not desirable for my implementation.
<extension
point="org.eclipse.ui.propertyPages">
<page
class="org.eclipse.tml.framework.device.ui.editors.InstancePropertyEditor"
id="org.eclipse.tml.framework.device.ui.editors.InstancePropertyEditorDefault"
name="Instance Properties">
<enabledWhen>
<instanceof
value="org.eclipse.tml.framework.device.internal.model.MobileInstance">
</instanceof>
</enabledWhen>
</page>
</extension>
Regards,
Julia
Julia Martinez
Perdigueiro
Instituto de Pesquisas
Eldorado