Adding a new 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
darkglobit
Posts:3
Joined:29 Nov 2011 18:56
[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
Adding a new Perspective

Post by darkglobit » 29 Nov 2011 19:11

Hi,

I try to add a new perspective to support my GeoView plugin.
So I create GeoPerspective class in my plugin module, I add the @ServiceProvider and fill methods getDisplayName(), getName(), getIcon() and the bundle :

Code: Select all

@ServiceProvider(service = Perspective.class, position=400)
public class GeoPerspective implements Perspective {

    @Override
    public String getDisplayName() {
       return NbBundle.getMessage(GeoPerspective.class, "GeoPerspective.name");
    }

    @Override
    public String getName() {
        return "GeoGroup";
    }

    @Override
    public Icon getIcon() {
        return ImageUtilities.loadImageIcon("org/gephi/desktop/perspective/plugin/resources/overview.png",false);
    }
    
}
When i run my project and click on the GeoView Icon I've got this error :

"Java.lang.NullPointerException
at org.gephi.desktop.perspective.PerspectiveController.select(PerspectiveController.java:126)
(...)"

I guess the system can't find my new perspective but don't know why, do you have any Idea ?
I'm new in developing world so please be indulgent if my question isn't relevant.

Thank you

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[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

Re: Adding a new Perspective

Post by mbastian » 30 Nov 2011 03:26

Hi,

Can you please open an issue on Github with the complete exception. Thanks.

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