Search in sources :

Example 6 with WizardDescriptor

use of org.openide.WizardDescriptor in project gephi by gephi.

the class ImportWizard method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    WizardIterator wizardIterator = new WizardIterator();
    WizardDescriptor wizardDescriptor = new WizardDescriptor(wizardIterator);
    wizardDescriptor.setTitleFormat(new MessageFormat("{0} ({1})"));
    wizardDescriptor.setTitle(NbBundle.getMessage(getClass(), "ImportWizard.wizard.title"));
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        ImporterWizardUI wizardUI = wizardIterator.getCurrentWizardUI();
        // Get Importer
        WizardImporter importer = null;
        for (WizardImporterBuilder wizardBuilder : Lookup.getDefault().lookupAll(WizardImporterBuilder.class)) {
            WizardImporter im = wizardBuilder.buildImporter();
            if (wizardUI.isUIForImporter(im)) {
                importer = im;
            }
        }
        if (importer == null) {
            NotifyDescriptor.Message msg = new NotifyDescriptor.Message(NbBundle.getMessage(getClass(), "ImportWizard.error_no_matching_importer"), NotifyDescriptor.WARNING_MESSAGE);
            DialogDisplayer.getDefault().notify(msg);
            return;
        }
        // Unsetup
        wizardIterator.unsetupPanels(importer);
        ImportControllerUI importControllerUI = Lookup.getDefault().lookup(ImportControllerUI.class);
        importControllerUI.importWizard(importer);
    }
}
Also used : NotifyDescriptor(org.openide.NotifyDescriptor) MessageFormat(java.text.MessageFormat) Dialog(java.awt.Dialog) WizardImporter(org.gephi.io.importer.spi.WizardImporter) ImportControllerUI(org.gephi.desktop.importer.api.ImportControllerUI) WizardDescriptor(org.openide.WizardDescriptor) ImporterWizardUI(org.gephi.io.importer.spi.ImporterWizardUI) WizardImporterBuilder(org.gephi.io.importer.spi.WizardImporterBuilder)

Example 7 with WizardDescriptor

use of org.openide.WizardDescriptor in project gephi by gephi.

the class TopDialog method updateMessage.

public void updateMessage() {
    if (messageComponent != null) {
        getContentPane().remove(messageComponent);
    }
    // System.err.println("updateMessage: " + nd.getMessage());
    messageComponent = message2Component(nd.getMessage());
    if (!(nd instanceof WizardDescriptor) && nd.getNotificationLineSupport() != null) {
        JComponent toAdd = new JPanel(new BorderLayout());
        toAdd.add(messageComponent, BorderLayout.CENTER);
        // NOI18N
        nbErrorForeground = UIManager.getColor("nb.errorForeground");
        if (nbErrorForeground == null) {
            // nbErrorForeground = new Color(89, 79, 191); // RGB suggested by Bruce in #28466
            // RGB suggested by jdinga in #65358
            nbErrorForeground = new Color(255, 0, 0);
        }
        // NOI18N
        nbWarningForeground = UIManager.getColor("nb.warningForeground");
        if (nbWarningForeground == null) {
            // Label.foreground
            nbWarningForeground = new Color(51, 51, 51);
        }
        // NOI18N
        nbInfoForeground = UIManager.getColor("nb.warningForeground");
        if (nbInfoForeground == null) {
            // NOI18N
            nbInfoForeground = UIManager.getColor("Label.foreground");
        }
        notificationLine = new FixedHeightLabel();
        NotificationLineSupport nls = nd.getNotificationLineSupport();
        if (nls.getInformationMessage() != null) {
            updateNotificationLine(this, MSG_TYPE_INFO, nls.getInformationMessage());
        } else if (nls.getWarningMessage() != null) {
            updateNotificationLine(this, MSG_TYPE_WARNING, nls.getWarningMessage());
        } else if (nls.getErrorMessage() != null) {
            updateNotificationLine(this, MSG_TYPE_ERROR, nls.getErrorMessage());
        }
        toAdd.add(notificationLine, BorderLayout.SOUTH);
        messageComponent = toAdd;
    }
    getContentPane().add(messageComponent, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) Color(java.awt.Color) JComponent(javax.swing.JComponent) WizardDescriptor(org.openide.WizardDescriptor) NotificationLineSupport(org.openide.NotificationLineSupport)

Example 8 with WizardDescriptor

use of org.openide.WizardDescriptor in project Aspose.BarCode-for-Java by aspose-barcode.

the class AsposeMavenBasicWizardPanel method storeSettings.

/**
 * @param settings
 */
@Override
public void storeSettings(Object settings) {
    WizardDescriptor d = (WizardDescriptor) settings;
    component.store(d);
}
Also used : WizardDescriptor(org.openide.WizardDescriptor)

Example 9 with WizardDescriptor

use of org.openide.WizardDescriptor in project Aspose.Cells-for-Java by aspose-cells.

the class AsposeMavenBasicWizardPanel method storeSettings.

/**
 * @param settings
 */
@Override
public void storeSettings(Object settings) {
    WizardDescriptor d = (WizardDescriptor) settings;
    component.store(d);
}
Also used : WizardDescriptor(org.openide.WizardDescriptor)

Example 10 with WizardDescriptor

use of org.openide.WizardDescriptor in project enclojure by EricThorsen.

the class ClojureTemplateWizardPanel method storeSettings.

public void storeSettings(Object settings) {
    WizardDescriptor d = (WizardDescriptor) settings;
    component.store(d);
}
Also used : WizardDescriptor(org.openide.WizardDescriptor)

Aggregations

WizardDescriptor (org.openide.WizardDescriptor)11 Dialog (java.awt.Dialog)4 MessageFormat (java.text.MessageFormat)3 BorderLayout (java.awt.BorderLayout)1 Color (java.awt.Color)1 File (java.io.File)1 Charset (java.nio.charset.Charset)1 JComponent (javax.swing.JComponent)1 JPanel (javax.swing.JPanel)1 AttributeColumnsController (org.gephi.datalab.api.AttributeColumnsController)1 DataTablesController (org.gephi.datalab.api.datatables.DataTablesController)1 ImportControllerUI (org.gephi.desktop.importer.api.ImportControllerUI)1 Graph (org.gephi.graph.api.Graph)1 ImporterWizardUI (org.gephi.io.importer.spi.ImporterWizardUI)1 WizardImporter (org.gephi.io.importer.spi.WizardImporter)1 WizardImporterBuilder (org.gephi.io.importer.spi.WizardImporterBuilder)1 NotificationLineSupport (org.openide.NotificationLineSupport)1 NotifyDescriptor (org.openide.NotifyDescriptor)1