1 /*******************************************************************************
2 * Copyright (c) 2007, 2017 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 * Semantum Oy - (#7084) page numbering
12 *******************************************************************************/
13 package org.simantics.modeling.ui.pdf;
16 import java.util.ArrayList;
17 import java.util.Collection;
18 import java.util.HashSet;
19 import java.util.List;
22 import org.eclipse.jface.viewers.IStructuredSelection;
23 import org.simantics.db.common.NamedResource;
24 import org.simantics.db.management.ISessionContext;
25 import org.simantics.export.core.pdf.PageNumbering;
26 import org.simantics.modeling.requests.CollectionResult;
27 import org.simantics.modeling.requests.Node;
28 import org.simantics.project.IProject;
30 public class PDFExportPlan {
33 public ISessionContext sessionContext;
34 public IProject project;
35 public IStructuredSelection initialSelection;
36 public NamedResource initialModelSelection;
37 public List<NamedResource> selectableModels = new ArrayList<NamedResource>();
38 public NamedResource selection;
39 public Collection<String> recentLocations;
42 public CollectionResult nodes = new CollectionResult();
43 public Set<Node> selectedNodeSet = new HashSet<Node>();
46 //NamedResource model;
47 public File exportLocation;
48 public Collection<Node> selectedNodes;
53 * <code>false</code> to print content as is regardless of whether it goes
54 * outside printed page boundaries. <code>true</code> to scale the content
55 * so that it fills the printed page size and the specified margins. If the
56 * content goes over page boundaries, it is shrunk and if it doesn't fill
57 * the page boundaries, it is scaled up uniformly to fill them either
58 * horizontally or vertically.
60 public boolean fitContentToPageMargins = false;
63 * <code>true</code> to attach TG of the diagram and the model.
65 public boolean attachTG = false;
68 * <code>true</code> to attach Wiki page.
70 public boolean attachWiki = false;
73 * Whether or not to add page numbers to the exported PDF. Default value is
74 * {@value #addPageNumbers}.
78 public boolean addPageNumbers = true;
81 * This is ignored if {@link #addPageNumbers} is <code>false</code>.
83 public PageNumbering.Position pageNumberPosition = PageNumbering.Position.BOTTOM_RIGHT;
86 * This is ignored if {@link #addPageNumbers} is <code>false</code>.
88 public PageNumbering.NumberingFormat pageNumberFormat = PageNumbering.NumberingFormat.PAGE_SLASH_TOTAL_PAGES;
91 public PDFExportPlan(ISessionContext sessionContext, Collection<String> recentLocations) {
92 this.sessionContext = sessionContext;
93 this.recentLocations = recentLocations;