Search in sources :

Example 1 with EntityFigure

use of org.jkiss.dbeaver.erd.ui.figures.EntityFigure in project dbeaver by serge-rider.

the class EntityPart method revertNameChange.

/**
 * Reverts to existing name in model when exiting from a direct edit
 * (possibly before a commit which will result in a change in the label
 * value)
 */
public void revertNameChange() {
    EntityFigure entityFigure = getFigure();
    EditableLabel label = entityFigure.getNameLabel();
    ERDEntity entity = getEntity();
    label.setText(entity.getObject().getName());
    label.setVisible(true);
    refreshVisuals();
}
Also used : EditableLabel(org.jkiss.dbeaver.erd.ui.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.erd.ui.figures.EntityFigure) ERDEntity(org.jkiss.dbeaver.erd.model.ERDEntity)

Example 2 with EntityFigure

use of org.jkiss.dbeaver.erd.ui.figures.EntityFigure in project dbeaver by serge-rider.

the class EntityPart method handleNameChange.

public void handleNameChange(String value) {
    EntityFigure entityFigure = getFigure();
    EditableLabel label = entityFigure.getNameLabel();
    label.setVisible(false);
    refreshVisuals();
}
Also used : EditableLabel(org.jkiss.dbeaver.erd.ui.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.erd.ui.figures.EntityFigure)

Example 3 with EntityFigure

use of org.jkiss.dbeaver.erd.ui.figures.EntityFigure in project dbeaver by serge-rider.

the class EntityPart method commitNameChange.

// ******************* Listener related methods *********************/
/**
 * Handles change in name when committing a direct edit
 */
@Override
protected void commitNameChange(PropertyChangeEvent evt) {
    EntityFigure entityFigure = getFigure();
    EditableLabel label = entityFigure.getNameLabel();
    label.setText(getEntity().getObject().getName());
    label.setVisible(true);
    refreshVisuals();
    entityFigure.refreshColors();
}
Also used : EditableLabel(org.jkiss.dbeaver.erd.ui.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.erd.ui.figures.EntityFigure)

Example 4 with EntityFigure

use of org.jkiss.dbeaver.erd.ui.figures.EntityFigure in project dbeaver by dbeaver.

the class EntityPart method commitNameChange.

// ******************* Listener related methods *********************/
/**
 * Handles change in name when committing a direct edit
 */
@Override
protected void commitNameChange(PropertyChangeEvent evt) {
    EntityFigure entityFigure = getFigure();
    EditableLabel label = entityFigure.getNameLabel();
    label.setText(getEntity().getObject().getName());
    label.setVisible(true);
    refreshVisuals();
    entityFigure.refreshColors();
}
Also used : EditableLabel(org.jkiss.dbeaver.erd.ui.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.erd.ui.figures.EntityFigure)

Example 5 with EntityFigure

use of org.jkiss.dbeaver.erd.ui.figures.EntityFigure in project dbeaver by dbeaver.

the class EntityPart method directEditHitTest.

private boolean directEditHitTest(Point requestLoc) {
    EntityFigure figure = getFigure();
    EditableLabel nameLabel = figure.getNameLabel();
    nameLabel.translateToRelative(requestLoc);
    return nameLabel.containsPoint(requestLoc);
}
Also used : EditableLabel(org.jkiss.dbeaver.erd.ui.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.erd.ui.figures.EntityFigure)

Aggregations

EntityFigure (org.jkiss.dbeaver.erd.ui.figures.EntityFigure)18 EditableLabel (org.jkiss.dbeaver.erd.ui.figures.EditableLabel)10 Rectangle (org.eclipse.draw2d.geometry.Rectangle)4 ERDEntity (org.jkiss.dbeaver.erd.model.ERDEntity)4 FileOutputStream (java.io.FileOutputStream)2 HashMap (java.util.HashMap)2 Bendpoint (org.eclipse.draw2d.Bendpoint)2 Point (org.eclipse.draw2d.geometry.Point)2 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)2 DBException (org.jkiss.dbeaver.DBException)2 ERDAssociation (org.jkiss.dbeaver.erd.model.ERDAssociation)2 ERDEntityAttribute (org.jkiss.dbeaver.erd.model.ERDEntityAttribute)2 ExtendedDirectEditManager (org.jkiss.dbeaver.erd.ui.directedit.ExtendedDirectEditManager)2 LabelCellEditorLocator (org.jkiss.dbeaver.erd.ui.directedit.LabelCellEditorLocator)2 TableNameCellEditorValidator (org.jkiss.dbeaver.erd.ui.directedit.TableNameCellEditorValidator)2 ValidationMessageHandler (org.jkiss.dbeaver.erd.ui.directedit.ValidationMessageHandler)2 ERDGraphicalViewer (org.jkiss.dbeaver.erd.ui.editor.ERDGraphicalViewer)2 AttributeListFigure (org.jkiss.dbeaver.erd.ui.figures.AttributeListFigure)2 EntityDiagram (org.jkiss.dbeaver.erd.ui.model.EntityDiagram)2 AssociationPart (org.jkiss.dbeaver.erd.ui.part.AssociationPart)2