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


Java DialogDescriptor.OK_CANCEL_OPTION属性代码示例

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


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

示例1: 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

示例2: open

/**
 * Opens dialog for adding entities.
 * @return fully qualified names of the selected entities' classes.
 */
public static List<String> open(EntityClassScope entityClassScope, Set<String> ignoreClassNames){
    AddEntityPanel panel = AddEntityPanel.create(entityClassScope, ignoreClassNames);
    
    final DialogDescriptor nd = new DialogDescriptor(
            panel,
            NbBundle.getMessage(AddEntityDialog.class, "LBL_AddEntity"),
            true,
            DialogDescriptor.OK_CANCEL_OPTION,
            DialogDescriptor.OK_OPTION,
            DialogDescriptor.DEFAULT_ALIGN,
            new HelpCtx(AddEntityPanel.class),
            null
            );
    
    Object button = DialogDisplayer.getDefault().notify(nd);
    if (button != NotifyDescriptor.OK_OPTION) {
        return Collections.emptyList();
    }
    
    return Collections.unmodifiableList(panel.getSelectedEntityClasses());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:AddEntityDialog.java

示例3: VersionUpdaterDialog

private VersionUpdaterDialog(String title, ElementValue value, VersionUpdaterPanel versionpanel, ChangePanel panel) {
    this.panel = panel;
    this.versionpanel = versionpanel;
    this.value = value;
    panel.setText(value.getText());
    dd = new DialogDescriptor(
            panel,
            title,
            false, //isModal,
            DialogDescriptor.OK_CANCEL_OPTION,
            DialogDescriptor.OK_OPTION,
            new DialogDoneListener()
    );
    dd.setClosingOptions(new Object[]{});
    dd.addPropertyChangeListener(dcl);
    DialogDisplayer.getDefault().notifyLater(dd);
}
 
开发者ID:The-Retired-Programmer,项目名称:nbreleaseplugin,代码行数:17,代码来源:VersionUpdaterDialog.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: customNode

/**
    */
   private static TreeNode customNode (TreeNode treeNode, Component panel, String title, boolean mode) {
DialogDescriptor dd = new DialogDescriptor
    (panel, title, true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION,
     DialogDescriptor.BOTTOM_ALIGN, null, null);

       //??? Warning same code is also in tree.nodes.NodeFactory
       if (panel instanceof JComponent) {
           // set hints to the customizer component
           if (mode) {
               ((JComponent)panel).putClientProperty("xml-edit-mode", "new");  // NOI18N
           } else {
               ((JComponent)panel).putClientProperty("xml-edit-mode", "edit"); // NOI18N
           }
       }
       
DialogDisplayer.getDefault ().createDialog (dd).setVisible(true);

if (dd.getValue() != DialogDescriptor.OK_OPTION) {
    return null;
       }
return treeNode;
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:Lib.java

示例6: getEnvironment

@Override
protected ExecutionEnvironment getEnvironment() {
    String title = NbBundle.getMessage(RemoteTerminalAction.class, "RemoteConnectionTitle");
    cfgPanel.init();
    DialogDescriptor dd = new DialogDescriptor(cfgPanel, title, // NOI18N
            true, DialogDescriptor.OK_CANCEL_OPTION,
            DialogDescriptor.OK_OPTION, null);

    Dialog cfgDialog = DialogDisplayer.getDefault().createDialog(dd);
    
    try {
        cfgDialog.setVisible(true);
    } catch (Throwable th) {
        if (!(th.getCause() instanceof InterruptedException)) {
            throw new RuntimeException(th);
        }
        dd.setValue(DialogDescriptor.CANCEL_OPTION);
    } finally {
        cfgDialog.dispose();
    }

    if (dd.getValue() != DialogDescriptor.OK_OPTION) {
        return null;
    }

    final ExecutionEnvironment env = cfgPanel.getExecutionEnvironment();
    return env;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:RemoteTerminalAction.java

示例7: argumentsButtonActionPerformed

/** Action handler for arguments button. */
private void argumentsButtonActionPerformed(ActionEvent evt) {
    final JavaI18nString javaI18nString = (JavaI18nString)i18nString;
    
    final Dialog[] dialogs = new Dialog[1];
    final ParamsPanel paramsPanel = new ParamsPanel();

    paramsPanel.setArguments(javaI18nString.getArguments());

    DialogDescriptor dd = new DialogDescriptor(
        paramsPanel,
        bundle.getString("CTL_ParamsPanelTitle"), // NOI18N
        true,
        DialogDescriptor.OK_CANCEL_OPTION,
        DialogDescriptor.OK_OPTION,
        new ActionListener() {
            public void actionPerformed(ActionEvent ev) {
                if (ev.getSource() == DialogDescriptor.OK_OPTION) {
                    javaI18nString.setArguments(paramsPanel.getArguments());
                    updateReplaceText();
                    
                    dialogs[0].setVisible(false);
                    dialogs[0].dispose();
                } else {
                    dialogs[0].setVisible(false);
                    dialogs[0].dispose();
                }
            }
       });
    dialogs[0] = DialogDisplayer.getDefault().createDialog(dd);
    dialogs[0].setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:JavaPropertyPanel.java

示例8: advancedActionPerformed

@Messages("CAP_ProjectSpecificOptions=Project Specific Options Settings")
private void advancedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_advancedActionPerformed
    AdvancedLocationPanel panel = new AdvancedLocationPanel(settingsFileLocation, projectSettings);
    DialogDescriptor dd = new DialogDescriptor(panel, Bundle.CAP_ProjectSpecificOptions(), true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, null);
    
    if (DialogDisplayer.getDefault().notify(dd) == DialogDescriptor.OK_OPTION) {
        settingsFileLocation = panel.getHintFileLocation();
        settingsFileLocationChanged();
        settingsOriginChanged();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ProjectHintSettingPanel.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: getCreateLocaleComponent

/**
 * Provides a visual component (modal dialog) usable as a property
 * customizer that allows create a new locale file for given bundle (default
 * bundle name provided). The created locale should be written as a string
 * (locale suffix) to the given propery editor.
 */
@Override
public Component getCreateLocaleComponent(final PropertyEditor prEd, FileObject srcFile, String bundleName) {
    final PropertiesDataObject propertiesDO;
    try {
        propertiesDO = getPropertiesDataObject(srcFile, bundleName);
    }
    catch (DataObjectNotFoundException ex) {
        ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);
        return null;
    }
    final Dialog[] dialog = new Dialog[1];
    final LocalePanel localePanel = new LocalePanel();

    DialogDescriptor dialogDescriptor = new DialogDescriptor(
        localePanel,
        NbBundle.getBundle(PropertiesDataObject.class).getString("CTL_NewLocaleTitle"), // NOI18N
        true,
        DialogDescriptor.OK_CANCEL_OPTION,
        DialogDescriptor.OK_OPTION,
        new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent evt) {
                if (evt.getSource() == DialogDescriptor.OK_OPTION) {
                    String locale = localePanel.getLocale().toString();
                    org.netbeans.modules.properties.Util.createLocaleFile(
                            propertiesDO, locale, false);
                    prEd.setValue("_" + locale); // NOI18N
                }
                dialog[0].setVisible(false);
                dialog[0].dispose();
            }
        }
    );
    dialog[0] = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
    return dialog[0];
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:42,代码来源:I18nServiceImpl.java

示例11: editButtonActionPerformed

private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed
    Variable var = explorer.getSelectedNodes()[0].getLookup().lookup(Variable.class);
    VariablePanel p = new VariablePanel(model, var);
    DialogDescriptor dd = new DialogDescriptor (p, NbBundle.getMessage(VariablesPanel.class, "DIALOG_Edit_Variable"), // NOI18N
        true, DialogDescriptor.OK_CANCEL_OPTION, null, null);
    p.setDialogDescriptor(dd);
    Dialog dlg = DialogDisplayer.getDefault().createDialog (dd);
    dlg.setVisible(true);
    if (dd.getValue() == DialogDescriptor.OK_OPTION) {
        var.setValue(p.getVariableLocation());
        setRootNode();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:VariablesPanel.java

示例12: create

/** Overrides superclass method. */
@Override
public void create() throws IOException {
    final PropertiesDataObject propertiesDataObject =
                      (PropertiesDataObject)getCookie(DataObject.class);

    final Dialog[] dialog = new Dialog[1];
    final LocalePanel panel = new LocalePanel();

    DialogDescriptor dialogDescriptor = new DialogDescriptor(
        panel,
        NbBundle.getBundle(PropertiesDataNode.class).getString("CTL_NewLocaleTitle"),
        true,
        DialogDescriptor.OK_CANCEL_OPTION,
        DialogDescriptor.OK_OPTION,
        new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent evt) {
                if (evt.getSource() == DialogDescriptor.OK_OPTION) {
                    if (containsLocale(propertiesDataObject, panel.getLocale())) {
                        NotifyDescriptor.Message msg = new NotifyDescriptor.Message(
                            MessageFormat.format(NbBundle.getBundle(PropertiesDataNode.class).getString("MSG_LangExists"), panel.getLocale()), 
                            NotifyDescriptor.ERROR_MESSAGE);
                        DialogDisplayer.getDefault().notify(msg);
                    } else {
                        Util.createLocaleFile(propertiesDataObject, panel.getLocale().toString(), true);
                        dialog[0].setVisible(false);
                        dialog[0].dispose();
                    }
                }
            }
        }
    );
    dialogDescriptor.setClosingOptions(new Object [] { DialogDescriptor.CANCEL_OPTION });
    
    dialog[0] = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
    dialog[0].setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:PropertiesDataNode.java

示例13: 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

示例14: customizeMethod

/**
 * Opens modal window for method customization.
 * 
 * @return true if OK button on customizer was pressed and changes should be written to source files,
 * false if Cancel button on customizer was pressed or if customizer was cancelled in any other way and
 * nothing should be written to source files.
 */
public boolean customizeMethod() {
    DialogDescriptor notifyDescriptor = new DialogDescriptor(
            panel, title, true,
            DialogDescriptor.OK_CANCEL_OPTION,
            DialogDescriptor.OK_OPTION,
            null
            );
    panel.addPropertyChangeListener(new ValidatingPropertyChangeListener(panel, notifyDescriptor, existingMethods, prefix));
    return DialogDisplayer.getDefault().notify(notifyDescriptor) == NotifyDescriptor.OK_OPTION;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:MethodCustomizer.java

示例15: open

boolean open() {
    final DialogDescriptor dd = 
        new DialogDescriptor (
            this, 
            NbBundle.getMessage(RevertDeletedAction.class, "LBL_SELECT_FILES"), // NOI18N
            true, 
            DialogDescriptor.OK_CANCEL_OPTION, 
            DialogDescriptor.OK_OPTION, 
            null); 
    final Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.setVisible(true);
    return dd.getValue() == DialogDescriptor.OK_OPTION;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:RevertPanel.java


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