/** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ @Override public void actionPerformed(final ActionEvent aEvent) { final Window parent = SwingComponentUtils.getOwningWindow(aEvent); final ClientController controller = getController(); // Issue #62: in case the user does NOT confirm to lose its changes, we // should bail out immediately, otherwise continue normally... if (controller.isProjectChanged() && // !SwingComponentUtils.askConfirmation( parent, "Current project has been changed.\nDo you really want to lose your changes?")) { return; } controller.createNewProject(); }
/** * Creates a new RepeatCaptureAction instance. * * @param aController the controller to use for this action. */ public RepeatCaptureAction(final ClientController aController) { super( ID, aController, ICON_RECAPTURE_DATA, "Repeat capture", "Repeat capture with current device settings"); putValue(ACCELERATOR_KEY, SwingComponentUtils.createMenuKeyMask(KeyEvent.VK_R)); putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_R)); }
/** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ @Override public void actionPerformed(final ActionEvent aEvent) { final Window owner = SwingComponentUtils.getOwningWindow(aEvent); if (!getController().isDeviceSelected()) { JOptionPane.showMessageDialog( owner, "No capturing device found!", "Capture error", JOptionPane.ERROR_MESSAGE); return; } if (!getController().isDeviceSetup()) { JOptionPane.showMessageDialog( owner, "Capturing device is not setup!", "Capture error", JOptionPane.ERROR_MESSAGE); return; } getController().repeatCaptureData(); }
/** * Creates a new NewProjectAction instance. * * @param aController the client controller to use. */ public NewProjectAction(final ClientController aController) { super(ID, aController, "New project ...", "Create a new project"); putValue(ACCELERATOR_KEY, SwingComponentUtils.createMenuKeyMask(KeyEvent.VK_N)); putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_N)); }
/** @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent) */ @Override public void actionPerformed(final ActionEvent aEvent) { final Window owner = SwingComponentUtils.getOwningWindow(aEvent); getController().showBundlesDialog(owner); }