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


Java DialogDescriptor.createNotificationLineSupport方法代码示例

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


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

示例1: showConfigurationPanel

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private AdjustConfigurationPanel showConfigurationPanel(AnalyzerFactory preselectedAnalyzer, String preselected, Configuration configurationToSelect) {
    final NotificationLineSupport[] nls = new NotificationLineSupport[1];
    final DialogDescriptor[] dd = new DialogDescriptor[1];
    ErrorListener errorListener = new ErrorListener() {
        @Override public void setError(String error) {
            nls[0].setErrorMessage(error);
            dd[0].setValid(error == null);
        }
    };
    AdjustConfigurationPanel panel = new AdjustConfigurationPanel(analyzers, preselectedAnalyzer, preselected, configurationToSelect, errorListener);
    DialogDescriptor nd = new DialogDescriptor(panel, Bundle.LBL_Configurations(), true, NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.OK_OPTION, null);
    
    nls[0] = nd.createNotificationLineSupport();
    dd[0] = nd;

    if (DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) {
        return panel;
    }
    
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:RunAnalysisPanel.java

示例2: createValidations

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
void createValidations(DialogDescriptor dd) {
    nls = dd.createNotificationLineSupport();
    vg = ValidationGroup.create(new NotificationLineSupportAdapter(nls), new DialogDescriptorAdapter(dd));
    vg.add(txtFolder,
            new OptionalValidator(cbFolder,
                ValidatorUtils.merge(
                    StringValidators.REQUIRE_NON_EMPTY_STRING,
                    ValidatorUtils.merge(StringValidators.REQUIRE_VALID_FILENAME,
                    new FileNameExists(FileUtil.toFile(project.getProjectDirectory().getParent()))
                )
            )));
    vg.add(txtArtifactId,
            new OptionalValidator(cbArtifactId,
                    MavenValidators.createArtifactIdValidators()
            ));
    checkEnablement();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:RenameProjectPanel.java

示例3: implement

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public ChangeInfo implement() throws Exception {
    JButton btnOk = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Ok"));
    JButton btnCancel = new JButton(NbBundle.getMessage(IntroduceHint.class, "LBL_Cancel"));
    IntroduceMethodPanel panel = new IntroduceMethodPanel("", duplicatesCount, targets, targetIsInterface); //NOI18N
    String caption = NbBundle.getMessage(IntroduceHint.class, "CAP_IntroduceMethod");
    DialogDescriptor dd = new DialogDescriptor(panel, caption, true, new Object[]{btnOk, btnCancel}, btnOk, DialogDescriptor.DEFAULT_ALIGN, null, null);
    NotificationLineSupport notifier = dd.createNotificationLineSupport();
    MethodValidator val = new MethodValidator(js, parameters, returnType);
    panel.setNotifier(notifier);
    panel.setValidator(val);
    panel.setOkButton(btnOk);
    if (DialogDisplayer.getDefault().notify(dd) != btnOk) {
        return null; //cancel
    }
    boolean redoReferences =  panel.isRefactorExisting();
    final String name = panel.getMethodName();
    final Set<Modifier> access = panel.getAccess();
    final boolean replaceOther = panel.getReplaceOther();
    final TargetDescription target = panel.getSelectedTarget();
    js.runModificationTask(new TaskImpl(access, name, target, replaceOther, val.getResult(), redoReferences)).commit();
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:IntroduceMethodFix.java

示例4: showDialog

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
/**
 * 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,代码行数:23,代码来源:AddTableColumnDialog.java

示例5: selectConnection

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public static DatabaseConnection selectConnection(boolean passwordRequired) {
    DatabaseConnection resConn = null;
    SelectConnectionPanel panel = new SelectConnectionPanel(passwordRequired);
    DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage(SelectConnectionPanel.class, "MSG_SelectConnection"));
    desc.createNotificationLineSupport();
    panel.initialize(desc);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(desc);
    dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SelectConnectionPanel.class, "ACSD_SelectConnection"));
    dialog.setVisible(true);
    dialog.dispose();

    if (desc.getValue() == DialogDescriptor.OK_OPTION) {
        return panel.dbconn;
    }

    // If the user cancels, keep the selection they started with, rather than setting it to null
    return resConn;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:SelectConnectionPanel.java

示例6: createDialog

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
/** Constructs managed dialog instance using TopManager.createDialog
* and returnrs it */
private Dialog createDialog () {
    ResourceBundle bundle = NbBundle.getBundle (AddBreakpointAction.class);

    panel = new AddBreakpointPanel ();
    // create dialog descriptor, create & return the dialog
    descriptor = new DialogDescriptor (
        panel,
        bundle.getString ("CTL_Breakpoint_Title"), // NOI18N
        true,
        this
    );
    descriptor.setOptions (new JButton[] {
        bOk = new JButton (bundle.getString ("CTL_Ok")), // NOI18N
        bCancel = new JButton (bundle.getString ("CTL_Cancel")) // NOI18N
    });
    bOk.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_CTL_Ok")); // NOI18N
    bCancel.getAccessibleContext ().setAccessibleDescription (bundle.getString ("ACSD_CTL_Cancel")); // NOI18N
    descriptor.setClosingOptions (new Object [0]);
    notificationSupport = descriptor.createNotificationLineSupport();
    Dialog d = DialogDisplayer.getDefault ().createDialog (descriptor);
    d.pack ();
    return d;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:AddBreakpointAction.java

示例7: actionPerformed

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public void actionPerformed (ActionEvent evt) {
    bOk = new JButton (NbBundle.getMessage (ConnectAction.class, "CTL_Ok")); // NOI18N
    bCancel = new JButton (NbBundle.getMessage (ConnectAction.class, "CTL_Cancel")); // NOI18N
    bOk.getAccessibleContext ().setAccessibleDescription (NbBundle.getMessage (ConnectAction.class, "ACSD_CTL_Ok")); // NOI18N
    bCancel.getAccessibleContext ().setAccessibleDescription (NbBundle.getMessage (ConnectAction.class, "ACSD_CTL_Cancel")); // NOI18N
    bCancel.setDefaultCapable(false);
    cp = new ConnectorPanel ();
    descr = new DialogDescriptor (
        cp,
        NbBundle.getMessage (ConnectAction.class, "CTL_Connect_to_running_process"),
        true, // modal
        new ConnectListener (cp)
    );
    descr.setOptions (new JButton[] {
        bOk, bCancel
    });
    notificationSupport = descr.createNotificationLineSupport();
    descr.setClosingOptions (new Object [0]);
    descr.setHelpCtx(HelpCtx.findHelp(cp)); // This is mandatory so that the descriptor tracks the changes in help correctly.
    dialog = DialogDisplayer.getDefault ().createDialog (descr);
    dialog.setVisible(true);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:ConnectAction.java

示例8: showDialog

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public void showDialog() {

        String titleMsgKey = replacing
                ? "LBL_ReplaceInProjects" //NOI18N
                : "LBL_FindInProjects"; //NOI18N

        DialogDescriptor dialogDescriptor = new DialogDescriptor(
                this,
                NbBundle.getMessage(getClass(), titleMsgKey),
                false,
                new Object[]{okButton, cancelButton},
                okButton,
                DialogDescriptor.BOTTOM_ALIGN,
                new HelpCtx(getClass().getCanonicalName() + "." + replacing),
                this);

        dialogDescriptor.setTitle(NbBundle.getMessage(getClass(), titleMsgKey));
        dialogDescriptor.createNotificationLineSupport();
        dialogDescriptor.setAdditionalOptions(new Object[] {newTabCheckBox});

        dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor);
        dialog.addWindowListener(new DialogCloseListener());
        this.setDialogDescriptor(dialogDescriptor);

        dialog.pack();
        setCurrentlyShown(this);
        dialog.setVisible(
                true);
        dialog.requestFocus();
        this.requestFocusInWindow();
        updateHelp();
        updateUsability();
        if (selectedPresenter == null) {
            chooseLastUsedPresenter();
        }
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:SearchPanel.java

示例9: performAction

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public void performAction() {
    if (!Util.checkInstallLocation()) {
        return;
    }
    if (!Util.ensureSystemHome()) {
        return;
    }
    
    String derbySystemHome = DerbyOptions.getDefault().getSystemHome();
    CreateSampleDatabasePanel panel = new CreateSampleDatabasePanel(derbySystemHome);
    DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage(CreateSampleDBAction.class, "LBL_CreateSampleDatabaseTitle"), true, null);
    desc.createNotificationLineSupport();
    panel.setDialogDescriptor(desc);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(desc);
    panel.setIntroduction();
    String acsd = NbBundle.getMessage(CreateSampleDBAction.class, "ACSD_CreateDatabaseAction");
    dialog.getAccessibleContext().setAccessibleDescription(acsd);
    dialog.setVisible(true);
    dialog.dispose();
    
    if (!DialogDescriptor.OK_OPTION.equals(desc.getValue())) {
        return;
    }
    
    String databaseName = panel.getDatabaseName();
    
    try {
        DerbyDatabasesImpl.getDefault().createSampleDatabase(databaseName, true);
    } catch (Exception e) {
        LOG.log(Level.INFO, null, e);
        LOG.log(Level.INFO, "", e);
        NotifyDescriptor nd = new NotifyDescriptor.Message(
                "Failed to ceate sample database:\n"
                + e.getLocalizedMessage(),
                NotifyDescriptor.ERROR_MESSAGE);
        DialogDisplayer.getDefault().notifyLater(nd);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:39,代码来源:CreateSampleDBAction.java

示例10: implement

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
public ChangeInfo implement(){
    PickOrCreateFieldPanel pnlPickOrCreateField = new PickOrCreateFieldPanel();
    pnlPickOrCreateField.setAvailableFields(getAvailableFields());
    pnlPickOrCreateField.setFileObject(fileObject);
    
    DialogDescriptor ddesc = new DialogDescriptor(pnlPickOrCreateField,
            NbBundle.getMessage(CreateId.class, "LBL_AddIDAnnotationDlgTitle"));
    ddesc.createNotificationLineSupport();
    
    Dialog dlg = DialogDisplayer.getDefault().createDialog(ddesc);
    
    pnlPickOrCreateField.setDlgDescriptor(ddesc);
    dlg.setLocationRelativeTo(null);
    dlg.setVisible(true);
    
    if (ddesc.getValue() == DialogDescriptor.OK_OPTION){
        if (pnlPickOrCreateField.wasCreateNewFieldSelected()){
            createIDField(pnlPickOrCreateField.getNewIdName(),
                    pnlPickOrCreateField.getSelectedIdType());
        } else{
            // pick existing
            String fieldName = (String) pnlPickOrCreateField.getSelectedField();
            createIDField(fieldName, null);
        }
    }
    
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:CreateId.java

示例11: createValidations

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
    void createValidations(DialogDescriptor dd) {
        line = dd.createNotificationLineSupport();
        this.dd = dd;
        vg = ValidationGroup.create(new NotificationLineSupportAdapter(line), new DialogDescriptorAdapter(dd));
        vg.add(txtName,
                    ValidatorUtils.merge(
                        StringValidators.REQUIRE_NON_EMPTY_STRING,
//                        StringValidators.REQUIRE_VALID_FILENAME,
                        new LibraryNameExists()
                    ));
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:CreateLibraryPanel.java

示例12: attachDialogDisplayer

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
/** For gaining access to DialogDisplayer instance to manage
 * warning messages
 */
private void attachDialogDisplayer(DialogDescriptor dd) {
    nls = dd.getNotificationLineSupport();
    if (nls == null) {
        nls = dd.createNotificationLineSupport();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:AddDependencyPanel.java

示例13: attachDialogDisplayer

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
void attachDialogDisplayer(DialogDescriptor dd) {
   this.dd = dd;
   dd.setValid(false);
   nls = dd.getNotificationLineSupport();
    if (nls == null) {
        nls = dd.createNotificationLineSupport();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:NewLicensePanel.java

示例14: attachDialogDisplayer

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
/** For gaining access to DialogDisplayer instance to manage
 * warning messages
 */
public void attachDialogDisplayer(DialogDescriptor dd) {
    nls = dd.getNotificationLineSupport();
    if (nls == null) {
        nls = dd.createNotificationLineSupport();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:NewMirrorPanel.java

示例15: formattersAddButtonActionPerformed

import org.openide.DialogDescriptor; //导入方法依赖的package包/类
private void formattersAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_formattersAddButtonActionPerformed
    VariablesFormatter f = new VariablesFormatter("");
    final VariableFormatterEditPanel fPanel = new VariableFormatterEditPanel();
    fPanel.load(f);

    fPanel.setFormatterNames(getFormatterNames());
    final Dialog[] dlgPtr = new Dialog[] { null };
    DialogDescriptor formatterEditDescriptor = new DialogDescriptor(
            fPanel,
            NbBundle.getMessage(CategoryPanelFormatters.class, "TTL_AddFormatter"),
            true,
            NotifyDescriptor.OK_CANCEL_OPTION, NotifyDescriptor.OK_OPTION,
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (e.getSource() == NotifyDescriptor.OK_OPTION) {
                        boolean valid = fPanel.checkValidInput();
                        if (valid) {
                            dlgPtr[0].setVisible(false);
                        }
                    } else {
                        dlgPtr[0].setVisible(false);
                    }
                }
            });
    formatterEditDescriptor.setClosingOptions(new Object[] {});
    NotificationLineSupport notificationSupport = formatterEditDescriptor.createNotificationLineSupport();
    fPanel.setValidityObjects(formatterEditDescriptor, notificationSupport, false);
    //formatterEditDescriptor.setValid(false);
    Dialog dlg = DialogDisplayer.getDefault().createDialog(formatterEditDescriptor);
    Properties p = Properties.getDefault().getProperties("debugger.options.JPDA");   // NOI18N
    int w = p.getInt("VariableFormatters_AddEdit_WIDTH", -1);                        // NOI18N
    int h = p.getInt("VariableFormatters_AddEdit_HEIGHT", -1);                       // NOI18N
    if (w > 0 && h > 0) {
        dlg.setSize(new Dimension(w, h));
    }
    dlgPtr[0] = dlg;
    dlg.setVisible(true);
    Dimension dim = dlg.getSize();
    p.setInt("VariableFormatters_AddEdit_WIDTH", dim.width);                         // NOI18N
    p.setInt("VariableFormatters_AddEdit_HEIGHT", dim.height);                       // NOI18N
    if (NotifyDescriptor.OK_OPTION.equals(formatterEditDescriptor.getValue())) {
        fPanel.store(f);
        ((DefaultListModel) formattersList.getModel()).addElement(f);
        formattersList.setSelectedValue(f, true);
    }

    /*
    NotifyDescriptor.InputLine nd = new NotifyDescriptor.InputLine(
            NbBundle.getMessage(CategoryPanelFormatters.class, "CategoryPanelFormatters.addDLG.nameLabel"),
            NbBundle.getMessage(CategoryPanelFormatters.class, "CategoryPanelFormatters.addDLG.title"));
    DialogDisplayer.getDefault().notify(nd);
    VariablesFormatter f = new VariablesFormatter(nd.getInputText());
    ((DefaultListModel) formattersList.getModel()).addElement(f);
    formattersList.setSelectedValue(f, true);
    //JCheckBox cb = new JCheckBox(nd.getInputText());
    //cb.setSelected(true);
    //filterClassesList.add(cb);
    //filterClassesList.repaint();
    */
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:61,代码来源:CategoryPanelFormatters.java


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