You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/07/12 00:21:26 UTC
[13/20] updating xbaya gui to the new airavata
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
deleted file mode 100644
index 9203e01..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JTree;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public abstract class AbstractAiravataTreeNode implements TreeNode {
-
- private TreeNode parent;
- private Color backgroundSelectionColor;
- private DefaultTreeCellRenderer defaultCellRenderer = new DefaultTreeCellRenderer();
- private List<TreeNode> children;
-
- public AbstractAiravataTreeNode(TreeNode parent) {
- setParent(parent);
- }
-
- protected XBayaEngine getXBayaEngine(){
- TreeNode root=getRootNode();
- if (root instanceof RegistryNode){
- return ((RegistryNode)root).getEngine();
- }
- return null;
- }
-
- @SuppressWarnings("rawtypes")
- @Override
- public Enumeration children() {
- this.children = listOfChildren();
- Collections.enumeration(children);
- return Collections.enumeration(children);
- }
-
- protected abstract List<TreeNode> getChildren();
-
- private List<TreeNode> listOfChildren() {
- children = (children == null) ? getChildren() : children;
- return children;
- }
-
- @Override
- public boolean getAllowsChildren() {
- return listOfChildren().size() > 0;
- }
-
- @Override
- public TreeNode getChildAt(int index) {
- return listOfChildren().get(index);
- }
-
- @Override
- public int getChildCount() {
- return listOfChildren().size();
- }
-
- @Override
- public int getIndex(TreeNode node) {
- return listOfChildren().indexOf(node);
- }
-
- @Override
- public TreeNode getParent() {
- return parent;
- }
-
- @Override
- public boolean isLeaf() {
- return listOfChildren().size() == 0;
- }
-
- public void setParent(TreeNode parent) {
- this.parent = parent;
- }
-
- public abstract String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus);
-
- public abstract Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus);
-
- public void setBackgroundSelectionColor(Color c) {
- backgroundSelectionColor = c;
- }
-
- public Color getBackgroundSelectionColor() {
- return backgroundSelectionColor;
- }
-
- public Component getNodeComponent(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return null;
- }
-
- public Component getNodeComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf,
- int row, boolean hasFocus) {
- Component nodeComponent = getNodeComponent(selected, expanded, leaf, hasFocus);
- if (nodeComponent == null) {
- nodeComponent = getDefaultCellRenderer().getTreeCellRendererComponent(tree, value, selected, expanded,
- leaf, row, hasFocus);
- if (nodeComponent instanceof JLabel) {
- JLabel lbl = (JLabel) nodeComponent;
- lbl.setText(getCaption(selected, expanded, leaf, hasFocus));
- lbl.setIcon(getIcon(selected, expanded, leaf, hasFocus));
- }
- }
- return nodeComponent;
- }
-
- protected DefaultTreeCellRenderer getDefaultCellRenderer() {
- return defaultCellRenderer;
- }
-
- protected List<TreeNode> getTreeNodeList(Object[] list, TreeNode parent) {
- List<TreeNode> nodes = new ArrayList<TreeNode>();
- for (Object o : list) {
- nodes.add(AiravataTreeNodeFactory.getTreeNode(o, parent));
- }
- return nodes;
- }
-
- protected List<TreeNode> emptyList() {
- return new ArrayList<TreeNode>();
- }
-
- public void refresh() {
- this.children = null;
- }
-
- public abstract List<String> getSupportedActions();
-
- public String getDefaultAction() {
- return null;
- }
-
- public boolean isActionSupported(AbstractBrowserActionItem action) {
- return getSupportedActions().contains(action.getID());
- }
-
- public boolean triggerAction(JTree tree, String action) throws Exception {
- return triggerAction(tree, action, false);
- }
-
- public boolean triggerAction(JTree tree, String action, boolean force) throws Exception {
- if (action.equals(RefreshAction.ID)) {
- refresh();
- ((DefaultTreeModel) tree.getModel()).reload(this);
- return true;
- }
- return false;
- }
-
- protected TreeNode getRootNode() {
- TreeNode rootNode = this;
- while (rootNode.getParent() != null) {
- rootNode = rootNode.getParent();
- }
- return rootNode;
- }
-
- public AiravataAPI getRegistry() {
- TreeNode rootNode = getRootNode();
- if (rootNode instanceof RegistryNode) {
- return ((RegistryNode) rootNode).getRegistry();
- }
- return null;
- }
-
- protected boolean askQuestion(String title, String question) {
- return JOptionPane.showConfirmDialog(null, question, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
- }
-
- protected void reloadTreeNode(JTree tree, TreeNode node) {
- TreePath selectionPath = tree.getSelectionPath();
- ((DefaultTreeModel) tree.getModel()).nodeChanged(node);
- ((DefaultTreeModel) tree.getModel()).reload(node);
- tree.expandPath(selectionPath);
- }
-
- public abstract String getActionCaption(AbstractBrowserActionItem action);
-
- public abstract Icon getActionIcon(AbstractBrowserActionItem action);
-
- public abstract String getActionDescription(AbstractBrowserActionItem action);
-
- protected String wrapAsHtml(String...data){
- String result="<html>";
- for (String item : data) {
- result+=item;
- }
- result+="</html>";
- return result;
- }
-
- public String createHTMLUrlTaggedString(String value) {
- String urledString = "";
- int lastIndex=0,index=0;
- while(index!=-1){
- index=value.toLowerCase().indexOf("://",lastIndex);
- if (index!=-1){
- int beginIndex=value.lastIndexOf(" ",index);
- urledString+=value.substring(lastIndex,beginIndex+1);
- int endIndex=value.indexOf(" ",index);
- if (beginIndex==-1){
- beginIndex=0;
- }else{
- beginIndex++;
- }
- if (endIndex==-1){
- endIndex=value.length();
- }
- String url=value.substring(beginIndex, endIndex);
- urledString+="<a href='"+url+"'>"+url+"</a>";
- lastIndex=endIndex;
- }
- }
- urledString+=value.substring(lastIndex, value.length());
- return urledString;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
deleted file mode 100644
index 6a3bf87..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class AiravataConfigurationsNode extends AbstractAiravataTreeNode {
- private AiravataConfigurations airavataConfigurations;
-
- public AiravataConfigurationsNode(AiravataConfigurations airavataConfigurations, TreeNode parent) {
- super(parent);
- setAiravataConfigurations(airavataConfigurations);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- List<Object> children=new ArrayList<Object>();
-// children.add(new GFacURLs(getRegistry()));
- children.add(new InterpreterServiceURLs(getRegistry()));
- children.add(new MessageBoxURLs(getRegistry()));
- children.add(new EventingServiceURLs(getRegistry()));
- return getTreeNodeList(children.toArray(), this);
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return "Airavata Configuration";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.AIRAVATA_CONFIG_ICON;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(RefreshAction.ID);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public AiravataConfigurations getAiravataConfigurations() {
- return airavataConfigurations;
- }
-
- public void setAiravataConfigurations(AiravataConfigurations airavataConfigurations) {
- this.airavataConfigurations = airavataConfigurations;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
deleted file mode 100644
index f62f538..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURL;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURL;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURL;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURL;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.NodeParameter;
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflow;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiment;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiments;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowNodeElement;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplate;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplates;
-
-public class AiravataTreeNodeFactory {
- public static TreeNode getTreeNode(Object o,TreeNode parent){
- if (o instanceof XBayaEngine){
- return new RegistryNode((XBayaEngine)o,parent);
- }else if (o instanceof AiravataConfigurations){
- return new AiravataConfigurationsNode((AiravataConfigurations)o,parent);
-// }else if (o instanceof GFacURLs){
-// return new GFacURLsNode((GFacURLs)o,parent);
- }else if (o instanceof GFacURL){
- return new GFacURLNode((GFacURL)o,parent);
- }else if (o instanceof InterpreterServiceURLs){
- return new InterpreterServiceURLsNode((InterpreterServiceURLs)o,parent);
- }else if (o instanceof InterpreterServiceURL){
- return new InterpreterServiceURLNode((InterpreterServiceURL)o,parent);
- }else if (o instanceof MessageBoxURLs){
- return new MessageBoxURLsNode((MessageBoxURLs)o,parent);
- }else if (o instanceof MessageBoxURL){
- return new MessageBoxURLNode((MessageBoxURL)o,parent);
- }else if (o instanceof EventingServiceURLs){
- return new EventingServiceURLsNode((EventingServiceURLs)o,parent);
- }else if (o instanceof EventingServiceURL){
- return new EventingServiceURLNode((EventingServiceURL)o,parent);
- }else if (o instanceof HostDescriptions){
- return new HostDescriptionsNode((HostDescriptions)o,parent);
- }else if (o instanceof HostDescription){
- return new HostDescriptionNode((HostDescription)o,parent);
- }else if (o instanceof ServiceDescriptions){
- return new ServiceDescriptionsNode((ServiceDescriptions)o,parent);
- }else if (o instanceof ServiceDescription){
- return new ServiceDescriptionNode((ServiceDescription)o,parent);
- }else if (o instanceof ApplicationDeploymentDescriptions){
- return new ApplicationDeploymentDescriptionsNode((ApplicationDeploymentDescriptions)o,parent);
- }else if (o instanceof ApplicationDeploymentDescriptionWrap){
- return new ApplicationDeploymentDescriptionNode((ApplicationDeploymentDescriptionWrap)o,parent);
- }else if (o instanceof XBayaWorkflowTemplates){
- return new XBayaWorkflowTemplatesNode((XBayaWorkflowTemplates)o,parent);
- }else if (o instanceof XBayaWorkflowTemplate){
- return new XBayaWorkflowTemplateNode((XBayaWorkflowTemplate)o,parent);
- }else if (o instanceof NodeParameter){
- return new ParameterNode((NodeParameter)o,parent);
- }else if (o instanceof InputParameters){
- return new InputParametersNode((InputParameters)o,parent);
- }else if (o instanceof OutputParameters){
- return new OutputParametersNode((OutputParameters)o,parent);
- }else if (o instanceof ServiceParameters){
- return new ParametersNode((ServiceParameters)o,parent);
- }else if (o instanceof XBayaWorkflowExperiments){
- return new XBayaWorkflowExperimentsNode((XBayaWorkflowExperiments)o,parent);
- }else if (o instanceof XBayaWorkflowExperiment){
- return new XBayaWorkflowExperimentNode((XBayaWorkflowExperiment)o,parent);
- }else if (o instanceof XBayaWorkflow){
- return new XBayaWorkflowNode((XBayaWorkflow)o,parent);
- }else if (o instanceof XBayaWorkflowNodeElement){
- return new XBayaWorkflowNodeElementNode((XBayaWorkflowNodeElement)o,parent);
- }else{
- return new DefaultMutableTreeNode(o);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
deleted file mode 100644
index 8a3d82a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
-
-public class ApplicationDeploymentDescriptionNode extends AbstractAiravataTreeNode {
- private ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap;
-
- public ApplicationDeploymentDescriptionNode(
- ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap, TreeNode parent) {
- super(parent);
- setApplicationDeploymentDescriptionWrap(applicationDeploymentDescriptionWrap);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- return emptyList();
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue();
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.APPLICATION_ICON;
- }
-
- public ApplicationDeploymentDescriptionWrap getApplicationDeploymentDescriptionWrap() {
- return applicationDeploymentDescriptionWrap;
- }
-
- public void setApplicationDeploymentDescriptionWrap(
- ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap) {
- this.applicationDeploymentDescriptionWrap = applicationDeploymentDescriptionWrap;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(DeleteAction.ID);
- }
-
-// @Override
-// public String getDefaultAction() {
-// return EditAction.ID;
-// }
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(DeleteAction.ID)) {
- return deleteApplicationDescription(tree);
- } else if (action.equals(EditAction.ID)) {
- return editDescriptor(tree);
- }
- return super.triggerAction(tree, action);
- }
-
- private boolean editDescriptor(JTree tree) {
- ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(getXBayaEngine(),false,getApplicationDeploymentDescriptionWrap().getDescription(),getApplicationDeploymentDescriptionWrap().getHost(),getApplicationDeploymentDescriptionWrap().getService());
- applicationDescriptionDialog.open();
- if (applicationDescriptionDialog.isApplicationDescCreated()) {
- refresh();
- reloadTreeNode(tree, this);
- }
- return true;
- }
-
- private boolean deleteApplicationDescription(JTree tree) throws AiravataAPIInvocationException {
- if (askQuestion("Application description",
- "Are you sure that you want to remove the application description \""
- + getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue() + "\"?")) {
- getRegistry().getApplicationManager().deleteApplicationDescription(getApplicationDeploymentDescriptionWrap().getService(),
- getApplicationDeploymentDescriptionWrap().getHost(),
- getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue());
- ((AbstractAiravataTreeNode) getParent()).refresh();
- reloadTreeNode(tree, getParent());
- }
- return true;
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(DeleteAction.ID)) {
- return "Remove";
- } else if (action.getID().equals(EditAction.ID)) {
- return "View/Edit";
- }
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
deleted file mode 100644
index 5d58fe9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
-
-public class ApplicationDeploymentDescriptionsNode extends AbstractAiravataTreeNode {
- private ApplicationDeploymentDescriptions applicationDeploymentDescriptions;
-
- public ApplicationDeploymentDescriptionsNode(ApplicationDeploymentDescriptions applicationDeploymentDescriptions,
- TreeNode parent) {
- super(parent);
- setApplicationDeploymentDescriptions(applicationDeploymentDescriptions);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- try {
- return getTreeNodeList(getApplicationDeploymentDescriptions().getDescriptions().toArray(), this);
- } catch (AiravataAPIInvocationException e) {
- e.printStackTrace();
- return emptyList();
- } catch (RegistryException e) {
- e.printStackTrace();
- return emptyList();
- }
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return "Deployments";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.APPLICATIONS_ICON;
- }
-
- public ApplicationDeploymentDescriptions getApplicationDeploymentDescriptions() {
- return applicationDeploymentDescriptions;
- }
-
- public void setApplicationDeploymentDescriptions(ApplicationDeploymentDescriptions applicationDeploymentDescriptions) {
- this.applicationDeploymentDescriptions = applicationDeploymentDescriptions;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(RefreshAction.ID, DeleteAction.ID);
- }
-
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(DeleteAction.ID)) {
- deleteApplicationDescription(tree);
- return true;
- } else if (action.equals(AddAction.ID)) {
- ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(getXBayaEngine());
- applicationDescriptionDialog.open();
- if (applicationDescriptionDialog.isApplicationDescCreated()) {
- refresh();
- reloadTreeNode(tree, this);
- }
- return true;
- }
- return super.triggerAction(tree, action);
- }
-
- private void deleteApplicationDescription(JTree tree) throws Exception {
- if (askQuestion("Application descriptions",
- "Are you sure that you want to remove all application descriptions in this registry?")) {
- AiravataAPI airavataAPI = getRegistry();
- List<ApplicationDeploymentDescriptionWrap> descriptions = getApplicationDeploymentDescriptions()
- .getDescriptions();
- for (ApplicationDeploymentDescriptionWrap descriptionWrap : descriptions) {
- airavataAPI.getApplicationManager().removeApplicationDescriptor(descriptionWrap.getService(), descriptionWrap.getHost(),
- descriptionWrap.getDescription().getType().getApplicationName().getStringValue());
- }
- refresh();
- reloadTreeNode(tree, this);
- }
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(DeleteAction.ID)) {
- return "Remove all applications";
- } else if (action.getID().equals(AddAction.ID)) {
- return "New application...";
- }
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
deleted file mode 100644
index f762efe..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class EventingServiceURLNode extends AbstractAiravataTreeNode {
- private EventingServiceURL eventingServiceURL;
-
- public EventingServiceURLNode(EventingServiceURL eventingServiceURL, TreeNode parent) {
- super(parent);
- setEventingServiceURL(eventingServiceURL);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- return emptyList();
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return getEventingServiceURL().getEventingServiceURL().toString();
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.GFAC_URL_ICON;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(CopyAction.ID);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(CopyAction.ID)) {
- return "Copy to clipboard";
- }
- return null;
- }
-
- @Override
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(CopyAction.ID)) {
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getEventingServiceURL().getEventingServiceURL().toString()), null);
- }
- return super.triggerAction(tree, action);
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public EventingServiceURL getEventingServiceURL() {
- return eventingServiceURL;
- }
-
- public void setEventingServiceURL(EventingServiceURL eventingServiceURL) {
- this.eventingServiceURL = eventingServiceURL;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
deleted file mode 100644
index 336e817..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class EventingServiceURLsNode extends AbstractAiravataTreeNode {
- private EventingServiceURLs eventingServiceURLs;
-
- public EventingServiceURLsNode(EventingServiceURLs eventingServiceURLs, TreeNode parent) {
- super(parent);
- setEventingServiceURLs(eventingServiceURLs);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- try {
- return getTreeNodeList(getEventingServiceURLs().getURLS().toArray(), this);
- } catch (AiravataAPIInvocationException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return "Eventing Services";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.GFAC_URLS_ICON;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(RefreshAction.ID);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public EventingServiceURLs getEventingServiceURLs() {
- return eventingServiceURLs;
- }
-
- public void setEventingServiceURLs(EventingServiceURLs eventingServiceURLs) {
- this.eventingServiceURLs = eventingServiceURLs;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
deleted file mode 100644
index 4270c29..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class GFacURLNode extends AbstractAiravataTreeNode {
- private GFacURL gfacURL;
-
- public GFacURLNode(GFacURL gfacURL, TreeNode parent) {
- super(parent);
- setGfacURL(gfacURL);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- return emptyList();
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return getGfacURL().getGfacURL().toString();
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.GFAC_URL_ICON;
- }
-
- public GFacURL getGfacURL() {
- return gfacURL;
- }
-
- public void setGfacURL(GFacURL gfacURL) {
- this.gfacURL = gfacURL;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(CopyAction.ID);
- }
-
- @Override
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(CopyAction.ID)) {
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getGfacURL().getGfacURL().toString()), null);
- }
- return super.triggerAction(tree, action);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(CopyAction.ID)) {
- return "Copy to clipboard";
- }
- return null;
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
deleted file mode 100644
index 97b18c7..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class GFacURLsNode{
-// extends AbstractAiravataTreeNode {
-// private GFacURLs gfacURLs;
-//
-// public GFacURLsNode(GFacURLs gfacURLs, TreeNode parent) {
-// super(parent);
-// setGfacURLs(gfacURLs);
-// }
-//
-// @Override
-// protected List<TreeNode> getChildren() {
-// try {
-// return getTreeNodeList(getGfacURLs().getURLS().toArray(), this);
-// } catch (AiravataAPIInvocationException e) {
-// e.printStackTrace();
-// }
-// return null;
-// }
-//
-// @Override
-// public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-// return "GFac Locations";
-// }
-//
-// @Override
-// public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-// return JCRBrowserIcons.GFAC_URLS_ICON;
-// }
-//
-// public GFacURLs getGfacURLs() {
-// return gfacURLs;
-// }
-//
-// public void setGfacURLs(GFacURLs gfacURLs) {
-// this.gfacURLs = gfacURLs;
-// }
-//
-// @Override
-// public List<String> getSupportedActions() {
-// return Arrays.asList(RefreshAction.ID);
-// }
-//
-// @Override
-// public String getActionCaption(AbstractBrowserActionItem action) {
-// return action.getDefaultCaption();
-// }
-//
-// @Override
-// public Icon getActionIcon(AbstractBrowserActionItem action) {
-// return null;
-// }
-//
-// @Override
-// public String getActionDescription(AbstractBrowserActionItem action) {
-// return null;
-// }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
deleted file mode 100644
index 2fba319..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDescriptionDialog;
-
-public class HostDescriptionNode extends AbstractAiravataTreeNode {
- private HostDescription hostDescription;
-
- public HostDescriptionNode(HostDescription hostDescription, TreeNode parent) {
- super(parent);
- setHostDescription(hostDescription);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- return emptyList();
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return getHostDescription().getType().getHostName();
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.HOST_ICON;
- }
-
- public HostDescription getHostDescription() {
- return hostDescription;
- }
-
- public void setHostDescription(HostDescription hostDescription) {
- this.hostDescription = hostDescription;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(EditAction.ID, DeleteAction.ID);
- }
-
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(DeleteAction.ID)) {
- return deleteHostDescription(tree);
- } else if (action.equals(EditAction.ID)) {
- return editHostDescription(tree);
- }
- return super.triggerAction(tree, action);
- }
-
- @Override
- public String getDefaultAction() {
- return EditAction.ID;
- }
-
- private boolean editHostDescription(JTree tree) {
- HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getXBayaEngine().getConfiguration().getAiravataAPI(),false,getHostDescription(), null);
- hostDescriptionDialog.open();
- if (hostDescriptionDialog.isHostCreated()) {
- refresh();
- reloadTreeNode(tree, this);
- }
- return true;
- }
-
- private boolean deleteHostDescription(JTree tree) throws AiravataAPIInvocationException {
- if (askQuestion("Host description", "Are you sure that you want to remove the host description \""
- + getHostDescription().getType().getHostName() + "\"?")) {
- getRegistry().getApplicationManager().deleteHostDescription(getHostDescription().getType().getHostName());
- ((AbstractAiravataTreeNode) getParent()).refresh();
- reloadTreeNode(tree, getParent());
- }
- return true;
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(DeleteAction.ID)) {
- return "Remove";
- } else if (action.getID().equals(EditAction.ID)) {
- return "View/Edit";
- }
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
deleted file mode 100644
index 525c15b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDescriptionDialog;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class HostDescriptionsNode extends AbstractAiravataTreeNode {
- private HostDescriptions hostDescriptions;
-
- public HostDescriptionsNode(HostDescriptions hostDescriptions, TreeNode parent) {
- super(parent);
- setHostDescriptions(hostDescriptions);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- try {
- return getTreeNodeList(getHostDescriptions().getDescriptions().toArray(), this);
- } catch (AiravataAPIInvocationException e) {
- e.printStackTrace();
- return emptyList();
- }
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return "Hosts";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.HOSTS_ICON;
- }
-
- public HostDescriptions getHostDescriptions() {
- return hostDescriptions;
- }
-
- public void setHostDescriptions(HostDescriptions hostDescriptions) {
- this.hostDescriptions = hostDescriptions;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(AddAction.ID, RefreshAction.ID, DeleteAction.ID);
- }
-
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(DeleteAction.ID)) {
- deleteHostDescription(tree);
- return true;
- } else if (action.equals(AddAction.ID)) {
- HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getXBayaEngine().getConfiguration().getAiravataAPI(), null);
- hostDescriptionDialog.open();
- if (hostDescriptionDialog.isHostCreated()) {
- refresh();
- reloadTreeNode(tree, this);
- }
- return true;
- }
- return super.triggerAction(tree, action);
- }
-
- private void deleteHostDescription(JTree tree) throws Exception {
- if (askQuestion("Host descriptions",
- "Are you sure that you want to remove all host descriptions in this registry?")) {
- AiravataAPI registry = getRegistry();
- List<HostDescription> descriptions = getHostDescriptions().getDescriptions();
- for (HostDescription descriptionWrap : descriptions) {
- registry.getApplicationManager().removeHostDescriptor(descriptionWrap.getType().getHostName());
- }
- refresh();
- reloadTreeNode(tree, this);
- }
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(DeleteAction.ID)) {
- return "Remove all hosts";
- } else if (action.getID().equals(AddAction.ID)) {
- return "New host...";
- }
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
deleted file mode 100644
index 4116fcb..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
-
-public class InputParametersNode extends ParametersNode {
-
- public InputParametersNode(InputParameters parameters, TreeNode parent) {
- super(parameters, parent);
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf,
- boolean hasFocus) {
- return "Input";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
- boolean hasFocus) {
- return JCRBrowserIcons.INPUT_PARAMETERS_ICON;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
deleted file mode 100644
index eb595e7..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class InterpreterServiceURLNode extends AbstractAiravataTreeNode {
- private InterpreterServiceURL interpreterServiceURL;
-
- public InterpreterServiceURLNode(InterpreterServiceURL interpreterServiceURL, TreeNode parent) {
- super(parent);
- setInterpreterServiceURL(interpreterServiceURL);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- return emptyList();
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return getInterpreterServiceURL().getInterpreterServiceURL().toString();
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.GFAC_URL_ICON;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(CopyAction.ID);
- }
-
- @Override
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(CopyAction.ID)) {
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getInterpreterServiceURL().getInterpreterServiceURL().toString()), null);
- }
- return super.triggerAction(tree, action);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(CopyAction.ID)) {
- return "Copy to clipboard";
- }
- return null;
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public InterpreterServiceURL getInterpreterServiceURL() {
- return interpreterServiceURL;
- }
-
- public void setInterpreterServiceURL(InterpreterServiceURL interpreterServiceURL) {
- this.interpreterServiceURL = interpreterServiceURL;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
deleted file mode 100644
index 1835dde..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class InterpreterServiceURLsNode extends AbstractAiravataTreeNode {
- private InterpreterServiceURLs interpreterServiceURLs;
-
- public InterpreterServiceURLsNode(InterpreterServiceURLs interpreterServiceURLs, TreeNode parent) {
- super(parent);
- setInterpreterServiceURLs(interpreterServiceURLs);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- try {
- return getTreeNodeList(getInterpreterServiceURLs().getURLS().toArray(), this);
- } catch (AiravataAPIInvocationException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return "Interpreter Servers";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.GFAC_URLS_ICON;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(RefreshAction.ID);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public InterpreterServiceURLs getInterpreterServiceURLs() {
- return interpreterServiceURLs;
- }
-
- public void setInterpreterServiceURLs(InterpreterServiceURLs interpreterServiceURLs) {
- this.interpreterServiceURLs = interpreterServiceURLs;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
deleted file mode 100644
index 17b7be2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.Icon;
-
-import org.apache.airavata.common.utils.SwingUtil;
-
-public class JCRBrowserIcons {
- public static final Icon APPLICATION_ICON=SwingUtil.createImageIcon("application.png");
- public static final Icon APPLICATIONS_ICON=SwingUtil.createImageIcon("applications.png");
- public static final Icon REGISTRY_ICON=SwingUtil.createImageIcon("jcr-repo.png");
- public static final Icon AIRAVATA_CONFIG_ICON=SwingUtil.createImageIcon("airavata-config.png");
- public static final Icon GFAC_URLS_ICON=SwingUtil.createImageIcon("gfac_urls.png");
- public static final Icon GFAC_URL_ICON=SwingUtil.createImageIcon("gfac_url.png");
- public static final Icon HOST_ICON=SwingUtil.createImageIcon("host.png");
- public static final Icon HOSTS_ICON=SwingUtil.createImageIcon("hosts.png");
- public static final Icon INPUT_PARAMETERS_ICON=SwingUtil.createImageIcon("input_para.png");
- public static final Icon OUTPUT_PARAMETERS_ICON=SwingUtil.createImageIcon("output_para.png");
- public static final Icon PARAMETER_ICON=SwingUtil.createImageIcon("parameter.png");
- public static final Icon PARAMETERS_ICON=SwingUtil.createImageIcon("parameter.png");
- public static final Icon PARAMETER_VALUE_ICON=SwingUtil.createImageIcon("parameter.png");
- public static final Icon SERVICE_ICON=SwingUtil.createImageIcon("service.png");
- public static final Icon SERVICES_ICON=SwingUtil.createImageIcon("services.png");
- public static final Icon WORKFLOW_EXPERIMENT_ICON=SwingUtil.createImageIcon("experiment.png");
- public static final Icon WORKFLOW_EXPERIMENTS_ICON=SwingUtil.createImageIcon("experiments.png");
- public static final Icon WORKFLOW_ICON=SwingUtil.createImageIcon("workflow.png");
- public static final Icon WORKFLOW_SERVICE_ICON=SwingUtil.createImageIcon("service.png");
- public static final Icon WORKFLOW_TEMPLATE_ICON=SwingUtil.createImageIcon("workflow.png");
- public static final Icon WORKFLOW_TEMPLATES_ICON=SwingUtil.createImageIcon("workflow_templates.png");
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
deleted file mode 100644
index 23a9c37..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class MessageBoxURLNode extends AbstractAiravataTreeNode {
- private MessageBoxURL messageBoxURL;
-
- public MessageBoxURLNode(MessageBoxURL messageBoxURL, TreeNode parent) {
- super(parent);
- setMessageBoxURL(messageBoxURL);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- return emptyList();
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return getMessageBoxURL().getMessageBoxURL().toString();
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.GFAC_URL_ICON;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(CopyAction.ID);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(CopyAction.ID)) {
- return "Copy to clipboard";
- }
- return null;
- }
-
- @Override
- public boolean triggerAction(JTree tree, String action) throws Exception {
- if (action.equals(CopyAction.ID)) {
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getMessageBoxURL().getMessageBoxURL().toString()), null);
- }
- return super.triggerAction(tree, action);
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public MessageBoxURL getMessageBoxURL() {
- return messageBoxURL;
- }
-
- public void setMessageBoxURL(MessageBoxURL messageBoxURL) {
- this.messageBoxURL = messageBoxURL;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
deleted file mode 100644
index 5f521d3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class MessageBoxURLsNode extends AbstractAiravataTreeNode {
- private MessageBoxURLs messageBoxURLs;
-
- public MessageBoxURLsNode(MessageBoxURLs messageBoxURLs, TreeNode parent) {
- super(parent);
- setMessageBoxURLs(messageBoxURLs);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- try {
- return getTreeNodeList(getMessageBoxURLs().getURLS().toArray(), this);
- } catch (AiravataAPIInvocationException e) {
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return "Message Boxes";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
- return JCRBrowserIcons.GFAC_URLS_ICON;
- }
-
- @Override
- public List<String> getSupportedActions() {
- return Arrays.asList(RefreshAction.ID);
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- return action.getDefaultCaption();
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public MessageBoxURLs getMessageBoxURLs() {
- return messageBoxURLs;
- }
-
- public void setMessageBoxURLs(MessageBoxURLs messageBoxURLs) {
- this.messageBoxURLs = messageBoxURLs;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
deleted file mode 100644
index bed1a70..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
-
-public class OutputParametersNode extends ParametersNode {
-
- public OutputParametersNode(OutputParameters parameters, TreeNode parent) {
- super(parameters, parent);
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf,
- boolean hasFocus) {
- return "Output";
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
- boolean hasFocus) {
- return JCRBrowserIcons.OUTPUT_PARAMETERS_ICON;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3e6c815a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
deleted file mode 100644
index 5ce637f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.common.utils.BrowserLauncher;
-import org.apache.airavata.xbaya.model.registrybrowser.NodeParameter;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.BrowserAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.ViewAction;
-import org.apache.airavata.xbaya.ui.dialogs.TextWindow;
-
-public class ParameterNode extends AbstractAiravataTreeNode {
- private NodeParameter parameter;
-
- public ParameterNode(NodeParameter parameter, TreeNode parent) {
- super(parent);
- setParameter(parameter);
- }
-
- @Override
- protected List<TreeNode> getChildren() {
- return emptyList();
- }
-
- @Override
- public String getCaption(boolean selected, boolean expanded, boolean leaf,
- boolean hasFocus) {
- if (getParameter().getValue()!=null){
- String parameterValue = getParameter().getValue().toString();
- if (parameterValue.length()>200){
- parameterValue=parameterValue.substring(0, 200)+"...";
- }
- return wrapAsHtml("<b>"+getParameter().getName()+"</b>",": ",""+parameterValue+"");
- }else{
- return getParameter().getName();
- }
- }
-
- @Override
- public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
- boolean hasFocus) {
- return JCRBrowserIcons.PARAMETER_ICON;
- }
-
- @Override
- public String getDefaultAction() {
- return ViewAction.ID;
- }
-
- @Override
- public List<String> getSupportedActions() {
- try {
- new URL(getParameter().getValue().toString());
- return Arrays.asList(ViewAction.ID,CopyAction.ID,BrowserAction.ID);
- } catch (MalformedURLException e) {
- //the content is not a proper url
- return Arrays.asList(ViewAction.ID,CopyAction.ID);
- }
- }
-
- @Override
- public String getActionCaption(AbstractBrowserActionItem action) {
- if (action.getID().equals(ViewAction.ID)) {
- return "View";
- } else if (action.getID().equals(CopyAction.ID)) {
- return "Copy to clipboard";
- } else if (action.getID().equals(BrowserAction.ID)) {
- return "Open in web browser...";
- }
- return null;
- }
-
- public boolean triggerAction(JTree tree,String action) throws Exception{
- String value = getParameter().getValue().toString();
- if (action.equals(ViewAction.ID)) {
- TextWindow textWindow = new TextWindow(getXBayaEngine(), getParameter().getName(), value,"Parameter Content");
- textWindow.show();
- } else if (action.equals(CopyAction.ID)) {
- Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(value), null);
- } else if (action.equals(BrowserAction.ID)) {
- BrowserLauncher.openURL(getParameter().getValue().toString());
- }
- return super.triggerAction(tree, action);
- }
-
- @Override
- public Icon getActionIcon(AbstractBrowserActionItem action) {
- return null;
- }
-
- @Override
- public String getActionDescription(AbstractBrowserActionItem action) {
- return null;
- }
-
- public NodeParameter getParameter() {
- return parameter;
- }
-
- public void setParameter(NodeParameter parameter) {
- this.parameter = parameter;
- }
-}
-