Search in sources :

Example 1 with IPriority

use of bndtools.editor.common.IPriority in project bndtools by bndtools.

the class BndEditor method showHighestPriorityPage.

void showHighestPriorityPage() {
    int selectedPrio = Integer.MIN_VALUE;
    String selected = null;
    BndPreferences prefs = new BndPreferences();
    if (prefs.getEditorOpenSourceTab()) {
        selected = SOURCE_PAGE;
        selectedPrio = 0;
    } else {
        for (Object pageObj : pages) {
            IFormPage page = (IFormPage) pageObj;
            int priority = 0;
            if (page instanceof IPriority)
                priority = ((IPriority) page).getPriority();
            if (priority > selectedPrio) {
                selected = page.getId();
                selectedPrio = priority;
            }
        }
    }
    if (selected != null)
        setActivePage(selected);
}
Also used : BndPreferences(bndtools.preferences.BndPreferences) IFormPage(org.eclipse.ui.forms.editor.IFormPage) IPriority(bndtools.editor.common.IPriority)

Aggregations

IPriority (bndtools.editor.common.IPriority)1 BndPreferences (bndtools.preferences.BndPreferences)1 IFormPage (org.eclipse.ui.forms.editor.IFormPage)1