public SecondaryWindow(MainWindow window) {

		addWindowListener(new WindowAdapter() {
			@Override
			public void windowOpened(WindowEvent e) {

				mainWindow.setEnabled(false);
				init();
			}

			@Override
			public void windowActivated(WindowEvent e) {

			}

			@Override
			public void windowClosing(WindowEvent arg0) {
			
				mainWindow.setEnabled(true);
				close();
			}

		});

		addComponentListener(new ComponentAdapter() {
			public void componentHidden(ComponentEvent e) {

				mainWindow.setEnabled(true);
				close();
			}

			public void componentShown(ComponentEvent e) {

				mainWindow.setEnabled(false);
				init();
			}
		});

		this.mainWindow = window;

		operations = new ArrayList<Operation>();
		jListingModel = new DefaultListModel<String>();
		jChoicesModel = new DefaultListModel<String>();
		oldSelection = new ArrayList<Operation>();
		removedOps = new LinkedHashMap<Operation, Integer>();
		newSelection = new ArrayList<Operation>();
		// initial nu este selectat nimic
		selectedIndex = -1;
		initComponents();
		setLocationRelativeTo(null);
	}