use of org.jkiss.dbeaver.ext.erd.part.NotePart in project dbeaver by serge-rider.
the class NoteCreateCommand method execute.
@Override
public void execute() {
diagramPart.getDiagram().addNote(note, true);
if (location != null) {
// Set new note location
for (Object diagramChild : diagramPart.getChildren()) {
if (diagramChild instanceof NotePart) {
NotePart entityPart = (NotePart) diagramChild;
if (entityPart.getNote() == note) {
final Dimension size = entityPart.getFigure().getPreferredSize();
final Rectangle newBounds = new Rectangle(location.x, location.y, size.width, size.height);
entityPart.modifyBounds(newBounds);
break;
}
}
}
}
}
use of org.jkiss.dbeaver.ext.erd.part.NotePart in project dbeaver by serge-rider.
the class NoteEditPolicy method createDeleteCommand.
@Override
protected Command createDeleteCommand(GroupRequest request) {
NotePart notePart = (NotePart) getHost();
Rectangle bounds = notePart.getFigure().getBounds().getCopy();
EntityDiagram parent = (EntityDiagram) (notePart.getParent().getModel());
return new NoteDeleteCommand(parent, notePart, bounds);
}
use of org.jkiss.dbeaver.ext.erd.part.NotePart in project dbeaver by dbeaver.
the class NoteDirectEditPolicy method revertOldEditValue.
/**
* @param request
*/
@Override
protected void revertOldEditValue(DirectEditRequest request) {
CellEditor cellEditor = request.getCellEditor();
cellEditor.setValue(oldValue);
NotePart entityPart = (NotePart) getHost();
entityPart.revertNameChange();
}
use of org.jkiss.dbeaver.ext.erd.part.NotePart in project dbeaver by dbeaver.
the class NoteEditPolicy method createDeleteCommand.
@Override
protected Command createDeleteCommand(GroupRequest request) {
NotePart notePart = (NotePart) getHost();
Rectangle bounds = notePart.getFigure().getBounds().getCopy();
EntityDiagram parent = (EntityDiagram) (notePart.getParent().getModel());
return new NoteDeleteCommand(parent, notePart, bounds);
}
Aggregations