Package javax.swing.event

Examples of javax.swing.event.ListSelectionListener


    });
    b.add( ggPlus );
    b.add( ggMinus );
    b.add( Box.createHorizontalGlue() );

    table.getSelectionModel().addListSelectionListener( new ListSelectionListener() {
      public void valueChanged( ListSelectionEvent e )
      {
        ggMinus.setEnabled( table.getSelectedRowCount() > 0 );
      }
    });
View Full Code Here


              m_addCustomPeriodicBut.setEnabled(true);
              m_savePeriodicBut.setEnabled(true);
              m_loadPeriodicBut.setEnabled(true);
             
              m_dateDerivedPeriodicSelector.getSelectionModel().
                addListSelectionListener(new ListSelectionListener() {
                  public void valueChanged(ListSelectionEvent e) {
                    if (!e.getValueIsAdjusting()) {
                      if (m_dateDerivedPeriodicSelector.getTable().
                          getSelectedRow() > NUM_PREDEFINED_PERIODICS - 1) {
                        m_editCustomPeriodicBut.setEnabled(true);
View Full Code Here

   
    m_outputPane.addTab("Output", null, js, "Forecaster output");
   
    m_history.setBorder(BorderFactory.createTitledBorder("Result list"));
    m_history.getList().getSelectionModel().
      addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {

          synchronized (ForecastingPanel.this) {
            if (!e.getValueIsAdjusting()) {
              ListSelectionModel lm = (ListSelectionModel)e.getSource();
View Full Code Here

        levelTable.getColumnModel().getColumn(1).setCellEditor(
                new DefaultCellEditor(tableLevelCB));
        levelTable.getColumnModel().getColumn(0).setPreferredWidth(85);
        levelTable.getColumnModel().getColumn(1).setPreferredWidth(15);
        levelTable.getSelectionModel().addListSelectionListener(
                new ListSelectionListener()
        {
            public void valueChanged(ListSelectionEvent lse) {
                if (levelTable.getSelectedRow() != -1) {
                    levelTableMinus.setEnabled(true);
                } else {
View Full Code Here

    public UncommittedChangesOverviewForm(Project project) {
        this.project = project;
        GuiUtils.replaceJSplitPaneWithIDEASplitter(mainPanel);

        connectionsList.addListSelectionListener(new ListSelectionListener() {
            @Override
            public void valueChanged(ListSelectionEvent e) {
                ConnectionHandler connectionHandler = (ConnectionHandler) connectionsList.getSelectedValue();
                showChangesForm(connectionHandler);
            }
View Full Code Here

        parameter.add(max, 1);
      } else {

        list = new JList(_kernelStringValues);
        list.setSelectedIndices(buildIntSeq(0, _kernelStringValues.size() - 1));
        list.addListSelectionListener(new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent e) {
            dataUpdated = false;
            fireSelectedDataChanged(_paramName + " list");
          }
        });
View Full Code Here

                       
                      topLevelResultsList = new JList(matches);
                     detailHelpAdapter = new autoCompleteListHandler();
                     topLevelResultsList.addKeyListener(detailHelpAdapter);
                        
                     topLevelResultsList.addListSelectionListener(new ListSelectionListener() {
                         public void valueChanged(ListSelectionEvent lse) {
                            
                             String  selValue = topLevelResultsList.getSelectedValue().toString();
                             selValue = selValue.substring(selValue.indexOf(GlobalValues.smallNameFullPackageSeparator)+3, selValue.length());
                              
                             GlobalValues.selectedStringForAutoCompletion = selValue;
                            
                   }
                     }
         );
        
                   
                GlobalValues.autoCompletionFrame = new AutoCompletionFrame("scalalabConsole AutoCompletion ( F1 for detailed help on the selected entry)");
               
            GlobalValues.autoCompletionFrame.displayMatches(topLevelResultsList);
            break;
               
            case KeyEvent.VK_ESCAPE:
                int i,j, lc;
            // Erase the current editing line
                e.consume();
                        if (GlobalValues.commandLineModeOn
                  ((scalalabConsole)inputCons).clearCommandLine();
                        break;

               
           case KeyEvent.VK_F5:
               GlobalValues.consoleOutputWindow.output.setText("");
               break;
          
           case KeyEvent.VK_F10:
                 inputConsole = (Console)e.getSource();
                 e.consume();
                    // get the text on the current line
                 text = inputConsole.getSelectedText();
                 if (text != null) {
          String  inspectCommand = "scalaSciCommands.BasicCommands.inspectg("+text+")  ";
          GlobalValues.globalInterpreter.interpret(inspectCommand);
                 }
          break;
                      
           case KeyEvent.VK_F6:
                    scalaExec.Interpreter.GlobalValues.autoCompletionWorkspace = new scalaExec.gui.AutoCompletionWorkspace();
                    inputConsole = (Console)e.getSource();
                    e.consume();
                    // get the text on the current line
                    text = inputConsole.getText();
                        // get the starting point of the current command start                   
                    lastNewLineCommandStartIdx = text.lastIndexOf(GlobalValues.scalalabPromptChar)+1;
               
                    endCommandChar = ';';   // character denoting the end of the previous command
                    previousSemicolonCommandStartIdx = text.lastIndexOf(endCommandChar)+1;
                    if (previousSemicolonCommandStartIdx > lastNewLineCommandStartIdx)  {  // multiple commands per line separated by ';''
                        lastNewLineCommandStartIdx = previousSemicolonCommandStartIdx;
                     }
                    eqIndex = text.lastIndexOf('=')+1// index of equality  (in order to match the text after it
                    posAutoCompletion = lastNewLineCommandStartIdx;
                    if (eqIndex > lastNewLineCommandStartIdx)
                        posAutoCompletion = eqIndex;
                  
                     text = text.substring(posAutoCompletion, text.length());
                    String iString = text; //= text.substring(startPos, text.length());
                    iString = iString.trim();

                     matches = null;
                     matches = scalaExec.Interpreter.GlobalValues.autoCompletionWorkspace.getMatched(iString);
                     topLevelResultsList = new JList(matches);
                     topLevelResultsList.addListSelectionListener(new ListSelectionListener() {
                     public void valueChanged(ListSelectionEvent lse) {
                            
                             String  selValue = topLevelResultsList.getSelectedValue().toString();
                            
                             String currentText = inputConsole.getText();
View Full Code Here

        parameter.add(max, 1);
      } else {

        list = new JList(_kernelStringValues);
        list.setSelectedIndices(buildIntSeq(0, _kernelStringValues.size() - 1));
        list.addListSelectionListener(new ListSelectionListener() {
          public void valueChanged(ListSelectionEvent e) {
            dataUpdated = false;
            fireSelectedDataChanged(_paramName + " list");
          }
        });
View Full Code Here

        capabilityScrollPane.setViewportView(componentsTable);

        // Listen for selections on the table, and when a row is selected then
        // enable the OK button (or not)
        ListSelectionModel selectionModel = componentsTable.getSelectionModel();
        selectionModel.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                boolean isEnabled = componentsTable.getSelectedRow() != -1;
                okButton.setEnabled(isEnabled);
            }
        });
View Full Code Here

        initComponents();
        cellList.setCellRenderer(new CellListRenderer());
       
        // Enable/disable the OK button based upon whether an element is
        // selected in the list.
        cellList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
               boolean isEnabled = cellList.getSelectedIndex() != -1;
               okButton.setEnabled(isEnabled);
            }
        });
View Full Code Here

TOP

Related Classes of javax.swing.event.ListSelectionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.