Example usage for org.eclipse.jface.action ICoolBarManager setLockLayout

List of usage examples for org.eclipse.jface.action ICoolBarManager setLockLayout

Introduction

In this page you can find the example usage for org.eclipse.jface.action ICoolBarManager setLockLayout.

Prototype

public void setLockLayout(boolean value);

Source Link

Document

Locks or unlocks the layout of the underlying cool bar widget.

Usage

From source file:org.eclipse.ui.internal.handlers.LockToolBarHandler.java

License:Open Source License

public Object execute(ExecutionEvent event) throws ExecutionException {

    WorkbenchWindow workbenchWindow = (WorkbenchWindow) HandlerUtil.getActiveWorkbenchWindow(event);
    if (workbenchWindow != null) {
        ICoolBarManager coolBarManager = workbenchWindow.getCoolBarManager2();
        if (coolBarManager != null) {
            boolean oldValue = HandlerUtil.toggleCommandState(event.getCommand());
            coolBarManager.setLockLayout(!oldValue);
        }/*from www. ja v  a 2 s . com*/
    }
    return null;
}