Attaching a Panel to a Perspective
Posted: 03 May 2011 03:56
Hi,
I am trying to attach a module panel to a perspective, following the wiki: http://wiki.gephi.org/index.php/HowTo_a ... dule_panel
As suggested by the wiki, in a module I added a new window (MyPanelTopComponent.java) with class name MyPanel and mode as "layoutmode".
To register it in a perspective, I accessed the source code for MyPanelTopComponent.java, and edited it to include the following:
As I understand it, this should attach the panel "MyPanelTopComponent" to the perspective "LabratoryPerspective", however I see it in all 3 perspectives.
I've tried setting the return value for the method "close" to false, but this does not seem to have any impact
The wiki states
I am trying to attach a module panel to a perspective, following the wiki: http://wiki.gephi.org/index.php/HowTo_a ... dule_panel
As suggested by the wiki, in a module I added a new window (MyPanelTopComponent.java) with class name MyPanel and mode as "layoutmode".
To register it in a perspective, I accessed the source code for MyPanelTopComponent.java, and edited it to include the following:
Code: Select all
@ConvertAsProperties(dtd = "-//org.gephi.desktop.perspective//MyPanel//EN",
autostore = false)
@ServiceProvider(service=PerspectiveMember.class)
public final class MyPanelTopComponent extends TopComponent implements PerspectiveMember {
...
...
...
public boolean open(Perspective perspective) {
return perspective instanceof LaboratoryPerspective;
}
public boolean close(Perspective perspective) {
return true;
}
}
I've tried setting the return value for the method "close" to false, but this does not seem to have any impact
The wiki states
This seems to imply that close() does not have to be used at all, and this would result in the panel being associated with only one panel, is that correct?Specifically use close() method if you want your panel to be visible on several perspectives.