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;
+ }
}