Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 package org.apache.cayenne.modeler.util;
 import java.util.Map;

Andrus Adamchik
 public final class DbAdapterInfo {
     private static final Map DEFAULT_ADAPTER_LABELS = new TreeMap();
     private static final String[] standardAdapters = new String[] {
             JdbcAdapter.class.getName(), OracleAdapter.class.getName(),
             MySQLAdapter.class.getName(), SybaseAdapter.class.getName(),
             PostgresAdapter.class.getName(), HSQLDBAdapter.class.getName(),
             DB2Adapter.class.getName(), SQLServerAdapter.class.getName(),
             FrontBaseAdapter.class.getName(), OpenBaseAdapter.class.getName(),
             DerbyAdapter.class.getName(), IngresAdapter.class.getName()
     private static final Map IMMUTABLE_LABELS = Collections
     static {
         .put(JdbcAdapter.class.getName(), "Generic JDBC Adapter");
         .put(OracleAdapter.class.getName(), "Oracle Adapter");
         .put(MySQLAdapter.class.getName(), "MySQL Adapter");
         .put(SybaseAdapter.class.getName(), "Sybase Adapter");
         .put(PostgresAdapter.class.getName(), "PostgreSQL Adapter");
         .put(HSQLDBAdapter.class.getName(), "HypersonicDB Adapter");
         .put(DB2Adapter.class.getName(), "DB2 Adapter");
                 "MS SQLServer Adapter");
         .put(FrontBaseAdapter.class.getName(), "FrontBase Adapter");
         .put(OpenBaseAdapter.class.getName(), "OpenBase Adapter");
         .put(DerbyAdapter.class.getName(), "Derby Adapter");
         .put(IngresAdapter.class.getName(), "Ingres Adapter");
     public static Map getStandardAdapterLabels() {
         return ;
     public static ListCellRenderer getListRenderer() {
         return new DbAdapterListRenderer();
     public static Object[] getStandardAdapters() {
         return ;
     static final class DbAdapterListRenderer extends DefaultListCellRenderer {
         Map adapterLabels;
         DbAdapterListRenderer(Map adapterLabels) {
             this. = (adapterLabels != null)
                     ? adapterLabels
                     : .;
        public Component getListCellRendererComponent(
                JList list,
                Object object,
                int index,
                boolean arg3,
                boolean arg4) {
            if (object instanceof Class) {
                object = ((Classobject).getName();
            Object label = .get(object);
            if (label == null) {
                label = object;
            return super.getListCellRendererComponent(listlabelindexarg3arg4);
New to GrepCode? Check out our FAQ X