def buttonPressedAction(self, buttonName):
     if buttonName == "Search":
         if self.mode == 0:
             texts = [self.defaultField.getEditor().getEditorComponent().text]
         elif self.mode == 1:
             texts = [
                 self.nameField.getEditor().getEditorComponent().text,
                 self.subjectField.getEditor().getEditorComponent().text,
                 self.authorField.getEditor().getEditorComponent().text,
                 self.classField.getEditor().getEditorComponent().text,
             ]
         text = SearchLogic.getValidText(texts)
         print(text)
         # Can't call SearchLogic.finalSearch in this file. This is Jython that is Python.
         # It uses MySQLdb which does not work with Jython.
         self.exit()
     elif buttonName == "Cancel":
         print("Cancel")
         self.exit()
     elif buttonName == "Advanced":
         print("Advanced")
         if self.mode == 0:
             self.win.visible = False
             self.secondSearch()
         elif self.mode == 1:
             self.win.visible = False
             self.thirdSearch()
         elif self.mode == 2:
             self.win.visible = False
             self.firstSearch()
     else:
         pass  # This case may come
	def buttonPressedAction(self, buttonName):
		"""
		This function performs functionality for button press,
		for both Keyboard and Remote. For Keyboard it is accessed through
		buttonPressed function and for Remote it is directly accessed.
		It is needed as Remote does not generate an event.
		"""
		if buttonName == 'Search':
			texts = []
			mode = self.tabbedPane.getSelectedIndex()
			if mode == 0:
				texts = [self.defaultField.getEditor().getEditorComponent().text]
			elif mode == 1:
				texts = [self.nameField_1.getEditor().getEditorComponent().text, \
						self.subjectField_1.getEditor().getEditorComponent().text, \
						self.authorField_1.getEditor().getEditorComponent().text, \
						self.classField_1.getSelectedItem()]
			elif mode == 2:
				texts = [self.nameField_2.getEditor().getEditorComponent().text, \
						self.subjectField_2.getEditor().getEditorComponent().text, \
						self.authorField_2.getEditor().getEditorComponent().text, \
						self.classField_2.getSelectedItem(), \
						self.descriptionField.text, \
						self.contentTypeField.getSelectedItem(), self.videoResField.getSelectedItem(), \
						self.otherMediaTextField.text, self.otherLangField.text, \
						self.uploadedAfterYear.getSelectedItem(), self.uploadedAfterMonth.getSelectedItem(), \
						self.uploadedAfterDay.getSelectedItem(), self.uploadedBeforeYear.getSelectedItem(), \
						self.uploadedBeforeMonth.getSelectedItem(), self.uploadedBeforeDay.getSelectedItem(), \
						self.contentDurationButtonGroup.getSelection().getActionCommand(), \
						self.contentDurationHour.getSelectedItem(), \
						self.contentDurationMinute.getSelectedItem(), self.uploadedByField.text, \
						self.objectIDField.text, self.subject_list, self.media_list, self.lang_list]
			text = SearchLogic.getValidText(texts)
			print(text, mode)
			self.exit()
			# Can't call SearchLogic.finalSearch in this file. This is Jython that is Python. 
			# It uses MySQLdb which does not work with Jython.
		elif buttonName == 'Cancel':
			print('Cancel', -1)
			self.exit()
		elif buttonName == 'Clear':
			self.contentDurationRadio_2.setSelected(True)
		else:
			pass									# This case may come