当前位置: 首页>>代码示例>>Java>>正文


Java Provider.equals方法代码示例

本文整理汇总了Java中org.netbeans.modules.j2ee.persistence.provider.Provider.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Provider.equals方法的具体用法?Java Provider.equals怎么用?Java Provider.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.modules.j2ee.persistence.provider.Provider的用法示例。


在下文中一共展示了Provider.equals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setSelectedLibrary

import org.netbeans.modules.j2ee.persistence.provider.Provider; //导入方法依赖的package包/类
/**
 * Sets selected item in library combo box.
 */
private void setSelectedLibrary(){
    ArrayList<Provider> providers = new ArrayList<Provider>();
    for(int i=0; i<libraryComboBox.getItemCount(); i++){
        Object obj = libraryComboBox.getItemAt(i);
        if(obj instanceof Provider){
            providers.add((Provider) obj);
        }
    }
    Provider selected = ProviderUtil.getProvider(persistenceUnit, providers.toArray(new Provider[]{}));
    
    if (selected == null){
        return;
    }
    for(int i = 0; i < libraryComboBox.getItemCount(); i++){
        Object item = libraryComboBox.getItemAt(i);
        Provider provider = (Provider) (item instanceof Provider ? item : null);
        if (provider!= null && provider.equals(selected)){
            libraryComboBox.setSelectedIndex(i);
            break;
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:PersistenceUnitPanel.java

示例2: getSupportedProviders

import org.netbeans.modules.j2ee.persistence.provider.Provider; //导入方法依赖的package包/类
@Override
public List<Provider> getSupportedProviders() {
    List<Provider> model = new ArrayList<Provider>();
    //get all, but remove duplicates
    for (Provider each : PersistenceLibrarySupport.getProvidersFromLibraries()) {
        boolean found = false;
        for (int i = 0; i < model.size(); i++) {
            Object elem = model.get(i);
            if (elem instanceof Provider && each.equals(elem)) {
                found = true;
                break;
            }
        }
        if (!found) {
            model.add(each);
        }
    }
    return model;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:Util.java

示例3: getSupportedProviders

import org.netbeans.modules.j2ee.persistence.provider.Provider; //导入方法依赖的package包/类
@Override
public List<Provider> getSupportedProviders() {
    ArrayList<Provider> providers = new ArrayList<Provider>();
    for (Provider each : PersistenceLibrarySupport.getProvidersFromLibraries()){
        boolean found = false;
        for (int i = 0; i < providers.size(); i++) {
            Object elem = providers.get(i);
            if (elem instanceof Provider && each.equals(elem)){
                found = true;
                break;
            }
        }
        if (!found){
           providers.add(each);
        }
    }
    return providers;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:PersistenceProviderComboboxHelper.java

示例4: getLibrary

import org.netbeans.modules.j2ee.persistence.provider.Provider; //导入方法依赖的package包/类
/**
 * @return the library in which given provider
 * is defined, or null none could be found.
 */
public static Library getLibrary(Provider provider) {
    List<ProviderLibrary> libraries = createLibraries(provider!=null ? provider.getProviderClass() : null);
    for (ProviderLibrary each : libraries) {
        if (provider.equals(each.getProvider())) {
            return each.getLibrary();
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:PersistenceLibrarySupport.java

示例5: isDefaultProvider

import org.netbeans.modules.j2ee.persistence.provider.Provider; //导入方法依赖的package包/类
public static boolean isDefaultProvider(Project project, Provider provider) {
    return provider != null && provider.equals(getDefaultProvider(project));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:Util.java


注:本文中的org.netbeans.modules.j2ee.persistence.provider.Provider.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。