Search in sources :

Example 36 with Dialog

use of java.awt.Dialog 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 37 with Dialog

use of java.awt.Dialog 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)37 Frame (java.awt.Frame)22 Window (java.awt.Window)8 Container (java.awt.Container)5 JButton (javax.swing.JButton)5 Graphics (java.awt.Graphics)4 Panel (java.awt.Panel)4 JInternalFrame (javax.swing.JInternalFrame)4 JPanel (javax.swing.JPanel)4 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)3 BorderLayout (java.awt.BorderLayout)3 Component (java.awt.Component)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 MouseEvent (java.awt.event.MouseEvent)3 JDialog (javax.swing.JDialog)3 DialogControls (org.gephi.datalab.spi.DialogControls)3 AttributeColumnsManipulatorUI (org.gephi.datalab.spi.columns.AttributeColumnsManipulatorUI)3 DialogDescriptor (org.openide.DialogDescriptor)3 Button (java.awt.Button)2