use of org.eclipse.draw2d.PrintFigureOperation in project dbeaver by dbeaver.
the class ERDEditorPart method printDiagram.
public void printDiagram() {
GraphicalViewer viewer = getGraphicalViewer();
PrintDialog dialog = new PrintDialog(viewer.getControl().getShell(), SWT.NULL);
PrinterData data = dialog.open();
if (data != null) {
IFigure rootFigure = rootPart.getLayer(ScalableFreeformRootEditPart.PRINTABLE_LAYERS);
// EntityDiagramFigure diagramFigure = findFigure(rootFigure, EntityDiagramFigure.class);
if (rootFigure != null) {
PrintFigureOperation printOp = new PrintFigureOperation(new Printer(data), rootFigure);
// Set print preferences
IPreferenceStore store = ERDActivator.getDefault().getPreferenceStore();
printOp.setPrintMode(store.getInt(ERDConstants.PREF_PRINT_PAGE_MODE));
printOp.setPrintMargin(new Insets(store.getInt(ERDConstants.PREF_PRINT_MARGIN_TOP), store.getInt(ERDConstants.PREF_PRINT_MARGIN_LEFT), store.getInt(ERDConstants.PREF_PRINT_MARGIN_BOTTOM), store.getInt(ERDConstants.PREF_PRINT_MARGIN_RIGHT)));
// Run print
printOp.run("Print ER diagram");
}
}
// new PrintAction(this).run();
}
use of org.eclipse.draw2d.PrintFigureOperation in project dbeaver by serge-rider.
the class ERDEditorPart method printDiagram.
public void printDiagram() {
GraphicalViewer viewer = getGraphicalViewer();
PrintDialog dialog = new PrintDialog(viewer.getControl().getShell(), SWT.NULL);
PrinterData data = dialog.open();
if (data != null) {
IFigure rootFigure = rootPart.getLayer(ScalableFreeformRootEditPart.PRINTABLE_LAYERS);
// EntityDiagramFigure diagramFigure = findFigure(rootFigure, EntityDiagramFigure.class);
if (rootFigure != null) {
PrintFigureOperation printOp = new PrintFigureOperation(new Printer(data), rootFigure);
// Set print preferences
DBPPreferenceStore store = ERDUIActivator.getDefault().getPreferences();
printOp.setPrintMode(store.getInt(ERDUIConstants.PREF_PRINT_PAGE_MODE));
printOp.setPrintMargin(new Insets(store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_TOP), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_LEFT), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_BOTTOM), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_RIGHT)));
// Run print
printOp.run("Print ER diagram");
}
}
// new PrintAction(this).run();
}
use of org.eclipse.draw2d.PrintFigureOperation in project dbeaver by dbeaver.
the class ERDEditorPart method printDiagram.
public void printDiagram() {
GraphicalViewer viewer = getGraphicalViewer();
PrintDialog dialog = new PrintDialog(viewer.getControl().getShell(), SWT.NULL);
PrinterData data = dialog.open();
if (data != null) {
IFigure rootFigure = rootPart.getLayer(ScalableFreeformRootEditPart.PRINTABLE_LAYERS);
// EntityDiagramFigure diagramFigure = findFigure(rootFigure, EntityDiagramFigure.class);
if (rootFigure != null) {
PrintFigureOperation printOp = new PrintFigureOperation(new Printer(data), rootFigure);
// Set print preferences
DBPPreferenceStore store = ERDUIActivator.getDefault().getPreferences();
printOp.setPrintMode(store.getInt(ERDUIConstants.PREF_PRINT_PAGE_MODE));
printOp.setPrintMargin(new Insets(store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_TOP), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_LEFT), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_BOTTOM), store.getInt(ERDUIConstants.PREF_PRINT_MARGIN_RIGHT)));
// Run print
printOp.run("Print ER diagram");
}
}
// new PrintAction(this).run();
}
Aggregations