use of com.cubrid.common.ui.er.editor.ERSchemaEditor in project cubrid-manager by CUBRID.
the class FlyoutChangeLayoutAction method run.
public void run() {
if (editor instanceof ERSchemaEditor) {
ERSchemaEditor erSchemaEditor = (ERSchemaEditor) editor;
ERSchema erSchema = erSchemaEditor.getSchema();
boolean isManual = erSchema.isLayoutManualDesired();
erSchema.setLayoutManualDesiredAndFire(!isManual);
checked = !isManual;
setChecked(checked);
}
}
use of com.cubrid.common.ui.er.editor.ERSchemaEditor in project cubrid-manager by CUBRID.
the class FlyoutChangeLayoutAction method isChecked.
public boolean isChecked(IEditorPart editor) {
if (editor instanceof ERSchemaEditor) {
ERSchemaEditor erSchemaEditor = (ERSchemaEditor) editor;
ERSchema erSchema = erSchemaEditor.getSchema();
boolean checkTrue = erSchema.isLayoutManualDesired();
return (!checkTrue);
} else {
return false;
}
}
use of com.cubrid.common.ui.er.editor.ERSchemaEditor in project cubrid-manager by CUBRID.
the class AbstractBasicPart method postSchemaDataChanged.
public void postSchemaDataChanged(PropertyChangeEvent evt) {
String property = evt.getPropertyName();
boolean isDataChanged = PropertyChangeProvider.CHILD_CHANGE.equals(property) | PropertyChangeProvider.OUTPUT_CHANGE.equals(property) | PropertyChangeProvider.INPUT_CHANGE.equals(property) | PropertyChangeProvider.TEXT_CHANGE.equals(property);
if (!isDataChanged) {
return;
}
IWorkbenchPage page = getActivePage();
if (page == null) {
return;
}
IEditorPart editor = page.getActiveEditor();
if (editor instanceof ERSchemaEditor) {
ERSchemaEditor erEditor = (ERSchemaEditor) editor;
erEditor.setDirty(true);
}
}
use of com.cubrid.common.ui.er.editor.ERSchemaEditor in project cubrid-manager by CUBRID.
the class SchemaContainerEditPolicy method getCreateCommand.
@Override
protected Command getCreateCommand(CreateRequest request) {
Object newObject = request.getNewObject();
if (!(newObject instanceof ERTable)) {
return null;
}
Point location = request.getLocation();
SchemaDiagramPart schemaPart = (SchemaDiagramPart) getHost();
ERSchema erSchema = schemaPart.getSchema();
ERTable erTable = (ERTable) newObject;
ERSchemaEditor editor = schemaPart.getEditor();
int offsetX = 0;
int offsetY = 0;
if (editor != null) {
offsetX = editor.getHorizontalScrollWidth();
offsetY = editor.getVerticalScrollHeight();
}
erTable.setBounds(new Rectangle(location.x + offsetX, location.y + offsetY, erTable.getMinWidth(), erTable.getMinHeight()));
AddTableCommand addTableCommand = new AddTableCommand();
addTableCommand.setSchema(erSchema);
SchemaInfo schemaInfo = ERTable.createEmptySchemaInfo(erTable.getName(), erTable.getCubridDatabase().getName());
addTableCommand.setTable(erTable, schemaInfo);
return addTableCommand;
}
use of com.cubrid.common.ui.er.editor.ERSchemaEditor in project cubrid-manager by CUBRID.
the class SchemaDiagramPart method moveLastTableLocationFocus.
public boolean moveLastTableLocationFocus() {
TablePart bottomRightT = getBottomRightTable();
ERSchemaEditor editor = getEditor();
if (bottomRightT != null && editor != null) {
IFigure figure = bottomRightT.getFigure();
Point point = figure.getBounds().getBottomRight();
editor.setLocatePoint(point.x, point.y + 160);
// 160 is the distance between ERD canvas top and the CM/CQB app top
return true;
}
return false;
}
Aggregations