]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/pdf/PDFExportPlan.java
Revert "Default property editing restores assertions"
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / pdf / PDFExportPlan.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2017 Association for Decentralized Information Management
3  * in Industry THTH ry.
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
8  *
9  * Contributors:
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;
14
15 import java.io.File;
16 import java.util.ArrayList;
17 import java.util.Collection;
18 import java.util.HashSet;
19 import java.util.List;
20 import java.util.Set;
21
22 import org.simantics.db.common.NamedResource;
23 import org.simantics.db.management.ISessionContext;
24 import org.simantics.export.core.pdf.PageNumbering;
25 import org.simantics.modeling.requests.CollectionResult;
26 import org.simantics.modeling.requests.Node;
27 import org.simantics.project.IProject;
28
29 public class PDFExportPlan {
30
31     // Input
32     public ISessionContext           sessionContext;
33     public IProject                  project;
34     public List<NamedResource>       selectableModels = new ArrayList<NamedResource>();
35     public NamedResource             selection;
36     public Collection<String>        recentLocations;
37
38     // Temporary data
39     public CollectionResult          nodes           = new CollectionResult();
40     public Set<Node>                 selectedNodeSet = new HashSet<Node>();
41
42     // Output
43     //NamedResource             model;
44     public File                      exportLocation;
45     public Collection<Node>          selectedNodes;
46
47     // I/O
48
49     /**
50      * <code>false</code> to print content as is regardless of whether it goes
51      * outside printed page boundaries. <code>true</code> to scale the content
52      * so that it fills the printed page size and the specified margins. If the
53      * content goes over page boundaries, it is shrunk and if it doesn't fill
54      * the page boundaries, it is scaled up uniformly to fill them either
55      * horizontally or vertically.
56      */
57     public boolean                   fitContentToPageMargins    = false;
58
59     /**
60      * <code>true</code> to attach TG of the diagram and the model.
61      */
62     public boolean attachTG = false;
63
64     /**
65      * <code>true</code> to attach Wiki page.
66      */
67     public boolean attachWiki = false;
68
69     /**
70      * Whether or not to add page numbers to the exported PDF. Default value is
71      * {@value #addPageNumbers}.
72      * 
73      * @since 1.28.0
74      */
75     public boolean addPageNumbers = true;
76
77     /**
78      * This is ignored if {@link #addPageNumbers} is <code>false</code>.
79      */
80     public PageNumbering.Position pageNumberPosition = PageNumbering.Position.BOTTOM_RIGHT;
81
82     /**
83      * This is ignored if {@link #addPageNumbers} is <code>false</code>.
84      */
85     public PageNumbering.NumberingFormat pageNumberFormat = PageNumbering.NumberingFormat.PAGE_SLASH_TOTAL_PAGES;
86
87
88     public PDFExportPlan(ISessionContext sessionContext, Collection<String> recentLocations) {
89         this.sessionContext = sessionContext;
90         this.recentLocations = recentLocations;
91     }
92
93 }