i am using DialogComponentDate now but i want to show the date and hide the time part.
I also want to set default date as current date, where i can config those features ? Because i can’t set in SettingsModelDate.
Then i tried to use DateInputDialog and i found
new DateInputDialog(DateInputDialog.Mode. NOTIME );
which fit my need. But how this work with addDialogComponent()? because i don’t know how to put this on my panel like cast to DialogComponent. Thank you
Have you looked into org.knime.time.util.DialogComponentDateTimeSelection? This is the new dialog component which was used in the new Date&Time nodes. There you can set the DisplayOption to SHOW_DATE_ONLY. If you want to have the current date set when opening the dialog, you need to specify this during loading the dialog settings.
I use SettingsModelDate and set the default time with the following code,but not work
@Override
protected void loadValidatedSettingsFrom(final NodeSettingsRO settings) throws InvalidSettingsException {
/*
* Load (valid) settings from the NodeSettings object. It can be safely assumed that
* the settings are validated by the method below.
*
* The SettingsModel will handle the loading. After this call, the current value
* (from the view) can be retrieved from the settings model.
*/
m_numberFormatSettings.loadSettingsFrom(settings);
startDateSettings.setTimeInMillis(new Date().getTime());
startDateSettings.loadSettingsFrom(settings);
}
You don’t need any jar at all. All you need is to set the target platform as described there. The target platform brings all these dependencies and you will be able to use the DialogComponentDateTimeSelection class.
The API documentation is in the code. It is open source, so you can just have a look at it. I don’t think we have a website which lists the API.
Hard to guess what the problem is. The only advice I can give is to double check that you didn’t skip any of the steps in the instruction and that all the dependencies are correctly set up.