ItEr43S09ImplantacionAplicacionItEr42S13: Using PlannerConfiguration print support to implement print button
This commit is contained in:
parent
1a149646f2
commit
77cc184cfa
2 changed files with 16 additions and 4 deletions
|
|
@ -365,4 +365,15 @@ public class FunctionalityExposedForExtensions<T> implements IContext<T> {
|
|||
configuration.reloadCharts();
|
||||
}
|
||||
|
||||
public boolean isPrintEnabled() {
|
||||
return configuration.isPrintEnabled();
|
||||
}
|
||||
|
||||
public void print() {
|
||||
if (!isPrintEnabled()) {
|
||||
throw new UnsupportedOperationException("print is not supported");
|
||||
}
|
||||
configuration.print();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ import org.zkoss.ganttz.data.GanttDiagramGraph.IGraphChangeListener;
|
|||
import org.zkoss.ganttz.extensions.ICommand;
|
||||
import org.zkoss.ganttz.extensions.ICommandOnTask;
|
||||
import org.zkoss.ganttz.extensions.IContext;
|
||||
import org.zkoss.ganttz.print.CutyPrint;
|
||||
import org.zkoss.ganttz.timetracker.TimeTracker;
|
||||
import org.zkoss.ganttz.timetracker.TimeTrackerComponent;
|
||||
import org.zkoss.ganttz.timetracker.TimeTrackerComponentWithoutColumns;
|
||||
|
|
@ -277,6 +276,8 @@ public class Planner extends HtmlMacroComponent {
|
|||
this.ganttPanel = new GanttPanel(this.context,
|
||||
commandsOnTasksContextualized, doubleClickCommand,
|
||||
disabilityConfiguration);
|
||||
Button button = (Button) getFellow("btnPrint");
|
||||
button.setDisabled(!context.isPrintEnabled());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
@ -389,9 +390,9 @@ public class Planner extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
public void print() {
|
||||
|
||||
// Pending to raise print configuration popup
|
||||
CutyPrint.print();
|
||||
// Pending to raise print configuration popup. Information retrieved
|
||||
// should be passed as parameter to context print method
|
||||
context.print();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue