Search in sources :

Example 1 with CopyTemplatesToOutputsModelAction

use of net.parostroj.timetable.gui.actions.impl.CopyTemplatesToOutputsModelAction in project grafikon by jub77.

the class ImportReplaceOutputTemplatesUrlAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    ActionHandler handler = ActionHandler.getInstance();
    ActionContext context = new ActionContext(GuiComponentUtils.getTopLevelComponent(e.getSource()));
    context.setAttribute("diagramImport", model.getDiagram());
    String url = model.getLibraryBaseUrl() + "/" + TEMPLATE;
    context.setAttribute("libraryUrl", url);
    log.debug("Loading library: {}", url);
    handler.execute(new LoadLibraryUrlModelAction(context));
    handler.execute(new OutputTemplateSelectionModelAction(context));
    handler.execute(new ImportModelAction(context));
    handler.execute(new CopyTemplatesToOutputsModelAction(context, model));
}
Also used : LoadLibraryUrlModelAction(net.parostroj.timetable.gui.actions.impl.LoadLibraryUrlModelAction) OutputTemplateSelectionModelAction(net.parostroj.timetable.gui.actions.impl.OutputTemplateSelectionModelAction) ActionContext(net.parostroj.timetable.gui.actions.execution.ActionContext) ActionHandler(net.parostroj.timetable.gui.actions.execution.ActionHandler) ImportModelAction(net.parostroj.timetable.gui.actions.execution.ImportModelAction) CopyTemplatesToOutputsModelAction(net.parostroj.timetable.gui.actions.impl.CopyTemplatesToOutputsModelAction)

Example 2 with CopyTemplatesToOutputsModelAction

use of net.parostroj.timetable.gui.actions.impl.CopyTemplatesToOutputsModelAction in project grafikon by jub77.

the class ImportReplaceOutputTemplatesAction method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    ActionHandler handler = ActionHandler.getInstance();
    ActionContext context = new ActionContext(GuiComponentUtils.getTopLevelComponent(e.getSource()));
    context.setAttribute("fileType", FileChooserFactory.Type.GTM_GTML);
    context.setAttribute("diagramImport", model.getDiagram());
    handler.execute(new OpenFileModelAction(context));
    handler.execute(new SelectLoadAction(context));
    handler.execute(new LoadDiagramModelAction(context));
    handler.execute(new LoadLibraryModelAction(context));
    handler.execute(new OutputTemplateSelectionModelAction(context));
    handler.execute(new ImportModelAction(context));
    handler.execute(new CopyTemplatesToOutputsModelAction(context, model));
}
Also used : LoadDiagramModelAction(net.parostroj.timetable.gui.actions.impl.LoadDiagramModelAction) SelectLoadAction(net.parostroj.timetable.gui.actions.impl.SelectLoadAction) LoadLibraryModelAction(net.parostroj.timetable.gui.actions.impl.LoadLibraryModelAction) OutputTemplateSelectionModelAction(net.parostroj.timetable.gui.actions.impl.OutputTemplateSelectionModelAction) ActionContext(net.parostroj.timetable.gui.actions.execution.ActionContext) ActionHandler(net.parostroj.timetable.gui.actions.execution.ActionHandler) OpenFileModelAction(net.parostroj.timetable.gui.actions.impl.OpenFileModelAction) ImportModelAction(net.parostroj.timetable.gui.actions.execution.ImportModelAction) CopyTemplatesToOutputsModelAction(net.parostroj.timetable.gui.actions.impl.CopyTemplatesToOutputsModelAction)

Aggregations

ActionContext (net.parostroj.timetable.gui.actions.execution.ActionContext)2 ActionHandler (net.parostroj.timetable.gui.actions.execution.ActionHandler)2 ImportModelAction (net.parostroj.timetable.gui.actions.execution.ImportModelAction)2 CopyTemplatesToOutputsModelAction (net.parostroj.timetable.gui.actions.impl.CopyTemplatesToOutputsModelAction)2 OutputTemplateSelectionModelAction (net.parostroj.timetable.gui.actions.impl.OutputTemplateSelectionModelAction)2 LoadDiagramModelAction (net.parostroj.timetable.gui.actions.impl.LoadDiagramModelAction)1 LoadLibraryModelAction (net.parostroj.timetable.gui.actions.impl.LoadLibraryModelAction)1 LoadLibraryUrlModelAction (net.parostroj.timetable.gui.actions.impl.LoadLibraryUrlModelAction)1 OpenFileModelAction (net.parostroj.timetable.gui.actions.impl.OpenFileModelAction)1 SelectLoadAction (net.parostroj.timetable.gui.actions.impl.SelectLoadAction)1