Example usage for org.apache.commons.lang ArrayUtils EMPTY_CLASS_ARRAY

List of usage examples for org.apache.commons.lang ArrayUtils EMPTY_CLASS_ARRAY

Introduction

In this page you can find the example usage for org.apache.commons.lang ArrayUtils EMPTY_CLASS_ARRAY.

Prototype

Class EMPTY_CLASS_ARRAY

To view the source code for org.apache.commons.lang ArrayUtils EMPTY_CLASS_ARRAY.

Click Source Link

Document

An empty immutable Class array.

Usage

From source file:org.eclipse.wb.internal.rcp.databinding.model.context.strategies.UpdateStrategyInfo.java

/**
 * Create configuration for edit this strategy.
 *//*from  ww  w  .  java2  s . c o m*/
protected ChooseClassConfiguration createConfiguration(BindingUiContentProviderContext context) {
    ChooseClassConfiguration configuration = new ChooseClassConfiguration();
    configuration.setValueScope(getStrategyClass());
    configuration.setRetargetClassName(getStrategyClass(), "POLICY_UPDATE");
    configuration.setBaseClassName(getStrategyClass());
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
    configuration.setEmptyClassErrorMessage(
            MessageFormat.format(Messages.UpdateStrategyInfo_errorMessage, context.getDirection()));
    configuration.setErrorMessagePrefix(
            MessageFormat.format(Messages.UpdateStrategyInfo_errorMessagePrefix, context.getDirection()));
    //
    if (m_strategyType == StrategyType.ExtendetClass && m_strategyValue.toString().indexOf('(') != -1) {
        configuration.addDefaultStart(m_strategyValue.toString());
    }
    //
    return configuration;
}

From source file:org.eclipse.wb.internal.rcp.databinding.model.context.strategies.UpdateStrategyInfo.java

/**
 * Create configuration for edit strategy convert.
 *//*from  ww w  . j a va 2 s.co m*/
protected final ChooseClassConfiguration createConverterConfiguration(BindingUiContentProviderContext context) {
    ChooseClassConfiguration configuration = new ChooseClassConfiguration();
    configuration.setDialogFieldLabel(Messages.UpdateStrategyInfo_chooseLabel);
    configuration.setValueScope("org.eclipse.core.databinding.conversion.IConverter");
    configuration.setClearValue("N/S");
    configuration.setBaseClassName("org.eclipse.core.databinding.conversion.IConverter");
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
    configuration.setEmptyClassErrorMessage(
            MessageFormat.format(Messages.UpdateStrategyInfo_chooseErrorMessage, context.getDirection()));
    configuration.setErrorMessagePrefix(
            MessageFormat.format(Messages.UpdateStrategyInfo_chooseErrorMessagePrefix, context.getDirection()));
    //
    if (m_converter != null && (m_converter.isAnonymous() || m_converter.getClassName().indexOf('(') != -1)) {
        configuration.addDefaultStart(m_converter.getClassName());
    }
    //
    return configuration;
}

From source file:org.eclipse.wb.internal.rcp.databinding.model.context.strategies.UpdateValueStrategyInfo.java

/**
 * Create configuration for edit strategy validator.
 *///from w ww. j  a  v  a  2  s.c  o  m
private ChooseClassConfiguration createValidatorConfiguration(BindingUiContentProviderContext context,
        String name, ValidatorInfo validator) {
    ChooseClassConfiguration configuration = new ChooseClassConfiguration();
    configuration.setDialogFieldLabel(name + ":");
    configuration.setValueScope("org.eclipse.core.databinding.validation.IValidator");
    configuration.setClearValue("N/S");
    configuration.setBaseClassName("org.eclipse.core.databinding.validation.IValidator");
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
    configuration.setEmptyClassErrorMessage(MessageFormat
            .format(Messages.UpdateValueStrategyInfo_validatorErrorMessage, context.getDirection(), name));
    configuration.setErrorMessagePrefix(MessageFormat.format(
            Messages.UpdateValueStrategyInfo_validatorErrorMessagePrefix, context.getDirection(), name));
    //
    if (validator != null && (validator.isAnonymous() || validator.getClassName().indexOf('(') != -1)) {
        configuration.addDefaultStart(validator.getClassName());
    }
    //
    return configuration;
}

From source file:org.eclipse.wb.internal.rcp.databinding.model.widgets.input.AbstractFactoryInfo.java

@Override
protected void configure(ChooseClassConfiguration configuration) {
    configuration.setValueScope(m_method);
    configuration.addDefaultStart(getClassName());
    configuration.setBaseClassName("org.eclipse.core.databinding.observable.masterdetail.IObservableFactory");
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
}

From source file:org.eclipse.wb.internal.rcp.databinding.model.widgets.input.ObservableFactoryInfo.java

/**
 * Create configuration for edit this factory.
 *//*w  w w. ja  v a 2 s .  c om*/
protected void configure(ChooseClassConfiguration configuration) {
    configuration.setValueScope("org.eclipse.core.databinding.observable.masterdetail.IObservableFactory");
    configuration.setBaseClassName("org.eclipse.core.databinding.observable.masterdetail.IObservableFactory");
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
}

From source file:org.eclipse.wb.internal.rcp.databinding.model.widgets.input.TreeStructureAdvisorInfo.java

/**
 * Create configuration for edit this advisor.
 *//*from   w ww.j a v  a 2s  . co  m*/
protected void configure(ChooseClassConfiguration configuration) {
    configuration.setValueScope("org.eclipse.jface.databinding.viewers.TreeStructureAdvisor");
    configuration.setBaseClassName("org.eclipse.jface.databinding.viewers.TreeStructureAdvisor");
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
}

From source file:org.eclipse.wb.internal.rcp.databinding.xwt.model.ConverterInfo.java

/**
 * Create {@link IUiContentProvider} content providers for edit this model.
 *///  w  w w. j  av a  2  s  . co m
public void createContentProviders(List<IUiContentProvider> providers, IPageListener listener,
        DatabindingsProvider provider) throws Exception {
    ChooseClassConfiguration configuration = new ChooseClassConfiguration();
    configuration.setDialogFieldLabel(Messages.ConverterInfo_providerTitle);
    configuration.setValueScope("org.eclipse.e4.xwt.IValueConverter");
    configuration.setClearValue("N/S");
    configuration.setBaseClassName("org.eclipse.e4.xwt.IValueConverter");
    configuration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
    configuration.setEmptyClassErrorMessage(Messages.ConverterInfo_errorMessage);
    configuration.setErrorMessagePrefix(Messages.ConverterInfo_errorMessagePrefix);
    //
    if (!m_element) {
        ClassLoader classLoader = provider.getXmlObjectRoot().getContext().getClassLoader();
        Class<?> ConverterClass = classLoader.loadClass("org.eclipse.e4.xwt.IValueConverter");
        List<String> defaultValues = Lists.newArrayList();
        BeansObserveTypeContainer beanContainer = (BeansObserveTypeContainer) provider
                .getContainer(ObserveType.BEANS);
        for (BeanBindableInfo bindable : beanContainer.getObservables0()) {
            if (ConverterClass.isAssignableFrom(bindable.getObjectType())) {
                defaultValues.add(bindable.getReference());
            }
        }
        //
        if (!defaultValues.isEmpty()) {
            configuration.setDefaultValues(defaultValues.toArray(new String[defaultValues.size()]));
        }
    }
    //
    providers.add(new ConverterUiContentProvider(provider, configuration, this));
}

From source file:org.eclipse.wb.internal.rcp.databinding.xwt.ui.contentproviders.ValidationUiContentProvider.java

private ClassInfo createInfo(String className) {
    ClassInfo info = new ClassInfo();
    info.className = className;//from  w w  w  .  jav a  2  s .com
    //
    if (className.length() == 0) {
        info.message = Messages.ValidationUiContentProvider_noClass;
    } else {
        if (className.startsWith("{") && className.endsWith("}")) {
            return info;
        }
        //
        try {
            // check load class
            Class<?> testClass = loadClass(className);
            // check permissions
            int modifiers = testClass.getModifiers();
            if (!Modifier.isPublic(modifiers)) {
                info.message = Messages.ValidationUiContentProvider_notPublicClass;
                return info;
            }
            if (Modifier.isAbstract(modifiers)) {
                info.message = Messages.ValidationUiContentProvider_abstractClass;
                return info;
            }
            // check constructor
            boolean noConstructor = true;
            try {
                testClass.getConstructor(ArrayUtils.EMPTY_CLASS_ARRAY);
                noConstructor = false;
            } catch (SecurityException e) {
            } catch (NoSuchMethodException e) {
            }
            // prepare error message for constructor
            if (noConstructor) {
                info.message = Messages.ValidationUiContentProvider_noPublicConstructor
                        + ClassUtils.getShortClassName(className) + "().";
            }
        } catch (ClassNotFoundException e) {
            info.message = Messages.ValidationUiContentProvider_notExistClass;
        }
    }
    return info;
}

From source file:org.eclipse.wb.internal.swing.databinding.model.bindings.BindingInfo.java

protected final ChooseClassConfiguration createConverterConfiguration() {
    if (m_converterConfiguration == null) {
        m_converterConfiguration = new ChooseClassConfiguration();
        m_converterConfiguration.setDialogFieldLabel(Messages.BindingInfo_converterLabel);
        m_converterConfiguration.setValueScope("org.jdesktop.beansbinding.Converter");
        m_converterConfiguration.setClearValue("N/S");
        m_converterConfiguration.setBaseClassName("org.jdesktop.beansbinding.Converter");
        m_converterConfiguration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
        m_converterConfiguration.setEmptyClassErrorMessage(Messages.BindingInfo_converterError);
        m_converterConfiguration.setErrorMessagePrefix(Messages.BindingInfo_converterErrorPrefix);
    }/*from  w ww  . ja v  a 2  s.co m*/
    m_converterConfiguration.clearDefaultStrings();
    if (m_converter != null && !StringUtils.isEmpty(m_converter.getParameters())) {
        m_converterConfiguration.addDefaultStart(m_converter.getFullClassName());
    }
    return m_converterConfiguration;
}

From source file:org.eclipse.wb.internal.swing.databinding.model.bindings.BindingInfo.java

protected final ChooseClassConfiguration createValidatorConfiguration() {
    if (m_validatorConfiguration == null) {
        m_validatorConfiguration = new ChooseClassConfiguration();
        m_validatorConfiguration.setDialogFieldLabel(Messages.BindingInfo_validatorLabel);
        m_validatorConfiguration.setValueScope("org.jdesktop.beansbinding.Validator");
        m_validatorConfiguration.setClearValue("N/S");
        m_validatorConfiguration.setBaseClassName("org.jdesktop.beansbinding.Validator");
        m_validatorConfiguration.setConstructorParameters(ArrayUtils.EMPTY_CLASS_ARRAY);
        m_validatorConfiguration.setEmptyClassErrorMessage(Messages.BindingInfo_validatorError);
        m_validatorConfiguration.setErrorMessagePrefix(Messages.BindingInfo_validatorErrorPrefix);
    }/*from   ww w.jav  a 2  s.c o  m*/
    m_validatorConfiguration.clearDefaultStrings();
    if (m_validator != null && !StringUtils.isEmpty(m_validator.getParameters())) {
        m_validatorConfiguration.addDefaultStart(m_validator.getFullClassName());
    }
    return m_validatorConfiguration;
}