@Nullable @Override public JComponent createComponent() { textLocalProfilerCsvPath.getButton().addMouseListener(new MyMouseListener()); return mainPanel; }
public TwigNamespaceDialog(Project project, TableView<TwigPath> tableView) { this.tableView = tableView; this.project = project; setContentPane(contentPane); setModal(true); getRootPane().setDefaultButton(buttonOK); this.setOkState(); this.namespacePath.getTextField().getDocument().addDocumentListener(new ChangeDocumentListener()); this.name.getDocument().addDocumentListener(new ChangeDocumentListener()); buttonOK.addActionListener(e -> onOK()); buttonCancel.addActionListener(e -> onCancel()); namespacePath.getButton().addMouseListener(createPathButtonMouseListener(namespacePath.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { onCancel(); } }); contentPane.registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); }
public JComponent createComponent() { pathToTranslationRootTextField.getButton().addMouseListener(createPathButtonMouseListener(pathToTranslationRootTextField.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); pathToTranslationRootTextFieldReset.addMouseListener(createResetPathButtonMouseListener(pathToTranslationRootTextField.getTextField(), Settings.DEFAULT_TRANSLATION_PATH)); directoryToApp.getButton().addMouseListener(createPathButtonMouseListener(directoryToApp.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); directoryToAppReset.addMouseListener(createResetPathButtonMouseListener(directoryToApp.getTextField(), Settings.DEFAULT_APP_DIRECTORY)); directoryToWeb.getButton().addMouseListener(createPathButtonMouseListener(directoryToWeb.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor())); directoryToWebReset.addMouseListener(createResetPathButtonMouseListener(directoryToWeb.getTextField(), Settings.DEFAULT_WEB_DIRECTORY)); enableSchedulerCheckBox.setEnabled(WebDeploymentUtil.isEnabled(project)); buttonReindex.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { IndexUtil.forceReindex(); super.mouseClicked(e); } }); return panel1; }