Package org.springframework.richclient.core

Examples of org.springframework.richclient.core.LabelConfigurable


    this.messageSource = messageSource;
  }

  public Object postProcessAfterInitialization(Object bean, String name) throws BeansException {
    if (bean instanceof LabelConfigurable) {
      LabelConfigurable configurable = (LabelConfigurable) bean;

      try {
        String label = messageSource.getMessage(new DefaultMessageSourceResolvable(name + "." + LABEL_KEY),
            Locale.getDefault());

        if (StringUtils.hasText(label)) {
          configurable.setLabelInfo(LabelInfo.valueOf(label));
        }
      }
      catch (NoSuchMessageException e) {
        throw new BeanInitializationException("Unable to initialize bean " + name, e);
      }
View Full Code Here


    String message = "bogusLabelInfo";
    LabelInfo expectedLabelInfo = LabelInfo.valueOf(message);

    EasyMock.expect(messageSource.getMessage(messageCode, null, Locale.getDefault())).andReturn(message);

    LabelConfigurable configurable = (LabelConfigurable) EasyMock.createMock(LabelConfigurable.class);
    configurable.setLabelInfo(expectedLabelInfo);

    EasyMock.replay(messageSource);
    EasyMock.replay(configurable);

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

    String objectName = "bogusLabelable";
    String messageCode = objectName + ".label";

    EasyMock.expect(messageSource.getMessage(messageCode, null, Locale.getDefault())).andReturn(null);

    LabelConfigurable configurable = (LabelConfigurable) EasyMock.createMock(LabelConfigurable.class);

    EasyMock.replay(messageSource);
    EasyMock.replay(configurable);

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

TOP

Related Classes of org.springframework.richclient.core.LabelConfigurable

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.