Skip to content

Commit 7b74c85

Browse files
committed
Merge branch 'netbeans73dev' into netbeans73
2 parents 91cd65d + 04681a9 commit 7b74c85

File tree

121 files changed

+9789
-946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+9789
-946
lines changed

README.md

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ This plugin provides support for CakePHP.
66

77
- 2010/07/16
88
- 2012/09/08 Support for NetBeans7.3
9-
- 2013/06/03 last update
9+
- 2013/07/12 last update
1010

1111
## ENVIRONMENT
1212

1313
- NetBeans 7.3+
1414
- CakePHP 1.3.x
1515
- CakePHP 2.x
16+
- CakePHP 3.x (early support)
1617

17-
## WHAT WORKS:
18+
## About CakePHP 3.x
19+
20+
This plugin recognizes CakePHP3. But many features might not work yet.
21+
22+
## WHAT WORKS
1823

1924
- badge icon ![badge icon](https://raw.github.com/junichi11/cakephp-netbeans/cakephp2/src/org/cakephp/netbeans/ui/resources/cakephp_badge_8.png) (displayed on project folder)
2025
- configuration files (add app/config files to important files)
@@ -23,6 +28,7 @@ This plugin provides support for CakePHP.
2328
- ignored files (hide app/tmp directory)
2429
- cake commands support [*1]
2530
- go to view, go to action
31+
- smart go to [v0.9.0]
2632
- clear cache action [*1]
2733
- install plugins action (from zip file URL)[*1]
2834
- template files (ctp, helper, component, behavior, shell, task)
@@ -36,8 +42,9 @@ This plugin provides support for CakePHP.
3642
- check default action [v0.6.15]
3743
- image and element code completion [v0.6.16]
3844
- support for PHPUnit settings and create test case [v0.6.17]
39-
- code generate [v0.8.1]
45+
- code generation [v0.8.1]
4046
- run action action
47+
- fix namespace action (only CakePHP3.x)
4148

4249
[*1] right-click in project node > CakePHP > (Run Command | Clear Cache | Install Plugins)
4350

@@ -271,6 +278,49 @@ Similar to Go to view action.
271278
1. Right-click on the view file (in editor)
272279
2. Navigate > Go to action
273280

281+
### Smart Go To [v0.9.0]
282+
283+
You can go to specific files relate to a current file.
284+
e.g. In case of current file is Controller, you can go to existing view, model, component, helper and test.
285+
![go to navigations matrix](https://dl.dropboxusercontent.com/u/10953443/netbeans-cakephp-plugin/go-to-navigagions-matrix.png)
286+
287+
#### how to run
288+
289+
There are three ways.
290+
291+
- Shortcuts
292+
- Editor Toolbar Menu
293+
- Context Menu
294+
295+
#### shortcuts
296+
297+
Pattern : [Ctrl + Shift + G] [*] \(or [Ctrl + J] [*]\)
298+
299+
- **[Ctrl + Shift + G] [S]** : Smart Go To
300+
- **[Ctrl + Shift + G] [M]** : Go To Model
301+
- **[Ctrl + Shift + G] [V]** : Go To View
302+
- **[Ctrl + Shift + G] [C]** : Go To Controller
303+
- **[Ctrl + Shift + G] [B]** : Go To Behavior
304+
- **[Ctrl + Shift + G] [H]** : Go To Helper
305+
- **[Ctrl + Shift + G] [P]** : Go To Component
306+
- **[Ctrl + Shift + G] [T]** : Go To Test Case
307+
- **[Ctrl + Shift + G] [F]** : Go To Fixture
308+
309+
Of course, if you don't like these shortcuts, you are able to change them in Options (KeyMap).
310+
311+
#### settings
312+
313+
project properties > Frameworks > CakePHP
314+
Please uncheck the following if you would like to go to it soon (without popup) when candidate file is only one.
315+
316+
- Show the popup for one candidate item.
317+
318+
#### notice
319+
320+
- Core helpers, components and behaviors are not contained in popup items.
321+
- Go To View / Action Action is not changed yet.
322+
- Automatic creation option is not available in this feature.
323+
274324
### Format+ Action (Format for CakePHP)
275325

276326
This action run the following.
@@ -341,7 +391,7 @@ If you run this action, you can test using fixture with NetBeans.
341391

342392
https://gist.github.com/2055307 ([nojimage](https://github.com/nojimage))
343393

344-
### Code Generate
394+
### Code Generation
345395
#### How to run
346396
`Alt` + `Insert` or Right-click on editor, select `Insert Code`.
347397

@@ -409,12 +459,22 @@ Currently, this is available for the simple situation.
409459

410460
Please also see the following: https://github.com/junichi11/cakephp-netbeans/issues/16
411461

412-
## HOW TO RUN:
462+
### Fix Namespace Action (CakePHP 3.x)
463+
464+
Add namespace to top of file if it doesn't exist.
465+
466+
```php
467+
// e.g.
468+
<?php
469+
namespace App\Controller;
470+
```
471+
472+
## HOW TO RUN
413473

414474
- download NBM file or manually create NBM file
415475
- manually install NBM file
416476

417-
## HOW TO DEVELOP:
477+
## HOW TO DEVELOP
418478

419479
- read this page [1] for the general overview but notice that current sources need to be used, then
420480
- checkout NB sources via Mercurial (preferred, easy updates)[2] or download archive with latest NB sources from NB download site [3]

manifest.mf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Manifest-Version: 1.0
22
OpenIDE-Module: org.cakephp.netbeans
33
OpenIDE-Module-Layer: org/cakephp/netbeans/resources/layer.xml
44
OpenIDE-Module-Localizing-Bundle: org/cakephp/netbeans/resources/Bundle.properties
5-
OpenIDE-Module-Specification-Version: 0.8.8
5+
OpenIDE-Module-Specification-Version: 0.9.0

src/org/cakephp/netbeans/CakePhp.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,15 @@ public class CakePhp {
5252
public static final String CAKE_ICON_16 = "org/cakephp/netbeans/ui/resources/cakephp_icon_16.png";
5353
public static final String CAKE_SUCCESS_ICON_16 = "org/cakephp/netbeans/ui/resources/cakephp_success_icon_16.png";
5454
public static final String CAKE_FAIL_ICON_16 = "org/cakephp/netbeans/ui/resources/cakephp_fail_icon_16.png";
55+
public static final String PHP_ICON = "org/cakephp/netbeans/resources/php_icon.png";
56+
public static final String CTP_ICON = "org/cakephp/netbeans/resources/ctp_icon.png";
57+
public static final String GOTO_CONTROLLER_ICON = "org/cakephp/netbeans/ui/resources/goto_controller_icon.png";
58+
public static final String GOTO_MODEL_ICON = "org/cakephp/netbeans/ui/resources/goto_model_icon.png";
59+
public static final String GOTO_VIEW_ICON = "org/cakephp/netbeans/ui/resources/goto_view_icon.png";
60+
public static final String GOTO_COMPONENT_ICON = "org/cakephp/netbeans/ui/resources/goto_component_icon.png";
61+
public static final String GOTO_HELPER_ICON = "org/cakephp/netbeans/ui/resources/goto_helper_icon.png";
62+
public static final String GOTO_BEHAVIOR_ICON = "org/cakephp/netbeans/ui/resources/goto_behavior_icon.png";
63+
public static final String GOTO_TESTCASE_ICON = "org/cakephp/netbeans/ui/resources/goto_testcase_icon.png";
64+
public static final String GOTO_FIXTURE_ICON = "org/cakephp/netbeans/ui/resources/goto_fixture_icon.png";
5565
public static final String CTP = "ctp";
5666
}

src/org/cakephp/netbeans/CakePhpActionsExtender.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
import org.cakephp.netbeans.ui.actions.*;
4848
import org.cakephp.netbeans.ui.wizards.InstallPluginsWizardAction;
4949
import org.cakephp.netbeans.util.CakePhpUtils;
50+
import org.cakephp.netbeans.util.CakeVersion;
51+
import org.netbeans.modules.php.api.phpmodule.PhpModule;
5052
import org.netbeans.modules.php.spi.framework.PhpModuleActionsExtender;
5153
import org.netbeans.modules.php.spi.framework.actions.GoToActionAction;
5254
import org.netbeans.modules.php.spi.framework.actions.GoToViewAction;
@@ -66,8 +68,11 @@ public List<? extends Action> getActions() {
6668
List<Action> list = new ArrayList<Action>();
6769
list.add(ClearCacheAction.getInstance());
6870
list.add(InstallPluginsWizardAction.getInstance());
69-
list.add(CheckDefault.getInstance());
70-
list.add(PHPUnitInitAction.getInstance());
71+
list.add(CheckDefaultAction.getInstance());
72+
PhpModule phpModule = PhpModule.inferPhpModule();
73+
if (CakeVersion.getInstance(phpModule).getMajor() >= 2) {
74+
list.add(PHPUnitInitAction.getInstance());
75+
}
7176
return list;
7277
}
7378

src/org/cakephp/netbeans/CakePhpFrameworkProvider.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import java.util.LinkedList;
4949
import java.util.List;
5050
import org.cakephp.netbeans.commands.CakePhpCommandSupport;
51-
import org.cakephp.netbeans.editor.CakePhpEditorExtender;
51+
import org.cakephp.netbeans.editor.codecompletion.CakePhpEditorExtenderFactory;
5252
import org.cakephp.netbeans.module.CakePhpModule;
5353
import org.cakephp.netbeans.module.CakePhpModule.DIR_TYPE;
5454
import org.netbeans.modules.php.api.framework.BadgeIcon;
@@ -83,11 +83,11 @@ public int compare(File o1, File o2) {
8383

8484
private CakePhpFrameworkProvider() {
8585
super("cakephp", // NOI18N
86-
NbBundle.getMessage(CakePhpFrameworkProvider.class, "LBL_CakePhpFramework"),
87-
NbBundle.getMessage(CakePhpFrameworkProvider.class, "LBL_CakePhpDescription"));
86+
NbBundle.getMessage(CakePhpFrameworkProvider.class, "LBL_CakePhpFramework"),
87+
NbBundle.getMessage(CakePhpFrameworkProvider.class, "LBL_CakePhpDescription"));
8888
badgeIcon = new BadgeIcon(
89-
ImageUtilities.loadImage(ICON_PATH),
90-
CakePhpFrameworkProvider.class.getResource("/" + ICON_PATH)); // NOI18N
89+
ImageUtilities.loadImage(ICON_PATH),
90+
CakePhpFrameworkProvider.class.getResource("/" + ICON_PATH)); // NOI18N
9191
}
9292

9393
@PhpFrameworkProvider.Registration(position = 500)
@@ -177,6 +177,6 @@ public FrameworkCommandSupport getFrameworkCommandSupport(PhpModule phpModule) {
177177

178178
@Override
179179
public EditorExtender getEditorExtender(PhpModule phpModule) {
180-
return new CakePhpEditorExtender();
180+
return CakePhpEditorExtenderFactory.create(phpModule);
181181
}
182182
}

src/org/cakephp/netbeans/CakePhpModuleCustomizerExtender.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,15 @@ public class CakePhpModuleCustomizerExtender extends PhpModuleCustomizerExtender
6363
private final String cakePhpDirPath;
6464
private final boolean isProjectDir;
6565
private final boolean originalIgnoreTmpDirectory;
66+
private final boolean isShowPopupForOneItem;
6667

6768
CakePhpModuleCustomizerExtender(PhpModule phpModule) {
6869
appName = CakePreferences.getAppName(phpModule);
6970
originalAutoCreateState = CakePreferences.getAutoCreateView(phpModule);
7071
cakePhpDirPath = CakePreferences.getCakePhpDirPath(phpModule);
7172
isProjectDir = CakePreferences.useProjectDirectory(phpModule);
7273
originalIgnoreTmpDirectory = CakePreferences.ignoreTmpDirectory(phpModule);
74+
isShowPopupForOneItem = CakePreferences.isShowPopupForOneItem(phpModule);
7375
}
7476

7577
@Override
@@ -118,6 +120,9 @@ public EnumSet<Change> save(PhpModule phpModule) {
118120
if (isProjectDir != getPanel().isUseProjectDirectory()) {
119121
CakePreferences.setUseProjectDirectory(phpModule, !isProjectDir);
120122
}
123+
if (isShowPopupForOneItem != getPanel().isShowPopupForOneItem()) {
124+
CakePreferences.setShowPopupForOneItem(phpModule, !isShowPopupForOneItem);
125+
}
121126
if (!cakePhpDirPath.equals(newCakePhpDirPath)) {
122127
CakePreferences.setCakePhpDirPath(phpModule, newCakePhpDirPath);
123128
}
@@ -141,6 +146,7 @@ private CakePhpCustomizerPanel getPanel() {
141146
component.setCakePhpDirTextField(cakePhpDirPath);
142147
component.setUseProjectDirectory(isProjectDir);
143148
component.setIgnoreTmpDirectory(originalIgnoreTmpDirectory);
149+
component.setShowPopupForOneItem(isShowPopupForOneItem);
144150
}
145151
return component;
146152
}

0 commit comments

Comments
 (0)