Search in sources :

Example 21 with DBPImage

use of org.jkiss.dbeaver.model.DBPImage in project dbeaver by serge-rider.

the class PrefPageProjectResourceSettings method performDefaults.

@Override
protected void performDefaults() {
    resourceTable.removeAll();
    DBPWorkspace workspace = DBWorkbench.getPlatform().getWorkspace();
    for (DBPResourceHandlerDescriptor descriptor : workspace.getResourceHandlerDescriptors()) {
        if (!descriptor.isManagable()) {
            continue;
        }
        TableItem item = new TableItem(resourceTable, SWT.NONE);
        item.setData(descriptor);
        final DBPImage icon = descriptor.getIcon();
        if (icon != null) {
            item.setImage(DBeaverIcons.getImage(icon));
        }
        item.setText(0, descriptor.getName());
        DBPProject projectMeta = getProjectMeta();
        String defaultRoot = projectMeta == null ? null : descriptor.getDefaultRoot(projectMeta);
        if (defaultRoot != null) {
            item.setText(1, defaultRoot);
        }
    }
    UIUtils.packColumns(resourceTable, true);
    super.performDefaults();
}
Also used : DBPWorkspace(org.jkiss.dbeaver.model.app.DBPWorkspace) DBPResourceHandlerDescriptor(org.jkiss.dbeaver.model.app.DBPResourceHandlerDescriptor) DBPProject(org.jkiss.dbeaver.model.app.DBPProject) DBPImage(org.jkiss.dbeaver.model.DBPImage)

Aggregations

DBPImage (org.jkiss.dbeaver.model.DBPImage)21 GridData (org.eclipse.swt.layout.GridData)5 Composite (org.eclipse.swt.widgets.Composite)5 DBException (org.jkiss.dbeaver.DBException)5 Point (org.eclipse.swt.graphics.Point)4 List (java.util.List)3 IDialogConstants (org.eclipse.jface.dialogs.IDialogConstants)3 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)3 SWT (org.eclipse.swt.SWT)3 Shell (org.eclipse.swt.widgets.Shell)3 DBPDriver (org.jkiss.dbeaver.model.connection.DBPDriver)3 ListContentProvider (org.jkiss.dbeaver.ui.controls.ListContentProvider)3 CommonUtils (org.jkiss.utils.CommonUtils)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 BigDecimal (java.math.BigDecimal)2 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)2 Action (org.eclipse.jface.action.Action)2 org.eclipse.jface.viewers (org.eclipse.jface.viewers)2 Rectangle (org.eclipse.swt.graphics.Rectangle)2 Control (org.eclipse.swt.widgets.Control)2