@Override
	public void actionPerformed(ActionEvent event) {
		if(event.getSource() == this.environments) {
			this.methods.removeAllItems();
			Environment env = (Environment) this.environments.getSelectedItem();
			if(env != null) {
				for(ServiceMethod method : env.getMethods()) {
					if(NewQueryDialog.operationPanels.containsKey(method.getRequestClass())) {
						this.methods.addItem(method);
					} else {
						logger.warn("No operation panel for method: " + method.getDisplayName());
					}
				}
			}
		} else if(event.getSource() == this.createBtn) {
			if(!Utilities.isNullOrWhitespace(this.getName())) {
				this.toCreate = true;
				this.setVisible(false);
				this.dispose();
			} else {
				JOptionPane.showMessageDialog(this, "Unable to create service without a name", "Invalid name", JOptionPane.ERROR_MESSAGE);
				this.nameField.requestFocus();
			}
		} else if(event.getSource() == this.cancelBtn) {
			this.setVisible(false);
			this.dispose();
		}
	}