<commit_before>package org.csstudio.trends.databrowser.ui;

import org.csstudio.apputil.time.StartEndTimeParser;
import org.csstudio.apputil.ui.time.StartEndDialog;
import org.csstudio.swt.xygraph.undo.OperationsManager;
import org.csstudio.trends.databrowser.model.Model;
import org.csstudio.trends.databrowser.propsheet.ChangeTimerangeCommand;
import org.eclipse.swt.widgets.Shell;

/** Helper for handling start/end time changes
 *  @author <NAME>
 */
public class StartEndTimeAction
{
    /** Prompt user for new start/end time
     *  @param shell Parent shell
     *  @param model Model to change
     *  @param operations_manager Undo/Redo operations manager
     */
    public static void run(final Shell shell, final Model model,
            final OperationsManager operations_manager)
    {
        final String start_time = model.getStartSpecification();
        final String end_time = model.getEndSpecification();
        final StartEndDialog dlg = new StartEndDialog(shell,
                start_time, end_time);
        if (dlg.open() != StartEndDialog.OK)
            return;
        // TODO dlg.isEndNow() doesn't seem to work
        new ChangeTimerangeCommand(model, operations_manager,
                dlg.isEndNow(), dlg.getStartCalendar(), dlg.getEndCalendar());<commit_msg>fixed abs/relative determination in start/end dialog<commit_after>package org.csstudio.trends.databrowser.ui;

import org.csstudio.apputil.time.StartEndTimeParser;
import org.csstudio.apputil.ui.time.StartEndDialog;
import org.csstudio.swt.xygraph.undo.OperationsManager;
import org.csstudio.trends.databrowser.model.Model;
import org.csstudio.trends.databrowser.propsheet.ChangeTimerangeCommand;
import org.eclipse.swt.widgets.Shell;

/** Helper for handling start/end time changes
 *  @author <NAME>
 */
public class StartEndTimeAction
{
    /** Prompt user for new start/end time
     *  @param shell Parent shell
     *  @param model Model to change
     *  @param operations_manager Undo/Redo operations manager
     */
    public static void run(final Shell shell, final Model model,
            final OperationsManager operations_manager)
    {
        final String start_time = model.getStartSpecification();
        final String end_time = model.getEndSpecification();
        final StartEndDialog dlg = new StartEndDialog(shell,
                start_time, end_time);
        if (dlg.open() != StartEndDialog.OK)
            return;
        new ChangeTimerangeCommand(model, operations_manager,
                dlg.isEndNow(), dlg.getStartCalendar(), dlg.getEndCalendar());
{'fraction_non_alphanumeric': 0.08995734780922839, 'fraction_numerical': 0.0, 'mean_word_length': 3.4482758620689653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2568102', 'n_tokens_mistral': 757, 'n_tokens_neox': 735, 'n_words': 174}