ItEr44S16CUAsignacionRecursosEspecificosAPlanificacionItEr37S10: Parametrizing if charts are shown

This commit is contained in:
Óscar González Fernández 2010-01-24 23:40:32 +01:00
parent 3c4e76786f
commit d4b36e8f90
4 changed files with 19 additions and 1 deletions

View file

@ -885,6 +885,11 @@ class Row {
protected String getTitle() {
return _("Streches list");
}
@Override
protected boolean getChartsEnabled() {
return true;
}
};
private IAssignmentFunctionConfiguration[] functions = { none,

View file

@ -43,6 +43,7 @@ public abstract class StrechesFunctionConfiguration implements
public void goToConfigure() {
StretchesFunctionController stretchesFunctionController = new StretchesFunctionController();
stretchesFunctionController.setTitle(getTitle());
stretchesFunctionController.setChartsEnabled(getChartsEnabled());
HashMap<String, Object> args = new HashMap<String, Object>();
args.put("stretchesFunctionController", stretchesFunctionController);
Window window = (Window) Executions.createComponents(
@ -57,6 +58,8 @@ public abstract class StrechesFunctionConfiguration implements
assignmentFunctionChanged();
}
protected abstract boolean getChartsEnabled();
protected abstract String getTitle();
protected abstract ResourceAllocation<?> getAllocation();

View file

@ -65,6 +65,8 @@ public class StretchesFunctionController extends GenericForwardComposer {
private String title;
private boolean chartsEnabled = true;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
@ -345,4 +347,12 @@ public class StretchesFunctionController extends GenericForwardComposer {
this.title = title;
}
public boolean isChartsEnabled() {
return chartsEnabled;
}
public void setChartsEnabled(boolean chartsEnabled) {
this.chartsEnabled = chartsEnabled;
}
}

View file

@ -58,7 +58,7 @@
</vbox>
<vbox id="charts">
<vbox id="charts" visible="@{stretchesFunctionController.chartsEnabled}">
<chart id="dedicationChart" title="${i18n:_('Dedication chart')}"
type="time_series" threeD="false"
model="@{stretchesFunctionController.getDedicationChartData}"