use of com.cubrid.common.ui.er.ValidationGraphicalViewer in project cubrid-manager by CUBRID.
the class ERSchemaEditor method createGraphicalViewer.
private ScrollingGraphicalViewer createGraphicalViewer(IEditorSite editorSite, Composite parent) {
StatusLineValidationMessageHandler messageHandler = new StatusLineValidationMessageHandler(editorSite);
ScrollingGraphicalViewer viewer = new ValidationGraphicalViewer(messageHandler);
viewer.createControl(parent);
viewer.getControl().setBackground(ColorConstants.white);
viewer.setRootEditPart(new ERScalableFreeformRootEditPart());
viewer.setEditPartFactory(new PartFactory());
viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));
viewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
viewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, true);
viewer.setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(10, 10));
viewer.setProperty(SnapToGrid.PROPERTY_GRID_ORIGIN, new Point(5, 5));
return viewer;
}
use of com.cubrid.common.ui.er.ValidationGraphicalViewer in project cubrid-manager by CUBRID.
the class ColumnPart method createDirectEditManager.
private void createDirectEditManager() {
if (manager == null) {
ValidationGraphicalViewer viewer = (ValidationGraphicalViewer) getViewer();
ValidationMessageHandler handler = viewer.getValidationHandler();
Label label = (Label) getFigure();
ColumnNameTypeCellEditorValidator columnNameTypeCellEditorValidator = new ColumnNameTypeCellEditorValidator(handler, (ERTableColumn) getModel());
manager = new ERDirectEditManager(label, columnNameTypeCellEditorValidator, this, TextCellEditor.class, new LabelCellEditorLocator(label));
}
}
use of com.cubrid.common.ui.er.ValidationGraphicalViewer in project cubrid-manager by CUBRID.
the class TablePart method performDirectEdit.
protected void performDirectEdit() {
if (manager == null) {
ValidationGraphicalViewer viewer = (ValidationGraphicalViewer) getViewer();
ValidationMessageHandler handler = viewer.getValidationHandler();
TableFigure figure = (TableFigure) getFigure();
EditableLabel nameLabel = figure.getNameLabel();
manager = new ERDirectEditManager(nameLabel, new TableNameCellEditorValidator(handler), this, TableNameCellEditor.class, new LabelCellEditorLocator(nameLabel));
}
manager.show();
}
use of com.cubrid.common.ui.er.ValidationGraphicalViewer in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method getEditor.
public ERSchemaEditor getEditor() {
EditPart parentP = getParent();
if (parentP instanceof ScalableFreeformRootEditPart) {
ScalableFreeformRootEditPart parentEditor = (ScalableFreeformRootEditPart) parentP;
EditPartViewer viewer = parentEditor.getViewer();
if (viewer instanceof ValidationGraphicalViewer) {
ValidationGraphicalViewer gViewer = (ValidationGraphicalViewer) viewer;
EditDomain domain = gViewer.getEditDomain();
if (domain instanceof ERSchemaEditDomain) {
ERSchemaEditDomain erEditorDomain = (ERSchemaEditDomain) domain;
return (ERSchemaEditor) erEditorDomain.getEditorPart();
}
}
}
return null;
}
Aggregations