use of org.netbeans.modules.php.api.editor.EditorSupport 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;
}
use of org.netbeans.modules.php.api.editor.EditorSupport in project cakephp-netbeans by cakephp.
the class CakePhpGoToViewAction method goToView.
@Override
public boolean goToView() {
EditorSupport editorSupport = Lookup.getDefault().lookup(EditorSupport.class);
PhpBaseElement phpElement = editorSupport.getElement(controller, offset);
if (phpElement == null) {
return false;
}
FileObject view = CakePhpUtils.getView(controller, phpElement);
if (view != null) {
UiUtils.open(view, DEFAULT_OFFSET);
return true;
}
return false;
}
Aggregations