ItEr43S10SoporteImpresionMultiplesPaxinasItEr42S15: Added support for expanded plannification printing
This commit is contained in:
parent
d93eed58dd
commit
d354b76e84
3 changed files with 24 additions and 11 deletions
|
|
@ -55,6 +55,7 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Checkbox;
|
||||
import org.zkoss.zul.Radiogroup;
|
||||
import org.zkoss.zul.Window;
|
||||
|
||||
|
|
@ -382,6 +383,21 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
return configuration.isPrintEnabled();
|
||||
}
|
||||
|
||||
private HashMap<String, String> buildParameters(Component parent) {
|
||||
HashMap<String, String> parameters = new HashMap<String, String>();
|
||||
|
||||
Radiogroup layout = (Radiogroup) parent.getFellow("print_layout");
|
||||
Checkbox expanded = (Checkbox) parent.getFellow("print_expanded");
|
||||
if (layout.getSelectedIndex() == 2) {
|
||||
parameters.put("extension", ".png");
|
||||
}
|
||||
if (expanded.isChecked() == true) {
|
||||
parameters.put("expanded", "all");
|
||||
}
|
||||
parameters.put("zoom", planner.getZoomLevel().toString());
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public void print() {
|
||||
if (!isPrintEnabled()) {
|
||||
throw new UnsupportedOperationException("print is not supported");
|
||||
|
|
@ -394,14 +410,7 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
printButton.addEventListener(Events.ON_CLICK, new EventListener() {
|
||||
@Override
|
||||
public void onEvent(Event event) throws Exception {
|
||||
Radiogroup layout = (Radiogroup) printProperties
|
||||
.getFellow("print_layout");
|
||||
HashMap<String, String> parameters = new HashMap<String, String>();
|
||||
if (layout.getSelectedIndex() == 2) {
|
||||
parameters.put("extension", ".png");
|
||||
}
|
||||
parameters.put("zoom", planner.getZoomLevel().toString());
|
||||
configuration.print(parameters);
|
||||
configuration.print(buildParameters(printProperties));
|
||||
}
|
||||
});
|
||||
printButton.setParent(printProperties);
|
||||
|
|
|
|||
|
|
@ -98,8 +98,12 @@ public class CutyPrint {
|
|||
captureString += " --url=http://" + request.getLocalName() + ":"
|
||||
+ request.getLocalPort() + url;
|
||||
|
||||
if ((parameters != null) && (parameters.get("zoom") != null)) {
|
||||
captureString += "?zoom=" + parameters.get("zoom");
|
||||
if (parameters != null) {
|
||||
captureString += "?";
|
||||
for (String key : parameters.keySet()) {
|
||||
captureString += key + "=" + parameters.get(key) + "&";
|
||||
}
|
||||
captureString.substring(0, captureString.length() - 1);
|
||||
}
|
||||
|
||||
// Static width and time delay parameters (FIX)
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
<checkbox id="print_resources"
|
||||
label="${i18n:_('Show all resource assignments')}" />
|
||||
<checkbox id="print_expanded"
|
||||
label="${i18n:_('Show expanded tree')}" visible="false" />
|
||||
label="${i18n:_('Show expanded tree')}" />
|
||||
<checkbox id="print_shrinked"
|
||||
label="${i18n:_('Shrink to fit page width')}" checked="true" disabled="true" />
|
||||
</vbox>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue