private void initOtherComponents() {
    Calendar now = Calendar.getInstance();
    toDatejSpinner.setValue(now.getTime());
    now.add(Calendar.MONTH, -6);
    fromDatejSpinner.setValue(now.getTime());

    exchangeJComboBox.setModel(
        new DefaultComboBoxModel(mainJFrame.mappingExchangeID_Assets.keySet().toArray()));
    exchangeComboKeyHandler = new ComboKeyHandler(exchangeJComboBox);
    JTextField fieldExchange = (JTextField) exchangeJComboBox.getEditor().getEditorComponent();
    fieldExchange.addKeyListener(exchangeComboKeyHandler);

    assetJComboBox.setModel(
        new DefaultComboBoxModel(
            mainJFrame.mappingExchangeID_Assets.get(
                (ExchangeEntity) exchangeJComboBox.getSelectedItem())));
    assetComboKeyHandler = new ComboKeyHandler(assetJComboBox);
    JTextField fieldSymbol = (JTextField) assetJComboBox.getEditor().getEditorComponent();
    fieldSymbol.addKeyListener(assetComboKeyHandler);

    asset = (AssetEntity) assetJComboBox.getSelectedItem();
    toDate = (Date) toDatejSpinner.getValue();
    fromDate = (Date) fromDatejSpinner.getValue();

    newAddDecAlgJDialog();
    newAddCriteriaJDialog();
    newImportPortfolioJDialog();
  }
  public ObstetCalculatorWindow() {
    Calendar dtNow = Calendar.getInstance();
    // Date dtNow = new Date();

    dtDay = dtNow.get(Calendar.DAY_OF_MONTH);
    dtMonth = dtNow.get(Calendar.MONTH);
    dtYear = dtNow.get(Calendar.YEAR);

    initComponents();

    spinDays.setModel(new SpinnerNumberModel(dtDay, 1, maxDay(), 1));
    spinMonth.setModel(new SpinnerNumberModel(dtMonth + 1, 1, 12, 1));
    spinYear.setModel(new SpinnerNumberModel(dtYear, dtYear - 1, dtYear + 1, 1));
    spinYear.setEditor(new javax.swing.JSpinner.NumberEditor(spinYear, "####"));

    SetListeners();

    txtWeek.addKeyListener(keyListW);
    txtDays.addKeyListener(keyListD);

    // setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // setMaximizedBounds(new java.awt.Rectangle(0, 0, 0, 0));
    setResizable(false);
    this.setTitle("Obstet Tools");
  }
  public void conectarCtl(CtlCargarVendedor c) {
    // TODO Auto-generated method stub

    // tglbtnEfectivo.addActionListener(c);
    // tglbtnEfectivo.addItemListener(c);
    txtEfectivo.addActionListener(c);
    txtEfectivo.addKeyListener(c);

    txtEfectivo.setActionCommand("BUSCAR");

    tglbtnEfectivo.addKeyListener(c);

    btnCerrar.addActionListener(c);
    btnCerrar.setActionCommand("CERRAR");
    this.btnCerrar.addKeyListener(c);

    btnCobrar.addActionListener(c);
    btnCobrar.setActionCommand("COBRAR");
    this.btnCobrar.addKeyListener(c);
    this.addWindowListener(c);

    txtCambio.addActionListener(c);
    txtCambio.addKeyListener(c);
    txtCambio.setActionCommand("IMPRIMIR");
  }
Example #4
0
 public NodeSelectionDialog(Frame owner, NodeLibrary library, NodeLibraryManager manager) {
   super(owner, "New Node", true);
   getRootPane().putClientProperty("Window.style", "small");
   JPanel panel = new JPanel(new BorderLayout());
   this.library = library;
   this.manager = manager;
   filteredNodeListModel = new FilteredNodeListModel(library, manager);
   searchField = new JTextField();
   searchField.putClientProperty("JTextField.variant", "search");
   EscapeListener escapeListener = new EscapeListener();
   searchField.addKeyListener(escapeListener);
   ArrowKeysListener arrowKeysListener = new ArrowKeysListener();
   searchField.addKeyListener(arrowKeysListener);
   SearchFieldChangeListener searchFieldChangeListener = new SearchFieldChangeListener();
   searchField.getDocument().addDocumentListener(searchFieldChangeListener);
   nodeList = new JList(filteredNodeListModel);
   DoubleClickListener doubleClickListener = new DoubleClickListener();
   nodeList.addMouseListener(doubleClickListener);
   nodeList.addKeyListener(escapeListener);
   nodeList.addKeyListener(arrowKeysListener);
   nodeList.setSelectedIndex(0);
   nodeList.setCellRenderer(new NodeRenderer());
   JScrollPane nodeScroll =
       new JScrollPane(
           nodeList,
           JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
           JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
   nodeScroll.setBorder(null);
   panel.add(searchField, BorderLayout.NORTH);
   panel.add(nodeScroll, BorderLayout.CENTER);
   setContentPane(panel);
   setSize(500, 400);
   SwingUtils.centerOnScreen(this);
 }
  public ArticulosControlador(
      AbmProductoGui apg,
      VentaControlador vc,
      CompraControlador cc,
      VentasRealizadasControlador vrc,
      ComprasRealizadasControlador crc) {

    // Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://localhost/sexshop", "root", "root");
    pl = new LinkedList<Producto>();
    pb = new busqueda();
    abmProd = new ABMProducto();
    this.prodGui = apg;
    this.vc = vc;
    this.cc = cc;
    this.vrc = vrc;
    this.crc = crc;
    nuevoPulsado = false;
    modificarPulsado = false;
    apg.setActionListener(this);
    bn = prodGui.getBusquedaNombre();
    mpp = new modificarPrecios1(apgui, true);
    bn.addKeyListener(
        new java.awt.event.KeyAdapter() {
          @Override
          public void keyReleased(java.awt.event.KeyEvent evt) {
            busquedaNombreKeyReleased(evt);
          }
        });
    bc = prodGui.getBusquedaCodigo();
    bc.addKeyListener(
        new java.awt.event.KeyAdapter() {
          @Override
          public void keyReleased(java.awt.event.KeyEvent evt) {
            busquedaCodigoKeyReleased(evt);
          }
        });
    tabla = prodGui.getTabla();
    tabla.addMouseListener(
        new java.awt.event.MouseAdapter() {
          @Override
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            tablaMouseClicked(evt);
          }
        });

    bm = prodGui.getBusquedaMarca();
    bm.addKeyListener(
        new java.awt.event.KeyAdapter() {
          @Override
          public void keyReleased(java.awt.event.KeyEvent evt) {
            busquedaMarcaKeyReleased(evt);
          }
        });

    tablaProductos = prodGui.getTablaArticulos();
    pl = pb.filtroProducto("", "", "");
    actualizarLista();
  }
Example #6
0
  public void addFields() {
    //		gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.ipadx = 20;
    content.add(new JLabel("Host", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Database", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Table", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Username", JLabel.CENTER), gbc);
    gbc.gridy++;
    content.add(new JLabel("Password", JLabel.CENTER), gbc);
    gbc.gridy = 0;
    gbc.gridx = 1;
    content.add(host, gbc);
    gbc.gridy++;
    content.add(database, gbc);
    gbc.gridy++;
    content.add(table, gbc);
    gbc.gridy++;
    content.add(username, gbc);
    gbc.gridy++;
    content.add(password, gbc);
    gbc.gridy++;
    login.setMnemonic(KeyEvent.VK_L);

    ActionListener act =
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (e.getSource() == login) {
              if (username.getText().length() > 0) alive = false;
              else {
                showMessage("Username required", "At least enter a username :)");
              }
            }
            if (e.getSource() == exit) {
              System.exit(0);
            }
          }
        };

    login.addActionListener(act);
    exit.addActionListener(act);
    JPanel p = new JPanel(new FlowLayout());
    p.add(login);
    p.add(exit);

    gbc.gridx = 0;
    gbc.gridwidth = 2;
    content.add(p, gbc);

    username.addKeyListener(this);
    password.addKeyListener(this);
    login.addKeyListener(this);
  }
  private void initUI() {

    this.setLayout(new BorderLayout());

    JPanel infoPanel = new JPanel();
    infoPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    infoPanel.setBackground(Color.WHITE);
    infoPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK));

    infoPanel.add(
        new JLabel(
            new ImageIcon(
                Thread.currentThread().getContextClassLoader().getResource("siw-logo3_2.gif"))));

    JLabel infoLabel =
        new JLabel("<html>Please select a project and context<br> Version must be a number</html>");
    infoPanel.add(infoLabel);

    this.add(infoPanel, BorderLayout.NORTH);

    JPanel entryPanel = new JPanel();
    entryPanel.setLayout(null);

    projectNameField.setText("");
    JLabel projectNameLabel = new JLabel("Project Name");
    projectNameLabel.setBounds(new Rectangle(30, 80, 135, 20));
    projectNameField.setBounds(new Rectangle(180, 80, 175, 20));

    JLabel projectVersionLabel = new JLabel("Project Version");
    projectVersionLabel.setBounds(new Rectangle(30, 125, 135, 20));
    projectVersionField.setBounds(new Rectangle(180, 125, 175, 20));

    JLabel contextLabel = new JLabel("Context");
    contextLabel.setBounds(new Rectangle(30, 165, 135, 20));
    contextComboBox.setBounds(new Rectangle(180, 165, 175, 20));

    JLabel packageLabel = new JLabel("Select Package");
    packageLabel.setBounds(new Rectangle(30, 210, 135, 20));
    packageComboBox.setBounds(new Rectangle(180, 210, 250, 20));

    entryPanel.add(projectNameLabel, null);
    entryPanel.add(projectNameField, null);
    entryPanel.add(projectVersionLabel, null);
    entryPanel.add(projectVersionField, null);
    entryPanel.add(contextLabel, null);
    entryPanel.add(contextComboBox, null);
    entryPanel.add(packageLabel, null);
    entryPanel.add(packageComboBox, null);

    this.add(entryPanel, BorderLayout.CENTER);

    projectVersionField.addKeyListener(this);
    projectNameField.addKeyListener(this);
  }
Example #8
0
 private void createFields() {
   login = new JTextField(Options.getLogin());
   login.addKeyListener(al);
   password = new JPasswordField(Options.getPassword());
   password.addKeyListener(al);
   fsneturl = new JTextField(Options.getFsnetUrl());
   fsneturl.addKeyListener(al);
   language = new JComboBox(LANG.values());
   language.setSelectedItem(Options.getLanguage());
   SpinnerModel model = new SpinnerNumberModel(Options.getLag(), 1, 120, 1);
   lag = new JSpinner(model);
 }
Example #9
0
 /**
  * Add the correct key listeners to the search text field, depending on whether and autocomplete
  * listener has been set and whether incremental search is selected.
  */
 private void updateKeyListeners() {
   KeyListener[] listeners = searchField.getKeyListeners();
   for (KeyListener listener : listeners) {
     searchField.removeKeyListener(listener);
   }
   if (increment.isSelected()) {
     searchField.addKeyListener(this);
   } else {
     if (searchAutoComplete.isSelected() && (autoCompleteListener != null)) {
       searchField.addKeyListener(autoCompleteListener);
     }
   }
 }
Example #10
0
  public GridTool() {
    try {
      setIcon(new ImageIcon(ImageUtil.getImage("net/rptools/maptool/client/image/grid.gif")));
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
    // Create the control panel
    controlPanel = new FormPanel("net/rptools/maptool/client/ui/forms/adjustGridControlPanel.xml");
    controlPanel.setBorder(BorderFactory.createLineBorder(Color.black));

    gridSizeSpinner = controlPanel.getSpinner("gridSize");
    gridSizeSpinner.setModel(new SpinnerNumberModel());
    gridSizeSpinner.addChangeListener(new UpdateGridListener());

    gridOffsetXTextField = controlPanel.getTextField("offsetX");
    gridOffsetXTextField.addKeyListener(new UpdateGridListener());

    gridOffsetYTextField = controlPanel.getTextField("offsetY");
    gridOffsetYTextField.addKeyListener(new UpdateGridListener());

    gridSecondDimensionLabel = (JETALabel) controlPanel.getLabel("gridSecondDimensionLabel");
    gridSecondDimension = controlPanel.getTextField("gridSecondDimension");
    gridSecondDimension.addFocusListener(new UpdateGridListener());

    colorWell = (JETAColorWell) controlPanel.getComponentByName("colorWell");
    colorWell.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            copyControlPanelToGrid();
          }
        });

    JButton closeButton = (JButton) controlPanel.getComponentByName("closeButton");
    closeButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            resetTool();
            //				Lee: just to make the light sources snap to their owners after the tool is closed
            Zone z = MapTool.getFrame().getCurrentZoneRenderer().getZone();
            z.putTokens(z.getTokens());
          }
        });
    zoomSlider = (JSlider) controlPanel.getComponentByName("zoomSlider");
    zoomSlider.setMinimum(0);
    zoomSlider.setMaximum(zoomSliderStopCount);
    ZoomChangeListener zoomListener = new ZoomChangeListener();
    zoomSlider.addChangeListener(zoomListener);
    zoomSlider.addMouseListener(zoomListener);
  }
Example #11
0
  private void setupInputListeners(final JTextField currentInput) {
    currentInput.addKeyListener(
        new KeyAdapter() {
          // Plot the graph.

          @Override
          public void keyPressed(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER && currentInput.isFocusOwner()) {
              try {
                String[] equations = new String[nInputs];
                for (int i = 0; i < nInputs; i++) {
                  equations[i] = input[i].getText();
                }
                addPlot(
                    equations,
                    templateFunc.getColor(),
                    gridOP.getGridBounds(),
                    gridOP.getGridStepSize());
              } catch (IllegalExpressionException e1) {
                signalAll(new ActionEvent(e1, -1, ""));
              }
            }
          }
        });
    currentInput.addFocusListener(
        new FocusAdapter() {

          @Override
          public void focusGained(FocusEvent arg0) {
            setSelected(templateFunc);
          }
        });
  }
Example #12
0
 public JInvidChooserFieldEditor(JInvidChooser chooser) {
   this.chooser = chooser;
   this.box = chooser.getCombo();
   theField = new JTextField();
   theField.addKeyListener(this);
   theField.addActionListener(this);
 }
 public void setHook() {
   ComboBoxEditor anEditor = this.getEditor();
   if (anEditor.getEditorComponent() instanceof JTextField) {
     editor = (JTextField) anEditor.getEditorComponent();
     editor.setColumns(TXT_FILENAME_LENGTH);
     editor.addKeyListener(
         new KeyAdapter() {
           public void keyReleased(KeyEvent ev) {
             char key = ev.getKeyChar();
             if (!(Character.isLetterOrDigit(key) || Character.isSpaceChar(key))) {
               return;
             }
             caretPos = editor.getCaretPosition();
             String text = "";
             try {
               text = editor.getText(0, caretPos);
             } catch (Exception ex) {
               Debug.error(me + "setHook: Problem getting image file name\n%s", ex.getMessage());
             }
             int n = getItemCount();
             for (int i = 0; i < n; i++) {
               int ind = ((String) getItemAt(i)).indexOf(text);
               if (ind == 0) {
                 setSelectedIndex(i);
                 return;
               }
             }
           }
         });
   }
 }
 private void createFilterField(JPanel jPanel, final boolean filterByNumber) {
   final JTextField field = new JTextField();
   field.addKeyListener(
       new KeyAdapter() {
         @Override
         public void keyReleased(KeyEvent pE) {
           if (filterByNumber) {
             if (!field.getText().equals(m_numberFilter)) {
               m_numberFilter = field.getText();
               m_customers =
                   CustomerDao.getInstance().findCustomersByAccountNumberStart(m_numberFilter);
               m_model.fireTableDataChanged();
             }
           } else {
             if (!field.getText().equals(m_nameFilter)) {
               m_nameFilter = field.getText();
               m_customers = CustomerDao.getInstance().findCustomersByNameLike(m_nameFilter);
               m_model.fireTableDataChanged();
             }
           }
         }
       });
   field.setName(filterByNumber ? "accountNumberFilter" : "customerNameFilter");
   field.setColumns(15);
   jPanel.add(field);
 }
Example #15
0
  /**
   * This method initializes tFichero
   *
   * @return javax.swing.JTextField
   */
  private JTextField getTxtName() {
    if (txtName == null) {
      txtName = new JTextField();
      txtName.setBounds(62, 8, 280, 20);
      txtName.setPreferredSize(new java.awt.Dimension(270, 20));
      txtName.setText(name);
      txtName.addKeyListener(
          new KeyListener() {

            public void keyPressed(KeyEvent e) {
              if (e.getKeyCode() == KeyEvent.VK_ENTER) {
                acceptAction();
              } else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
                cancelAction();
              }
            }

            public void keyReleased(KeyEvent e) {
              // TODO Auto-generated method stub

            }

            public void keyTyped(KeyEvent e) {
              // TODO Auto-generated method stub

            }
          });
    }
    return txtName;
  }
  private void registerQueryTabListeners() {
    // So that the button is enabled when user types something
    queryTransText.addKeyListener(
        new KeyAdapter() {
          public void keyReleased(KeyEvent keyEvent) {
            querySuccessMsg.setText(null);
            if (queryTransText.getText().length() == 5) {
              queryTransButton.setEnabled(true);
            } else {
              queryTransButton.setEnabled(false);
              queryResults.clear();
            }
          }
        });

    queryTransButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            ArrayList<Transaction> t =
                (ArrayList<Transaction>)
                    Library.getInstance().queryForTransactionHistory(queryTransText.getText());
            queryResults.clear();
            queryResults.addItems(t);
            if (t == null) {
              querySuccessMsg.setText(
                  "No previous transaction found for " + queryTransText.getText());
            }
          }
        });
  }
Example #17
0
  public Console() {
    super("Javacalculus Test GUI");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setResizable(false);
    System.setOut(new PrintStream(new consoleOutputStream()));
    // System.setErr(new PrintStream(new consoleOutputStream(true)));
    inputLabel.setLabelFor(input);
    input.setPreferredSize(new Dimension(300, 20));
    input.setBorder(BorderFactory.createLoweredBevelBorder());
    input.addKeyListener(this);
    commandHistory.add("");
    execute.addActionListener(this);
    execute.setBackground(Color.GREEN);
    execute.setForeground(Color.WHITE);
    console.setLineWrap(true);
    console.setWrapStyleWord(true);
    console.setEditable(false);
    console.setFont(new Font("Dialog", Font.BOLD, 14));
    JScrollPane consolePane =
        new JScrollPane(
            console,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    consolePane.setPreferredSize(new Dimension(600, 300));
    consolePane.setBorder(BorderFactory.createLoweredBevelBorder());
    //		error.setLineWrap(true);
    //		error.setWrapStyleWord(true);
    //		error.setEditable(false);
    //    	error.setFont(new Font("Dialog", Font.ITALIC, 12));
    //		JScrollPane errorPane = new JScrollPane(error, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
    //				JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    //		errorPane.setBorder(BorderFactory.createLoweredBevelBorder());
    //		errorPane.setPreferredSize(new Dimension(600,300));
    // content.setPreferredSize(new Dimension(400,400));
    content.setLayout(new GridBagLayout());
    content.setBorder(BorderFactory.createLoweredBevelBorder());
    GridBagConstraints c = new GridBagConstraints();

    c.gridx = 0;
    c.gridy = 0;
    c.fill = GridBagConstraints.BOTH;
    content.add(inputLabel, c);
    c.gridx = 1;
    c.gridy = 0;
    content.add(input, c);
    c.gridx = 2;
    c.gridy = 0;
    content.add(execute, c);
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 3;
    content.add(consolePane, c);
    //		c.gridx = 0; c.gridy = 2;
    //		content.add(errorPane, c);
    add(content);

    pack();
    setVisible(true);
    input.requestFocus();
  }
  @Override
  public JComponent config() {
    FormLayout layout =
        new FormLayout("left:pref, 3dlu, p, 3dlu, 0:grow", "p, 3dlu, p, 3dlu, 0:grow");
    PanelBuilder builder = new PanelBuilder(layout);
    builder.setBorder(Borders.EMPTY_BORDER);
    builder.setOpaque(false);

    CellConstraints cc = new CellConstraints();

    JComponent cmp = builder.addSeparator(Messages.getString("NetworkTab.5"), cc.xyw(1, 1, 5));
    cmp = (JComponent) cmp.getComponent(0);
    cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));

    builder.addLabel(Messages.getString("FFMpegDVRMSRemux.0"), cc.xy(1, 3));
    altffpath = new JTextField(PMS.getConfiguration().getFfmpegAlternativePath());
    altffpath.addKeyListener(
        new KeyListener() {
          @Override
          public void keyPressed(KeyEvent e) {}

          @Override
          public void keyTyped(KeyEvent e) {}

          @Override
          public void keyReleased(KeyEvent e) {
            PMS.getConfiguration().setFfmpegAlternativePath(altffpath.getText());
          }
        });
    builder.add(altffpath, cc.xyw(3, 3, 3));

    return builder.getPanel();
  }
Example #19
0
  /** The constructor. */
  public StylePanelFig() {
    super("Fig Appearance");
    initChoices();

    Document bboxDoc = bboxField.getDocument();
    bboxDoc.addDocumentListener(this);
    bboxField.addKeyListener(this);
    bboxField.addFocusListener(this);
    fillField.addItemListener(this);
    lineField.addItemListener(this);

    fillField.setRenderer(new ColorRenderer());
    lineField.setRenderer(new ColorRenderer());

    bboxLabel.setLabelFor(bboxField);
    add(bboxLabel);
    add(bboxField);

    fillLabel.setLabelFor(fillField);
    add(fillLabel);
    add(fillField);

    lineLabel.setLabelFor(lineField);
    add(lineLabel);
    add(lineField);
  }
  /**
   * @description Here we create the search frame GUI Our Frame GUI will basically contain a search
   *     box and a panel area to display results
   */
  private void createGUI() {
    /* Setting up the main panel */
    mainPanel = new JPanel(new BorderLayout());

    /* Adding the search keyword TF to the main panel */
    keywordTF = new JTextField();
    keywordTF.addKeyListener(
        new KeyListener() {
          /* Adding a key listener to the search keyword text field*/
          @Override
          public void keyTyped(KeyEvent e) {}

          @Override
          public void keyPressed(KeyEvent e) {}

          @Override
          public void keyReleased(KeyEvent e) {
            if (e.getKeyCode() == KeyEvent.VK_ENTER) {
              /* Call the search method */
              frame.search();
            }
          }
        });
    mainPanel.add(keywordTF, BorderLayout.NORTH);

    /* Adding the Results Panel to the main panel */
    resultsPanel = new JPanel();
    mainPanel.add(resultsPanel, BorderLayout.CENTER);

    /* Add the Main panel to the frame */
    scrollPane = new JScrollPane(mainPanel);
    frame.getContentPane().add(scrollPane);
  }
Example #21
0
  private void createReplacePanel() {
    if (!table.isReadOnly()) {
      replaceField.setColumns(textFieldLength);
      replaceField.addKeyListener(new FindReplaceTextFieldKeyAdapter());

      replaceButton = createButton(getResourceString("SS_SR_REPLACE"));
      replaceButton.addActionListener(replaceAction);

      replaceAllButton = createButton(getResourceString("SS_SR_REPLACEALL"));
      replaceAllButton.addActionListener(replaceAction);

      // replaceButton.setMnemonic(KeyEvent.VK_N);
      // replaceButton.addActionListener(searchAction);
      // JComponent[] itemSample = { new JMenuItem("Replace"), new JMenuItem("Replace All") };
      // memoryReplaceButton = new MemoryDropDownButton("Replace",
      // IconManager.getIcon("DropDownArrow"),
      // 1, java.util.Arrays.asList(itemSample));
      // memoryReplaceButton.setOverrideBorder(true, memoryReplaceButton.raisedBorder);
      // memoryReplaceButton.setEnabled(false);

      builder.add(replaceField, cc.xy(5, 3));
      builder.add(replaceButton, cc.xy(7, 3));
      builder.add(replaceAllButton, cc.xy(9, 3));
    }
  }
Example #22
0
  public void refreshSupplier(boolean remove) {

    if (remove) panel.remove(supplierCombo);

    try {
      model =
          new DefaultComboBoxModel(
              Manager.getInstance().getSupplierManager().getSuppliers().toArray());
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    supplierCombo = new JComboBox(model);
    supplierCombo.setUI(ColorArrowUI.createUI(this));
    supplierCombo.setEditable(true);
    supplierComboField = (JTextField) supplierCombo.getEditor().getEditorComponent();
    supplierComboField.setText("");
    supplierComboField.setOpaque(false);
    supplierComboField.setBorder(BorderFactory.createEmptyBorder());
    supplierComboField.addKeyListener(new ComboKeyHandler(supplierCombo));

    supplierCombo.setFont(new Font("Arial Narrow", Font.PLAIN, 14));
    supplierCombo.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.BLACK));
    supplierCombo.setOpaque(false);

    supplierCombo.setSelectedIndex(-1);

    supplierCombo.setVisible(supplierLabel.isVisible());

    supplierCombo.setBounds(85, 56, 220, 20);

    panel.add(supplierCombo);
  }
 public FindReplaceWindow(JFrame f, PlainPage page) {
   this.page = page;
   // this.f = f;
   dialog = new JDialog(f, "Find/Replace");
   JPanel p = new JPanel();
   dialog.getContentPane().add(p);
   SimpleLayout s = new SimpleLayout(p);
   s.add(new JLabel("Find:"));
   s.add(jta1 = new JTextField());
   s.newline();
   s.add(new JLabel("Replace:"));
   s.add(jta2 = new JTextField());
   s.newline();
   s.add(jrb1 = new JRadioButton("IgnoreCase"));
   jrb1.setSelected(true);
   s.add(jrb2 = new JRadioButton("RegularExpression"));
   s.newline();
   s.add(jb1 = new JButton("Find"));
   s.add(jb4 = new JButton("FindAll"));
   s.add(jb2 = new JButton("Replace"));
   s.add(jb3 = new JButton("Replace All"));
   s.newline();
   s.add(jcb1 = new JCheckBox("in files", false));
   s.add(new JLabel("Dir:"));
   s.add(jtadir = new JTextField());
   s.newline();
   s.add(jcb2 = new JCheckBox("include subdir", true));
   s.add(jcb3 = new JCheckBox("skip binary", true));
   s.newline();
   jb1.setActionCommand("find");
   jb2.setActionCommand("replace");
   jb3.setActionCommand("replaceall");
   jb4.setActionCommand("findall");
   jb1.addActionListener(this);
   jb2.addActionListener(this);
   jb3.addActionListener(this);
   jb4.addActionListener(this);
   jcb2.setEnabled(false);
   jcb3.setEnabled(false);
   dialog.pack();
   dialog.setLocationRelativeTo(f);
   if (page != null && page.fn != null) {
     jtadir.setText(new File(page.fn).getParent().replace(cacheDirectory.getAbsolutePath(), ""));
   }
   jta1.addKeyListener(this);
   jta2.addKeyListener(this);
 }
Example #24
0
 /**
  * This method initializes jTextField
  *
  * @return javax.swing.JTextField
  */
 private JTextField getJTextField() {
   if (jTextField == null) {
     jTextField = new JTextField();
     jTextField.setPreferredSize(new Dimension(40, 20));
     jTextField.addKeyListener(myAction);
   }
   return jTextField;
 }
  /**
   * This method initializes portTextField
   *
   * @return javax.swing.JTextField
   */
  private JTextField getPortTextField() {
    if (portTextField == null) {
      portTextField = new JTextField();
      portTextField.addKeyListener(this);
      portTextField.setBounds(new java.awt.Rectangle(155, 105, 166, 21));
    }

    return portTextField;
  }
  /**
   * This method initializes dbTextField
   *
   * @return javax.swing.JTextField
   */
  private JTextField getDbTextField() {
    if (dbTextField == null) {
      dbTextField = new JTextField();
      dbTextField.addKeyListener(this);
      dbTextField.setBounds(new java.awt.Rectangle(155, 130, 166, 21));
    }

    return dbTextField;
  }
  /**
   * This method initializes userTextField
   *
   * @return javax.swing.JTextField
   */
  private JTextField getUserTextField() {
    if (userTextField == null) {
      userTextField = new JTextField();
      userTextField.addKeyListener(this);
      userTextField.setBounds(new java.awt.Rectangle(155, 197, 166, 21));
    }

    return userTextField;
  }
  private JTextField getUrlTextArea() {
    if (urlTextField == null) {
      urlTextField = new JTextField();
      urlTextField.addKeyListener(this);
      urlTextField.setBounds(new java.awt.Rectangle(155, 80, 166, 21));
    }

    return urlTextField;
  }
Example #29
0
 private void initListeners() {
   txtInput.addKeyListener(
       new KeyAdapter() {
         @Override
         public void keyReleased(KeyEvent e) {
           calculate();
         }
       });
 }
  /**
   * This method initializes connNameTextField
   *
   * @return javax.swing.JTextField
   */
  private JTextField getConnNameTextField() {
    if (connNameTextField == null) {
      connNameTextField = new JTextField();
      connNameTextField.addKeyListener(this);
      connNameTextField.setBounds(new java.awt.Rectangle(155, 30, 166, 21));
    }

    return connNameTextField;
  }