@Override public void actionPerformed(ActionEvent e) { String documentationURL = "https://wiki.duraspace.org/display/FEDORA/All+Documentation"; JOptionPane.showMessageDialog(getDesktop(), "For Fedora documentation, see " + documentationURL, "Fedora Documentation", JOptionPane.INFORMATION_MESSAGE); } });
@Override public void actionPerformed(ActionEvent evt) { // add the editor, and disable the button try { startCustomEditor(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content Edit Error", e .getMessage(), e); } } });
public FTypeDialog() { super(JOptionPane.getFrameForComponent(Administrator.getDesktop()), "Select Object Type(s)", true); throw new UnsupportedOperationException("This operation uses obsolete field search semantics"); }
@Override public void actionPerformed(ActionEvent evt) { // add the editor, and disable the button try { startEditor(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content Edit Error", e .getMessage(), e); } } });
public void actionPerformed(ActionEvent ae) { try { new LoginDialog(); } catch (Exception e) { Administrator.showErrorDialog(Administrator.getDesktop(), "Login Error", e.getClass().getName() + ": " + e.getMessage(), e); } }
@Override public void actionPerformed(ActionEvent evt) { // add the editor, and disable the button try { startCustomViewer(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content Edit Error", e .getMessage(), e); } } });
@Override public void actionPerformed(ActionEvent evt) { // add the viewer, and disable the view button try { startViewer(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content View Error", e .getMessage(), e); } } });
@Override public void actionPerformed(ActionEvent evt) { // open a separate viewing window, using the content // from the *server* if the text is "View", and the // content from the editor if the text is "Preview" try { startSeparateViewer(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content View Error", e.getMessage(), e); } } });
@Override public void actionPerformed(ActionEvent evt) { ImportDialog imp = new ImportDialog(); if (imp.file != null) { try { m_xEditor.setContent(new FileInputStream(imp.file)); } catch (Exception e) { String msg = e.getMessage(); if (msg.indexOf("Error parsing as XML") != -1) { msg = "Imported text does not contain valid XML.\n" + "Inline XML Metadata datastreams must contain valid XML."; } Administrator.showErrorDialog(Administrator .getDesktop(), "Import Error", msg, e); } } } });
public void launch() { if (m_prompt) { String pid = JOptionPane .showInputDialog("Enter the PID of the object to open."); if (pid == null) { return; } m_pids = new HashSet<String>(); m_pids.add(pid); } Iterator<String> pidIter = m_pids.iterator(); while (pidIter.hasNext()) { String pid = pidIter.next(); try { ObjectEditorFrame editor = new ObjectEditorFrame(pid, 0); editor.setVisible(true); Administrator.getDesktop().add(editor); editor.setSelected(true); } catch (Exception e) { e.printStackTrace(); Administrator.showErrorDialog(Administrator.getDesktop(), "Error Opening Object", e.getClass().getName() + ": " + e.getMessage(), e); } } }
public void actionPerformed(ActionEvent evt) { JFileChooser browse; if (Administrator.getLastDir() == null) { browse = new JFileChooser(); } else { browse = new JFileChooser(Administrator.getLastDir()); } browse.setApproveButtonText("Import"); browse.setApproveButtonMnemonic('I'); browse .setApproveButtonToolTipText("Imports the selected file."); browse.setDialogTitle("Import New Datastream Content..."); int returnVal = browse.showOpenDialog(Administrator.getDesktop()); if (returnVal == JFileChooser.APPROVE_OPTION) { m_fileField.setText(browse.getSelectedFile().getPath()); } } });
public void actionPerformed(ActionEvent e) { String logMessage = JOptionPane.showInputDialog("Enter a log message."); if (logMessage != null) { try { saveChanges(logMessage); changesSaved(); } catch (Exception ex) { String msg = ex.getMessage(); if (msg == null) { msg = ex.getClass().getName(); } Administrator.showErrorDialog(Administrator .getDesktop(), "Save Error", msg, ex); } updateButtonVisibility(); } } });
@Override public void actionPerformed(ActionEvent evt) { // get a viewer and put it in the middle of m_erPane // we assume we can get a viewer here because // the view button wouldn't be enabled if that weren't // the case try { String mimeType = (String) m_mimeComboBox.getSelectedItem(); m_erViewer = ContentHandlerFactory .getViewer(mimeType, Administrator.DOWNLOADER .get(m_referenceTextField .getText())); m_erPane.add(m_erViewer.getComponent(), BorderLayout.CENTER); m_erPane.validate(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "View error", e.getMessage(), e); } } });
@Override public void actionPerformed(ActionEvent evt) { JButton btn = (JButton) evt.getSource(); try { ContentViewer v = ContentHandlerFactory.getViewer(m_ds.getMIMEType(), Administrator.DOWNLOADER .getDatastreamContent(m_pid, m_ds.getID(), m_ds.getCreateDate())); add(v.getComponent(), BorderLayout.CENTER); btn.setEnabled(false); m_viewButton.setEnabled(true); validate(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content View Failure", e.getMessage(), e); } } });
Administrator.showErrorDialog(Administrator.getDesktop(), "Content Export Failure", e.getMessage(),
@Override public void actionPerformed(ActionEvent evt) { JButton btn = (JButton) evt.getSource(); try { ContentViewer v = ContentHandlerFactory .getViewer(getCustomMimeType(m_ds), Administrator.DOWNLOADER .getDatastreamContent(m_pid, m_ds.getID(), m_ds.getCreateDate())); add(v.getComponent(), BorderLayout.CENTER); btn.setEnabled(false); m_viewTextButton.setEnabled(true); validate(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content View Failure", e.getMessage(), e); } } });
/** * Refresh the content of the tab for the indicated datastream with the * latest information from the server. */ protected void refresh(String dsID) { int i = getTabIndex(dsID); try { List<Datastream> versions = Administrator.APIM.getDatastreamHistory(m_pid, dsID); m_currentVersionMap.put(dsID, versions.get(i)); logger.debug("New create date is: " + versions.get(i).getCreateDate()); DatastreamPane replacement = new DatastreamPane(m_owner, m_pid, versions, this); m_datastreamPanes[i] = replacement; m_tabbedPane.setComponentAt(i, replacement); m_tabbedPane.setToolTipTextAt(i, versions.get(i).getMIMEType() + " - " + versions.get(i).getLabel() + " (" + versions.get(i).getControlGroup().toString() + ")"); colorTabForState(dsID, versions.get(i).getState()); setDirty(dsID, false); } catch (Exception e) { Administrator .showErrorDialog(Administrator.getDesktop(), "Error while refreshing", e.getMessage() + "\nTry re-opening the object viewer.", e); } }
new ResultFrame("Search Results", displayFields, 100, query); frame.setVisible(true); Administrator.getDesktop().add(frame); try { frame.setSelected(true);
@Override public void actionPerformed(ActionEvent e) { m_parent.removeMoreResultsButton(); ResultFrame frame = new ResultFrame("More Search Results", m_displayFields, m_sessionToken); frame.setVisible(true); Administrator.getDesktop().add(frame); try { frame.setSelected(true); } catch (java.beans.PropertyVetoException pve) { } } }
@Override public void actionPerformed(ActionEvent evt) { JButton btn = (JButton) evt.getSource(); try { ContentViewer v = ContentHandlerFactory .getViewer(getCustomMimeType(m_ds), Administrator.DOWNLOADER .getDatastreamContent(m_pid, m_ds.getID(), m_ds.getCreateDate())); add(v.getComponent(), BorderLayout.CENTER); btn.setEnabled(false); validate(); } catch (Exception e) { Administrator.showErrorDialog(Administrator .getDesktop(), "Content View Failure", e.getMessage(), e); } } });