Attaching a Panel to a Perspective

Extensions and customization
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
aurora
Posts:6
Joined:13 Apr 2011 06:36
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Attaching a Panel to a Perspective

Post by aurora » 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:

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;
    }
}

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
Specifically use close() method if you want your panel to be visible on several perspectives.
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?

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable