01: package com.opensymphony.workflow.designer.actions;
02:
03: import java.awt.event.ActionEvent;
04: import java.awt.*;
05: import java.io.File;
06: import java.net.MalformedURLException;
07: import javax.swing.*;
08:
09: import com.opensymphony.workflow.designer.Utils;
10: import com.opensymphony.workflow.designer.WorkflowDesigner;
11: import com.opensymphony.workflow.designer.ResourceManager;
12:
13: /**
14: * @author Hani Suleiman (hani@formicary.net)
15: * Date: May 21, 2003
16: * Time: 12:09:41 AM
17: */
18: public class OpenWorkspace extends AbstractAction {
19: public OpenWorkspace() {
20: }
21:
22: public void actionPerformed(ActionEvent e) {
23: File file = Utils.promptUserForFile((Component) e.getSource(),
24: JFileChooser.FILES_AND_DIRECTORIES, false,
25: WorkflowDesigner.WORKSPACE_SUFFIX, ResourceManager
26: .getString("workspace.files"));
27: if (file == null)
28: return;
29: try {
30: WorkflowDesigner.INSTANCE.openWorkspace(file.toURL());
31: } catch (MalformedURLException e1) {
32: e1.printStackTrace();
33: }
34: }
35: }
|