Example usage for org.eclipse.jface.action CoolBarManager USER_SEPARATOR

List of usage examples for org.eclipse.jface.action CoolBarManager USER_SEPARATOR

Introduction

In this page you can find the example usage for org.eclipse.jface.action CoolBarManager USER_SEPARATOR.

Prototype

String USER_SEPARATOR

To view the source code for org.eclipse.jface.action CoolBarManager USER_SEPARATOR.

Click Source Link

Document

A separator created by the end user.

Usage

From source file:org.eclipse.ui.tests.internal.EditorActionBarsTest.java

License:Open Source License

/**
 * Tests an edge case in cool bar updating when the cool bar has a single separator 
 * and no other contents (or multiple separators and no other contents). 
 * See bug 239945 for details.//  ww  w .  j a  v  a2s .  c om
 * @throws Throwable
 */
public void test239945() throws Throwable {
    // Test a cool bar with a single separator
    CoolBarManager coolBarManager = new CoolBarManager();
    coolBarManager.add(new Separator(CoolBarManager.USER_SEPARATOR));
    try {
        coolBarManager.createControl(fWindow.getShell());
        coolBarManager.update(true);
    } catch (ArrayIndexOutOfBoundsException e) {
        fail("Exception updating cool bar with a single separator");
    }

    // Test a cool bar with multiple separators
    CoolBarManager coolBarManager2 = new CoolBarManager();
    coolBarManager2.add(new Separator(CoolBarManager.USER_SEPARATOR));
    try {
        coolBarManager2.createControl(fWindow.getShell());
        coolBarManager2.update(true);
    } catch (ArrayIndexOutOfBoundsException e) {
        fail("Exception updating cool bar with multiple separators");
    }
}