当前位置: 首页>>代码示例>>Java>>正文


Java DialogDescriptor.OK_OPTION属性代码示例

本文整理汇总了Java中org.openide.DialogDescriptor.OK_OPTION属性的典型用法代码示例。如果您正苦于以下问题:Java DialogDescriptor.OK_OPTION属性的具体用法?Java DialogDescriptor.OK_OPTION怎么用?Java DialogDescriptor.OK_OPTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.openide.DialogDescriptor的用法示例。


在下文中一共展示了DialogDescriptor.OK_OPTION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateFor

public static boolean updateFor (String url) {
    boolean retval = false;
    final RemoteRepository repository = new RemoteRepository(null, url, true);
    JPanel panel = repository.getPanel();
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));
    final DialogDescriptor dd = new DialogDescriptor(panel, NbBundle.getMessage(RemoteRepositoryPanel.class, "ACSD_RepositoryPanel_Title"), //NOI18N
            true, new Object[] { DialogDescriptor.OK_OPTION, DialogDescriptor.CANCEL_OPTION }, DialogDescriptor.OK_OPTION, 
            DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(RemoteRepository.class), null);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    repository.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged (ChangeEvent e) {
            dd.setValid(repository.isValid());
        }
    });
    if (repository.isValid()) {
        dd.setValid(true);
    }
    dialog.setVisible(true);
    if (dd.getValue() == DialogDescriptor.OK_OPTION) {
        repository.activeSettingsType.store();
        retval = true;
    }
    return retval;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:RemoteRepository.java

示例2: buttonDownloadModeActionPerformed

private void buttonDownloadModeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonDownloadModeActionPerformed
    final JFXDownloadModePanel rc = new JFXDownloadModePanel(
            jfxProps.getRuntimeCP(),
            jfxProps.getLazyJars());
    final DialogDescriptor dd = new DialogDescriptor(rc,
            NbBundle.getMessage(JFXDeploymentPanel.class, "TXT_ManageResources"), // NOI18N
            true,
            DialogDescriptor.OK_CANCEL_OPTION,
            DialogDescriptor.OK_OPTION,
            null);
    if (DialogDisplayer.getDefault().notify(dd) == DialogDescriptor.OK_OPTION) {
        jfxProps.setLazyJars(rc.getResources());
        jfxProps.setLazyJarsChanged(true);
        refreshDownloadModeControls();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:JFXDeploymentPanel.java

示例3: btnEditActionPerformed

private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed
    ModelHandle2.Configuration conf = (ModelHandle2.Configuration) lstConfigurations.getSelectedValue();
    if (conf != null) {
        NewConfigurationPanel pnl = new NewConfigurationPanel();
        pnl.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ConfigurationsPanel.class, "ACSD_Edit_Config"));
        pnl.setConfigurationId(conf.getId());
        pnl.setProfiles(conf.getActivatedProfiles());
        pnl.setProperties(ActionMappings.createPropertiesList(conf.getProperties()));
        pnl.setShared(conf.isShared());
        DialogDescriptor dd = new DialogDescriptor(pnl, NbBundle.getMessage(ConfigurationsPanel.class, "TIT_Edit_Config"));
        Object ret = DialogDisplayer.getDefault().notify(dd);
        if (ret == DialogDescriptor.OK_OPTION) {
            conf.setShared(pnl.isShared());
            conf.setActivatedProfiles(pnl.getProfiles());
            conf.setProperties(ActionMappings.convertStringToActionProperties(pnl.getProperties()));
            handle.markConfigurationsAsModified();
            createListModel();
            lstConfigurations.setSelectedValue(conf, true);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ConfigurationsPanel.java

示例4: manageResources

private void manageResources(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_manageResources

    final ResourcesCustomizer rc = new ResourcesCustomizer(
            jwsProps.runtimeCP,
            jwsProps.lazyJars);
    final DialogDescriptor dd = new DialogDescriptor(rc,
            NbBundle.getMessage(JWSCustomizerPanel.class, "TXT_ManageResources"), //NOI18N
            true,
            DialogDescriptor.OK_CANCEL_OPTION,
            DialogDescriptor.OK_OPTION,
            null);
    if (DialogDisplayer.getDefault().notify(dd) == DialogDescriptor.OK_OPTION) {
        jwsProps.lazyJars = rc.getResources();
        jwsProps.lazyJarsChanged = true;
    }
    
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:JWSCustomizerPanel.java

示例5: actionPerformed

@Messages("TIT_Find_In_Repositories=Find in Repositories")
@Override public void actionPerformed(ActionEvent e) {
    final FindInRepoPanel pnl = new FindInRepoPanel();
    pnl.getAccessibleContext().setAccessibleDescription(TIT_Find_In_Repositories());
    final DialogDescriptor dd = new DialogDescriptor(pnl, TIT_Find_In_Repositories());
    pnl.attachDesc(dd);
    Object ret = DialogDisplayer.getDefault().notify(dd);
    if (ret == DialogDescriptor.OK_OPTION) {
        QueryRequest request = new QueryRequest(pnl.getQuery(), RepositoryPreferences.getInstance().getRepositoryInfos());
        synchronized (searches) {
            searches.add(request);
        }
        cs.fireChange();
        //TODO we need to find, select and expand the node of the query here.
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:M2RepositoryBrowser.java

示例6: getProblemDesriptor

private DialogDescriptor getProblemDesriptor(String message) {
    Object [] options;
    if (buttons == null || buttons.length == 0) {
        options = new Object [] { DialogDescriptor.OK_OPTION };
    } else {
        options = buttons;
    }
    DialogDescriptor descriptor = new DialogDescriptor(
         this,
         isWarning ? NbBundle.getMessage(ProblemPanel.class, "CTL_Warning") : message,
         true,                              // Modal
         options,                           // Option list
         null,                              // Default
         DialogDescriptor.DEFAULT_ALIGN,    // Align
         null,                              // Help
         null
    );

    descriptor.setMessageType (isWarning ? NotifyDescriptor.WARNING_MESSAGE : NotifyDescriptor.ERROR_MESSAGE);
    descriptor.setClosingOptions(null);
    return descriptor;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ProblemPanel.java

示例7: showDialog

/**
 * Shows Add Column dialog and returns ColumnItem instance or null if
 * cancelled.
 * @param spec DB specification
 * @param columnItem column item to be edited or null
 * @return ColumnItem instance or null if cancelled
 */
public static ColumnItem showDialog(Specification spec, ColumnItem columnItem) {
    AddTableColumnDialog panel = new AddTableColumnDialog(spec);
    DialogDescriptor descriptor = new DialogDescriptor(panel, NbBundle.getMessage(AddTableColumnDialog.class, "AddColumnDialogTitle")); //NOI18N
    descriptor.createNotificationLineSupport();
    panel.setDescriptor(descriptor);
    if (columnItem != null) {
        panel.setValues(columnItem);
    }
    Dialog dialog = DialogDisplayer.getDefault().createDialog(descriptor);
    dialog.setVisible(true);
    if (descriptor.getValue() == DialogDescriptor.OK_OPTION) {
        return panel.getColumnItem();
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:AddTableColumnDialog.java

示例8: show

public static Font show(Font initialFont) {
    PropertyEditor pe = PropertyEditorManager.findEditor(Font.class);
    if (pe == null) {
        throw new RuntimeException("Could not find font editor component.");
    }
    pe.setValue(initialFont);
    DialogDescriptor dd = new DialogDescriptor(
            pe.getCustomEditor(),
            "Choose Font");
    DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
    if (dd.getValue() == DialogDescriptor.OK_OPTION) {
        Font f = (Font)pe.getValue();
        return f;
    }
    return initialFont;
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:16,代码来源:FontChooserDialog.java

示例9: show

/**
 * Shows a dialog listing all given versioning info properties.
 * @param properties
 */
public static void show (HashMap<File, Map<String, String>> properties) {
    PropertySheet ps = new PropertySheet();
    ps.setNodes(new VersioningInfoNode[] {new VersioningInfoNode(properties)});
    DialogDescriptor dd = new DialogDescriptor(ps, NbBundle.getMessage(VersioningInfo.class, "MSG_VersioningInfo_title"), //NOI18N
            true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, null);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.addWindowListener(new DialogBoundsPreserver(NbPreferences.forModule(VersioningInfo.class), "versioning.util.versioningInfo")); //NOI18N
    dialog.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:VersioningInfo.java

示例10: askPassword

@Override
public boolean askPassword(ExecutionEnvironment execEnv, String key) {
    Mnemonics.setLocalizedText(promptLabel, NbBundle.getMessage(CertPassphraseDlg.class, "CertPassphraseDlg.promptLabel.text", key)); // NOI18N

    tfUser.setText(execEnv.getUser());

    String hostName = execEnv.getHost();
    if (execEnv.getSSHPort() != 22) {
        hostName += ":" + execEnv.getSSHPort(); //NOI18N
    }
    tfHost.setText(hostName); // NOI18N

    DialogDescriptor dd = new DialogDescriptor(this,
            NbBundle.getMessage(CertPassphraseDlg.class, "CertPassphraseDlg.title.text"), // NOI18N
            true, // NOI18N
            new Object[]{
                DialogDescriptor.OK_OPTION,
                DialogDescriptor.CANCEL_OPTION},
            DialogDescriptor.OK_OPTION,
            DialogDescriptor.DEFAULT_ALIGN, null, null);

    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.setResizable(false);

    try {
        dialog.setVisible(true);
    } catch (Throwable th) {
        if (!(th.getCause() instanceof InterruptedException)) {
            throw new RuntimeException(th);
        }
        dd.setValue(DialogDescriptor.CANCEL_OPTION);
    } finally {
        dialog.dispose();
    }

    return dd.getValue() == DialogDescriptor.OK_OPTION;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:CertPassphraseDlg.java

示例11: changeNameButtonActionPerformed

private void changeNameButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeNameButtonActionPerformed
    final Dialog[] dialog = new Dialog[1];
    final LocalePanel panel = new LocalePanel(getLocale(entry));

    DialogDescriptor dd = new DialogDescriptor(
        panel,
        NbBundle.getBundle(PropertiesDataNode.class).getString("CTL_NewLocaleTitle"),
        true,
        DialogDescriptor.OK_CANCEL_OPTION,
        DialogDescriptor.OK_OPTION,
        new ActionListener() {
            public void actionPerformed(ActionEvent evt2) {
                // OK pressed
                if (evt2.getSource() == DialogDescriptor.OK_OPTION) {
                    dialog[0].setVisible(false);
                    dialog[0].dispose();

                    updateName(panel.getLocale());
                // Cancel pressed
                } else if (evt2.getSource() == DialogDescriptor.CANCEL_OPTION) {
                    dialog[0].setVisible(false);
                    dialog[0].dispose();
                }
            }
        }
    );
    dialog[0] = DialogDisplayer.getDefault().createDialog(dd);
    dialog[0].setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:LocaleNodeCustomizer.java

示例12: signingCustomizeButtonActionPerformed

private void signingCustomizeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_signingCustomizeButtonActionPerformed
    SigningPanel panel = new SigningPanel(jwsProps);
    DialogDescriptor dialogDesc = new DialogDescriptor(panel, NbBundle.getMessage(SigningPanel.class, "TITLE_SigningPanel"), true, null); //NOI18N
    panel.registerListeners();
    panel.setDialogDescriptor(dialogDesc);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDesc);
    dialog.setVisible(true);
    if (dialogDesc.getValue() == DialogDescriptor.OK_OPTION) {
        panel.store();
        refreshSigningLabel();
    }
    panel.unregisterListeners();
    dialog.dispose();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:JWSCustomizerPanel.java

示例13: getButtons

private Object[] getButtons() {
    return new Object[] {
        DialogDescriptor.OK_OPTION,
        createButton(new ButtonAction(i18n("LBL_Apply"), i18n("TLT_Apply")) { // NOI18N
            public void actionPerformed(ActionEvent event) {
                updatePreview();
            }
        }),
        DialogDescriptor.CANCEL_OPTION
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:Attribute.java

示例14: displayProfilingPoints

public static void displayProfilingPoints(Lookup.Provider project, ProfilingSettings settings) {
    ProfilingPointsDisplayer ppd = getDefault();
    ppd.setupDisplay(project, settings);

    final DialogDescriptor dd = new DialogDescriptor(ppd,
                                                     Bundle.ProfilingPointsDisplayer_PpActiveMsg(settings.getSettingsName()), 
                                                     true,
                                                     new Object[] { DialogDescriptor.OK_OPTION }, DialogDescriptor.OK_OPTION,
                                                     0, null, null);
    final Dialog d = DialogDisplayer.getDefault().createDialog(dd);
    d.pack();
    d.setVisible(true);

    ppd.cleanup();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ProfilingPointsDisplayer.java

示例15: selectTargetDirectory

private String selectTargetDirectory() {
    // Choose heapdump destination
    ChooseHeapdumpTargetPanel targetSelector = getHeapdumpTargetSelector();
    targetSelector.updateDefaultLocation((NetBeansProfiler.getDefaultNB().getProfiledProject() != null)
                                         ? Bundle.HeapDumpAction_LocationProjectString() : 
                                           Bundle.HeapDumpAction_LocationGlobalString());

    int previousType = targetSelector.getDestinationType();
    String previousDirectory = targetSelector.getCustomDirectory();
    
    DialogDescriptor desc = new DialogDescriptor(targetSelector, Bundle.HeapDumpAction_DestinationDialogCaption(), true,
                                                 new Object[] { targetSelector.getOKButton(), DialogDescriptor.CANCEL_OPTION },
                                                 DialogDescriptor.OK_OPTION, 0, null, null);
    Object res = DialogDisplayer.getDefault().notify(desc);

    if (!res.equals(targetSelector.getOKButton())) {
        targetSelector.setDestinationType(previousType);
        targetSelector.setCustomDirectory(previousDirectory);
        return SELECTING_TARGET_CANCELLED;
    }

    // Resolve destination file
    int destinationType = targetSelector.getDestinationType();

    if (destinationType == ChooseHeapdumpTargetPanel.DESTINATION_DEFAULT) {
        targetSelector.setCustomDirectory(previousDirectory);
        return getCurrentHeapDumpFilename(null);
    } else if (destinationType == ChooseHeapdumpTargetPanel.DESTINATION_CUSTOM) {
        return getCurrentHeapDumpFilename(targetSelector.getCustomDirectory());
    }

    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:HeapDumpAction.java


注:本文中的org.openide.DialogDescriptor.OK_OPTION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。