Search in sources :

Example 16 with ERDEntity

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

the class EntityFigure method createToolTip.

@NotNull
private IFigure createToolTip() {
    ERDEntity entity = part.getEntity();
    DBPDataSourceContainer dataSource = entity.getDataSource().getContainer();
    Figure toolTip = new Figure();
    toolTip.setOpaque(true);
    // toolTip.setPreferredSize(300, 200);
    toolTip.setBorder(getBorder());
    toolTip.setLayoutManager(new GridLayout(1, false));
    {
        Label dsLabel = new Label(dataSource.getName());
        dsLabel.setIcon(DBeaverIcons.getImage(dataSource.getDriver().getIcon()));
        dsLabel.setBorder(new MarginBorder(2));
        toolTip.add(dsLabel);
    }
    {
        Label entityLabel = new Label(DBUtils.getObjectFullName(entity.getObject(), DBPEvaluationContext.UI));
        entityLabel.setIcon(DBeaverIcons.getImage(entity.getObject().getEntityType().getIcon()));
        entityLabel.setBorder(new MarginBorder(2));
        toolTip.add(entityLabel);
    }
    return toolTip;
}
Also used : ERDEntity(org.jkiss.dbeaver.erd.model.ERDEntity) DBPDataSourceContainer(org.jkiss.dbeaver.model.DBPDataSourceContainer) NotNull(org.jkiss.code.NotNull)

Aggregations

ERDEntity (org.jkiss.dbeaver.erd.model.ERDEntity)16 Point (org.eclipse.draw2d.geometry.Point)6 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 Collection (java.util.Collection)4 Rectangle (org.eclipse.draw2d.geometry.Rectangle)4 Command (org.eclipse.gef.commands.Command)4 EntityFigure (org.jkiss.dbeaver.erd.ui.figures.EntityFigure)4 DiagramCollectSettingsDefault (org.jkiss.dbeaver.erd.ui.model.DiagramCollectSettingsDefault)4 EntityPart (org.jkiss.dbeaver.erd.ui.part.EntityPart)4 DBPNamedObject (org.jkiss.dbeaver.model.DBPNamedObject)4 FileOutputStream (java.io.FileOutputStream)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Bendpoint (org.eclipse.draw2d.Bendpoint)2 Dimension (org.eclipse.draw2d.geometry.Dimension)2 CreateRequest (org.eclipse.gef.requests.CreateRequest)2 CreationFactory (org.eclipse.gef.requests.CreationFactory)2 Control (org.eclipse.swt.widgets.Control)2 NotNull (org.jkiss.code.NotNull)2