def actionPerformed(self, event): # create the dialog box with the main window as the dialog box's owner dialog_ref = WindowReference(url, "HelloDialog", [window]) dialog = dialog_ref.getWindow() button = dialog_ref.getView("OkayButton") button.addActionListener(DialogOkayAction(dialog)) dialog.setLocationRelativeTo(window) dialog.setVisible(true)
from org.csstudio.mps.sns.tools.bricks import WindowReference from org.csstudio.mps.sns.tools.plot import * # python Java additions true = (1 == 1) false = not true null = None # locate the sample folder and get the bricks file within it sample_folder = File(sys.argv[0]).getParentFile() url = File(sample_folder, "test.bricks").toURL() print url # generate a window reference resource and pass the desired constructor arguments window_ref = WindowReference(url, "MainWindow", ["Test Title"]) # get the main window window = window_ref.getWindow() # get the magnet list and populate it with data magnet_list = window_ref.getView("MagnetList") magnets = Vector() magnets.add("Dipole") magnets.add("Quadrupole") magnets.add("Sextupole") magnets.add("Octupole") magnets.add("Skew Dipole") magnets.add("Skew Quadrupole") magnets.add("Skew Sextupole") magnet_list.setListData(magnets)