Package org.nbphpcouncil.modules.php.yii.editor.navi

Examples of org.nbphpcouncil.modules.php.yii.editor.navi.GoToDefaultItem


    private List<GoToItem> createGoToItems(PhpModule phpModule, Document doc, int offset) {
        List<GoToItem> items = new ArrayList<GoToItem>();
        // check whether target is class name
        FileObject classFile = getClassFileObject(phpModule, target);
        if (classFile != null) {
            items.add(new GoToDefaultItem(classFile, DEFAULT_OFFSET));
            return items;
        }

        // get method name
        TokenSequence<PHPTokenId> ts = YiiDocUtils.getTokenSequence(doc);
        ts.move(offset);
        ts.moveNext();
        String methodName = getMethodName(ts);
        if (!methods.contains(methodName)) {
            return items;
        }

        // for i18n
        if (methodName.equals("t")) { // NOI18N
            return createGoToTItems(phpModule, ts, offset);
        }

        // for absolute view path
        FileObject file = null;
        if (YiiViewPathSupport.isAbsoluteViewPath(target)) {
            // for application's view path
            FileObject currentFile = NbEditorUtilities.getFileObject(doc);
            file = YiiViewPathSupport.getAbsoluteViewFile(target, currentFile);
        }

        // for path alias
        if (file == null) {
            file = YiiPathAliasSupport.getFileObject(phpModule, target);
        }
        if (file != null && file.isData()) {
            items.add(new GoToDefaultItem(file, DEFAULT_OFFSET));
        }
        return items;
    }
View Full Code Here

TOP

Related Classes of org.nbphpcouncil.modules.php.yii.editor.navi.GoToDefaultItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.