Search in sources :

Example 26 with NotifyDescriptor

use of org.openide.NotifyDescriptor in project netbeans-mmd-plugin by raydac.

the class NbUtils method editFilePath.

@Nullable
public static FileEditPanel.DataContainer editFilePath(@Nullable Component parentComponent, @Nonnull final String title, @Nullable final File projectFolder, @Nullable final FileEditPanel.DataContainer data) {
    final FileEditPanel filePathEditor = new FileEditPanel(projectFolder, data);
    filePathEditor.doLayout();
    filePathEditor.setPreferredSize(new Dimension(450, filePathEditor.getPreferredSize().height));
    final NotifyDescriptor desc = new NotifyDescriptor.Confirmation(filePathEditor, title, NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.PLAIN_MESSAGE);
    FileEditPanel.DataContainer result = null;
    if (DialogDisplayer.getDefault().notify(desc) == NotifyDescriptor.OK_OPTION) {
        result = filePathEditor.getData();
        if (!result.isValid()) {
            NbUtils.msgError(parentComponent, String.format(java.util.ResourceBundle.getBundle("com/igormaznitsa/nbmindmap/i18n/Bundle").getString("MMDGraphEditor.editFileLinkForTopic.errorCantFindFile"), result.getPath()));
            result = null;
        }
    }
    return result;
}
Also used : NotifyDescriptor(org.openide.NotifyDescriptor) Dimension(java.awt.Dimension) FileEditPanel(com.igormaznitsa.nbmindmap.nb.swing.FileEditPanel) Nullable(javax.annotation.Nullable)

Aggregations

NotifyDescriptor (org.openide.NotifyDescriptor)26 FileObject (org.openide.filesystems.FileObject)5 File (java.io.File)4 IOException (java.io.IOException)4 BlueData (blue.BlueData)3 PolyObject (blue.soundObject.PolyObject)3 Nullable (javax.annotation.Nullable)3 DataObject (org.openide.loaders.DataObject)3 ScoreObject (blue.score.ScoreObject)2 SoundObject (blue.soundObject.SoundObject)2 FileChooserManager (blue.ui.utilities.FileChooserManager)2 Dimension (java.awt.Dimension)2 FileWriter (java.io.FileWriter)2 PrintWriter (java.io.PrintWriter)2 AudioFile (blue.soundObject.AudioFile)1 FrozenSoundObject (blue.soundObject.FrozenSoundObject)1 Instance (blue.soundObject.Instance)1 ScoreObjectEditor (blue.soundObject.editor.ScoreObjectEditor)1 MMapURI (com.igormaznitsa.mindmap.model.MMapURI)1 FileEditPanel (com.igormaznitsa.nbmindmap.nb.swing.FileEditPanel)1