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.DateTimeEditor Maven / Gradle / Ivy
package org.nuiton.jaxx.widgets.datetime;
/*-
* #%L
* JAXX :: Widgets
* %%
* Copyright (C) 2008 - 2024 Code Lutin, Ultreia.io
* %%
* 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.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSpinner;
import javax.swing.JToolBar;
import javax.swing.SpinnerDateModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jdesktop.swingx.JXDatePicker;
import org.nuiton.jaxx.runtime.JAXXBinding;
import org.nuiton.jaxx.runtime.JAXXContext;
import org.nuiton.jaxx.runtime.JAXXObject;
import org.nuiton.jaxx.runtime.JAXXObjectDescriptor;
import org.nuiton.jaxx.runtime.JAXXUtil;
import org.nuiton.jaxx.runtime.bean.BeanScopeAware;
import org.nuiton.jaxx.runtime.binding.DefaultJAXXBinding;
import org.nuiton.jaxx.runtime.binding.SimpleJAXXObjectBinding;
import org.nuiton.jaxx.runtime.context.DefaultJAXXContext;
import org.nuiton.jaxx.runtime.spi.UIHandler;
import org.nuiton.jaxx.runtime.swing.SwingUtil;
import org.nuiton.jaxx.widgets.datetime.actions.DateTimeEditorResetAction;
import static io.ultreia.java4all.i18n.I18n.t;
public class DateTimeEditor extends JPanel implements BeanScopeAware, JAXXObject {
/*-----------------------------------------------------------------------*/
/*---------------- Constants for all javaBean properties ----------------*/
/*-----------------------------------------------------------------------*/
public static final String PROPERTY_SHOW_RESET = "showReset";
/*-----------------------------------------------------------------------*/
/*------------------ Constants for all public bindings ------------------*/
/*-----------------------------------------------------------------------*/
public static final String BINDING_DAY_DATE_EDITOR_DATE = "dayDateEditor.date";
public static final String BINDING_DAY_DATE_EDITOR_ENABLED = "dayDateEditor.enabled";
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_RESET_ENABLED = "reset.enabled";
public static final String BINDING_TOOLBAR_RESET_VISIBLE = "toolbarReset.visible";
/*-----------------------------------------------------------------------*/
/*------------------------- Other static fields -------------------------*/
/*-----------------------------------------------------------------------*/
private static final String $jaxxObjectDescriptor = "H4sIAAAAAAAAAK1WS3MbRRAeKZEcyZKJIRWeBa48bJnHbkJxoMopiG3Zpbik2GU7KQcfwkg7lsYZzSyzs9YaFTlw4MYRDhy4cqHyH1KcqOLC1f+BqvwEevYtZ23LAR1W2pnur7/unv5Gv/+DCo5EHwvZNbhLleDGPvY8Q7pc0T4x1hZ3dtbb+6Sj6sTpSGorIVHwyeVRfhdNWvG6o5Cx2wQkM0AyNZIZIpnLom8LTngKaKGJyo46ZMTpEaIUqp3o3HEccyu2XPBsV4axMllnxfrrh9tHOVL/JY+QZwP9y5D2R+cASLK+2ER5ain0enMfH2CTYd4FcpLyLiRU1WvLDDvOfdwn36CnaKKJijaWAKbQJ69UHh/Oh/JshS7dWNvAnLBbCpnH+Q+o1SXKMSysiJ9IHX5sw48VC4ykbfswRYUKfWERptBn50RoabcEptQTbrCm0Hs6c89wBlAIY8umnBOpnY+5TPYpd8NVvTSdQnN6YrBJHH0WpjWaoWtrLAnBCOaJXVmTC/hAF9Jhg8pos1JsHdXrtn5/Wz/ejPeqVphdE7d1DqNg/qK2fCd2qCgg08YyZHllxH4b9pawHPUoyMD0jRHTJVdBybXJB7HldJLWsuAKzkI248N6Kv0Z3cB9GMInStgBumes7WiTDdp5Qnw2N2P3Kd3TxD8OkFiUdUsj9NH8wqZqww9j+yLTVWrot/dHdypBp5NIRrgv0exJgweDbiSDnsxcbhcK6cKyQtdP1hgtE5tgFQjE9ZMFQofxDb9/9lT+NnhxFKlCBcjNnOWVEkAYUVsKm0hFNbfXAklwFWVmC9sLu3CmCQP19NVx7nTmW6ElsAcWwQBoJKOBnR6gFSaOnv9x9eu/L6D8Kiozga1VrO3voZLqwSnrCWZ59pd3fXKVwSUtcpomnL2ekPRbOFOYLTLa5X1fjIod+CLSg1LNnV6qmNmz9Rd//vrjzedRuXJA9MY4nknJCl+hIuWMcuLLaKiQmbI5aTvEtUQif1mCiGDEFFWM2KFAfO4/77xUhwsKXfRVDV0Z+upngNDVg2mqzX+n0MSekH2soFFTw2uWZbZa5iF8ruktwnGbERD9uSF1VoKX2vzM7OxMAEWdaKj0FsB5rmZx16+R/rWEjs/uWXzz4NDBjHALy1VKGAS/OlwOF4zG+oPNx+urj+uLj4Bf4QAzFzK7NexhbjEidW6NSJsf6s1anPN2KAG1+WyaiaiPQTG6SCaHsdd49YrulFPqlZKiMZicesih94p48H559D4zGlmBQ017hQ5NJx1q3bv/YHsl1ZxP081pJbfgOduTvkDP0aDqMOX3v7VoROPHmMBqW0iLyA1MoSsQu7CHGVyPaOKAOhTCgIQCm63of4A/l6U90DqfRGSfySR9M4/BpLQnOq6TRk3XpJquCXCo+NbHaGfRCK77s+Ln/DN2KOBfAJq6A6qEZ9qUW3DLfvESaE4/y2ci6uWf9OPnbIS3/jPCu4DwL9AzLzUwDAAA";
private static final Logger log = LogManager.getLogger(DateTimeEditor.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();
protected final JAXXContext delegateContext = new DefaultJAXXContext();
/*-----------------------------------------------------------------------*/
/*------------------------ Protected components ------------------------*/
/*-----------------------------------------------------------------------*/
protected JPanel dateEditor;
protected JPanel dateEditorContent;
protected JLabel dateTimeLabel;
protected JXDatePicker dayDateEditor;
protected DateTimeEditorHandler handler;
protected JSpinner hourEditor;
protected SpinnerDateModel hourModel;
protected JLabel labelH;
protected JSpinner minuteEditor;
protected SpinnerDateModel minuteModel;
protected DateTimeEditorModel model;
protected JButton reset;
protected Boolean showReset;
protected JPanel timeDateEditor;
protected JToolBar toolbarReset;
/*-----------------------------------------------------------------------*/
/*------------------------- Private components -------------------------*/
/*-----------------------------------------------------------------------*/
private DateTimeEditor $JPanel0;
private JPanel $JPanel1;
/*-----------------------------------------------------------------------*/
/*---------------------- Raw body code from script ----------------------*/
/*-----------------------------------------------------------------------*/
public void init() { handler.init(this); }
@Override
public Object getBean() { return model.getBean(); }
@Override
public void setBean(Object bean) { model.setBean(bean); }
public void setPropertyTimeDate(String property) { model.setPropertyTimeDate(property); }
public void setPropertyDayDate(String property) { model.setPropertyDayDate(property); }
public void setPropertyDate(String property) { model.setPropertyDate(property); }
public void setDateEditable(boolean dateEditable) { model.setDateEditable(dateEditable); }
public void setTimeEditable(boolean timeEditable) { model.setTimeEditable(timeEditable); }
public void setDate(Date date) { model.setDate(date); }
public void setDateFormat(String dateFormat) { dayDateEditor.setFormats(dateFormat); }
public void setLabel(String label) { dateTimeLabel.setText(label); }
public void reset() { model.reset(); }
/*-----------------------------------------------------------------------*/
/*---------------------------- Constructors ----------------------------*/
/*-----------------------------------------------------------------------*/
public DateTimeEditor() {
$initialize();
}
public DateTimeEditor(JAXXContext parentContext) {
JAXXUtil.initContext(this, parentContext);
$initialize();
}
public DateTimeEditor(boolean param0) {
super(param0);
$initialize();
}
public DateTimeEditor(JAXXContext parentContext, boolean param1) {
super(param1);
JAXXUtil.initContext(this, parentContext);
$initialize();
}
public DateTimeEditor(LayoutManager param0) {
super(param0);
$initialize();
}
public DateTimeEditor(JAXXContext parentContext, LayoutManager param1) {
super(param1);
JAXXUtil.initContext(this, parentContext);
$initialize();
}
public DateTimeEditor(LayoutManager param0, boolean param1) {
super(param0 ,param1);
$initialize();
}
public DateTimeEditor(JAXXContext parentContext, LayoutManager param1, boolean param2) {
super(param1 ,param2);
JAXXUtil.initContext(this, parentContext);
$initialize();
}
/*-----------------------------------------------------------------------*/
/*--------------------------- Statics methods ---------------------------*/
/*-----------------------------------------------------------------------*/
public static JAXXObjectDescriptor $getJAXXObjectDescriptor() {
return JAXXUtil.decodeCompressedJAXXObjectDescriptor($jaxxObjectDescriptor);
}
/*-----------------------------------------------------------------------*/
/*---------------------- JAXXObject implementation ----------------------*/
/*-----------------------------------------------------------------------*/
@Override
public void applyDataBinding(String $binding) {
if ($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 ($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 ($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);
}
/*-----------------------------------------------------------------------*/
/*---------------------------- Event methods ----------------------------*/
/*-----------------------------------------------------------------------*/
public void doActionPerformed__on__dayDateEditor(ActionEvent event) {
if (log.isDebugEnabled()) {
log.debug(event);
}
model.setDayDate((Date)((JXDatePicker)event.getSource()).getDate());
}
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 accessor methods -----------------------*/
/*-----------------------------------------------------------------------*/
public JPanel getDateEditor() {
return dateEditor;
}
public JPanel getDateEditorContent() {
return dateEditorContent;
}
public JLabel getDateTimeLabel() {
return dateTimeLabel;
}
public JXDatePicker getDayDateEditor() {
return dayDateEditor;
}
public DateTimeEditorHandler 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 DateTimeEditorModel getModel() {
return model;
}
public JButton getReset() {
return reset;
}
public Boolean getShowReset() {
return showReset;
}
public JPanel getTimeDateEditor() {
return timeDateEditor;
}
public JToolBar getToolbarReset() {
return toolbarReset;
}
public Boolean isShowReset() {
return showReset !=null && showReset;
}
/*-----------------------------------------------------------------------*/
/*----------------------- Public mutator methods -----------------------*/
/*-----------------------------------------------------------------------*/
public void setShowReset(Boolean showReset) {
Boolean oldValue = this.showReset;
this.showReset = showReset;
firePropertyChange(PROPERTY_SHOW_RESET, oldValue, showReset);
}
/*-----------------------------------------------------------------------*/
/*--------------------- Protected accessors methods ---------------------*/
/*-----------------------------------------------------------------------*/
protected JPanel get$JPanel1() {
return $JPanel1;
}
/*-----------------------------------------------------------------------*/
/*--------------------- Components creation methods ---------------------*/
/*-----------------------------------------------------------------------*/
protected void addChildrenToDateEditor() {
dateEditor.add($JPanel1, BorderLayout.CENTER);
dateEditor.add(dateEditorContent, BorderLayout.EAST);
}
protected void addChildrenToDateEditorContent() {
dateEditorContent.add(dayDateEditor);
dateEditorContent.add(timeDateEditor);
}
protected void addChildrenToTimeDateEditor() {
timeDateEditor.add(hourEditor);
timeDateEditor.add(labelH);
timeDateEditor.add(minuteEditor);
}
protected void addChildrenToToolbarReset() {
toolbarReset.add(reset);
}
protected void createDateEditor() {
$objectMap.put("dateEditor", dateEditor = new JPanel());
dateEditor.setName("dateEditor");
dateEditor.setLayout(new BorderLayout());
}
protected void createDateEditorContent() {
$objectMap.put("dateEditorContent", dateEditorContent = new JPanel());
dateEditorContent.setName("dateEditorContent");
}
protected void createDateTimeLabel() {
$objectMap.put("dateTimeLabel", dateTimeLabel = new JLabel());
dateTimeLabel.setName("dateTimeLabel");
}
protected void createDayDateEditor() {
$objectMap.put("dayDateEditor", dayDateEditor = new JXDatePicker());
dayDateEditor.setName("dayDateEditor");
dayDateEditor.addActionListener(JAXXUtil.getEventListener(ActionListener.class, "actionPerformed", this, "doActionPerformed__on__dayDateEditor"));
}
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("DateTimeEditor.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 DateTimeEditorModel());
}
protected void createReset() {
$objectMap.put("reset", reset = new JButton());
reset.setName("reset");
reset.setFocusable(false);
reset.setFocusPainted(false);
}
protected void createShowReset() {
$objectMap.put("showReset", showReset = false);
}
protected void createTimeDateEditor() {
$objectMap.put("timeDateEditor", timeDateEditor = new JPanel());
timeDateEditor.setName("timeDateEditor");
}
protected void createToolbarReset() {
$objectMap.put("toolbarReset", toolbarReset = new JToolBar());
toolbarReset.setName("toolbarReset");
toolbarReset.setBorderPainted(false);
toolbarReset.setFloatable(false);
}
/*-----------------------------------------------------------------------*/
/*------------------------ Internal jaxx methods ------------------------*/
/*-----------------------------------------------------------------------*/
protected void $initialize() {
if (log.isDebugEnabled()) {
log.debug(this);
}
$JPanel0 = this;
JAXXObject.initialize(
this,
this::$initialize_01_createHandler,
this::$initialize_01_createComponents,
this::$initialize_02_registerDataBindings,
this::$initialize_03_finalizeCreateComponents,
this::$initialize_03_registerActions,
this::$initialize_04_applyDataBindings,
this::$initialize_05_setProperties,
this::$initialize_06_finalizeInitialize);
}
protected void $initialize_01_createComponents() {
if (log.isDebugEnabled()) {
log.debug(this);
}
$objectMap.put("$JPanel0", $JPanel0);
createModel();
createHourModel();
createMinuteModel();
createShowReset();
createDateEditor();
// inline creation of $JPanel1
$objectMap.put("$JPanel1", $JPanel1 = new JPanel());
$JPanel1.setName("$JPanel1");
$JPanel1.setLayout(new BorderLayout());
createDateTimeLabel();
createToolbarReset();
createReset();
createDateEditorContent();
createDayDateEditor();
createTimeDateEditor();
createHourEditor();
createLabelH();
createMinuteEditor();
// inline creation of $JPanel0
setName("$JPanel0");
setLayout(new BorderLayout());
}
protected UIHandler extends JAXXObject> $initialize_01_createHandler() {
if (log.isDebugEnabled()) {
log.debug(this);
}
return handler = new DateTimeEditorHandler();
}
protected void $initialize_02_registerDataBindings() {
if (log.isDebugEnabled()) {
log.debug(this);
}
// register 8 data bindings
registerDataBinding(new DefaultJAXXBinding(this, BINDING_HOUR_MODEL_VALUE, true) {
@Override
public void applyDataBinding() {
if (model != null) {
model.addPropertyChangeListener("timeDate", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
hourModel.setValue(handler.getHourModelValue(model.getTimeDate()));
}
}
@Override
public void removeDataBinding() {
if (model != null) {
model.removePropertyChangeListener("timeDate", this);
}
}
});
registerDataBinding(new DefaultJAXXBinding(this, BINDING_MINUTE_MODEL_VALUE, true) {
@Override
public void applyDataBinding() {
if (model != null) {
model.addPropertyChangeListener("timeDate", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
minuteModel.setValue(handler.getMinuteModelValue(model.getTimeDate()));
}
}
@Override
public void removeDataBinding() {
if (model != null) {
model.removePropertyChangeListener("timeDate", this);
}
}
});
registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_TOOLBAR_RESET_VISIBLE, true ,"showReset") {
@Override
public void processDataBinding() {
toolbarReset.setVisible(isShowReset());
}
});
registerDataBinding(new SimpleJAXXObjectBinding(this, BINDING_RESET_ENABLED, true ,"enabled") {
@Override
public void processDataBinding() {
reset.setEnabled(isEnabled());
}
});
registerDataBinding(new DefaultJAXXBinding(this, BINDING_DAY_DATE_EDITOR_DATE, true) {
@Override
public void applyDataBinding() {
if (model != null) {
model.addPropertyChangeListener("dayDate", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
dayDateEditor.setDate(model.getDayDate());
}
}
@Override
public void removeDataBinding() {
if (model != null) {
model.removePropertyChangeListener("dayDate", this);
}
}
});
registerDataBinding(new DefaultJAXXBinding(this, BINDING_DAY_DATE_EDITOR_ENABLED, true, true) {
@Override
public void applyDataBinding() {
addPropertyChangeListener("enabled", this);
if (model != null) {
model.addPropertyChangeListener("dateEditable", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
dayDateEditor.setEnabled(isEnabled() && model.isDateEditable());
}
}
@Override
public void removeDataBinding() {
removePropertyChangeListener("enabled", this);
if (model != null) {
model.removePropertyChangeListener("dateEditable", this);
}
}
});
registerDataBinding(new DefaultJAXXBinding(this, BINDING_HOUR_EDITOR_ENABLED, true, true) {
@Override
public void applyDataBinding() {
addPropertyChangeListener("enabled", this);
if (model != null) {
model.addPropertyChangeListener("timeEditable", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
hourEditor.setEnabled(isEnabled() && model.isTimeEditable());
}
}
@Override
public void removeDataBinding() {
removePropertyChangeListener("enabled", this);
if (model != null) {
model.removePropertyChangeListener("timeEditable", this);
}
}
});
registerDataBinding(new DefaultJAXXBinding(this, BINDING_MINUTE_EDITOR_ENABLED, true, true) {
@Override
public void applyDataBinding() {
addPropertyChangeListener("enabled", this);
if (model != null) {
model.addPropertyChangeListener("timeEditable", this);
}
}
@Override
public void processDataBinding() {
if (model != null) {
minuteEditor.setEnabled(isEnabled() && model.isTimeEditable());
}
}
@Override
public void removeDataBinding() {
removePropertyChangeListener("enabled", this);
if (model != null) {
model.removePropertyChangeListener("timeEditable", this);
}
}
});
}
protected void $initialize_03_finalizeCreateComponents() {
if (log.isDebugEnabled()) {
log.debug(this);
}
// inline complete setup of $JPanel0
add(dateEditor, BorderLayout.NORTH);
addChildrenToDateEditor();
// inline complete setup of $JPanel1
$JPanel1.add(dateTimeLabel, BorderLayout.WEST);
$JPanel1.add(toolbarReset, BorderLayout.EAST);
addChildrenToToolbarReset();
addChildrenToDateEditorContent();
addChildrenToTimeDateEditor();
}
protected void $initialize_03_registerActions() {
if (log.isDebugEnabled()) {
log.debug(this);
}
DateTimeEditorResetAction.init(this, reset, new DateTimeEditorResetAction());
}
protected void $initialize_04_applyDataBindings() {
if (log.isDebugEnabled()) {
log.debug(this);
}
// apply 8 data bindings
JAXXUtil.applyDataBinding(this, $bindings.keySet());
}
protected void $initialize_05_setProperties() {
if (log.isDebugEnabled()) {
log.debug(this);
}
// apply 8 property setters
hourModel.setCalendarField(Calendar.HOUR_OF_DAY);
minuteModel.setCalendarField(Calendar.MINUTE);
dayDateEditor.setFormats("dd/MM/yyyy");
hourEditor.setModel(hourModel);
minuteEditor.setModel(minuteModel);
}
protected void $initialize_06_finalizeInitialize() {
if (log.isDebugEnabled()) {
log.debug(this);
}
}
}