Search in sources :

Example 11 with EditableLabel

use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.

the class ColumnPart method handleLabelChange.

/**
	 * Handles when successfully applying direct edit
	 */
@Override
protected void handleLabelChange(PropertyChangeEvent evt) {
    ERTableColumn newColumn = getColumn();
    EditableLabel label = (EditableLabel) getFigure();
    label.setText(newColumn.getLabelText());
    label.setPK(newColumn.isPrimaryKey());
    freshIcon();
    freshBorder();
    label.revalidate();
}
Also used : EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel) ERTableColumn(com.cubrid.common.ui.er.model.ERTableColumn)

Example 12 with EditableLabel

use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.

the class RelationshipPart method handleDeleteConnection.

public void handleDeleteConnection() {
    Relationship relations = (Relationship) this.getModel();
    TablePart sourceTablePart = (TablePart) this.getSource();
    TablePart targetTablePart = (TablePart) this.getTarget();
    // set source and target columns
    if (sourceTablePart != null) {
        List<EditPart> children = sourceTablePart.getChildren();
        for (EditPart child : children) {
            if (!(child instanceof ColumnPart)) {
                continue;
            }
            ColumnPart columnPart = (ColumnPart) child;
            ERTableColumn column = (ERTableColumn) columnPart.getModel();
            if (relations.getReferenceColumns().contains(column.getName())) {
                EditableLabel columnLable = (EditableLabel) columnPart.getFigure();
                columnLable.setFontProtrude(false);
            }
        }
    }
    // target
    if (targetTablePart != null) {
        List<EditPart> children = targetTablePart.getChildren();
        for (EditPart child : children) {
            if (!(child instanceof ColumnPart)) {
                continue;
            }
            ColumnPart columnPart = (ColumnPart) child;
            ERTableColumn column = (ERTableColumn) columnPart.getModel();
            if (relations.getReferencedPKs().contains(column.getName())) {
                EditableLabel columnLable = (EditableLabel) columnPart.getFigure();
                columnLable.setFontProtrude(false);
            }
        }
    }
}
Also used : EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel) Relationship(com.cubrid.common.ui.er.model.Relationship) ERTableColumn(com.cubrid.common.ui.er.model.ERTableColumn) EditPart(org.eclipse.gef.EditPart)

Example 13 with EditableLabel

use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.

the class TablePart method handleNameChange.

public void handleNameChange(String value) {
    TableFigure tableFigure = (TableFigure) getFigure();
    EditableLabel label = tableFigure.getNameLabel();
    label.setVisible(false);
    refreshVisuals();
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel)

Example 14 with EditableLabel

use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.

the class TablePart method revertNameChange.

public void revertNameChange() {
    TableFigure tableFigure = (TableFigure) getFigure();
    EditableLabel label = tableFigure.getNameLabel();
    ERTable erTable = getTable();
    label.setText(erTable.getShownName());
    label.setVisible(true);
    refreshVisuals();
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel) ERTable(com.cubrid.common.ui.er.model.ERTable)

Example 15 with EditableLabel

use of com.cubrid.common.ui.er.figures.EditableLabel in project cubrid-manager by CUBRID.

the class TablePart method directEditHitTest.

private boolean directEditHitTest(Point requestLoc) {
    TableFigure figure = (TableFigure) getFigure();
    EditableLabel nameLabel = figure.getNameLabel();
    nameLabel.translateToRelative(requestLoc);
    if (nameLabel.containsPoint(requestLoc)) {
        return true;
    }
    return false;
}
Also used : TableFigure(com.cubrid.common.ui.er.figures.TableFigure) EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel)

Aggregations

EditableLabel (com.cubrid.common.ui.er.figures.EditableLabel)16 TableFigure (com.cubrid.common.ui.er.figures.TableFigure)6 ERTableColumn (com.cubrid.common.ui.er.model.ERTableColumn)5 ERTable (com.cubrid.common.ui.er.model.ERTable)2 Relationship (com.cubrid.common.ui.er.model.Relationship)2 EditPart (org.eclipse.gef.EditPart)2 ValidationGraphicalViewer (com.cubrid.common.ui.er.ValidationGraphicalViewer)1 ValidationMessageHandler (com.cubrid.common.ui.er.ValidationMessageHandler)1 ERDirectEditManager (com.cubrid.common.ui.er.directedit.ERDirectEditManager)1 LabelCellEditorLocator (com.cubrid.common.ui.er.directedit.LabelCellEditorLocator)1 TableNameCellEditorValidator (com.cubrid.common.ui.er.directedit.TableNameCellEditorValidator)1 TableNameCellEditor (com.cubrid.common.ui.er.editor.TableNameCellEditor)1 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1