當前位置: 首頁>>代碼示例>>Java>>正文


Java Problem.getNext方法代碼示例

本文整理匯總了Java中org.netbeans.modules.refactoring.api.Problem.getNext方法的典型用法代碼示例。如果您正苦於以下問題:Java Problem.getNext方法的具體用法?Java Problem.getNext怎麽用?Java Problem.getNext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.netbeans.modules.refactoring.api.Problem的用法示例。


在下文中一共展示了Problem.getNext方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addToEnd

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
/**
 * Sets the given <code>toAdd</code> as the following problem for
 * the given <code>existing</code> problem.
 *
 * @param toAdd the problem to add, may be null.
 * @param existing the problem whose following problem should be set, may be null.
 *
 * @return the existing problem with its following problem
 * set to the given problem or null if both of the params
 * were null.
 *
 */
public static Problem addToEnd(Problem toAdd, Problem existing){
    if (existing == null){
        return toAdd;
    }
    if (toAdd == null){
        return existing;
    }
    
    Problem tail = existing;
    while(tail.getNext() != null){
        tail = tail.getNext();
    }
    tail.setNext(toAdd);
    
    return tail;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:RefactoringUtil.java

示例2: addProblemsToEnd

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
public static Problem addProblemsToEnd(Problem where, Problem what) {
    Problem whereCopy = where;
    err.log("Where: " + where);
    err.log("What: " + what);
    if (what != null) {
        if (where == null) {
            whereCopy = what;
        } else {
            while (where.getNext() != null) {
                where = where.getNext();
            }
            err.log("Last where: " + where);
            while (what != null) {
                Problem elem = what;
                err.log("Elem: " + elem);
                where.setNext(elem);
                where = where.getNext();
                what = what.getNext();
            }
        }
    }
    err.log("wherecopy return: " + whereCopy);
    return whereCopy;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:Utility.java

示例3: chainProblems

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
public static Problem chainProblems(Problem result, Problem problem) {
    if (result == null) {
        return problem;
    }
    if (problem == null) {
        return result;
    }
    Problem value;
    if(problem.isFatal()) {
        problem.setNext(result);
        value = problem;
    } else {
        Problem next = value = result;
        while (next.getNext() != null) {
            next = next.getNext();
        }
        next.setNext(problem);
    }
    return value;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:JavaPluginUtils.java

示例4: initButtonSize

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
static void initButtonSize(Problem problem) {
    buttonWidth = -1.0;
    while (problem != null) {
        ProblemDetails pdi = problem.getDetails();
        if (pdi != null) {
            buttonWidth = Math.max(new JButton(pdi.getDetailsHint()).getMinimumSize().getWidth(), buttonWidth);
        }
        problem = problem.getNext();
    }
    
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ProblemComponent.java

示例5: perform

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
public boolean perform(AbstractRefactoring absRefactoring, ParameterSetter parameterSetter) {
    Problem problem = absRefactoring.preCheck();
    boolean fatal = false;
    while (problem != null) {
        ref(problem.getMessage());
        fatal = fatal || problem.isFatal();
        problem = problem.getNext();
    }
    if (fatal) {
        return false;
    }
    parameterSetter.setParameters();
    problem = absRefactoring.fastCheckParameters();
    while (problem != null) {
        ref(problem.getMessage());
        fatal = fatal || problem.isFatal();
        problem = problem.getNext();
    }
    if (fatal) {
        return false;
    }
    problem = absRefactoring.checkParameters();
    while (problem != null) {
        ref(problem.getMessage());
        fatal = fatal || problem.isFatal();
        problem = problem.getNext();
    }
    if (fatal) {
        return false;
    }
    RefactoringSession rs = RefactoringSession.create("Session");
    try {
        absRefactoring.prepare(rs);
        Collection<RefactoringElement> elems = rs.getRefactoringElements();
        rs.doRefactoring(true);
    } catch (Throwable t) {
        t.printStackTrace();
    }
    return true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:41,代碼來源:RefPerfTestCase.java

示例6: problemIsFatal

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
protected static boolean problemIsFatal(List<Problem> problems) {
    for (Problem problem : problems) {
        Problem next = problem;
        do {
            if (next.isFatal()) {
                return true;
            }
            next = next.getNext();
        } while (next != null);
    }
    return false;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:RefactoringTestBase.java

示例7: createProblem

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
public static final Problem createProblem(Problem result, boolean isFatal, String message) {
    Problem problem = new Problem(isFatal, message);
    if (result == null) {
        return problem;
    } else if (isFatal) {
        problem.setNext(result);
        return problem;
    } else {
        Problem p = result;
        while (p.getNext() != null)
            p = p.getNext();
        p.setNext(problem);
        return result;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:HibernateRefactoringUtil.java

示例8: addAllProblems

import org.netbeans.modules.refactoring.api.Problem; //導入方法依賴的package包/類
protected static void addAllProblems(List<Problem> problems, Problem head) {
    while (head != null) {
        problems.add(head);
        head = head.getNext();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:RefTestBase.java


注:本文中的org.netbeans.modules.refactoring.api.Problem.getNext方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。