1

I am trying to generate getters and setters or constructor or even methods that come from implemented interface, but I do not get anything. I have tried Alt + Enter, but nothing happens. Tried Alt + i, but when I did that I get only three options like: Connection to Database, Database Table and Action and/or Render Method. I feel like I use cutted version, although I got it from the official site of netbeans. What should I do? I got this only because I thought it will have improvements compared to the stable 8.2, but I get this and not all the plugins I got in 8.2. Should I install something else too to it or? I installed the binary version not the source version.

Link to the image when I press Alt + Ins: https://pasteboard.co/IlbSMDv.png Link to the image of the plugins tab(most of them are activated, all php related are activated): https://pasteboard.co/IlbUolB.png

skomisa
  • 16,436
  • 7
  • 61
  • 102
Ivanp
  • 425
  • 7
  • 18
  • 2
    [1] Can you show a screen shot of the class that is giving the problem after you press ALT/INSERT (or even better, show a simplified version of the class if possible). Note that the context menu options shown are constrained by the content of your class file source. [2] What happens if you position the cursor anywhere within the class and just right-click the mouse instead? Does a context menu appear? [3] You may need to activate the plugins. Go to **Tools > Plugins > Installed**, check **Show Details** and see if the plugin(s) you want to use are installed but not activated. – skomisa Jun 26 '19 at 04:20
  • @skomisa I have activated some plugins(PHP ones mainly), but I get the same thing. I will add a picture now. – Ivanp Jun 26 '19 at 11:06

2 Answers2

1

To get the context menu working for a PHP class in Apache NetBeans 11.0:

  • Activate all the PHP plugins:

    • Tools > Plugins > Installed.
    • Click Show details then sort by Category.
    • Scroll down, check all the plugins for the PHP category and click Activate. (Obviously you don't need to activate all the plugins; I just used that approach for simplicity.)

      phpPlugins

  • Create a PHP project using the project wizard.

  • Create a class for the PHP project using the project wizard.
  • Postion the cursor anywhere within the class, and press ALT+INSERT. You will still see the problem you described in the OP: no getter/setter menu options are presented.
  • Restart NetBeans, and try again. The menu options are now available:

    phpContextMenu

If you just restart NetBeans I think your context menu should be fine.

skomisa
  • 16,436
  • 7
  • 61
  • 102
0

Alt+Insert opens the context menu you are looking for.

Note: Alt+Insert where you would put the new code (i.e. Alt+Insert on empty line of the code inside the class)

So don't put Alt+Insert when you are on attribute because "getters and setters" won't be shown

Gherry
  • 5
  • 3
Joachim Rohde
  • 5,915
  • 2
  • 29
  • 46
  • It does not. I was not gonna add possible duplicate if I saw the answer elsewhere. Alt + Insert opens only 3 options: Connection to Database, Database Table and Action and/or Render Method. – Ivanp Jun 25 '19 at 21:35
  • Yes it is on focus, I click on property then I press Alt + Ins and those are the only options I am provided with. – Ivanp Jun 26 '19 at 15:03