Search in sources :

Example 1 with HelpCtx

use of org.openide.util.HelpCtx in project enclojure by EricThorsen.

the class ClojureWatchesActionsProvider method newWatch.

private static void newWatch() {
    WatchPanel wp = new WatchPanel("");
    JComponent panel = wp.getPanel();
    org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor(panel, // NOI18N
    NbBundle.getMessage(ClojureWatchesActionsProvider.class, "CTL_New_Watch_Dialog_Title"));
    dd.setHelpCtx(new HelpCtx("debug.new.watch"));
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.setVisible(true);
    dialog.dispose();
    if (dd.getValue() != org.openide.DialogDescriptor.OK_OPTION)
        return;
    DebuggerManager.getDebuggerManager().createWatch(wp.getExpression());
}
Also used : Dialog(java.awt.Dialog) HelpCtx(org.openide.util.HelpCtx)

Example 2 with HelpCtx

use of org.openide.util.HelpCtx in project enclojure by EricThorsen.

the class AddClojureWatchAction method performAction.

public void performAction() {
    ResourceBundle bundle = NbBundle.getBundle(AddClojureWatchAction.class);
    JPanel panel = new JPanel();
    // NOI18N
    panel.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_WatchPanel"));
    JTextField textField;
    // NOI18N
    JLabel textLabel = new JLabel(bundle.getString("CTL_Watch_Name"));
    textLabel.setBorder(new EmptyBorder(0, 0, 0, 10));
    panel.setLayout(new BorderLayout());
    panel.setBorder(new EmptyBorder(11, 12, 1, 11));
    // NOI18N
    panel.add("West", textLabel);
    // NOI18N
    panel.add("Center", textField = new JTextField(25));
    // NOI18N
    textField.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_CTL_Watch_Name"));
    textField.setBorder(new CompoundBorder(textField.getBorder(), new EmptyBorder(2, 0, 2, 0)));
    textLabel.setDisplayedMnemonic(// NOI18N
    bundle.getString("CTL_Watch_Name_Mnemonic").charAt(0));
    //Utils.getELIdentifier();
    String t = null;
    //        Utils.log("Watch: ELIdentifier = " + t);
    boolean isScriptlet = Utils.isScriptlet();
    LOG.log(Level.FINEST, "Watch: isScriptlet: " + isScriptlet);
    if ((t == null) && (isScriptlet)) {
        t = Utils.getJavaIdentifier();
        LOG.log(Level.FINEST, "Watch: javaIdentifier = " + t);
    }
    if (t != null) {
        textField.setText(t);
    } else {
        textField.setText(watchHistory);
    }
    textField.selectAll();
    textLabel.setLabelFor(textField);
    textField.requestFocus();
    org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor(panel, // NOI18N
    bundle.getString("CTL_Watch_Title"));
    dd.setHelpCtx(new HelpCtx("debug.add.watch"));
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.setVisible(true);
    dialog.dispose();
    if (dd.getValue() != org.openide.DialogDescriptor.OK_OPTION)
        return;
    String watch = textField.getText();
    if ((watch == null) || (watch.trim().length() == 0)) {
        return;
    }
    String s = watch;
    int i = s.indexOf(';');
    while (i > 0) {
        String ss = s.substring(0, i).trim();
        if (ss.length() > 0)
            DebuggerManager.getDebuggerManager().createWatch(ss);
        s = s.substring(i + 1);
        i = s.indexOf(';');
    }
    s = s.trim();
    if (s.length() > 0)
        DebuggerManager.getDebuggerManager().createWatch(s);
    watchHistory = watch;
// open watches view
//        new WatchesAction ().actionPerformed (null); TODO
}
Also used : JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) BorderLayout(java.awt.BorderLayout) Dialog(java.awt.Dialog) HelpCtx(org.openide.util.HelpCtx) ResourceBundle(java.util.ResourceBundle) CompoundBorder(javax.swing.border.CompoundBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 3 with HelpCtx

use of org.openide.util.HelpCtx in project enclojure by EricThorsen.

the class ClojureWatchesActionsProvider method customize.

private static void customize(Watch w) {
    WatchPanel wp = new WatchPanel(w.getExpression());
    JComponent panel = wp.getPanel();
    org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor(panel, // NOI18N 
    NbBundle.getMessage(// NOI18N 
    ClojureWatchesActionsProvider.class, // NOI18N 
    "CTL_Edit_Watch_Dialog_Title", w.getExpression()));
    dd.setHelpCtx(new HelpCtx("debug.add.watch"));
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.setVisible(true);
    dialog.dispose();
    if (dd.getValue() != org.openide.DialogDescriptor.OK_OPTION)
        return;
    w.setExpression(wp.getExpression());
}
Also used : Dialog(java.awt.Dialog) HelpCtx(org.openide.util.HelpCtx)

Aggregations

Dialog (java.awt.Dialog)3 HelpCtx (org.openide.util.HelpCtx)3 BorderLayout (java.awt.BorderLayout)1 ResourceBundle (java.util.ResourceBundle)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JTextField (javax.swing.JTextField)1 CompoundBorder (javax.swing.border.CompoundBorder)1 EmptyBorder (javax.swing.border.EmptyBorder)1