Package org.springframework.richclient.command.config

Examples of org.springframework.richclient.command.config.CommandIconConfigurable


        expectedSelectedLargeIcon, expectedRolloverLargeIcon, expectedDisabledLargeIcon,
        expectedPressedLargeIcon);

    // Create the required mock objects
    IconSource iconSource = (IconSource) EasyMock.createMock(IconSource.class);
    CommandIconConfigurable configurable = (CommandIconConfigurable) EasyMock
        .createMock(CommandIconConfigurable.class);

    // Create the configurer with the mock icon source
    DefaultApplicationObjectConfigurer configurer = new DefaultApplicationObjectConfigurer(null, null, iconSource,
        null);

    EasyMock.expect(iconSource.getIcon(iconKey)).andReturn(expectedIcon);
    EasyMock.expect(iconSource.getIcon(disabledIconKey)).andReturn(expectedDisabledIcon);
    EasyMock.expect(iconSource.getIcon(selectedIconKey)).andReturn(expectedSelectedIcon);
    EasyMock.expect(iconSource.getIcon(rolloverIconKey)).andReturn(expectedRolloverIcon);
    EasyMock.expect(iconSource.getIcon(pressedIconKey)).andReturn(expectedPressedIcon);
    EasyMock.expect(iconSource.getIcon(largeIconKey)).andReturn(expectedLargeIcon);
    EasyMock.expect(iconSource.getIcon(disabledLargeIconKey)).andReturn(expectedDisabledLargeIcon);
    EasyMock.expect(iconSource.getIcon(selectedLargeIconKey)).andReturn(expectedSelectedLargeIcon);
    EasyMock.expect(iconSource.getIcon(rolloverLargeIconKey)).andReturn(expectedRolloverLargeIcon);
    EasyMock.expect(iconSource.getIcon(pressedLargeIconKey)).andReturn(expectedPressedLargeIcon);
    configurable.setIconInfo(expectedIconInfo);
    configurable.setLargeIconInfo(expectedLargeIconInfo);

    EasyMock.replay(iconSource);
    EasyMock.replay(configurable);

    configurer.configure(configurable, objectName);

    EasyMock.verify(iconSource);
    EasyMock.verify(configurable);

    // Reset the mock objects for the next test
    EasyMock.reset(iconSource);
    EasyMock.reset(configurable);

    // Set the expectations. This time the loadOptionalIcons will be set to
    // false.
    configurer.setLoadOptionalIcons(false);
    expectedIconInfo = new CommandButtonIconInfo(expectedIcon);
    expectedLargeIconInfo = new CommandButtonIconInfo(expectedLargeIcon);
    EasyMock.expect(iconSource.getIcon(iconKey)).andReturn(expectedIcon);
    EasyMock.expect(iconSource.getIcon(largeIconKey)).andReturn(expectedLargeIcon);
    configurable.setIconInfo(expectedIconInfo);
    configurable.setLargeIconInfo(expectedLargeIconInfo);

    EasyMock.replay(iconSource);
    EasyMock.replay(configurable);

    configurer.configure(configurable, objectName);
View Full Code Here


    String iconKey = objectName + ".icon";
    String largeIconKey = objectName + ".large.icon";

    // Create the required mock objects
    IconSource iconSource = (IconSource) EasyMock.createMock(IconSource.class);
    CommandIconConfigurable configurable = (CommandIconConfigurable) EasyMock
        .createMock(CommandIconConfigurable.class);

    // Create the configurer with the mock icon source
    DefaultApplicationObjectConfigurer configurer = new DefaultApplicationObjectConfigurer(null, null, iconSource,
        null);
View Full Code Here

TOP

Related Classes of org.springframework.richclient.command.config.CommandIconConfigurable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.