package com.onaro.sanscreen.client.view.policy.global; import javax.swing.JCheckBox; import javax.swing.JPanel; import com.onaro.sanscreen.client.view.policy.fields.GlobalEnableProperty; import com.onaro.sanscreen.client.view.policy.fields.PolicyProperty; import com.onaro.sanscreen.server.approve.GlobalApprove; public abstract class GlobalPolicyTab { public abstract String getTitle(); public abstract JPanel getPanel(); public abstract boolean updateRule(GlobalApprove globalApprove); public JCheckBox prepareEnableCheckbox(GlobalEnableProperty enableProperty, Iterable> policyProperties) { //TODO: refactor the enable property. avoid this dirty workaround JCheckBox checkbox = (JCheckBox) enableProperty.getEditor(); checkbox.setText(enableProperty.getLabel().getText()); checkbox.setIconTextGap(10); new EnablePropertiesByCheckBox(checkbox, policyProperties); return checkbox; } }