use of org.netbeans.modules.php.api.editor.PhpClass in project cakephp-netbeans by cakephp.
the class CakePhpGoToActionAction method getActionMethodOffset.
private int getActionMethodOffset(FileObject controller) {
String actionMethodName = CakePhpUtils.getActionName(view);
EditorSupport editorSupport = Lookup.getDefault().lookup(EditorSupport.class);
for (PhpClass phpClass : editorSupport.getClasses(controller)) {
if (CakePhpUtils.isControllerName(phpClass.getName())) {
if (actionMethodName != null) {
for (PhpClass.Method method : phpClass.getMethods()) {
if (actionMethodName.equals(method.getName())) {
return method.getOffset();
}
}
}
return phpClass.getOffset();
}
}
return DEFAULT_OFFSET;
}
Aggregations