Search in sources :

Example 1 with EditableLabel

use of org.jkiss.dbeaver.ext.erd.figures.EditableLabel in project dbeaver by serge-rider.

the class AttributePart method handleNameChange.

public void handleNameChange(String textValue) {
    EditableLabel label = getFigure();
    label.setVisible(false);
    setSelected(EditPart.SELECTED_NONE);
    label.revalidate();
}
Also used : EditableLabel(org.jkiss.dbeaver.ext.erd.figures.EditableLabel)

Example 2 with EditableLabel

use of org.jkiss.dbeaver.ext.erd.figures.EditableLabel 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 = getTable();
    label.setText(entity.getObject().getName());
    label.setVisible(true);
    refreshVisuals();
}
Also used : EditableLabel(org.jkiss.dbeaver.ext.erd.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.ext.erd.figures.EntityFigure) ERDEntity(org.jkiss.dbeaver.ext.erd.model.ERDEntity)

Example 3 with EditableLabel

use of org.jkiss.dbeaver.ext.erd.figures.EditableLabel in project dbeaver by serge-rider.

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.ext.erd.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.ext.erd.figures.EntityFigure)

Example 4 with EditableLabel

use of org.jkiss.dbeaver.ext.erd.figures.EditableLabel in project dbeaver by serge-rider.

the class AttributePart method setSelected.

/**
	 * Sets the width of the line when selected
	 */
@Override
public void setSelected(int value) {
    super.setSelected(value);
    EditableLabel columnLabel = getFigure();
    if (value != EditPart.SELECTED_NONE)
        columnLabel.setSelected(true);
    else
        columnLabel.setSelected(false);
    columnLabel.repaint();
}
Also used : EditableLabel(org.jkiss.dbeaver.ext.erd.figures.EditableLabel)

Example 5 with EditableLabel

use of org.jkiss.dbeaver.ext.erd.figures.EditableLabel 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.ext.erd.figures.EditableLabel) EntityFigure(org.jkiss.dbeaver.ext.erd.figures.EntityFigure)

Aggregations

EditableLabel (org.jkiss.dbeaver.ext.erd.figures.EditableLabel)7 EntityFigure (org.jkiss.dbeaver.ext.erd.figures.EntityFigure)5 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)1 ExtendedDirectEditManager (org.jkiss.dbeaver.ext.erd.directedit.ExtendedDirectEditManager)1 LabelCellEditorLocator (org.jkiss.dbeaver.ext.erd.directedit.LabelCellEditorLocator)1 TableNameCellEditorValidator (org.jkiss.dbeaver.ext.erd.directedit.TableNameCellEditorValidator)1 ValidationMessageHandler (org.jkiss.dbeaver.ext.erd.directedit.ValidationMessageHandler)1 ERDGraphicalViewer (org.jkiss.dbeaver.ext.erd.editor.ERDGraphicalViewer)1 ERDEntity (org.jkiss.dbeaver.ext.erd.model.ERDEntity)1