Search in sources :

Example 11 with EntityPart

use of org.jkiss.dbeaver.ext.erd.part.EntityPart in project dbeaver by serge-rider.

the class EntityDirectEditPolicy method showCurrentEditValue.

/**
	 * @see DirectEditPolicy#showCurrentEditValue(org.eclipse.gef.requests.DirectEditRequest)
	 */
@Override
protected void showCurrentEditValue(DirectEditRequest request) {
    String value = (String) request.getCellEditor().getValue();
    EntityPart entityPart = (EntityPart) getHost();
    entityPart.handleNameChange(value);
}
Also used : EntityPart(org.jkiss.dbeaver.ext.erd.part.EntityPart)

Example 12 with EntityPart

use of org.jkiss.dbeaver.ext.erd.part.EntityPart in project dbeaver by serge-rider.

the class EntityDirectEditPolicy method revertOldEditValue.

/**
	 * @param request
	 */
@Override
protected void revertOldEditValue(DirectEditRequest request) {
    CellEditor cellEditor = request.getCellEditor();
    cellEditor.setValue(oldValue);
    EntityPart entityPart = (EntityPart) getHost();
    entityPart.revertNameChange();
}
Also used : CellEditor(org.eclipse.jface.viewers.CellEditor) EntityPart(org.jkiss.dbeaver.ext.erd.part.EntityPart)

Example 13 with EntityPart

use of org.jkiss.dbeaver.ext.erd.part.EntityPart in project dbeaver by serge-rider.

the class EntityEditPolicy method createDeleteCommand.

@Override
protected Command createDeleteCommand(GroupRequest request) {
    EntityPart entityPart = (EntityPart) getHost();
    Rectangle bounds = entityPart.getFigure().getBounds().getCopy();
    EntityDiagram parent = (EntityDiagram) (entityPart.getParent().getModel());
    return new EntityDeleteCommand(parent, entityPart, bounds);
}
Also used : EntityDiagram(org.jkiss.dbeaver.ext.erd.model.EntityDiagram) EntityDeleteCommand(org.jkiss.dbeaver.ext.erd.command.EntityDeleteCommand) Rectangle(org.eclipse.draw2d.geometry.Rectangle) EntityPart(org.jkiss.dbeaver.ext.erd.part.EntityPart)

Aggregations

EntityPart (org.jkiss.dbeaver.ext.erd.part.EntityPart)13 Rectangle (org.eclipse.draw2d.geometry.Rectangle)5 Bendpoint (org.eclipse.draw2d.Bendpoint)2 Dimension (org.eclipse.draw2d.geometry.Dimension)2 Point (org.eclipse.draw2d.geometry.Point)2 AssociationCreateCommand (org.jkiss.dbeaver.ext.erd.command.AssociationCreateCommand)2 ERDEntity (org.jkiss.dbeaver.ext.erd.model.ERDEntity)2 AssociationPart (org.jkiss.dbeaver.ext.erd.part.AssociationPart)2 XMLBuilder (org.jkiss.utils.xml.XMLBuilder)2 FileOutputStream (java.io.FileOutputStream)1 HashMap (java.util.HashMap)1 AbsoluteBendpoint (org.eclipse.draw2d.AbsoluteBendpoint)1 Figure (org.eclipse.draw2d.Figure)1 IFigure (org.eclipse.draw2d.IFigure)1 RelativeBendpoint (org.eclipse.draw2d.RelativeBendpoint)1 Insets (org.eclipse.draw2d.geometry.Insets)1 PaletteDrawer (org.eclipse.gef.palette.PaletteDrawer)1 CellEditor (org.eclipse.jface.viewers.CellEditor)1 DBException (org.jkiss.dbeaver.DBException)1 AssociationReconnectSourceCommand (org.jkiss.dbeaver.ext.erd.command.AssociationReconnectSourceCommand)1