Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.nuiton.jaxx.widgets.datetime.TimeEditor Maven / Gradle / Ivy
package org.nuiton.jaxx.widgets.datetime;
/*-
* #%L
* JAXX :: Widgets DateTime
* %%
* Copyright (C) 2008 - 2016 CodeLutin
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* .
* #L%
*/
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.LayoutManager;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import javax.swing.DefaultBoundedRangeModel;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JSpinner;
import javax.swing.JToolBar;
import javax.swing.SpinnerDateModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import jaxx.runtime.JAXXBinding;
import jaxx.runtime.JAXXContext;
import jaxx.runtime.JAXXObject;
import jaxx.runtime.JAXXObjectDescriptor;
import jaxx.runtime.JAXXUtil;
import jaxx.runtime.JAXXValidator;
import jaxx.runtime.SwingUtil;
import jaxx.runtime.binding.DefaultJAXXBinding;
import jaxx.runtime.binding.SimpleJAXXObjectBinding;
import jaxx.runtime.context.DefaultJAXXContext;
import jaxx.runtime.swing.HidorButton;
import jaxx.runtime.validator.swing.SwingValidator;
import jaxx.runtime.validator.swing.SwingValidatorUtil;
import jaxx.runtime.validator.swing.meta.Validator;
import jaxx.runtime.validator.swing.meta.ValidatorField;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static org.nuiton.i18n.I18n.t;
public class TimeEditor extends JPanel implements JAXXObject, JAXXValidator {
/*-----------------------------------------------------------------------*/
/*---------------- Constants for all javaBean properties ----------------*/
/*-----------------------------------------------------------------------*/
public static final String PROPERTY_SHOW_TIME_EDITOR_SLIDER = "showTimeEditorSlider";
/*-----------------------------------------------------------------------*/
/*------------------ Constants for all public bindings ------------------*/
/*-----------------------------------------------------------------------*/
public static final String BINDING_HOUR_EDITOR_ENABLED = "hourEditor.enabled";
public static final String BINDING_HOUR_MODEL_VALUE = "hourModel.value";
public static final String BINDING_MINUTE_EDITOR_ENABLED = "minuteEditor.enabled";
public static final String BINDING_MINUTE_MODEL_VALUE = "minuteModel.value";
public static final String BINDING_SLIDER_ENABLED = "slider.enabled";
public static final String BINDING_SLIDER_HIDOR_TARGET_VISIBLE = "sliderHidor.targetVisible";
public static final String BINDING_SLIDER_VALUE = "slider.value";
/*-----------------------------------------------------------------------*/
/*------------------------- Other static fields -------------------------*/
/*-----------------------------------------------------------------------*/
private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAAJ1WTW8bRRieuLET2wkkTYlKmoIJFUpp2DiAKqHw0XzKqZKmitOokEMZeyfxhPHMdma2cWsV8RP4CXxcuSBx44Q4cObApeIvIMSBK+Kd2V3vbrLFCTlsvO/n8z4z88x+9wfKK4leO8KdjiN9rmmbOLeX7t/fbhyRpl4lqimpp4VEwd9ADuX2Udnt2ZVGr+9vmvT5MH1+RbQ9wQlPZC9uopLSjxlRLUK0RlfTGU2l5us992LH82VUtQcqq+pXf/2Z+9L94uscQh0P0I3BKJV+WfEkg5soR12NLkKnR3ieYX4IMCTlh4B31NhWGFbqDm6Th+hzNLSJCh6WUEyjmbOPbGvY/I6n0fC123cxJ6yq0Q0hDx3uUy24Y0EfU/eQaOW4WBOLfhceay4ESM+zJQoa5dvCJUyj6jmyt0xKXKLYEn5g02jajNlx1DFM7dQ9yjmRq1DhREq5TbkfWo1pPHZdUi1xHPeqM+oSqdG4KewYTp1lIRjBPAHgEYYoDNHAQmq9eo4IkXnuRca4QslMGTSE9UvOENBrwopxP1N7EzfMwOlgazRRU73gaIUWzPt02lfSvTl73krsNbxGoC6l+oTMmsCZXnyBme418/Zq2jMS0B13eiPtv6gsyzXqCrkL7C7jUx1DcxphOZGn0Ssp6oM861r2NWwrk3MjBqvChZ1ID2atId0SXUmVhHPtxOc6PngD+ygvfTBrdHn/tBTsgCsQgcsnRMAUtN5/Jid++/H3H9ajk1+G3i9lhiaEC06kJ4UHQ1DT+sXg2Puasvkt7C3uo6IiDFTPqtp0BrB66AZw0C/Y4SbdqWHVghL5oWc//Tz56a8XUG4dlZjA7jo28RuwA1sSWBDM7Xgf3bKIRo6HjWQZbEBqS0j6RHCN2RKjh7xtVabQhH9EdoCJ6QwmenAaxV/+nqh/fytiYwDQvfzc8JiR/CeoQDmjnFglDEUuU/nKniK+K2Ixy5I3BPKkqWbEC0/qe/b5wamJcxqNNjEj3MVynRIGIjzZXQkNTm373s6D7fUHq0sfP4WKoAk+7J65bgtzlxHpgMzVIgXbM85Zq4nGbnRo9vr1px3fNF6yXJhfKygpe2eAF8lsudvLAixDhOMGIwB3tEvVWvAym90uoQZn6PefG0CjQU068D5iFpPYmk4tq2koKf+D//GY/62NO/d21xLUO0nqt+Kb4BzkJy+Qc9A/2k3knXMBUiLar+cFqNgQErTsLqbAOXTIH2CmYPqC8PBDQ0NkKB7A0damdWTLap+h0f1ADAIIjSVQuUcVtfWnYMx6xgULMwMbwdULnxVXu3p2JrE5jMMJAMzYyBb8zIw0jmRkIQAA92A3sGYvZ2K4flMNQ7hnSLWXrTKbWRo6S9a4S5ufxbbiARyBtxR9Ar9zCwsajbXxEfAHQXUPN+HKAfvNauIzqMvJcWWVHGCf6WXhc5e4O/DREeyY2epcZWGuAs+b1cqblbffNROOwb44WfKdarzbp7qpHb3Bgx2vAsrPsQHDK7MfPwP22D4WcOmiF96HDxtcaVDuArAPT1UdMM9S34rG/I15fJtd4QpU+BcTS3nS+wsAAA==";
private static final Log log = LogFactory.getLog(TimeEditor.class);
private static final long serialVersionUID = 1L;
/*-----------------------------------------------------------------------*/
/*--------------------------- Internal states ---------------------------*/
/*-----------------------------------------------------------------------*/
protected List $activeBindings = new ArrayList();
protected Map $bindingSources = new HashMap();
protected final Map $bindings = new TreeMap();
protected Map $objectMap = new HashMap();
protected Map, ?> $previousValues = new HashMap();
private boolean allComponentsCreated;
protected final JAXXContext delegateContext = new DefaultJAXXContext();
/*-----------------------------------------------------------------------*/
/*------------------------ Protected components ------------------------*/
/*-----------------------------------------------------------------------*/
protected JPanel dateEditor;
protected final TimeEditorHandler handler = createHandler();
protected JSpinner hourEditor;
protected SpinnerDateModel hourModel;
protected JLabel labelH;
protected JSpinner minuteEditor;
protected SpinnerDateModel minuteModel;
protected TimeEditorModel model;
protected Boolean showTimeEditorSlider;
protected JSlider slider;
protected HidorButton sliderHidor;
protected JToolBar sliderHidorToolBar;
@ValidatorField( validatorId = "validator", propertyName = "time", editorName = "timeEditor")
protected JPanel timeEditor;
protected JLabel timeLabel;
@Validator( validatorId = "validator")
protected SwingValidator validator;
protected List validatorIds = new ArrayList();
/*-----------------------------------------------------------------------*/
/*------------------------- Private components -------------------------*/
/*-----------------------------------------------------------------------*/
private TimeEditor $JPanel0 = this;
private JPanel $JPanel1;
/*-----------------------------------------------------------------------*/
/*---------------------- Raw body code from script ----------------------*/
/*-----------------------------------------------------------------------*/
public void init() { handler.init(this); }
public void setBean(Serializable bean) { model.setBean(bean); }
public void setPropertyTime(String property) { model.setPropertyTime(property); }
public void setTime(Date time) { model.setTime(time); }
public void setLabel(String label) { timeLabel.setText(label); }
/*-----------------------------------------------------------------------*/
/*---------------------------- Constructors ----------------------------*/
/*-----------------------------------------------------------------------*/
public TimeEditor(LayoutManager param0, boolean param1) {
super(param0 ,param1);
$initialize();
}
public TimeEditor(JAXXContext parentContext, LayoutManager param1, boolean param2) {
super(param1 ,param2);
JAXXUtil.initContext(this, parentContext);
$initialize();
}
public TimeEditor(LayoutManager param0) {
super(param0);
$initialize();
}
public TimeEditor(JAXXContext parentContext, LayoutManager param1) {
super(param1);
JAXXUtil.initContext(this, parentContext);
$initialize();
}
public TimeEditor() {
$initialize();
}
public TimeEditor(JAXXContext parentContext) {
JAXXUtil.initContext(this, parentContext);
$initialize();
}
public TimeEditor(boolean param0) {
super(param0);
$initialize();
}
public TimeEditor(JAXXContext parentContext, boolean param1) {
super(param1);
JAXXUtil.initContext(this, parentContext);
$initialize();
}
/*-----------------------------------------------------------------------*/
/*--------------------------- Statics methods ---------------------------*/
/*-----------------------------------------------------------------------*/
public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
}
/*-----------------------------------------------------------------------*/
/*---------------------- JAXXObject implementation ----------------------*/
/*-----------------------------------------------------------------------*/
@Override
public void applyDataBinding(String $binding) {
if (allComponentsCreated && $bindings.containsKey($binding)) {
getDataBinding($binding).applyDataBinding();
}
processDataBinding($binding);
}
@Override
public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
super.firePropertyChange(propertyName, oldValue, newValue);
}
@Override
public Map get$objectMap() {
return $objectMap;
}
@Override
public JAXXBinding getDataBinding(String bindingId) {
return $bindings.get(bindingId);
}
@Override
public JAXXBinding[] getDataBindings() {
return $bindings.values().toArray(new JAXXBinding[$bindings.size()]);
}
@Override
public Object getObjectById(String id) {
return $objectMap.get(id);
}
@Override
public void processDataBinding(String $binding, boolean $force) {
if (!$force && $activeBindings.contains($binding)) {
return;
}
$activeBindings.add($binding);
try {
if (allComponentsCreated && $bindings.containsKey($binding)) {
getDataBinding($binding).processDataBinding();
}
} finally {
$activeBindings.remove($binding);
}
}
@Override
public void processDataBinding(String $binding) {
processDataBinding($binding, false);
}
@Override
public void registerDataBinding(JAXXBinding binding) {
$bindings.put(binding.getId(), binding);
}
@Override
public void removeDataBinding(String $binding) {
if (allComponentsCreated && $bindings.containsKey($binding)) {
getDataBinding($binding).removeDataBinding();
}
}
/*-----------------------------------------------------------------------*/
/*--------------------- JAXXContext implementation ---------------------*/
/*-----------------------------------------------------------------------*/
@Override
public T getContextValue(Class clazz) {
return delegateContext.getContextValue(clazz, null);
}
@Override
public T getContextValue(Class clazz, String name) {
return delegateContext.getContextValue(clazz, name);
}
@Override
public JAXXContext getDelegateContext() {
return delegateContext;
}
@Override
public O getParentContainer(Class clazz) {
return SwingUtil.getParentContainer(this, clazz);
}
@Override
public O getParentContainer(Object source, Class clazz) {
return SwingUtil.getParentContainer(source, clazz);
}
@Override
public void removeContextValue(Class clazz) {
delegateContext.removeContextValue(clazz, null);
}
@Override
public void removeContextValue(Class clazz, String name) {
delegateContext.removeContextValue(clazz, name);
}
@Override
public void setContextValue(T o) {
delegateContext.setContextValue(o, null);
}
@Override
public void setContextValue(T o, String name) {
delegateContext.setContextValue(o, name);
}
/*-----------------------------------------------------------------------*/
/*-------------------- JAXXValidator implementation --------------------*/
/*-----------------------------------------------------------------------*/
@Override
public SwingValidator> getValidator(String validatorId) {
return (SwingValidator>) (validatorIds.contains(validatorId) ? getObjectById(validatorId) : null);
}
@Override
public List getValidatorIds() {
return validatorIds;
}
@Override
public void registerValidatorFields() {
SwingValidatorUtil.detectValidatorFields(this);
}
/*-----------------------------------------------------------------------*/
/*---------------------------- Event methods ----------------------------*/
/*-----------------------------------------------------------------------*/
public void doStateChanged__on__hourEditor(ChangeEvent event) {
if (log.isDebugEnabled()) {
log.debug(event);
}
handler.setHours((Date)((JSpinner)event.getSource()).getValue());
}
public void doStateChanged__on__minuteEditor(ChangeEvent event) {
if (log.isDebugEnabled()) {
log.debug(event);
}
handler.setMinutes((Date)((JSpinner)event.getSource()).getValue());
}
public void doStateChanged__on__slider(ChangeEvent event) {
if (log.isDebugEnabled()) {
log.debug(event);
}
if (!slider.getValueIsAdjusting()) model.setTimeInMinutes((Integer)((JSlider)event.getSource()).getValue());
}
/*-----------------------------------------------------------------------*/
/*----------------------- Public acessor methods -----------------------*/
/*-----------------------------------------------------------------------*/
public JPanel getDateEditor() {
return dateEditor;
}
public TimeEditorHandler getHandler() {
return handler;
}
public JSpinner getHourEditor() {
return hourEditor;
}
public SpinnerDateModel getHourModel() {
return hourModel;
}
public JLabel getLabelH() {
return labelH;
}
public JSpinner getMinuteEditor() {
return minuteEditor;
}
public SpinnerDateModel getMinuteModel() {
return minuteModel;
}
public TimeEditorModel getModel() {
return model;
}
public Boolean getShowTimeEditorSlider() {
return showTimeEditorSlider;
}
public JSlider getSlider() {
return slider;
}
public HidorButton getSliderHidor() {
return sliderHidor;
}
public JToolBar getSliderHidorToolBar() {
return sliderHidorToolBar;
}
public JPanel getTimeEditor() {
return timeEditor;
}
public JLabel getTimeLabel() {
return timeLabel;
}
public SwingValidator getValidator() {
return validator;
}
public Boolean isShowTimeEditorSlider() {
return showTimeEditorSlider !=null && showTimeEditorSlider;
}
/*-----------------------------------------------------------------------*/
/*----------------------- Public mutator methods -----------------------*/
/*-----------------------------------------------------------------------*/
public void setShowTimeEditorSlider(Boolean showTimeEditorSlider) {
Boolean oldValue = this.showTimeEditorSlider;
this.showTimeEditorSlider = showTimeEditorSlider;
firePropertyChange(PROPERTY_SHOW_TIME_EDITOR_SLIDER, oldValue, showTimeEditorSlider);
}
/*-----------------------------------------------------------------------*/
/*--------------------- Protected acessors methods ---------------------*/
/*-----------------------------------------------------------------------*/
protected JPanel get$JPanel1() {
return $JPanel1;
}
/*-----------------------------------------------------------------------*/
/*--------------------- Components creation methods ---------------------*/
/*-----------------------------------------------------------------------*/
protected void addChildrenToDateEditor() {
if (!allComponentsCreated) {
return;
}
dateEditor.add(timeLabel, BorderLayout.WEST);
dateEditor.add($JPanel1, BorderLayout.EAST);
}
protected void addChildrenToSliderHidorToolBar() {
if (!allComponentsCreated) {
return;
}
sliderHidorToolBar.add(sliderHidor);
}
protected void addChildrenToTimeEditor() {
if (!allComponentsCreated) {
return;
}
timeEditor.add(hourEditor);
timeEditor.add(labelH);
timeEditor.add(minuteEditor);
}
protected void addChildrenToValidator() {
if (!allComponentsCreated) {
return;
}
validator.setBean(model);
}
protected void createDateEditor() {
$objectMap.put("dateEditor", dateEditor = new JPanel());
dateEditor.setName("dateEditor");
dateEditor.setLayout(new BorderLayout());
}
protected TimeEditorHandler createHandler() {
return new TimeEditorHandler();
}
protected void createHourEditor() {
$objectMap.put("hourEditor", hourEditor = new JSpinner());
hourEditor.setName("hourEditor");
hourEditor.addChangeListener(JAXXUtil.getEventListener(ChangeListener.class, "stateChanged", this, "doStateChanged__on__hourEditor"));
}
protected void createHourModel() {
$objectMap.put("hourModel", hourModel = new SpinnerDateModel());
}
protected void createLabelH() {
$objectMap.put("labelH", labelH = new JLabel());
labelH.setName("labelH");
labelH.setHorizontalAlignment(0);
labelH.setText(t("timeeditor.H"));
}
protected void createMinuteEditor() {
$objectMap.put("minuteEditor", minuteEditor = new JSpinner());
minuteEditor.setName("minuteEditor");
minuteEditor.addChangeListener(JAXXUtil.getEventListener(ChangeListener.class, "stateChanged", this, "doStateChanged__on__minuteEditor"));
}
protected void createMinuteModel() {
$objectMap.put("minuteModel", minuteModel = new SpinnerDateModel());
}
protected void createModel() {
$objectMap.put("model", model = new TimeEditorModel());
}
protected void createShowTimeEditorSlider() {
$objectMap.put("showTimeEditorSlider", showTimeEditorSlider = true);
}
protected void createSlider() {
$objectMap.put("slider", slider = new JSlider());
slider.setName("slider");
slider.setValue(0);
slider.setPaintLabels(true);
slider.setPaintTicks(true);
if (slider.getFont() != null) {
slider.setFont(slider.getFont().deriveFont((float) 11));
}
slider.setMajorTickSpacing(60);
slider.setMinorTickSpacing(30);
slider.addChangeListener(JAXXUtil.getEventListener(ChangeListener.class, "stateChanged", this, "doStateChanged__on__slider"));
}
protected void createSliderHidor() {
$objectMap.put("sliderHidor", sliderHidor = new HidorButton());
sliderHidor.setName("sliderHidor");
}
protected void createSliderHidorToolBar() {
$objectMap.put("sliderHidorToolBar", sliderHidorToolBar = new JToolBar());
sliderHidorToolBar.setName("sliderHidorToolBar");
sliderHidorToolBar.setBorderPainted(false);
sliderHidorToolBar.setOpaque(false);
sliderHidorToolBar.setFloatable(false);
}
protected void createTimeEditor() {
$objectMap.put("timeEditor", timeEditor = new JPanel());
timeEditor.setName("timeEditor");
}
protected void createTimeLabel() {
$objectMap.put("timeLabel", timeLabel = new JLabel());
timeLabel.setName("timeLabel");
}
protected void createValidator() {
$objectMap.put("validator", validator = SwingValidator.newValidator(TimeEditorModel.class, null));
}
/*-----------------------------------------------------------------------*/
/*------------------------ Internal jaxx methods ------------------------*/
/*-----------------------------------------------------------------------*/
private void $completeSetup() {
allComponentsCreated = true;
if (log.isDebugEnabled()) {
log.debug(this);
}
// inline complete setup of $JPanel0
add(dateEditor, BorderLayout.NORTH);
add(slider, BorderLayout.SOUTH);
addChildrenToValidator();
addChildrenToDateEditor();
// inline complete setup of $JPanel1
$JPanel1.add(SwingUtil.boxComponentWithJxLayer(timeEditor));
$JPanel1.add(sliderHidorToolBar);
addChildrenToTimeEditor();
addChildrenToSliderHidorToolBar();
// apply 7 data bindings
JAXXUtil.applyDataBinding(this, $bindings.keySet());
// apply 10 property setters
hourModel.setCalendarField(Calendar.HOUR_OF_DAY);
minuteModel.setCalendarField(Calendar.MINUTE);
hourEditor.setModel(hourModel);
minuteEditor.setModel(minuteModel);
sliderHidor.setShowTip(t("timeeditor.show.slider"));
sliderHidor.setHideTip(t("timeeditor.hide.slider"));
sliderHidor.setTarget(slider);
slider.setModel(new DefaultBoundedRangeModel(0, 1, 0, 60 * 24));
// late initializer
// register 1 validator(s)
validatorIds = SwingValidatorUtil.detectValidators(this);
SwingValidatorUtil.installUI(this);
}
private void $initialize() {
if (allComponentsCreated) {
return;
}
if (log.isDebugEnabled()) {
log.debug(this);
}
handler.beforeInit(this);
$objectMap.put("$JPanel0", $JPanel0);
createModel();
createHourModel();
createMinuteModel();
createShowTimeEditorSlider();
createValidator();
createDateEditor();
createTimeLabel();
// inline creation of $JPanel1
$objectMap.put("$JPanel1", $JPanel1 = new JPanel());
$JPanel1.setName("$JPanel1");
createTimeEditor();
createHourEditor();
createLabelH();
createMinuteEditor();
createSliderHidorToolBar();
createSliderHidor();
createSlider();
// inline creation of $JPanel0
setName("$JPanel0");
setLayout(new BorderLayout());
// registers 7 data bindings
$registerDefaultBindings();
$completeSetup();
handler.afterInit(this);
}
private void $registerDefaultBindings() {
// register 7 data bindings
registerDataBinding(new DefaultJAXXBinding(this, BINDING_HOUR_MODEL_VALUE, true) {
@Override
public void applyDataBinding() {
if (model != null) {
model.addPropertyChangeListener("time", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
hourModel.setValue(handler.getHourModelValue(model.getTime()));
}
}
@Override
public void removeDataBinding() {
if (model != null) {
model.removePropertyChangeListener("time", this);
}
}
});
registerDataBinding(new DefaultJAXXBinding(this, BINDING_MINUTE_MODEL_VALUE, true) {
@Override
public void applyDataBinding() {
if (model != null) {
model.addPropertyChangeListener("time", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
minuteModel.setValue(handler.getMinuteModelValue(model.getTime()));
}
}
@Override
public void removeDataBinding() {
if (model != null) {
model.removePropertyChangeListener("time", this);
}
}
});
registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_HOUR_EDITOR_ENABLED, true ,"enabled") {
@Override
public void processDataBinding() {
hourEditor.setEnabled(isEnabled());
}
});
registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_MINUTE_EDITOR_ENABLED, true ,"enabled") {
@Override
public void processDataBinding() {
minuteEditor.setEnabled(isEnabled());
}
});
registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_SLIDER_HIDOR_TARGET_VISIBLE, true ,"showTimeEditorSlider") {
@Override
public void processDataBinding() {
sliderHidor.setTargetVisible(isShowTimeEditorSlider());
}
});
registerDataBinding(new DefaultJAXXBinding(this, BINDING_SLIDER_VALUE, true) {
@Override
public void applyDataBinding() {
if (model != null) {
model.addPropertyChangeListener("timeInMinutes", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
slider.setValue(model.getTimeInMinutes());
}
}
@Override
public void removeDataBinding() {
if (model != null) {
model.removePropertyChangeListener("timeInMinutes", this);
}
}
});
registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_SLIDER_ENABLED, true ,"enabled") {
@Override
public void processDataBinding() {
slider.setEnabled(isEnabled());
}
});
}
}