protected void sayHelloProgram() {
        Program p = getProgram();

        if (p == null) {
            return;
        }

        announce("Hello " + p.getName());
    }
Callback for Hello->Program menu option
Ghidra/Extensions/sample/src/main/java/ghidra/examples/HelloProgramPlugin.java