airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject svn commit: r1476709 - in /airavata/trunk/modules/xbaya-gui: pom.xml src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
Date Sun, 28 Apr 2013 02:58:27 GMT
Author: smarru
Date: Sun Apr 28 02:58:26 2013
New Revision: 1476709

URL: http://svn.apache.org/r1476709
Log:
Removing unused dependency to jsdl jar

Modified:
    airavata/trunk/modules/xbaya-gui/pom.xml
    airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java

Modified: airavata/trunk/modules/xbaya-gui/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/pom.xml?rev=1476709&r1=1476708&r2=1476709&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/pom.xml (original)
+++ airavata/trunk/modules/xbaya-gui/pom.xml Sun Apr 28 02:58:26 2013
@@ -27,7 +27,6 @@
         <plugins>
             <plugin>
                 <artifactId>maven-antrun-plugin</artifactId>
-                <version>1.6</version>
                 <executions>
                     <execution>
                         <id>restore-persistence</id>
@@ -47,7 +46,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>${surefire.version}</version>
                 <configuration>
                     <includes>
                         <include>**/*Suite.java</include>
@@ -149,7 +147,6 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
         </dependency>
         <dependency>
             <groupId>xsul</groupId>
@@ -327,10 +324,5 @@
             <artifactId>derbyclient</artifactId>
             <version>${derby.version}</version>
         </dependency>
-        <dependency>
-            <groupId>de.fzj.unicore</groupId>
-            <artifactId>jsdl-xmlbeans</artifactId>
-            <version>2.1.0</version>
-        </dependency>
     </dependencies>
 </project>

Modified: airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java?rev=1476709&r1=1476708&r2=1476709&view=diff
==============================================================================
--- airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
(original)
+++ airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
Sun Apr 28 02:58:26 2013
@@ -60,7 +60,6 @@ import org.apache.airavata.xbaya.ui.widg
 import org.apache.airavata.xbaya.ui.widgets.XBayaLinkButton;
 import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
 import org.apache.xmlbeans.XmlException;
-import org.ggf.schemas.jsdl.x2006.x07.jsdlHpcpa.HPCProfileApplicationDocument;
 
 public class HostDeploymentDialog extends JDialog implements ActionListener {
     /**
@@ -79,21 +78,22 @@ public class HostDeploymentDialog extend
     private String hostName;
     private JComboBox cmbHostName;
 
-	private JButton btnHostAdvanceOptions;
-	private boolean newDescriptor;
-	private ApplicationDescription originalDescription;
-	private String originalHost; 
-	private JButton btnTmpDirBrowse;
-	private JButton btnExecBrowse;
-	private List<String> existingHostList;
-	
+    private JButton btnHostAdvanceOptions;
+    private boolean newDescriptor;
+    private ApplicationDescription originalDescription;
+    private String originalHost;
+    private JButton btnTmpDirBrowse;
+    private JButton btnExecBrowse;
+    private List<String> existingHostList;
+
     /**
      * Create the dialog.
      */
-    public HostDeploymentDialog(AiravataAPI registry, boolean newDescriptor, ApplicationDescription
originalDescription, String originalHost, List<String> existingHostList) {
-    	setNewDescriptor(newDescriptor);
-    	setOriginalDescription(originalDescription);
-    	setOriginalHost(originalHost);
+    public HostDeploymentDialog(AiravataAPI registry, boolean newDescriptor,
+            ApplicationDescription originalDescription, String originalHost, List<String>
existingHostList) {
+        setNewDescriptor(newDescriptor);
+        setOriginalDescription(originalDescription);
+        setOriginalHost(originalHost);
         setRegistry(registry);
         setExistingHostList(existingHostList);
         iniGUI();
@@ -107,14 +107,15 @@ public class HostDeploymentDialog extend
     protected HostDeploymentDialog getDialog() {
         return this;
     }
-    
+
     private void iniGUI() {
         if (isNewDescriptor()) {
-			setTitle("New Application Deployment");
-		}else{
-			setTitle("Update Application Deployment: "+ getOriginalDescription().getType().getApplicationName().getStringValue());
-		}
-		setBounds(100, 100, 600, 620);
+            setTitle("New Application Deployment");
+        } else {
+            setTitle("Update Application Deployment: "
+                    + getOriginalDescription().getType().getApplicationName().getStringValue());
+        }
+        setBounds(100, 100, 600, 620);
         setModal(true);
         setLocationRelativeTo(null);
         GridPanel buttonPane = new GridPanel();
@@ -122,8 +123,8 @@ public class HostDeploymentDialog extend
             lblError = new JLabel("");
             lblError.setForeground(Color.RED);
             buttonPane.add(lblError);
-            if (!isNewDescriptor()){
-            	JButton resetButton = new JButton("Reset");
+            if (!isNewDescriptor()) {
+                JButton resetButton = new JButton("Reset");
                 resetButton.addActionListener(new ActionListener() {
                     public void actionPerformed(ActionEvent e) {
                         loadData();
@@ -133,8 +134,8 @@ public class HostDeploymentDialog extend
             }
             {
                 okButton = new JButton("Add");
-                if (!isNewDescriptor()){
-                	okButton.setText("Update");
+                if (!isNewDescriptor()) {
+                    okButton.setText("Update");
                 }
                 okButton.addActionListener(new ActionListener() {
                     public void actionPerformed(ActionEvent e) {
@@ -160,7 +161,7 @@ public class HostDeploymentDialog extend
             }
         }
         {
-        	JPanel execPath=new JPanel();
+            JPanel execPath = new JPanel();
             txtExecPath = new XBayaTextField();
             txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
                 @Override
@@ -169,31 +170,31 @@ public class HostDeploymentDialog extend
                 }
             });
             txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
-            	@Override
-            	public void focusLost(FocusEvent e) {
-            		super.focusLost(e);
-            		updateTempDirWithExecPath(txtExecPath.getText());
-            	}
-			});
+                @Override
+                public void focusLost(FocusEvent e) {
+                    super.focusLost(e);
+                    updateTempDirWithExecPath(txtExecPath.getText());
+                }
+            });
             txtExecPath.setColumns(10);
-            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
-            btnExecBrowse.addActionListener(new ActionListener(){
-				public void actionPerformed(ActionEvent arg0) {
-					JFileChooser c = new JFileChooser();
-					int rVal = c.showOpenDialog(null);
-					if (rVal == JFileChooser.APPROVE_OPTION) {
-						txtExecPath.setText(c.getSelectedFile().toString());
-						setExecutablePath(txtExecPath.getText());
-					}
-				}
+            btnExecBrowse = new JButton(MenuIcons.OPEN_ICON);
+            btnExecBrowse.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent arg0) {
+                    JFileChooser c = new JFileChooser();
+                    int rVal = c.showOpenDialog(null);
+                    if (rVal == JFileChooser.APPROVE_OPTION) {
+                        txtExecPath.setText(c.getSelectedFile().toString());
+                        setExecutablePath(txtExecPath.getText());
+                    }
+                }
             });
             execPath.add(txtExecPath.getSwingComponent());
             execPath.add(btnExecBrowse);
-            
-            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());
+
+            setupLayoutForBrowse(execPath, txtExecPath.getSwingComponent());
 
             JLabel lblExecutablePath = new JLabel("Executable path");
-        	JPanel tmpDirPath=new JPanel();
+            JPanel tmpDirPath = new JPanel();
 
             txtTempDir = new XBayaTextField();
             txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
@@ -203,22 +204,22 @@ public class HostDeploymentDialog extend
                 }
             });
             txtTempDir.setColumns(10);
-            btnTmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
-            btnTmpDirBrowse.addActionListener(new ActionListener(){
-				public void actionPerformed(ActionEvent arg0) {
-					JFileChooser c = new JFileChooser();
-					c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-					int rVal = c.showOpenDialog(null);
-					if (rVal == JFileChooser.APPROVE_OPTION) {
-						txtTempDir.setText(c.getSelectedFile().toString());
-						setTempDir(txtTempDir.getText());
-					}
-				}
+            btnTmpDirBrowse = new JButton(MenuIcons.OPEN_DIR_ICON);
+            btnTmpDirBrowse.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent arg0) {
+                    JFileChooser c = new JFileChooser();
+                    c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+                    int rVal = c.showOpenDialog(null);
+                    if (rVal == JFileChooser.APPROVE_OPTION) {
+                        txtTempDir.setText(c.getSelectedFile().toString());
+                        setTempDir(txtTempDir.getText());
+                    }
+                }
             });
             JTextField component = txtTempDir.getSwingComponent();
-			tmpDirPath.add(component);
+            tmpDirPath.add(component);
             tmpDirPath.add(btnTmpDirBrowse);
-            
+
             setupLayoutForBrowse(tmpDirPath, component);
 
             JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");
@@ -240,7 +241,7 @@ public class HostDeploymentDialog extend
             cmbHostName = new JComboBox();
             cmbHostName.addActionListener(this);
 
-            XBayaLabel lblHostName = new XBayaLabel("Application host",cmbHostName);
+            XBayaLabel lblHostName = new XBayaLabel("Application host", cmbHostName);
             XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
             lnkNewHost.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent e) {
@@ -250,16 +251,19 @@ public class HostDeploymentDialog extend
                         hostDescriptionDialog.open();
 
                         if (hostDescriptionDialog.isHostCreated()) {
-                        	ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(),
"Host Descriptions", "Refreshing host list..", 0, 200);
-                        	int progress=1;
-                        	progressMonitor.setProgress(progress++);
-                        	while(cmbHostName.getSelectedIndex()==-1 || !cmbHostName.getSelectedItem().toString().equals(hostDescriptionDialog.getHostLocation())){
-	                            loadHostDescriptions();
-	                            cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
-	                            progressMonitor.setProgress(progress++);
-	                            Thread.sleep(50);
-                        	}
-                        	progressMonitor.setProgress(200);
+                            ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(),
+                                    "Host Descriptions", "Refreshing host list..", 0, 200);
+                            int progress = 1;
+                            progressMonitor.setProgress(progress++);
+                            while (cmbHostName.getSelectedIndex() == -1
+                                    || !cmbHostName.getSelectedItem().toString()
+                                            .equals(hostDescriptionDialog.getHostLocation()))
{
+                                loadHostDescriptions();
+                                cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
+                                progressMonitor.setProgress(progress++);
+                                Thread.sleep(50);
+                            }
+                            progressMonitor.setProgress(200);
                         }
                     } catch (Exception e1) {
                         e1.printStackTrace();
@@ -270,64 +274,65 @@ public class HostDeploymentDialog extend
             lnkNewHost.setText("Create new host...");
             lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);
 
-            btnHostAdvanceOptions=new JButton("HPC Configuration...");
+            btnHostAdvanceOptions = new JButton("HPC Configuration...");
             btnHostAdvanceOptions.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent arg0) {
-					try {
-						ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog = new ApplicationDescriptionHostAdvancedOptionDialog(getRegistry(),getShellApplicationDescription());
+                public void actionPerformed(ActionEvent arg0) {
+                    try {
+                        ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog
= new ApplicationDescriptionHostAdvancedOptionDialog(
+                                getRegistry(), getShellApplicationDescription());
                         hostAdvancedOptionsDialog.open();
                     } catch (Exception e1) {
                         e1.printStackTrace();
                         JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
                     }
-				}
-			});
+                }
+            });
             btnHostAdvanceOptions.setVisible(false);
-            GridPanel hostPanel=new GridPanel();
+            GridPanel hostPanel = new GridPanel();
             hostPanel.add(cmbHostName);
-//            hostPanel.add(btnHostAdvanceOptions);
+            // hostPanel.add(btnHostAdvanceOptions);
             hostPanel.add(new JLabel());
-            
+
             SwingUtil.layoutToGrid(hostPanel.getSwingComponent(), 1, 2, 0, 0);
-            
+
             GridPanel infoPanel1 = new GridPanel();
 
-            
             infoPanel1.add(lblExecutablePath);
             infoPanel1.add(execPath);
             infoPanel1.add(lblTemporaryDirectory);
             infoPanel1.add(tmpDirPath);
-            
+
             GridPanel infoPanel3 = new GridPanel();
 
             infoPanel3.add(lblHostName);
             infoPanel3.add(hostPanel);
             infoPanel3.add(new JLabel());
             infoPanel3.add(lnkNewHost);
-            
-            GridPanel infoPanel4=new GridPanel();
-//            infoPanel4.add(new JLabel());
+
+            GridPanel infoPanel4 = new GridPanel();
+            // infoPanel4.add(new JLabel());
             infoPanel4.add(btnHostAdvanceOptions);
             infoPanel4.add(btnAdvance);
             infoPanel4.layout(1, 2, 0, 0);
-            
+
             SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE,
0);
             SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE,
1);
 
             GridPanel infoPanel = new GridPanel();
             infoPanel.add(new JSeparator());
-			infoPanel.add(infoPanel3);
+            infoPanel.add(infoPanel3);
             infoPanel.add(new JSeparator());
             infoPanel.add(infoPanel1);
 
             infoPanel.add(new JSeparator());
             infoPanel.add(infoPanel4);
-            
+
             SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 6, 1, SwingUtil.WEIGHT_NONE,
0);
-            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),SwingUtil.WEIGHT_NONE,0);
+            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),
+                    SwingUtil.WEIGHT_NONE, 0);
             getContentPane().add(infoPanel.getSwingComponent());
             getContentPane().add(buttonPane.getSwingComponent());
-            
+
             buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
             infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
 
@@ -336,37 +341,37 @@ public class HostDeploymentDialog extend
         }
         setResizable(true);
         getRootPane().setDefaultButton(okButton);
-        if (!isNewDescriptor()){
-        	loadData();
+        if (!isNewDescriptor()) {
+            loadData();
         }
         pack();
-        if (getSize().getWidth()<500){
-        	setSize(500, getSize().height);
+        if (getSize().getWidth() < 500) {
+            setSize(500, getSize().height);
         }
     }
 
-	private void setupLayoutForBrowse(JPanel tmpDirPath, JTextField component) {
-		GridBagLayout layout;
-		GridBagConstraints constraints;
-		layout = new GridBagLayout();
-		constraints = new GridBagConstraints();
-		constraints.fill = GridBagConstraints.BOTH;
-		constraints.weightx = 1;
-		layout.setConstraints(component, constraints);
-		tmpDirPath.setLayout(layout);
-	}
-
-    private void loadData(){
-    	txtExecPath.setText(getOriginalDescription().getType().getExecutableLocation());
-    	setExecutablePath(txtExecPath.getText());
-    	txtTempDir.setText(getOriginalDescription().getType().getScratchWorkingDirectory());
-    	setTempDir(txtTempDir.getText());
-
-    	cmbHostName.setSelectedItem(getOriginalHost());
-    	setHostName(cmbHostName.getSelectedItem().toString());
-    	cmbHostName.setEnabled(isNewDescriptor());
+    private void setupLayoutForBrowse(JPanel tmpDirPath, JTextField component) {
+        GridBagLayout layout;
+        GridBagConstraints constraints;
+        layout = new GridBagLayout();
+        constraints = new GridBagConstraints();
+        constraints.fill = GridBagConstraints.BOTH;
+        constraints.weightx = 1;
+        layout.setConstraints(component, constraints);
+        tmpDirPath.setLayout(layout);
+    }
+
+    private void loadData() {
+        txtExecPath.setText(getOriginalDescription().getType().getExecutableLocation());
+        setExecutablePath(txtExecPath.getText());
+        txtTempDir.setText(getOriginalDescription().getType().getScratchWorkingDirectory());
+        setTempDir(txtTempDir.getText());
+
+        cmbHostName.setSelectedItem(getOriginalHost());
+        setHostName(cmbHostName.getSelectedItem().toString());
+        cmbHostName.setEnabled(isNewDescriptor());
     }
-    
+
     private void loadHostDescriptions() {
         cmbHostName.removeAllItems();
         setHostName(null);
@@ -374,8 +379,8 @@ public class HostDeploymentDialog extend
             List<HostDescription> hostDescriptions = getRegistry().getApplicationManager().getAllHostDescriptions();
             for (HostDescription hostDescription : hostDescriptions) {
                 if (!isNewDescriptor() || !getExistingHostList().contains(hostDescription.getType().getHostName()))
{
-					cmbHostName.addItem(hostDescription.getType().getHostName());
-				}
+                    cmbHostName.addItem(hostDescription.getType().getHostName());
+                }
             }
         } catch (Exception e) {
             setError(e.getLocalizedMessage());
@@ -384,22 +389,22 @@ public class HostDeploymentDialog extend
     }
 
     public ApplicationDescription getShellApplicationDescription() {
-        if(shellApplicationDescription == null){
+        if (shellApplicationDescription == null) {
             if (isNewDescriptor()) {
-				shellApplicationDescription = new ApplicationDescription();
-			}else{
-				try {
-					shellApplicationDescription= ApplicationDescription.fromXML(getOriginalDescription().toXML());
-				} catch (XmlException e) {
-					//shouldn't happen (hopefully)
-				}
-			}
+                shellApplicationDescription = new ApplicationDescription();
+            } else {
+                try {
+                    shellApplicationDescription = ApplicationDescription.fromXML(getOriginalDescription().toXML());
+                } catch (XmlException e) {
+                    // shouldn't happen (hopefully)
+                }
+            }
         }
         return shellApplicationDescription;
     }
 
     public ApplicationDeploymentDescriptionType getApplicationDescriptionType() {
-    	return getShellApplicationDescription().getType();
+        return getShellApplicationDescription().getType();
     }
 
     public String getExecutablePath() {
@@ -407,30 +412,31 @@ public class HostDeploymentDialog extend
     }
 
     public void setExecutablePath(String executablePath) {
-    	getApplicationDescriptionType().setExecutableLocation(executablePath);
-    	updateTempDirWithExecPath(executablePath);
+        getApplicationDescriptionType().setExecutableLocation(executablePath);
+        updateTempDirWithExecPath(executablePath);
         updateDialogStatus();
     }
 
-	private void updateTempDirWithExecPath(String executablePath) {
-//		if (!executablePath.trim().equals("") && (!txtExecPath.getSwingComponent().isFocusOwner())
&& 
-//				(getApplicationDescriptionType().getScratchWorkingDirectory()==null || getApplicationDescriptionType().getScratchWorkingDirectory().trim().equalsIgnoreCase(""))){
-//    		String temp_location = "workflow_runs";
-//			String tempDir = new File(new File(executablePath).getParentFile(),temp_location).toString();
-//			txtTempDir.setText(tempDir);
-//    		txtTempDir.getSwingComponent().setSelectionStart(tempDir.length()-temp_location.length());
-//    		txtTempDir.getSwingComponent().setSelectionEnd(tempDir.length());
-//    		setTempDir(txtTempDir.getText());
-//    		txtTempDir.getSwingComponent().requestFocus();
-//    	}
-	}
+    private void updateTempDirWithExecPath(String executablePath) {
+        // if (!executablePath.trim().equals("") && (!txtExecPath.getSwingComponent().isFocusOwner())
&&
+        // (getApplicationDescriptionType().getScratchWorkingDirectory()==null ||
+        // getApplicationDescriptionType().getScratchWorkingDirectory().trim().equalsIgnoreCase(""))){
+        // String temp_location = "workflow_runs";
+        // String tempDir = new File(new File(executablePath).getParentFile(),temp_location).toString();
+        // txtTempDir.setText(tempDir);
+        // txtTempDir.getSwingComponent().setSelectionStart(tempDir.length()-temp_location.length());
+        // txtTempDir.getSwingComponent().setSelectionEnd(tempDir.length());
+        // setTempDir(txtTempDir.getText());
+        // txtTempDir.getSwingComponent().requestFocus();
+        // }
+    }
 
     public String getTempDir() {
         return getApplicationDescriptionType().getScratchWorkingDirectory();
     }
 
     public void setTempDir(String tempDir) {
-    	getApplicationDescriptionType().setScratchWorkingDirectory(tempDir);
+        getApplicationDescriptionType().setScratchWorkingDirectory(tempDir);
         updateDialogStatus();
     }
 
@@ -439,7 +445,7 @@ public class HostDeploymentDialog extend
     }
 
     public void saveApplicationDescription() {
-		setApplicationDescCreated(true);
+        setApplicationDescCreated(true);
     }
 
     public boolean isApplicationDescCreated() {
@@ -468,7 +474,7 @@ public class HostDeploymentDialog extend
         okButton.setEnabled(message == null);
         setError(message);
     }
-	
+
     private void validateDialog() throws Exception {
         if (getExecutablePath() == null || getExecutablePath().trim().equals("")) {
             throw new Exception("Executable path cannot be empty!!!");
@@ -493,29 +499,27 @@ public class HostDeploymentDialog extend
         if (hostName != null) {
             HostDescription hostDescription;
             try {
-				hostDescription = registry.getApplicationManager().getHostDescription(hostName);
-				if (hostDescription.getType() instanceof GlobusHostType) {
-				    getShellApplicationDescription().getType().changeType(
-                            HpcApplicationDeploymentType.type);
-				} else {
-				    getShellApplicationDescription().getType().changeType(
-				            ApplicationDeploymentDescriptionType.type);
-				}
-				btnHostAdvanceOptions.setVisible(hostDescription.getType() instanceof GlobusHostType);
-				String hostAddress = hostDescription.getType().getHostAddress();
-				boolean isLocal = isLocalAddress(hostAddress);
-				btnExecBrowse.setVisible(isLocal);
-				btnTmpDirBrowse.setVisible(isLocal);
-			}  catch (AiravataAPIInvocationException e) {
+                hostDescription = registry.getApplicationManager().getHostDescription(hostName);
+                if (hostDescription.getType() instanceof GlobusHostType) {
+                    getShellApplicationDescription().getType().changeType(HpcApplicationDeploymentType.type);
+                } else {
+                    getShellApplicationDescription().getType().changeType(ApplicationDeploymentDescriptionType.type);
+                }
+                btnHostAdvanceOptions.setVisible(hostDescription.getType() instanceof GlobusHostType);
+                String hostAddress = hostDescription.getType().getHostAddress();
+                boolean isLocal = isLocalAddress(hostAddress);
+                btnExecBrowse.setVisible(isLocal);
+                btnTmpDirBrowse.setVisible(isLocal);
+            } catch (AiravataAPIInvocationException e) {
                 e.printStackTrace();
             }
         }
         updateDialogStatus();
     }
 
-	private boolean isLocalAddress(String hostAddress) {
-		return hostAddress.equalsIgnoreCase("localhost") || hostAddress.equalsIgnoreCase("127.0.0.1");
-	}
+    private boolean isLocalAddress(String hostAddress) {
+        return hostAddress.equalsIgnoreCase("localhost") || hostAddress.equalsIgnoreCase("127.0.0.1");
+    }
 
     private void updateHostName() {
         if (cmbHostName.getSelectedItem() != null) {
@@ -543,65 +547,71 @@ public class HostDeploymentDialog extend
         this.registry = registry;
     }
 
-	public boolean isNewDescriptor() {
-		return newDescriptor;
-	}
-
-	public void setNewDescriptor(boolean newDescriptor) {
-		this.newDescriptor = newDescriptor;
-	}
-
-	public ApplicationDescription getOriginalDescription() {
-		return originalDescription;
-	}
-
-	public void setOriginalDescription(
-            ApplicationDescription originalDescription) {
-		this.originalDescription = originalDescription;
-	}
-
-	public String getOriginalHost() {
-		return originalHost;
-	}
-
-	public void setOriginalHost(String originalHost) {
-		this.originalHost = originalHost;
-	}
-	
-	public HostDeployment execute() throws AiravataAPIInvocationException{
-		open();
-		if (isApplicationDescCreated()){
-			return new HostDeployment(getRegistry().getApplicationManager().getHostDescription(getHostName()),getShellApplicationDescription());
-		}
-		return null;
-	}
-	public List<String> getExistingHostList() {
-		return existingHostList;
-	}
-
-	public void setExistingHostList(List<String> existingHostList) {
-		this.existingHostList = existingHostList;
-	}
-	
-	public static class HostDeployment{
-		private HostDescription hostDescription;
-		private ApplicationDescription applicationDescription;
-		public HostDeployment(HostDescription hostDescription,ApplicationDescription applicationDescription)
{
-			setHostDescription(hostDescription);
-			setApplicationDescription(applicationDescription);
-		}
-		public ApplicationDescription getApplicationDescription() {
-			return applicationDescription;
-		}
-		public void setApplicationDescription(ApplicationDescription applicationDescription) {
-			this.applicationDescription = applicationDescription;
-		}
-		public HostDescription getHostDescription() {
-			return hostDescription;
-		}
-		public void setHostDescription(HostDescription hostDescription) {
-			this.hostDescription = hostDescription;
-		}
-	}
-	
+    public boolean isNewDescriptor() {
+        return newDescriptor;
+    }
+
+    public void setNewDescriptor(boolean newDescriptor) {
+        this.newDescriptor = newDescriptor;
+    }
+
+    public ApplicationDescription getOriginalDescription() {
+        return originalDescription;
+    }
+
+    public void setOriginalDescription(ApplicationDescription originalDescription) {
+        this.originalDescription = originalDescription;
+    }
+
+    public String getOriginalHost() {
+        return originalHost;
+    }
+
+    public void setOriginalHost(String originalHost) {
+        this.originalHost = originalHost;
+    }
+
+    public HostDeployment execute() throws AiravataAPIInvocationException {
+        open();
+        if (isApplicationDescCreated()) {
+            return new HostDeployment(getRegistry().getApplicationManager().getHostDescription(getHostName()),
+                    getShellApplicationDescription());
+        }
+        return null;
+    }
+
+    public List<String> getExistingHostList() {
+        return existingHostList;
+    }
+
+    public void setExistingHostList(List<String> existingHostList) {
+        this.existingHostList = existingHostList;
+    }
+
+    public static class HostDeployment {
+        private HostDescription hostDescription;
+        private ApplicationDescription applicationDescription;
+
+        public HostDeployment(HostDescription hostDescription, ApplicationDescription applicationDescription)
{
+            setHostDescription(hostDescription);
+            setApplicationDescription(applicationDescription);
+        }
+
+        public ApplicationDescription getApplicationDescription() {
+            return applicationDescription;
+        }
+
+        public void setApplicationDescription(ApplicationDescription applicationDescription)
{
+            this.applicationDescription = applicationDescription;
+        }
+
+        public HostDescription getHostDescription() {
+            return hostDescription;
+        }
+
+        public void setHostDescription(HostDescription hostDescription) {
+            this.hostDescription = hostDescription;
+        }
+    }
+
 }



Mime
View raw message