KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > actions > OpenWorkspace


1 package com.opensymphony.workflow.designer.actions;
2
3 import java.awt.event.ActionEvent JavaDoc;
4 import java.awt.*;
5 import java.io.File JavaDoc;
6 import java.net.MalformedURLException JavaDoc;
7 import javax.swing.*;
8
9 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 {
20   public OpenWorkspace()
21   {
22   }
23
24   public void actionPerformed(ActionEvent JavaDoc e)
25   {
26     File JavaDoc file = Utils.promptUserForFile((Component)e.getSource(), JFileChooser.FILES_AND_DIRECTORIES, false, WorkflowDesigner.WORKSPACE_SUFFIX, ResourceManager.getString("workspace.files"));
27     if(file == null) return;
28       try
29       {
30           WorkflowDesigner.INSTANCE.openWorkspace(file.toURL());
31       }
32       catch(MalformedURLException JavaDoc e1)
33       {
34           e1.printStackTrace();
35       }
36   }
37 }
38
Popular Tags