1 package com.opensymphony.workflow.designer.actions; 2 3 import java.awt.event.ActionEvent ; 4 import java.awt.*; 5 import java.io.File ; 6 import java.net.MalformedURLException ; 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 18 public class OpenWorkspace extends AbstractAction 19 { 20 public OpenWorkspace() 21 { 22 } 23 24 public void actionPerformed(ActionEvent e) 25 { 26 File 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 e1) 33 { 34 e1.printStackTrace(); 35 } 36 } 37 } 38 | Popular Tags |