use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableDirectEditPolicy method showCurrentEditValue.
@Override
protected void showCurrentEditValue(DirectEditRequest request) {
String value = (String) request.getCellEditor().getValue();
TablePart tablePart = (TablePart) getHost();
tablePart.handleNameChange(value);
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableLayoutEditPolicy method createAddCommand.
@Override
protected Command createAddCommand(EditPart child, EditPart after) {
if (!(child instanceof ColumnPart) || !(after instanceof ColumnPart)) {
return null;
}
ERTableColumn toMove = (ERTableColumn) child.getModel();
ERTableColumn afterModel = (ERTableColumn) after.getModel();
TablePart originalTablePart = (TablePart) child.getParent();
ERTable originalTable = (ERTable) originalTablePart.getModel();
TablePart newTablePart = (TablePart) after.getParent();
ERTable newTable = newTablePart.getTable();
int oldIndex = originalTablePart.getChildren().indexOf(child);
int newIndex = newTablePart.getChildren().indexOf(after);
return new TransferColumnCommand(toMove, afterModel, originalTable, newTable, oldIndex, newIndex);
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableNodeEditPolicy method getConnectionCompleteCommand.
/**
* @see GraphicalNodeEditPolicy#getConnectionCompleteCommand(CreateConnectionRequest)
*/
@Override
protected Command getConnectionCompleteCommand(CreateConnectionRequest request) {
CreateRelationshipCommand cmd = (CreateRelationshipCommand) request.getStartCommand();
TablePart part = (TablePart) request.getTargetEditPart();
cmd.setPrimaryTable(part.getTable());
return cmd;
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class TableNodeEditPolicy method getReconnectTargetCommand.
/**
* @see GraphicalNodeEditPolicy#getReconnectTargetCommand(ReconnectRequest)
*/
@Override
protected Command getReconnectTargetCommand(ReconnectRequest request) {
ReconnectPrimaryKeyCommand cmd = new ReconnectPrimaryKeyCommand();
cmd.setRelationship((Relationship) request.getConnectionEditPart().getModel());
TablePart tablePart = (TablePart) getHost();
cmd.setTargetPrimaryKey(tablePart.getTable());
return cmd;
}
use of com.cubrid.common.ui.er.part.TablePart in project cubrid-manager by CUBRID.
the class ERSchemaEditor method setLocateTable.
/**
* Set the ERD focus location onto the gave table
*
* @param tableName
*/
public void setLocateTable(String tableName) {
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;
ERTable erTable = tablePart.getTable();
if (erTable.getName().equals(tableName)) {
setLocatePoint(erTable.getBounds().x, erTable.getBounds().y);
}
}
}
Aggregations