TAVERNA-963 Remove unused GUI code
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/commit/5bce4cb6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/tree/5bce4cb6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/diff/5bce4cb6 Branch: refs/heads/docker Commit: 5bce4cb650ae5d389e3082e959c65fca76e47ffd Parents: 71352f2 Author: Stian Soiland-Reyes <[email protected]> Authored: Wed May 4 01:03:36 2016 +0100 Committer: Stian Soiland-Reyes <[email protected]> Committed: Wed May 4 01:03:36 2016 +0100 ---------------------------------------------------------------------- .../externaltool/gui/AskUserForPwPopup.java | 74 -------------------- .../externaltool/gui/PleaseWaitDialog.java | 73 ------------------- 2 files changed, 147 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/5bce4cb6/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/AskUserForPwPopup.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/AskUserForPwPopup.java b/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/AskUserForPwPopup.java deleted file mode 100644 index 9dbe959..0000000 --- a/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/AskUserForPwPopup.java +++ /dev/null @@ -1,74 +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.taverna.activities.externaltool.gui; - -import javax.swing.JOptionPane; - -import org.apache.taverna.activities.externaltool.invocation.AskUserForPw; -import org.apache.taverna.activities.externaltool.ssh.SshNode; - -public final class AskUserForPwPopup implements AskUserForPw { - private SshNode ret; - private String pw, pp, kf, us; - - public static String ask(String message, String title) { - return (String) JOptionPane.showInputDialog(null, message, title, JOptionPane.QUESTION_MESSAGE, null, null, ""); - } - - public static boolean askYN(String message, String title) { - return JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION; - } - - public String getPassword() { - getUsername(); - if (pw != null) - return pw; - pw = ask("Please enter your password for " + us + " @ " + ret.getHost(), us + " @ " + ret.getHost()); - return pw; - } - - public String getPassphrase() { - getUsername(); - if (pp != null) - return pp; - pp = ask("Please enter your passphrase for " + kf + " used for " + us + " @ " + ret.getHost(), us + " @ " + ret.getHost()); - return pp; - } - - public String getKeyfile() { - getUsername(); - if (kf != null) - return kf; - kf = ask("Please enter the keyfile for " + us + " @ " + ret.getHost(), us + " @ " + ret.getHost()); - return kf; - } - - public String getUsername() { - if (us != null) - return us; - us = ask("Please enter the username for " + ret.getHost(), "Username for " + ret.getHost()); - return us; - } - - public void setSshNode(SshNode sshNode) { - this.ret = sshNode; - } - - public void authenticationSucceeded() { - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-taverna-common-activities/blob/5bce4cb6/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/PleaseWaitDialog.java ---------------------------------------------------------------------- diff --git a/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/PleaseWaitDialog.java b/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/PleaseWaitDialog.java deleted file mode 100755 index 9e265c8..0000000 --- a/taverna-external-tool-activity/src/main/java/org/apache/taverna/activities/externaltool/gui/PleaseWaitDialog.java +++ /dev/null @@ -1,73 +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.taverna.activities.externaltool.gui; - -import java.util.ArrayList; -import java.util.List; - -import javax.swing.JDialog; -import javax.swing.JLabel; - -public class PleaseWaitDialog extends JDialog { - private static final long serialVersionUID = 1L; - - static PleaseWaitDialog instance = new PleaseWaitDialog(); - - public class WaitMessage{ - public WaitMessage() { - } - - String str; - public void set(String newstr) { - synchronized (PleaseWaitDialog.instance) { - if(this.str != null && this.str.equals(newstr)) return; - if(this.str != null) messages.remove(this.str); - this.str = newstr; - if(this.str != null) messages.add(this.str); - } - updateDialog(); - } - public void done() { - set(null); - } - } - - private void updateDialog() { - synchronized (PleaseWaitDialog.instance) { - if(messages.size() > 0) this.setVisible(true); - else this.setVisible(false); - String t = ""; - for (String cur : messages) { - t += cur + "<br>"; - } - l.setText("<html>"+t+"</html>"); - } - } - - List<String> messages = new ArrayList<String>(); - - JLabel l; - private PleaseWaitDialog() { - this.setAlwaysOnTop(true); - this.setTitle("Please wait"); - l = new JLabel(""); - this.add(l); - this.setSize(400, 100); - } -}
