本文整理汇总了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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}