Index: org.hibernate.eclipse.console/icons/images/error.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: org.hibernate.eclipse.console/icons/images/exclamation.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: org.hibernate.eclipse.console\icons\images\exclamation.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java =================================================================== --- org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java (revision 28613) +++ org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.java (working copy) @@ -256,6 +256,7 @@ public static String LazyDatabaseSchemaWorkbenchAdapter_problems_while_reading_database_schema; public static String LazyDatabaseSchemaWorkbenchAdapter_reading_schema_error; public static String LazyDatabaseSchemaWorkbenchAdapter_schema_not_available; + public static String LazyDatabaseSchemaWorkbenchAdapter_nothing_to_show; public static String LazySessionFactoryAdapter_problems_while_creating_sessionfactory; public static String LazySessionFactoryAdapter_session_factory; public static String LazySessionFactoryAdapter_sessionfactory_error; Index: org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties =================================================================== --- org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties (revision 28613) +++ org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/HibernateConsoleMessages.properties (working copy) @@ -257,6 +257,7 @@ LazyDatabaseSchemaWorkbenchAdapter_problems_while_reading_database_schema=Problems while reading database schema LazyDatabaseSchemaWorkbenchAdapter_reading_schema_error= LazyDatabaseSchemaWorkbenchAdapter_schema_not_available= +LazyDatabaseSchemaWorkbenchAdapter_nothing_to_show= LazySessionFactoryAdapter_problems_while_creating_sessionfactory=Problems while creating sessionfactory LazySessionFactoryAdapter_session_factory=Session Factory LazySessionFactoryAdapter_sessionfactory_error= Index: org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/InfoLabel.java =================================================================== --- org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/InfoLabel.java (revision 0) +++ org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/InfoLabel.java (revision 0) @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2011 Red Hat, Inc. + * Distributed under license by Red Hat, Inc. All rights reserved. + * This program is made available under the terms of the + * Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributor: + * Red Hat, Inc. - initial API and implementation + ******************************************************************************/ +package org.hibernate.eclipse.console.workbench; + +/** + * @author vy (vyemialyanchyk@gmail.com) + */ +public class InfoLabel { + + final protected String label; + + public InfoLabel(String label) { + this.label = label; + } + + public String toString() { + return label; + } + +} Index: org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java =================================================================== --- org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java (revision 28614) +++ org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java (working copy) @@ -56,9 +56,8 @@ @SuppressWarnings("unchecked") public synchronized Object[] getChildren(Object o, final IProgressMonitor monitor) { LazyDatabaseSchema dbs = getLazyDatabaseSchema( o ); - ConsoleConfiguration consoleConfiguration = dbs.getConsoleConfiguration(); - + Object[] res; try { DefaultDatabaseCollector db = readDatabaseSchema(monitor, consoleConfiguration, dbs.getReverseEngineeringStrategy()); @@ -69,20 +68,20 @@ Map.Entry> entry = qualifierEntries.next(); result.add(new TableContainer(entry.getKey(), entry.getValue())); } - return toArray(result.iterator(), TableContainer.class, new Comparator() { - + res = toArray(result.iterator(), TableContainer.class, new Comparator() { public int compare(TableContainer arg0, TableContainer arg1) { - return arg0.getName().compareTo(arg1.getName()); } - }); + if (res.length == 0) { + res = new Object[] { new InfoLabel(HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_nothing_to_show) }; + } } catch (HibernateException e) { HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_problems_while_reading_database_schema, e); String out = NLS.bind(HibernateConsoleMessages.LazyDatabaseSchemaWorkbenchAdapter_reading_schema_error, e.getMessage()); - return new Object[]{out}; + res = new Object[] { out }; } - + return res; } private LazyDatabaseSchema getLazyDatabaseSchema(Object o) { Index: org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/xpl/AnyAdaptableLabelProvider.java =================================================================== --- org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/xpl/AnyAdaptableLabelProvider.java (revision 28613) +++ org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/xpl/AnyAdaptableLabelProvider.java (working copy) @@ -39,6 +39,7 @@ import org.hibernate.console.ImageConstants; import org.hibernate.eclipse.console.HibernateConsoleMessages; import org.hibernate.eclipse.console.utils.EclipseImages; +import org.hibernate.eclipse.console.workbench.InfoLabel; /** * LabelProvider based on WorkBenchLabelProvider that is not limited to WorkBench elements. @@ -165,7 +166,9 @@ IWorkbenchAdapter adapter = getAdapter(element); ImageDescriptor descriptor = null; if (adapter == null) { - descriptor = EclipseImages.getImageDescriptor(ImageConstants.ERROR); + descriptor = EclipseImages.getImageDescriptor( + (element instanceof InfoLabel) ? + ImageConstants.EXCLAMATION : ImageConstants.ERROR); } else { descriptor = adapter.getImageDescriptor(element); @@ -189,6 +192,9 @@ if (element instanceof String) { return (String) element; } + if (element instanceof InfoLabel) { + return ((InfoLabel)element).toString(); + } if (adapter == null) { String out = NLS.bind(HibernateConsoleMessages.AnyAdaptableLabelProvider_unknown, element.getClass().getName(), element); return out; Index: org.hibernate.eclipse/src/org/hibernate/console/ImageConstants.java =================================================================== --- org.hibernate.eclipse/src/org/hibernate/console/ImageConstants.java (revision 28613) +++ org.hibernate.eclipse/src/org/hibernate/console/ImageConstants.java (working copy) @@ -124,13 +124,13 @@ public static final String CHECKBOX_EMPTY = "images/xpl/incomplete_tsk.gif"; //$NON-NLS-1$ public static final String RELOAD = "images/reload.gif"; //$NON-NLS-1$ public static final String ERROR = "images/error.gif"; //$NON-NLS-1$ + public static final String EXCLAMATION = "images/exclamation.gif"; //$NON-NLS-1$ public static final String PINUP = "PINUP"; //$NON-NLS-1$ public static final String PINUP_PATH = "images/pinup.png"; //$NON-NLS-1$ - public static final String PINDOWN = "PINDOWN"; //$NON-NLS-1$ public static final String PINDOWN_PATH = "images/pindown.png"; //$NON-NLS-1$ + public static final String PRIMARY_KEY = "PRIMARY_KEY";//$NON-NLS-1$ public static final String GENERATOR = "GENERATOR";//$NON-NLS-1$ - } \ No newline at end of file Index: org.hibernate.eclipse/src/org/hibernate/console/ImageMap.java =================================================================== --- org.hibernate.eclipse/src/org/hibernate/console/ImageMap.java (revision 28613) +++ org.hibernate.eclipse/src/org/hibernate/console/ImageMap.java (working copy) @@ -75,6 +75,7 @@ declareRegistryImage(CHECKBOX_FULL, "images/xpl/complete_tsk.gif"); //$NON-NLS-1$ declareRegistryImage(RELOAD, "images/reload.gif"); //$NON-NLS-1$ declareRegistryImage(ERROR, "images/error.gif"); //$NON-NLS-1$ + declareRegistryImage(EXCLAMATION, EXCLAMATION); declareRegistryImage(PINUP, PINUP_PATH); declareRegistryImage(PINDOWN, PINDOWN_PATH); declareRegistryImage(PRIMARY_KEY, "images/primary_key.gif"); //$NON-NLS-1$