use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableDirectEditPolicy method revertOldEditValue.
@Override
protected void revertOldEditValue(DirectEditRequest request) {
CellEditor cellEditor = request.getCellEditor();
cellEditor.setValue(oldValue);
TablePart tablePart = (TablePart) getHost();
tablePart.revertNameChange();
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableEditPolicy method createDeleteCommand.
@Override
protected Command createDeleteCommand(GroupRequest request) {
TablePart tablePart = (TablePart) getHost();
Rectangle bounds = tablePart.getFigure().getBounds().getCopy();
ERSchema parent = (ERSchema) (tablePart.getParent().getModel());
DeleteTableCommand deleteCmd = new DeleteTableCommand();
deleteCmd.setSchema(parent);
deleteCmd.setTable((ERTable) (tablePart.getModel()));
deleteCmd.setOriginalBounds(bounds);
return deleteCmd;
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableNodeEditPolicy method getConnectionCreateCommand.
/**
* @see GraphicalNodeEditPolicy#getConnectionCreateCommand(CreateConnectionRequest)
*/
@Override
protected Command getConnectionCreateCommand(CreateConnectionRequest request) {
CreateRelationshipCommand cmd = new CreateRelationshipCommand();
TablePart part = (TablePart) getHost();
cmd.setForeignTable(part.getTable());
request.setStartCommand(cmd);
return cmd;
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableNodeEditPolicy method getReconnectSourceCommand.
/**
* @see GraphicalNodeEditPolicy#getReconnectSourceCommand(ReconnectRequest)
*/
@Override
protected Command getReconnectSourceCommand(ReconnectRequest request) {
ReconnectForeignKeyCommand cmd = new ReconnectForeignKeyCommand();
cmd.setRelationship((Relationship) request.getConnectionEditPart().getModel());
TablePart tablePart = (TablePart) getHost();
cmd.setSourceForeignKey(tablePart.getTable());
return cmd;
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class ERSchemaEditor method setAllFiguresOrigin.
/**
* When user click the empty space on the ERD canvas, then all the table
* should be unselected and background color should be reset to default.
*/
public void setAllFiguresOrigin() {
graphicalViewer.setFocus(null);
graphicalViewer.deselectAll();
SchemaDiagramPart schemaRootPart = getERSchemaRootPart();
List allParts = schemaRootPart.getChildren();
Iterator it = allParts.iterator();
while (it.hasNext()) {
Object obj = it.next();
if (!(obj instanceof TablePart)) {
continue;
}
TablePart tablePart = (TablePart) obj;
tablePart.setSelected(TablePart.SELECTED_NONE);
tablePart.getFigure().setBackgroundColor(TableFigure.defaultBackgroundColor);
}
}
Aggregations