+/*******************************************************************************
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ *******************************************************************************/
package jalview.gui;
import jalview.io.packed.DataProvider.JvDataType;
import jalview.ws.rest.RestServiceDescription;
import java.awt.BorderLayout;
+import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentEvent;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
+import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
});
panels.addChangeListener(new ChangeListener()
{
+
+ /**
+ * last panel selected - used to decide whether the service or the GUI has the latest info
+ */
Object lastComp;
@Override
public void stateChanged(ChangeEvent e)
public RestServiceEditorPane(RestServiceDescription toedit)
{
- super();
+ this();
oldservice = toedit;
if (oldservice!=null)
{ currentservice = new RestServiceDescription(toedit);
}
}
+ String finalService=null;
+ public void showDialog(String title)
+ {
+ if (oldservice!=null)
+ {
+ finalService = oldservice.toString();
+ }
+ JalviewDialog jvd = new JalviewDialog()
+ {
+
+ @Override
+ protected void raiseClosed()
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected void okPressed()
+ {
+ updateServiceFromGui();
+ finalService = currentservice.toString();
+ }
+
+ @Override
+ protected void cancelPressed()
+ {
+
+ }
+ };
+ JPanel pane = new JPanel(new BorderLayout()),okcancel=new JPanel(new FlowLayout());
+ pane.add(this,BorderLayout.CENTER);
+ okcancel.add(jvd.ok);
+ okcancel.add(jvd.cancel);
+ pane.add(okcancel, BorderLayout.SOUTH);
+ jvd.initDialogFrame(pane, true, true, title, 600,350);
+ jvd.waitForInput();
+ }
+
+ public String getEditedRestService()
+ {
+ return finalService;
+ }
}