Search in sources :

Example 6 with EditableLabel

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

the class ColumnPart method handleNameChange.

/**
	 * @param Handles name change during direct edit
	 */
public void handleNameChange(String textValue) {
    EditableLabel label = (EditableLabel) getFigure();
    label.setVisible(false);
    setSelected(EditPart.SELECTED_NONE);
    label.revalidate();
}
Also used : EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel)

Example 7 with EditableLabel

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

the class ColumnPart method createFigure.

@Override
protected IFigure createFigure() {
    ERTableColumn column = (ERTableColumn) getModel();
    String label = column.getLabelText();
    EditableLabel columnLabel = new EditableLabel(label);
    columnLabel.setPK(column.isPrimaryKey());
    if (column.isPrimaryKey()) {
        columnLabel.setIcon(pkImage);
        columnLabel.setBorder(new ColumnLabelBorder(InsetsType.ICON));
    } else {
        columnLabel.setIcon(null);
        columnLabel.setBorder(new ColumnLabelBorder(InsetsType.TEXT));
    }
    return columnLabel;
}
Also used : EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel) ERTableColumn(com.cubrid.common.ui.er.model.ERTableColumn)

Example 8 with EditableLabel

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

the class ColumnPart method refreshVisuals.

/**
	 * We don't need to explicitly handle refresh visuals because the times when
	 * this needs to be done it is handled by the table e.g. handleNameChange()
	 */
@Override
protected void refreshVisuals() {
    ERTableColumn column = (ERTableColumn) getModel();
    EditableLabel columnLabel = (EditableLabel) getFigure();
    columnLabel.setText(column.getLabelText());
    columnLabel.setPK(column.isPrimaryKey());
    freshIcon();
    freshBorder();
}
Also used : EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel) ERTableColumn(com.cubrid.common.ui.er.model.ERTableColumn)

Example 9 with EditableLabel

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

the class ColumnPart method handleViewModelChange.

@Override
protected void handleViewModelChange(PropertyChangeEvent evt) {
    EditableLabel label = (EditableLabel) getFigure();
    label.setText(getColumn().getLabelText());
    label.revalidate();
}
Also used : EditableLabel(com.cubrid.common.ui.er.figures.EditableLabel)

Example 10 with EditableLabel

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

the class ColumnPart method revertNameChange.

/**
	 * Reverts state back to prior edit state
	 */
public void revertNameChange(String oldValue) {
    EditableLabel label = (EditableLabel) getFigure();
    label.setVisible(true);
    setSelected(EditPart.SELECTED_PRIMARY);
    label.revalidate();
}
Also used : 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