Package com.dubture.composer.ui.converter

Source Code of com.dubture.composer.ui.converter.License2StringConverter

package com.dubture.composer.ui.converter;

import org.apache.commons.lang.StringUtils;
import org.eclipse.core.databinding.conversion.Converter;

import com.dubture.getcomposer.core.collection.License;

public class License2StringConverter extends Converter {

  public License2StringConverter() {
    super(String[].class, String.class);
  }

  @Override
  public String convert(Object fromObject) {
    if (fromObject == null) {
      return "";
    }
    License licenses = (License)fromObject;
    return StringUtils.join((String[])licenses.toArray(new String[]{}), ", ");
  }

}
TOP

Related Classes of com.dubture.composer.ui.converter.License2StringConverter

TOP
Copyright © 2018 www.massapi.com. 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.