Search in sources :

Example 1 with ToolbarKey

use of com.servoy.j2db.util.toolbar.Toolbar.ToolbarKey in project servoy-client by Servoy.

the class J2DBClient method fillToolbar.

/**
 * @param actions
 */
protected void fillToolbar(Map<String, Action> actions) {
    toolbarsPanel.clear();
    SortedList<Toolbar.ToolbarKey> sortedList = new SortedList<Toolbar.ToolbarKey>();
    createToolBars(sortedList, actions);
    int offsetRow = 0;
    if (sortedList.size() > 0) {
        offsetRow = sortedList.get(0).getRow();
        if (offsetRow == -1)
            offsetRow = 0;
    }
    for (ToolbarKey key : sortedList) {
        if (toolbarsPanel.getToolBar(key.getToolbar().getName()) == null) {
            if (// $NON-NLS-1$
            "edit".equals(key.getToolbar().getName())) {
                fillBrowseToolbar(key.getToolbar(), actions);
            }
            toolbarsPanel.addToolbar(key.getToolbar(), key.getRow() - offsetRow);
            toolbarsPanel.setToolbarVisible(key.getToolbar().getName(), key.isVisible());
        }
    }
}
Also used : SortedList(com.servoy.j2db.util.SortedList) ToolbarKey(com.servoy.j2db.util.toolbar.Toolbar.ToolbarKey) Toolbar(com.servoy.j2db.util.toolbar.Toolbar)

Aggregations

SortedList (com.servoy.j2db.util.SortedList)1 Toolbar (com.servoy.j2db.util.toolbar.Toolbar)1 ToolbarKey (com.servoy.j2db.util.toolbar.Toolbar.ToolbarKey)1