Package javax.swing.event

Examples of javax.swing.event.ListSelectionListener


        //
        JList list = new JList(myListModel);
        list.setName("list");
        list.setBorder(BorderFactory.createLoweredBevelBorder());
        myListSelectionModel = list.getSelectionModel();
        myListSelectionModel.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        updateActions();
      }
        });
        JScrollPane scrollPane = new JScrollPane(list);
View Full Code Here


        if (!prj.isOnlyViewer) {
            table.addMouseListener(ml);
            table.getTreeTable().getParent().addMouseListener(ml);
        }
        myResourcePropertiesAction = new ResourcePropertiesAction(prj.getProject(), prj.getUIFacade());
        myContextListener = new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        myResourcePropertiesAction.setContext(getContext());
      }
        };
        table.getTable().getSelectionModel().addListSelectionListener(myContextListener);
View Full Code Here

        fontNameList.setVisibleRowCount(7);

        // fontNameList.setAutoscrolls(true);

        fontNameList.addListSelectionListener(new ListSelectionListener() {

            public void valueChanged(ListSelectionEvent e) {

                if (!fontNameList.isSelectionEmpty() && !e.getValueIsAdjusting()) {

                    try {

                        adjusting = true;

                        String fn = ((Font) fontNameList.getSelectedValue()).getName();

                        fontName.setText(fn.equals(AUTOMATIC) ? "Automatic" : fn);

                        fontName.requestFocus();

                    } catch (IllegalStateException iee) {

                    }

                    adjusting = false;

                    changeFontBasedOnState();

                }

            }

        });



        // Create the font style selection panel

        JPanel stylePanel = null;

        if (showStyles) {

            stylePanel = new JPanel(new GridBagLayout());

            stylePanel.setBorder(BorderFactory.createTitledBorder("Font style"));



            GridBagConstraints gBC = new GridBagConstraints();

            gBC.fill = GridBagConstraints.BOTH;

            gBC.anchor = GridBagConstraints.CENTER;

            gBC.weighty = 0.0;

            gBC.insets = new Insets(2, 2, 2, 2);



            ActionListener l = new ActionListener() {

                public void actionPerformed(ActionEvent evt) {

                    changeFontBasedOnState();

                }

            };



            UIUtil.jGridBagAdd(stylePanel, bold = new JCheckBox("Bold"), gBC, GridBagConstraints.REMAINDER);

            bold.addActionListener(l);

            bold.setMnemonic('b');

            UIUtil.jGridBagAdd(stylePanel, italic = new JCheckBox("Italic"), gBC, GridBagConstraints.REMAINDER);

            italic.setMnemonic('i');

            italic.addActionListener(l);

        }



        // Create the font size list

        // @todo make this more specific to the font. not sure how yet :-)

        JPanel sizePanel = null;

        if (showSize) {

            fontSizeList = new JList(new Integer[] { new Integer(8), new Integer(9), new Integer(10), new Integer(11),

                            new Integer(12), new Integer(14), new Integer(16), new Integer(18), new Integer(20), new Integer(22),

                            new Integer(24), new Integer(26), new Integer(28), new Integer(36), new Integer(48), new Integer(72) });

            fontSizeList.setVisibleRowCount(4);

            fontSizeList.setAutoscrolls(true);

            fontSizeList.addListSelectionListener(new ListSelectionListener() {

                public void valueChanged(ListSelectionEvent e) {

                    if (!fontNameList.isSelectionEmpty() && !e.getValueIsAdjusting()) {
View Full Code Here

            identitiesTable.getColumnModel().getColumn(5).setCellRenderer(showColoredLinesRenderer);

            jScrollPane.addMouseListener(listener);
            identitiesTable.addMouseListener(listener);

            identitiesTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
                public void valueChanged(final ListSelectionEvent e) {
                    final int[] selRows = identitiesTable.getSelectedRows();

                    // nothing selected
                    if( selRows.length == 0 ) {
View Full Code Here

        }
        setHighlighters(new HighlighterPipeline(new Highlighter[] {
                AlternateRowHighlighter.quickSilver,
                new HierarchicalColumnHighlighter() }));

      getTable().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        onCellSelectionChanged();
      }
      });
      getTable().getColumnModel().getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        onCellSelectionChanged();
      }
      });
View Full Code Here

        updateSelectedBoardButton.setEnabled(false);

        //------------------------------------------------------------------------
        // Actionlistener
        //------------------------------------------------------------------------
        boardTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
                     public void valueChanged(final ListSelectionEvent e) {
                         boardTableListModel_valueChanged(e);
                     } });

        // updateButton
View Full Code Here

    add(new JLabel("Headers to include"));
    setHeaderList(headerInfo.getNames());
    headerList.setVisibleRowCount(5);
    add(new JScrollPane(getHeaderList()));
    ListSelectionListener tmp = new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        synchronizeTo();
      }
    };
    getHeaderList().addListSelectionListener(tmp);
View Full Code Here

  public NamedNodeView(HeaderInfo nodeInfo) {
    headerInfo = nodeInfo;
    headerInfo.addObserver(this);
    setLayout(new BorderLayout());
    rebuildNodeList();
    nodeList.addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        int selected = nodeList.getSelectedIndex();
        if (selected >= 0) {
          String id = nodeListModel.getId(selected);
          selection.setSelectedNode(id);
View Full Code Here

    _viewOnlineButton.setOpaque(false);
    _viewOnlineButton.setFocusPainted(false);
    _viewOnlineButton.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);

    _regexSelectionTable = new DCTable();
    _regexSelectionTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent e) {
        int selectedRow = _regexSelectionTable.getSelectedRow();
        if (selectedRow >= 0) {
          String regexName = (String) _regexSelectionTable.getValueAt(selectedRow, 0);
          Regex regex = _client.getRegexByName(regexName);
View Full Code Here

   
    setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    ListSelectionModel rowSM = getSelectionModel();

    rowSM.addListSelectionListener(new ListSelectionListener() {
  public void valueChanged(ListSelectionEvent e) {

    if (e.getValueIsAdjusting()) {
      return;
    }
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.