public CreateVersionAction(ExplorerFrame pOwner) { super( I18N.BUNDLE.getString("VersionCreation_title"), "/com/docdoku/client/resources/icons/documents_new.png", pOwner); putValue(Action.SHORT_DESCRIPTION, I18N.BUNDLE.getString("VersionCreation_short_desc")); putValue(Action.LONG_DESCRIPTION, I18N.BUNDLE.getString("VersionCreation_long_desc")); putValue(Action.MNEMONIC_KEY, new Integer(I18N.getCharBundle("VersionCreation_mnemonic_key"))); }
public ViewIterationsAction(ExplorerFrame pOwner) { super( I18N.BUNDLE.getString("ViewIterationList_title"), "/com/docdoku/client/resources/icons/history2.png", pOwner); putValue(Action.SHORT_DESCRIPTION, I18N.BUNDLE.getString("ViewIterationList_short_desc")); putValue(Action.LONG_DESCRIPTION, I18N.BUNDLE.getString("ViewIterationList_long_desc")); putValue( Action.MNEMONIC_KEY, new Integer(I18N.getCharBundle("ViewIterationList_mnemonic_key"))); }
public DeleteElementAction(ExplorerFrame pOwner) { super( I18N.BUNDLE.getString("DeleteElement_title"), "/com/docdoku/client/resources/icons/garbage_empty.png", pOwner); putValue(Action.SHORT_DESCRIPTION, I18N.BUNDLE.getString("DeleteElement_short_desc")); putValue(Action.LONG_DESCRIPTION, I18N.BUNDLE.getString("DeleteElement_long_desc")); putValue(Action.MNEMONIC_KEY, new Integer(I18N.getCharBundle("DeleteElement_mnemonic_key"))); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); }
public ViewLinksPanel(final ActionListener pDownloadAction, final ActionListener pOpenAction) { mLinksListModel = new DefaultListModel(); mLinksScrollPane = new JScrollPane(); mLinksList = new JList(mLinksListModel); mLinksList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); Image img = Toolkit.getDefaultToolkit() .getImage( ViewIterationsDialog.class.getResource( "/com/docdoku/client/resources/icons/view_large.png")); ImageIcon viewIcon = new ImageIcon(img); mViewDocButton = new JButton(I18N.BUNDLE.getString("ViewDocument_button"), viewIcon); mViewDocButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent pAE) { Dialog dialog = (Dialog) SwingUtilities.getAncestorOfClass(Dialog.class, ViewLinksPanel.this); DocumentMaster docM = MainModel.getInstance().getDocM(getSelectedLink()); new ViewDocDetailsDialog(dialog, docM.getLastIteration(), pDownloadAction, pOpenAction); } }); createLayout(); createListener(); }
public EditLifeCycleStateDialog(Frame pOwner, String pState, ActionListener pAction) { super(pOwner, I18N.BUNDLE.getString("EditLifecycle_title"), true); setLocationRelativeTo(pOwner); mLifeCycleStatePanel = new EditLifeCycleStatePanel(pState); mOKCancelPanel = new OKCancelPanel(this, this); mAction = pAction; createLayout(); setVisible(true); }
@Override public void actionPerformed(ActionEvent pAE) { DocumentMaster docM = mOwner.getSelectedDocM(); WorkflowModel wfModel = mOwner.getSelectedWorkflowModel(); FolderTreeNode folderTreeNode = mOwner.getSelectedFolder(); DocumentMasterTemplate template = mOwner.getSelectedDocMTemplate(); MainController controller = MainController.getInstance(); try { if (docM == null && wfModel == null && template == null && folderTreeNode != null) { if (folderTreeNode instanceof TagTreeNode) { String questionMsg = MessageFormat.format( I18N.BUNDLE.getString("DeleteElement_question_tag"), folderTreeNode.getName()); if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog( mOwner, questionMsg, I18N.BUNDLE.getString("DeleteElement_question_title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { controller.delTag(folderTreeNode.getName()); } } else { String questionMsg = MessageFormat.format( I18N.BUNDLE.getString("DeleteElement_question_folder"), folderTreeNode.getCompletePath()); if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog( mOwner, questionMsg, I18N.BUNDLE.getString("DeleteElement_question_title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { DocumentMasterKey[] pks = controller.delFolder(folderTreeNode.getCompletePath()); for (DocumentMasterKey pk : pks) { FileIO.rmDir(Config.getCheckOutFolder(pk)); FileIO.rmDir(Config.getCacheFolder(pk)); Prefs.removeDocNode(pk); } } } } else if (docM != null) { String questionMsg = MessageFormat.format(I18N.BUNDLE.getString("DeleteElement_question_document"), docM); if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog( mOwner, questionMsg, I18N.BUNDLE.getString("DeleteElement_question_title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { controller.delDocM(docM); FileIO.rmDir(Config.getCheckOutFolder(docM)); FileIO.rmDir(Config.getCacheFolder(docM)); Prefs.removeDocNode(docM); } } else if (wfModel != null) { String questionMsg = MessageFormat.format(I18N.BUNDLE.getString("DeleteElement_question_workflow"), wfModel); if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog( mOwner, questionMsg, I18N.BUNDLE.getString("DeleteElement_question_title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { controller.delWorkflowModel(wfModel); } } else if (template != null) { String questionMsg = MessageFormat.format( I18N.BUNDLE.getString("DeleteElement_question_template"), template); if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog( mOwner, questionMsg, I18N.BUNDLE.getString("DeleteElement_question_title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) { controller.delDocMTemplate(template); FileIO.rmDir(Config.getCacheFolder(template)); } } } catch (Exception pEx) { String message = pEx.getMessage() == null ? I18N.BUNDLE.getString("Error_unknown") : pEx.getMessage(); JOptionPane.showMessageDialog( null, message, I18N.BUNDLE.getString("Error_title"), JOptionPane.ERROR_MESSAGE); } ExplorerFrame.unselectElementInAllFrame(); }