airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samin...@apache.org
Subject svn commit: r1355100 - in /incubator/airavata/trunk/modules: commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/ xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ xbaya-gui/src/main/java/org/apache/airavata...
Date Thu, 28 Jun 2012 18:39:12 GMT
Author: samindaw
Date: Thu Jun 28 18:39:11 2012
New Revision: 1355100

URL: http://svn.apache.org/viewvc?rev=1355100&view=rev
Log:
updating the host desc dialog with remote protocols + rearranging host to the bottom in app
desc dialog + menu rearrangin in xbaya main menu for new workflow/app desc/host

Modified:
    incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
    incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java

Modified: incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java?rev=1355100&r1=1355099&r2=1355100&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
(original)
+++ incubator/airavata/trunk/modules/commons/registry-api/src/main/java/org/apache/airavata/registry/api/impl/AiravataJCRRegistry.java
Thu Jun 28 18:39:11 2012
@@ -99,7 +99,6 @@ public class AiravataJCRRegistry extends
     public static final String WORKFLOW_USER_PROPERTY = "User";
     public static final String NOTIFICATION_STORE = "User";
 
-
     private static Logger log = LoggerFactory.getLogger(AiravataJCRRegistry.class);
 
     public AiravataJCRRegistry(URI repositoryURI, String className,

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java?rev=1355100&r1=1355099&r2=1355100&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
Thu Jun 28 18:39:11 2012
@@ -22,7 +22,6 @@
 package org.apache.airavata.xbaya.ui.dialogs.descriptors;
 
 import java.awt.Color;
-import java.awt.Font;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
@@ -93,6 +92,8 @@ public class ApplicationDescriptionDialo
 	private String originalHost; 
 	private String originalService;
     private ServiceDescription serviceDescription=null;
+	private JButton btnTmpDirBrowse;
+	private JButton btnExecBrowse;
 
     /**
      * Launch the application.
@@ -175,9 +176,9 @@ public class ApplicationDescriptionDialo
     
     private void iniGUI() {
         if (isNewDescritor()) {
-			setTitle("New Deployment Description");
+			setTitle("Application Description");
 		}else{
-			setTitle("Update Deployment Description: "+getOriginalDeploymentDescription().getType().getApplicationName().getStringValue());
+			setTitle("Update Application Description: "+getOriginalDeploymentDescription().getType().getApplicationName().getStringValue());
 		}
 		setBounds(100, 100, 600, 620);
         setModal(true);
@@ -248,8 +249,8 @@ public class ApplicationDescriptionDialo
             	}
 			});
             txtExecPath.setColumns(10);
-            JButton execBrowse=new JButton(MenuIcons.OPEN_ICON);
-            execBrowse.addActionListener(new ActionListener(){
+            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
+            btnExecBrowse.addActionListener(new ActionListener(){
 				@Override
 				public void actionPerformed(ActionEvent arg0) {
 					JFileChooser c = new JFileChooser();
@@ -261,13 +262,14 @@ public class ApplicationDescriptionDialo
 				}
             });
             execPath.add(txtExecPath.getSwingComponent());
-            execPath.add(execBrowse);
-            JButton btnIOParameters = new JButton("Input/Output Parameters...");
+            execPath.add(btnExecBrowse);
+            JButton btnIOParameters = new JButton("IO Parameters...");
             btnIOParameters.addActionListener(new ActionListener(){
 				@Override
 				public void actionPerformed(ActionEvent event) {
 					try {
                         ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),getServiceDescription()==null,getServiceDescription(),false,getApplicationName());
+                        serviceDescriptionDialog.setLocationRelativeTo(getContentPane());
                         serviceDescriptionDialog.open();
                         if (serviceDescriptionDialog.isServiceCreated()) {
                         	setServiceDescription(serviceDescriptionDialog.getServiceDescription());
@@ -292,7 +294,7 @@ public class ApplicationDescriptionDialo
             });
             txtAppName.setColumns(10);
             XBayaLabel lblApplicationName = new XBayaLabel("Application name",txtAppName);
-            XBayaLabel lblExecutablePath = new XBayaLabel("Executable path",txtExecPath);
+            JLabel lblExecutablePath = new JLabel("Executable path");
         	JPanel tmpDirPath=new JPanel();
 
             txtTempDir = new XBayaTextField();
@@ -303,8 +305,8 @@ public class ApplicationDescriptionDialo
                 }
             });
             txtTempDir.setColumns(10);
-            JButton tmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
-            tmpDirBrowse.addActionListener(new ActionListener(){
+            btnTmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
+            btnTmpDirBrowse.addActionListener(new ActionListener(){
 				@Override
 				public void actionPerformed(ActionEvent arg0) {
 					JFileChooser c = new JFileChooser();
@@ -318,13 +320,13 @@ public class ApplicationDescriptionDialo
             });
             JTextField component = txtTempDir.getSwingComponent();
 			tmpDirPath.add(component);
-            tmpDirPath.add(tmpDirBrowse);
+            tmpDirPath.add(btnTmpDirBrowse);
 //            tmpDirPath.layout(1, 2, 0, 0);
             
             setupLayoutForBrowse(tmpDirPath, component);
 
 
-            XBayaLabel lblTemporaryDirectory = new XBayaLabel("Temporary directory",txtTempDir);
+            JLabel lblTemporaryDirectory = new JLabel("Temporary directory");
 
             JButton btnAdvance = new JButton("Advanced options...");
             btnAdvance.addActionListener(new ActionListener() {
@@ -344,13 +346,14 @@ public class ApplicationDescriptionDialo
             cmbHostName = new JComboBox();
             cmbHostName.addActionListener(this);
 
-            XBayaLabel lblHostName = new XBayaLabel("Bind the application to Host",cmbHostName);
-            lblHostName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
+            XBayaLabel lblHostName = new XBayaLabel("Application host",cmbHostName);
+//            lblHostName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
             XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
             lnkNewHost.addActionListener(new ActionListener() {
                 public void actionPerformed(ActionEvent e) {
                     try {
-                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine);
+                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine);
+                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
                         hostDescriptionDialog.open();
 
                         if (hostDescriptionDialog.isHostCreated()) {
@@ -431,7 +434,7 @@ public class ApplicationDescriptionDialo
             
             SwingUtil.layoutToGrid(infoPanel0.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE,
1);
 
-            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE,
1);
+            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE,
0);
 //            SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE,
0);
             SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE,
1);
 
@@ -440,8 +443,10 @@ public class ApplicationDescriptionDialo
             infoPanel.add(new JSeparator());
             infoPanel.add(infoPanel1);
             infoPanel.add(new JSeparator());
-//            infoPanel.add(infoPanel2);
-            infoPanel.add(infoPanel3);
+//          infoPanel.add(infoPanel2);
+			infoPanel.add(infoPanel3);
+			
+
             infoPanel.add(new JSeparator());
             infoPanel.add(infoPanel4);
             
@@ -463,6 +468,9 @@ public class ApplicationDescriptionDialo
         	loadData();
         }
         pack();
+        if (getSize().getWidth()<500){
+        	setSize(500, getSize().height);
+        }
     }
 
 	private void setupLayoutForBrowse(JPanel tmpDirPath, JTextField component) {
@@ -662,7 +670,7 @@ public class ApplicationDescriptionDialo
         }
 
         if (getServiceName() == null || getServiceName().trim().equals("")) {
-            throw new Exception("Click on Input/Output Parameters...  to define parameters
for the application");
+            throw new Exception("Click on IO Parameters...  to define parameters for the
application");
         }
 
         if (getHostName() == null || getHostName().trim().equals("")) {
@@ -697,14 +705,22 @@ public class ApplicationDescriptionDialo
 					getShellApplicationDescription().getType().changeType(
 							ApplicationDeploymentDescriptionType.type);
 				}
-				btnHostAdvanceOptions
-						.setVisible(hostDescription.getType() instanceof GlobusHostType);
+				btnHostAdvanceOptions.setVisible(hostDescription.getType() instanceof GlobusHostType);
+				String hostAddress = hostDescription.getType().getHostAddress();
+				boolean isLocal = isLocalAddress(hostAddress);
+				btnExecBrowse.setVisible(isLocal);
+				btnTmpDirBrowse.setVisible(isLocal);
+				
 			} catch (RegistryException e) {
 				//not there - ouch
 			}
 		}
 		updateDialogStatus();
-    }
+    }
+
+	private boolean isLocalAddress(String hostAddress) {
+		return hostAddress.equalsIgnoreCase("localhost") || hostAddress.equalsIgnoreCase("127.0.0.1");
+	}
 
     private void updateServiceName() {
         if (getServiceDescription() == null) {

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java?rev=1355100&r1=1355099&r2=1355100&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
Thu Jun 28 18:39:11 2012
@@ -189,6 +189,7 @@ public class DescriptorEditorDialog exte
 	    	case HOST:
 	    		HostDescription h = (HostDescription) getSelected();
 	    		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine,false,h);
+	    		hostDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
 	    		hostDescriptionDialog.open();
 	    		if (hostDescriptionDialog.isHostCreated()) {
 					loadDescriptors();
@@ -206,6 +207,7 @@ public class DescriptorEditorDialog exte
 	    		ApplicationDeploymentDescription a = (ApplicationDeploymentDescription) getSelected();
 	    		String[] s = dlist.get(a).split("\\$");
 	    		ApplicationDescriptionDialog aDescriptionDialog = new ApplicationDescriptionDialog(engine,false,a,s[1],s[0]);
+	    		aDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
 	    		aDescriptionDialog.open();
 			if (aDescriptionDialog.isApplicationDescCreated()) {
 				loadDescriptors();
@@ -232,6 +234,7 @@ public class DescriptorEditorDialog exte
 	    		break;
 	    	case APPLICATION:
 	    		ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(engine);
+	    		applicationDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
 	    		applicationDescriptionDialog.open();
 	    		if (applicationDescriptionDialog.isApplicationDescCreated()){
 	    			loadDescriptors();

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java?rev=1355100&r1=1355099&r2=1355100&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
Thu Jun 28 18:39:11 2012
@@ -22,6 +22,7 @@
 package org.apache.airavata.xbaya.ui.dialogs.descriptors;
 
 import java.awt.Color;
+import java.awt.Font;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.KeyAdapter;
@@ -31,9 +32,10 @@ import java.awt.event.WindowEvent;
 
 import javax.swing.BorderFactory;
 import javax.swing.JButton;
-import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
+import javax.swing.SwingConstants;
 
 import org.apache.airavata.common.registry.api.exception.RegistryException;
 import org.apache.airavata.common.utils.SwingUtil;
@@ -64,8 +66,6 @@ public class HostDescriptionDialog exten
 
     private AiravataRegistry registry;
 
-	private JCheckBox chkGobusHost;
-
 	private XBayaLabel globusGateKeeperLabel;
 
 	private XBayaLabel gridFTPLabel;
@@ -81,6 +81,17 @@ public class HostDescriptionDialog exten
     private HostDescription originalHostDescription;
     
     private XBayaEngine engine;
+
+	private JComboBox cmbResourceProtocol;
+
+	private GridPanel infoPanel2;
+	
+	private static final String REMOTE_PROTOCOL_STR_LOCAL="Local";
+	private static final String REMOTE_PROTOCOL_STR_GLOBUS="Globus";
+	private static final String REMOTE_PROTOCOL_STR_UNICORE="Unicore";
+	private static final String REMOTE_PROTOCOL_STR_AMAZON_EC2="Amazon EC2";
+	private static final String REMOTE_PROTOCOL_STR_HADOOP="Hadoop";
+	
     
     public HostDescriptionDialog(XBayaEngine engine) {
     	this(engine,true,null);
@@ -96,18 +107,19 @@ public class HostDescriptionDialog exten
         addWindowListener(new WindowAdapter() {
             @Override
             public void windowOpened(WindowEvent arg0) {
-                if (isNewHost()) {
-					String baseName = "Host";
-					int i = 1;
-					String defaultName = baseName + i;
-					try {
-						while (getRegistry().getServiceDescription(defaultName) != null) {
-							defaultName = baseName + (++i);
-						}
-					} catch (Exception e) {
-					}
-					hostIdTextField.setText(defaultName);
-				}
+//                if (isNewHost()) {
+//					String baseName = "Host";
+//					int i = 1;
+//					String defaultName = baseName + i;
+//					try {
+//						while (getRegistry().getServiceDescription(defaultName) != null) {
+//							defaultName = baseName + (++i);
+//						}
+//					} catch (Exception e) {
+//						e.printStackTrace();
+//					}
+//					hostIdTextField.setText(defaultName);
+//				}
             }
         });
         setRegistry(engine.getConfiguration().getJcrComponentRegistry().getRegistry());
@@ -154,12 +166,21 @@ public class HostDescriptionDialog exten
     private void setGridFTPEPR(String epr) {
         ((GlobusHostType)hostDescription.getType()).addGridFTPEndPoint(epr);
     }
+    
+    private GridPanel createPanelWithMessage(String message){
+    	GridPanel gridPanel = new GridPanel();
+    	JLabel lblMessage = new JLabel(message, SwingConstants.CENTER);
+		gridPanel.add(lblMessage);
+		lblMessage.setFont(new Font("Tahoma", Font.ITALIC, 11));
+    	gridPanel.layout(1,1, 0,0);
+    	return gridPanel;
+    }
 
     /**
      * Initializes the GUI.
      */
     private void initGUI() {
-    	setBounds(100, 100, 400, 330);
+    	setBounds(100, 100, 400, 350);
     	setModal(true);
         setLocationRelativeTo(null);
         if (isNewHost()) {
@@ -169,18 +190,19 @@ public class HostDescriptionDialog exten
 		}
 		this.hostIdTextField = new XBayaTextField();
         this.hostAddressTextField = new XBayaTextField();
-        this.globusGateKeeperTextField = new XBayaTextField();
-        this.GridFTPTextField = new XBayaTextField();
 
         XBayaLabel hostIdLabel = new XBayaLabel("Host ID", this.hostIdTextField);
         XBayaLabel hostAddressLabel = new XBayaLabel("Host Address", this.hostAddressTextField);
-        globusGateKeeperLabel = new XBayaLabel("Globus Gate Keeper Endpoint", this.globusGateKeeperTextField);
-        gridFTPLabel = new XBayaLabel("Grid FTP Endpoint", this.GridFTPTextField);
-        chkGobusHost=new JCheckBox("Define this host as a Globus host");
-        chkGobusHost.addActionListener(new ActionListener() {
+        cmbResourceProtocol = new JComboBox(new String[]{REMOTE_PROTOCOL_STR_LOCAL,REMOTE_PROTOCOL_STR_GLOBUS,REMOTE_PROTOCOL_STR_UNICORE,REMOTE_PROTOCOL_STR_AMAZON_EC2,
REMOTE_PROTOCOL_STR_HADOOP});
+        JLabel lblResourceProtocol = new JLabel("Resource Protocol");
+        GridPanel pnlResourceProtocolSelection=new GridPanel();
+        pnlResourceProtocolSelection.add(lblResourceProtocol);
+        pnlResourceProtocolSelection.add(cmbResourceProtocol);
+        pnlResourceProtocolSelection.layout(1, 2, 0, 1);
+        cmbResourceProtocol.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent arg0) {
-                updateGlobusHostTypeAndControls();
+                updateRemoteProtocolTypeAndControls();
             }
         });
         hostIdTextField.getSwingComponent().addKeyListener(new KeyAdapter() {
@@ -200,19 +222,16 @@ public class HostDescriptionDialog exten
         infoPanel1.add(this.hostIdTextField);
         infoPanel1.add(hostAddressLabel);
         infoPanel1.add(this.hostAddressTextField);
-        infoPanel1.add(chkGobusHost);
-        GridPanel infoPanel2 = new GridPanel();
-        infoPanel2.add(globusGateKeeperLabel);
-        infoPanel2.add(globusGateKeeperTextField);
-        infoPanel2.add(gridFTPLabel);
-        infoPanel2.add(GridFTPTextField);
+//        infoPanel1.add(chkGobusHost);
+        infoPanel2 = new GridPanel();
+        infoPanel2.add(createPanelWithMessage("Initializing..."));
         SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE,
1);
-        SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE,
1);
+        SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE,
1);
 
         GridPanel infoPanel = new GridPanel();
 
         infoPanel.add(infoPanel1);
-        infoPanel.add(chkGobusHost);
+        infoPanel.add(pnlResourceProtocolSelection);
         infoPanel.add(infoPanel2);
         infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
         SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 3, 1, SwingUtil.WEIGHT_NONE,
0);
@@ -250,8 +269,8 @@ public class HostDescriptionDialog exten
         SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
         
         getRootPane().setDefaultButton(okButton);
-        chkGobusHost.setSelected(false);
-        updateGlobusHostTypeAndControls();
+        cmbResourceProtocol.setSelectedIndex(0);
+        updateRemoteProtocolTypeAndControls();
         if (!isNewHost()) {
 			loadData();
 		}
@@ -259,8 +278,24 @@ public class HostDescriptionDialog exten
 //        SwingUtil.addPlaceHolder(hostAddressTextField.getSwingComponent(), "[a valid host
address, eg: myhost.com, 127.0.0.1]");
 //        SwingUtil.addPlaceHolder(GridFTPTextField.getSwingComponent(), "[List of grid ftp
endpoints]");
 //        SwingUtil.addPlaceHolder(globusGateKeeperTextField.getSwingComponent(), "[List
of globus gate keeper endpoints]");
+        updateDialogStatus();
     }
 
+	private GridPanel createGlobusRemoteProtocolPanel() {
+		GridPanel globusPanel = new GridPanel();
+        this.GridFTPTextField = new XBayaTextField();
+        this.globusGateKeeperTextField = new XBayaTextField();
+        globusGateKeeperLabel = new XBayaLabel("Globus Gate Keeper Endpoint", this.globusGateKeeperTextField);
       
+        gridFTPLabel = new XBayaLabel("Grid FTP Endpoint", this.GridFTPTextField);
+        globusPanel.add(globusGateKeeperLabel);
+        globusPanel.add(globusGateKeeperTextField);
+        globusPanel.add(gridFTPLabel);
+        globusPanel.add(GridFTPTextField);
+//        globusPanel.getContentPanel().setBorder(BorderFactory.createEtchedBorder());
+        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE,
1);
+        return globusPanel;
+	}
+
     private String arrayToString(String[] list) {
     	String result="";
 		for (String s : list) {
@@ -277,13 +312,13 @@ public class HostDescriptionDialog exten
     	hostIdTextField.setText(t.getHostName());
 		hostAddressTextField.setText(t.getHostAddress());
 		boolean isGlobus = t instanceof GlobusHostType;
-		chkGobusHost.setSelected(isGlobus);
 		if (isGlobus){
+			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_GLOBUS);
 			globusGateKeeperTextField.setText(arrayToString(((GlobusHostType) t).getGlobusGateKeeperEndPointArray()));
 			GridFTPTextField.setText(arrayToString(((GlobusHostType) t).getGridFTPEndPointArray()));
 		}
 		hostIdTextField.setEditable(isNewHost());
-		updateGlobusHostTypeAndControls();
+		updateRemoteProtocolTypeAndControls();
 	}
     
     public String getHostId() {
@@ -381,17 +416,24 @@ public class HostDescriptionDialog exten
     public void setRegistry(AiravataRegistry registry) {
         this.registry = registry;
     }
-
-	private void updateGlobusHostTypeAndControls() {
-		if(chkGobusHost.isSelected()) {
-			getHostDescription().getType().changeType(GlobusHostType.type);
-		}else{
-			getHostDescription().getType().changeType(HostDescriptionType.type);
+    String previousProtocol=null;
+	private void updateRemoteProtocolTypeAndControls() {
+		String selectedProtocol=cmbResourceProtocol.getSelectedItem().toString();
+		if (previousProtocol==null || !previousProtocol.equals(selectedProtocol)){
+			infoPanel2.getContentPanel().removeAll();
+			if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_LOCAL)){
+				getHostDescription().getType().changeType(HostDescriptionType.type);
+				infoPanel2.add(createPanelWithMessage("No configurations for remote protocol '"+REMOTE_PROTOCOL_STR_LOCAL+"'"));
+			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_GLOBUS)){
+				getHostDescription().getType().changeType(GlobusHostType.type);
+				infoPanel2.add(createGlobusRemoteProtocolPanel());
+			}else{
+				infoPanel2.add(createPanelWithMessage("Remote protocol '"+selectedProtocol+"' is not
supported yet."));
+			}
+			infoPanel2.getContentPanel().setBorder(BorderFactory.createEtchedBorder());
+			infoPanel2.getContentPanel().updateUI();
+			infoPanel2.layout(1, 1,0,0);
 		}
-		globusGateKeeperLabel.getSwingComponent().setEnabled(isGlobusHostType());
-		globusGateKeeperTextField.setEnabled(isGlobusHostType());
-		gridFTPLabel.getSwingComponent().setEnabled(isGlobusHostType());
-		GridFTPTextField.setEnabled(isGlobusHostType());
 	}
 
 	public boolean isNewHost() {

Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java?rev=1355100&r1=1355099&r2=1355100&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java
(original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java
Thu Jun 28 18:39:11 2012
@@ -57,8 +57,6 @@ import org.apache.airavata.xbaya.util.XB
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.sun.corba.se.spi.legacy.connection.GetEndPointInfoAgainException;
-
 public class XBayaMenuItem implements XBayaExecutionModeListener {
 
     private static final Logger logger = LoggerFactory.getLogger(XBayaMenuItem.class);
@@ -186,18 +184,21 @@ public class XBayaMenuItem implements XB
         
         xbayaMenuItem = new JMenu("XBaya");
         xbayaMenuItem.setMnemonic(KeyEvent.VK_X);
-        JMenu newMenu = new JMenu("New");
-	        newMenu.add(newWorkflowTabItem);
-	        newMenu.addSeparator();
-	        
-	        newMenu.add(this.registerApplicationDesc);
-	        newMenu.addSeparator();
-	        JMenu regAddSubMenuItem = new JMenu("Registry additions");
-	        newMenu.add(regAddSubMenuItem);
-	        regAddSubMenuItem.add(this.registerHostDesc);
-	        regAddSubMenuItem.add(this.registerServiceDesc);
-	        
-        xbayaMenuItem.add(newMenu);
+//        JMenu newMenu = new JMenu("New");
+//	        newMenu.add(newWorkflowTabItem);
+//	        newMenu.addSeparator();
+//	        
+//	        newMenu.add(this.registerApplicationDesc);
+//	        newMenu.addSeparator();
+//	        JMenu regAddSubMenuItem = new JMenu("Registry additions");
+//	        newMenu.add(regAddSubMenuItem);
+//	        regAddSubMenuItem.add(this.registerHostDesc);
+//	        regAddSubMenuItem.add(this.registerServiceDesc);
+//	        
+//        xbayaMenuItem.add(newMenu);
+        xbayaMenuItem.add(newWorkflowTabItem);
+        xbayaMenuItem.add(registerHostDesc);
+        xbayaMenuItem.add(registerApplicationDesc);
         xbayaMenuItem.add(this.openWorkflowItem);
         
         xbayaMenuItem.addSeparator();
@@ -322,7 +323,7 @@ public class XBayaMenuItem implements XB
     }
 
     private void createRegisterApplicationDesc() {
-        this.registerApplicationDesc = new JMenuItem("Application Description...");
+        this.registerApplicationDesc = new JMenuItem("Add application...");
 
         this.registerApplicationDesc.addActionListener(new AbstractAction() {
 			private static final long serialVersionUID = 1L;
@@ -332,6 +333,7 @@ public class XBayaMenuItem implements XB
                     try {
                         ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(
                                 engine);
+        	    		applicationDescriptionDialog.setLocationRelativeTo(engine.getGUI().getFrame());
                         applicationDescriptionDialog.open();
                     } catch (Exception e1) {
                         engine.getGUI().getErrorWindow().error(e1);
@@ -343,7 +345,7 @@ public class XBayaMenuItem implements XB
     }
 
     private void createRegisterHostDesc() {
-        this.registerHostDesc = new JMenuItem("Host Description...");
+        this.registerHostDesc = new JMenuItem("Add Host...");
 
         this.registerHostDesc.addActionListener(new AbstractAction() {
 			private static final long serialVersionUID = 1L;
@@ -363,7 +365,7 @@ public class XBayaMenuItem implements XB
 
     }
     private JMenuItem createClearWorkflowItem() {
-        JMenuItem menuItem = new JMenuItem("Clear Workflow");
+        JMenuItem menuItem = new JMenuItem("Clear workflow");
         menuItem.addActionListener(new AbstractAction() {
 			private static final long serialVersionUID = 1L;
 			public void actionPerformed(ActionEvent e) {
@@ -375,7 +377,7 @@ public class XBayaMenuItem implements XB
 
     private JMenuItem createNewWorkflowTabMenuItem() {
         
-		JMenuItem menuItem = new JMenuItem("Workflow", MenuIcons.NEW_ICON);
+		JMenuItem menuItem = new JMenuItem("New workflow", MenuIcons.NEW_ICON);
         menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
         AbstractAction action = new AbstractAction() {
 			private static final long serialVersionUID = 1L;



Mime
View raw message